Fix RCS1077

This commit is contained in:
RoosterDragon
2023-03-18 12:47:08 +00:00
committed by Gustas
parent 499efa1d0a
commit 330ca92045
60 changed files with 110 additions and 97 deletions

View File

@@ -278,7 +278,7 @@ namespace OpenRA.Mods.Common.Server
{
// Client 0 will always be the Host
// In some cases client 0 doesn't exist, so we untick all players
var host = server.LobbyInfo.Clients.FirstOrDefault(c => c.Index == 0);
var host = server.LobbyInfo.Clients.Find(c => c.Index == 0);
if (host != null)
host.State = Session.ClientState.NotReady;
else
@@ -442,7 +442,7 @@ namespace OpenRA.Mods.Common.Server
}
else
{
var occupantConn = server.Conns.FirstOrDefault(c => c.PlayerIndex == occupant.Index);
var occupantConn = server.Conns.Find(c => c.PlayerIndex == occupant.Index);
if (occupantConn != null)
{
server.SendOrderTo(conn, "ServerError", SlotClosed);
@@ -1143,7 +1143,7 @@ namespace OpenRA.Mods.Common.Server
if (spawnPoint == 0)
return true;
var existingClient = server.LobbyInfo.Clients.FirstOrDefault(cc => cc.SpawnPoint == spawnPoint);
var existingClient = server.LobbyInfo.Clients.Find(cc => cc.SpawnPoint == spawnPoint);
if (client != existingClient && !client.IsAdmin)
{
server.SendLocalizedMessageTo(conn, AdminClearSpawn);
@@ -1200,7 +1200,7 @@ namespace OpenRA.Mods.Common.Server
return true;
}
if (server.LobbyInfo.Clients.Where(cc => cc != client).Any(cc => (cc.SpawnPoint == spawnPoint) && (cc.SpawnPoint != 0)))
if (server.LobbyInfo.Clients.Any(cc => cc != client && (cc.SpawnPoint == spawnPoint) && (cc.SpawnPoint != 0)))
{
server.SendLocalizedMessageTo(conn, SpawnOccupied);
return true;