diff options
author | rubidium <rubidium@openttd.org> | 2009-03-19 23:32:39 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-03-19 23:32:39 +0000 |
commit | ee4a660b0c7e308213c72a861102914978d111a6 (patch) | |
tree | 682f409d8eb42ee59e0828725b781244a3ff54d7 /src/network | |
parent | 096debebe713c284c084dc40a784ea40dba66157 (diff) | |
download | openttd-ee4a660b0c7e308213c72a861102914978d111a6.tar.xz |
(svn r15773) -Fix [FS#2475]: number of active clients wasn't always properly
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network.cpp | 6 | ||||
-rw-r--r-- | src/network/network_func.h | 1 | ||||
-rw-r--r-- | src/network/network_server.cpp | 4 |
3 files changed, 2 insertions, 9 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp index f6d4caf50..7f0279eac 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -346,7 +346,7 @@ static uint NetworkCountActiveClients() static bool _min_active_clients_paused = false; /* Check if the minimum number of active clients has been reached and pause or unpause the game as appropriate */ -void CheckMinActiveClients() +static void CheckMinActiveClients() { if (!_network_dedicated) return; @@ -466,8 +466,6 @@ void NetworkCloseClient(NetworkClientSocket *cs) delete cs->GetInfo(); delete cs; - - CheckMinActiveClients(); } /* For the server, to accept new clients */ @@ -820,7 +818,6 @@ bool NetworkServerStart() if (_network_dedicated) IConsoleCmdExec("exec scripts/on_dedicated.scr 0"); _min_active_clients_paused = false; - CheckMinActiveClients(); /* Try to register us to the master server */ _network_last_advertise_frame = 0; @@ -1028,6 +1025,7 @@ void NetworkGameLoop() cp->company = (CompanyID)company; } #endif /* DEBUG_DUMP_COMMANDS */ + CheckMinActiveClients(); bool send_frame = false; diff --git a/src/network/network_func.h b/src/network/network_func.h index fcbf9e241..9fdcfa2d5 100644 --- a/src/network/network_func.h +++ b/src/network/network_func.h @@ -24,7 +24,6 @@ extern char *_network_host_list[10]; extern char *_network_ban_list[25]; byte NetworkSpectatorCount(); -void CheckMinActiveClients(); void NetworkUpdateClientName(); bool NetworkCompanyHasClients(CompanyID company); bool NetworkChangeCompanyPassword(byte argc, char *argv[]); diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index d2654751d..85fa2b3a7 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -1018,8 +1018,6 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_ACK) NetworkServerSendChat(NETWORK_ACTION_SERVER_MESSAGE, DESTTYPE_BROADCAST, 0, "", CLIENT_ID_SERVER, NETWORK_SERVER_MESSAGE_GAME_UNPAUSED_CONNECT); } - CheckMinActiveClients(); - /* Execute script for, e.g. MOTD */ IConsoleCmdExec("exec scripts/on_server_connect.scr 0"); } @@ -1752,8 +1750,6 @@ void NetworkServerDoMove(ClientID client_id, CompanyID company_id) NetworkAction action = (company_id == COMPANY_SPECTATOR) ? NETWORK_ACTION_COMPANY_SPECTATOR : NETWORK_ACTION_COMPANY_JOIN; NetworkServerSendChat(action, DESTTYPE_BROADCAST, 0, "", client_id, company_id + 1); - - CheckMinActiveClients(); } void NetworkServerSendRcon(ClientID client_id, ConsoleColour colour_code, const char *string) |