fix crash on server overfill, fix another problem preventing spec slots from autofilling
This commit is contained in:
@@ -263,15 +263,18 @@ namespace OpenRA.Server
|
|||||||
|
|
||||||
case "Chat":
|
case "Chat":
|
||||||
case "TeamChat":
|
case "TeamChat":
|
||||||
|
var fromClient = GetClient(conn);
|
||||||
|
var fromIndex = fromClient != null ? fromClient.Index : 0;
|
||||||
|
|
||||||
foreach (var c in conns.Except(conn).ToArray())
|
foreach (var c in conns.Except(conn).ToArray())
|
||||||
DispatchOrdersToClient(c, GetClient(conn).Index, 0, so.Serialize());
|
DispatchOrdersToClient(c, fromIndex, 0, so.Serialize());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Session.Client GetClient(Connection conn)
|
public Session.Client GetClient(Connection conn)
|
||||||
{
|
{
|
||||||
return lobbyInfo.Clients.First(c => c.Index == conn.PlayerIndex);
|
return lobbyInfo.ClientWithIndex(conn.PlayerIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DropClient(Connection toDrop, Exception e)
|
public void DropClient(Connection toDrop, Exception e)
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
};
|
};
|
||||||
|
|
||||||
var slotData = server.lobbyInfo.Slots.FirstOrDefault( x => x.Index == client.Slot );
|
var slotData = server.lobbyInfo.Slots.FirstOrDefault( x => x.Index == client.Slot );
|
||||||
if (slotData != null)
|
if (slotData != null && slotData.MapPlayer != null)
|
||||||
SyncClientToPlayerReference(client, server.Map.Players[slotData.MapPlayer]);
|
SyncClientToPlayerReference(client, server.Map.Players[slotData.MapPlayer]);
|
||||||
|
|
||||||
server.lobbyInfo.Clients.Add(client);
|
server.lobbyInfo.Clients.Add(client);
|
||||||
|
|||||||
Reference in New Issue
Block a user