send player names to master server
This commit is contained in:
@@ -12,6 +12,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
using OpenRA.Server;
|
using OpenRA.Server;
|
||||||
using S = OpenRA.Server.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 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 numSpectators = server.LobbyInfo.Clients.Where(c1 => c1.Bot == null && c1.Slot == null).Count();
|
||||||
var passwordProtected = string.IsNullOrEmpty(server.Settings.Password) ? 0 : 1;
|
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 = () =>
|
Action a = () =>
|
||||||
{
|
{
|
||||||
try
|
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";
|
if (isInitialPing) url += "&new=1";
|
||||||
|
|
||||||
using (var wc = new WebClient())
|
using (var wc = new WebClient())
|
||||||
@@ -79,7 +81,8 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
server.LobbyInfo.GlobalSettings.Map,
|
server.LobbyInfo.GlobalSettings.Map,
|
||||||
server.Map.PlayerCount,
|
server.Map.PlayerCount,
|
||||||
numSpectators,
|
numSpectators,
|
||||||
passwordProtected));
|
passwordProtected,
|
||||||
|
string.Join(",", clients)));
|
||||||
|
|
||||||
if (isInitialPing)
|
if (isInitialPing)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user