summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2010-04-22 17:26:57 +0000
committersmatz <smatz@openttd.org>2010-04-22 17:26:57 +0000
commitf48f4c8293951fd31cae0d94f2e346950c1b6c17 (patch)
tree87cc263c33d478ee9719ea64df3ef237b88f0ba3 /src/network
parent2836d9c1d7cd1965048ce9485c95b962aec13e18 (diff)
downloadopenttd-f48f4c8293951fd31cae0d94f2e346950c1b6c17.tar.xz
(svn r19693) -Codechange: split STATUS_INACTIVE to two states
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/tcp_game.h1
-rw-r--r--src/network/network_server.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h
index 5fb58aa65..c5f56486e 100644
--- a/src/network/core/tcp_game.h
+++ b/src/network/core/tcp_game.h
@@ -77,6 +77,7 @@ struct CommandPacket;
/** Status of a client */
enum ClientStatus {
STATUS_INACTIVE, ///< The client is not connected nor active
+ STATUS_NEWGRFS_CHECK, ///< The client is checking NewGRFs
STATUS_AUTH_GAME, ///< The client is authorizing with game (server) password
STATUS_AUTH_COMPANY, ///< The client is authorizing with company password
STATUS_AUTHORIZED, ///< The client is authorized
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index bdb7642bf..1d4233af4 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -656,7 +656,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMPANY_INFO)
DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)
{
- if (cs->status != STATUS_INACTIVE) {
+ if (cs->status != STATUS_NEWGRFS_CHECK) {
/* Illegal call, return error and ignore the packet */
return SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED);
}
@@ -739,7 +739,10 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
/* Make sure companies to which people try to join are not autocleaned */
if (Company::IsValidID(playas)) _network_company_states[playas].months_empty = 0;
+ cs->status = STATUS_NEWGRFS_CHECK;
+
if (_grfconfig == NULL) {
+ /* Behave as if we received PACKET_CLIENT_NEWGRFS_CHECKED */
return RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)(cs, NULL);
}
@@ -1703,6 +1706,7 @@ void NetworkServerShowStatusToConsole()
{
static const char * const stat_str[] = {
"inactive",
+ "checking NewGRFs",
"authorizing (server password)",
"authorizing (company password)",
"authorized",