(svn r22032) -Codechange: add some asserts to verify we don't allocate too many NetworkClientSockets/Infos

This commit is contained in:
rubidium
2011-02-08 21:47:10 +00:00
parent 1708df0d4b
commit 6e898d4bba
2 changed files with 16 additions and 1 deletions

View File

@@ -682,6 +682,8 @@ static void NetworkInitGameInfo()
/* The server is a client too */
_network_game_info.clients_on = _network_dedicated ? 0 : 1;
/* There should be always space for the server. */
assert(NetworkClientInfo::CanAllocateItem());
NetworkClientInfo *ci = new NetworkClientInfo(CLIENT_ID_SERVER);
ci->client_playas = _network_dedicated ? COMPANY_SPECTATOR : _local_company;
/* Give the server a valid IP; banning it is pointless anyways */