diff options
author | Darkvater <darkvater@openttd.org> | 2006-01-25 18:11:06 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-01-25 18:11:06 +0000 |
commit | 78fa9c73933a10e052ed9358a73dc1015f49d14b (patch) | |
tree | 2e2b02a496376c4fb097825d484c2c4a6f6f5492 /players.c | |
parent | 42a9353ae2283939609d068725d89ac93f199bcd (diff) | |
download | openttd-78fa9c73933a10e052ed9358a73dc1015f49d14b.tar.xz |
(svn r3427) - Feature: Allow seeing and setting the maximum amount of companies and spectators for a server. This can be changed/viewed during runtime as well in the console.
Diffstat (limited to 'players.c')
-rw-r--r-- | players.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -856,13 +856,15 @@ int32 CmdPlayerCtrl(int x, int y, uint32 flags, uint32 p1, uint32 p2) _local_player = ci->client_playas - 1; NetworkSend_Command(0, 0, 0, CMD_CHANGE_PRESIDENT_NAME, NULL); _local_player = player_backup; + _network_game_info.companies_on++; } } - } else if (_network_server) { + } else if (_network_server) { // Creating player failed, defer client to spectator /* XXX - UGLY! p2 (pid) is mis-used to fetch the client-id, done at server-side * in network_server.c:838, function DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND) */ NetworkClientInfo *ci = &_network_client_info[pid]; ci->client_playas = OWNER_SPECTATOR; + _network_game_info.spectators_on++; NetworkUpdateClientInfo(ci->client_index); } #else @@ -901,6 +903,9 @@ int32 CmdPlayerCtrl(int x, int y, uint32 flags, uint32 p1, uint32 p2) p->is_active = false; } RemoveAllEngineReplacementForPlayer(p); +#ifdef ENABLE_NETWORK + _network_game_info.companies_on--; +#endif /* ENABLE_NETWORK */ } break; |