public void RegisterMaps(MapServerInfo MapInfo, RpcClientInfo RpcInfo) { MapServerInfo Info = GetMapInfo(MapInfo.MapAdress); if (Info == null) { MapsInfo.Add(MapInfo); } else { Info.RpcInfo = RpcInfo; } MapInfo.RpcInfo = RpcInfo; Log.Success("MapMgr", "Map online : " + MapInfo.MapAdress); }
public MapServerInfo GetMapInfo() { int MinPlayers = int.MaxValue; MapServerInfo MapInfo = null; foreach (MapServerInfo Info in MapsInfo) { if (Info.PlayerCount < MinPlayers) { MapInfo = Info; MinPlayers = Info.PlayerCount; } } return(MapInfo); }