1
0
Fork 0

(svn r19693) -Codechange: split STATUS_INACTIVE to two states

release/1.1
smatz 2010-04-22 17:26:57 +00:00
parent 2836d9c1d7
commit f48f4c8293
2 changed files with 6 additions and 1 deletions

View File

@ -77,6 +77,7 @@ struct CommandPacket;
/** Status of a client */ /** Status of a client */
enum ClientStatus { enum ClientStatus {
STATUS_INACTIVE, ///< The client is not connected nor active 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_GAME, ///< The client is authorizing with game (server) password
STATUS_AUTH_COMPANY, ///< The client is authorizing with company password STATUS_AUTH_COMPANY, ///< The client is authorizing with company password
STATUS_AUTHORIZED, ///< The client is authorized STATUS_AUTHORIZED, ///< The client is authorized

View File

@ -656,7 +656,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMPANY_INFO)
DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED) 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 */ /* Illegal call, return error and ignore the packet */
return SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED); 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 */ /* Make sure companies to which people try to join are not autocleaned */
if (Company::IsValidID(playas)) _network_company_states[playas].months_empty = 0; if (Company::IsValidID(playas)) _network_company_states[playas].months_empty = 0;
cs->status = STATUS_NEWGRFS_CHECK;
if (_grfconfig == NULL) { if (_grfconfig == NULL) {
/* Behave as if we received PACKET_CLIENT_NEWGRFS_CHECKED */
return RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)(cs, NULL); return RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)(cs, NULL);
} }
@ -1703,6 +1706,7 @@ void NetworkServerShowStatusToConsole()
{ {
static const char * const stat_str[] = { static const char * const stat_str[] = {
"inactive", "inactive",
"checking NewGRFs",
"authorizing (server password)", "authorizing (server password)",
"authorizing (company password)", "authorizing (company password)",
"authorized", "authorized",