Merge pull request #8398 from Mailaender/ping-order-nre
Fixed NREs in LobbyCommands PingFromClient
This commit is contained in:
@@ -492,7 +492,11 @@ namespace OpenRA.Server
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var pingFromClient = LobbyInfo.PingFromClient(GetClient(conn));
|
var client = GetClient(conn);
|
||||||
|
if (client == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var pingFromClient = LobbyInfo.PingFromClient(client);
|
||||||
if (pingFromClient == null)
|
if (pingFromClient == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -186,9 +186,12 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
server.LobbyInfo.Clients.Remove(occupant);
|
server.LobbyInfo.Clients.Remove(occupant);
|
||||||
server.SyncLobbyClients();
|
server.SyncLobbyClients();
|
||||||
var ping = server.LobbyInfo.PingFromClient(occupant);
|
var ping = server.LobbyInfo.PingFromClient(occupant);
|
||||||
|
if (ping != null)
|
||||||
|
{
|
||||||
server.LobbyInfo.ClientPings.Remove(ping);
|
server.LobbyInfo.ClientPings.Remove(ping);
|
||||||
server.SyncClientPing();
|
server.SyncClientPing();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var occupantConn = server.Conns.FirstOrDefault(c => c.PlayerIndex == occupant.Index);
|
var occupantConn = server.Conns.FirstOrDefault(c => c.PlayerIndex == occupant.Index);
|
||||||
@@ -221,7 +224,11 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
{
|
{
|
||||||
server.LobbyInfo.Clients.Remove(occupant);
|
server.LobbyInfo.Clients.Remove(occupant);
|
||||||
var ping = server.LobbyInfo.PingFromClient(occupant);
|
var ping = server.LobbyInfo.PingFromClient(occupant);
|
||||||
|
if (ping != null)
|
||||||
|
{
|
||||||
server.LobbyInfo.ClientPings.Remove(ping);
|
server.LobbyInfo.ClientPings.Remove(ping);
|
||||||
|
server.SyncClientPing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server.SyncLobbyClients();
|
server.SyncLobbyClients();
|
||||||
|
|||||||
Reference in New Issue
Block a user