send player names to master server

This commit is contained in:
ihptru
2014-07-29 19:58:23 +04:00
parent 56dcba5e47
commit b76d9ed2e4

View File

@@ -12,6 +12,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using OpenRA.Server;
using S = OpenRA.Server.Server;
@@ -58,12 +59,13 @@ namespace OpenRA.Mods.RA.Server
var numBots = server.LobbyInfo.Clients.Where(c1 => c1.Bot != null).Count();
var numSpectators = server.LobbyInfo.Clients.Where(c1 => c1.Bot == null && c1.Slot == null).Count();
var passwordProtected = string.IsNullOrEmpty(server.Settings.Password) ? 0 : 1;
var clients = server.LobbyInfo.Clients.Where(c1 => c1.Bot == null).Select(c => Convert.ToBase64String(Encoding.UTF8.GetBytes(c.Name))).ToArray();
Action a = () =>
{
try
{
var url = "ping?port={0}&name={1}&state={2}&players={3}&bots={4}&mods={5}&map={6}&maxplayers={7}&spectators={8}&protected={9}";
var url = "ping?port={0}&name={1}&state={2}&players={3}&bots={4}&mods={5}&map={6}&maxplayers={7}&spectators={8}&protected={9}&clients={10}";
if (isInitialPing) url += "&new=1";
using (var wc = new WebClient())
@@ -79,7 +81,8 @@ namespace OpenRA.Mods.RA.Server
server.LobbyInfo.GlobalSettings.Map,
server.Map.PlayerCount,
numSpectators,
passwordProtected));
passwordProtected,
string.Join(",", clients)));
if (isInitialPing)
{