diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-08-25 14:59:37 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-08-25 14:59:37 +0000 |
commit | c47d5cd45cf5edce2f6c55e49934b075caf8094f (patch) | |
tree | ffbf6a7d7f9a60f6ad5ce4ff42f7d8301af960e5 | |
parent | 0d18a13a94d2d3b9bf3ac6ca160c49f7199a0c91 (diff) |
Do not rely on NULL version string when determining if client is
connecting for the first time, use previous client state for that.
Display a hint when client enters `aclist' or `acinfo' command on
servers built without AC, don't pass it to the game mod.
-rw-r--r-- | source/sv_user.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/source/sv_user.c b/source/sv_user.c index b1396ed..d7465a7 100644 --- a/source/sv_user.c +++ b/source/sv_user.c @@ -324,9 +324,11 @@ This will be sent on the initial connection and upon each server load. void SV_New_f( void ) { char junk[8][16]; int i, j, c; + clstate_t oldstate; Com_DPrintf( "New() from %s\n", sv_client->name ); + oldstate = sv_client->state; if( sv_client->state < cs_connected ) { Com_DPrintf( "Going from cs_assigned to cs_connected for %s\n", sv_client->name ); @@ -414,7 +416,7 @@ void SV_New_f( void ) { SV_ClientCommand( sv_client, "\n" ); // send version string request - if( !sv_client->versionString ) { + if( oldstate == cs_assigned ) { SV_ClientCommand( sv_client, "cmd \177c version $version\n" #if USE_ANTICHEAT & 2 "cmd \177c actoken $actoken\n" @@ -436,10 +438,7 @@ void SV_New_f( void ) { memset( &sv_client->lastcmd, 0, sizeof( sv_client->lastcmd ) ); #if USE_ZLIB - if( !( sv_client->flags & CF_DEFLATE ) ) { - write_plain_configstrings(); - write_plain_baselines(); - } else { + if( sv_client->flags & CF_DEFLATE ) { if( sv_client->netchan->type == NETCHAN_NEW ) { write_compressed_gamestate(); } else { @@ -447,11 +446,12 @@ void SV_New_f( void ) { write_compressed_configstrings(); write_plain_baselines(); } + } else +#endif // USE_ZLIB + { + write_plain_configstrings(); + write_plain_baselines(); } -#else // USE_ZLIB - write_plain_configstrings(); - write_plain_baselines(); -#endif // !USE_ZLIB // send next command SV_ClientCommand( sv_client, "precache %i\n", sv.spawncount ); @@ -773,6 +773,13 @@ static void SV_AC_Info_f( void ) { Com_EndRedirect(); } +#else + +static void SV_AC_Null_f( void ) { + SV_ClientPrintf( sv_client, PRINT_HIGH, + "This server does not support anticheat.\n" ); +} + #endif static const ucmd_t ucmds[] = { @@ -796,6 +803,9 @@ static const ucmd_t ucmds[] = { #if USE_ANTICHEAT & 2 { "aclist", SV_AC_List_f }, { "acinfo", SV_AC_Info_f }, +#else + { "aclist", SV_AC_Null_f }, + { "acinfo", SV_AC_Null_f }, #endif { NULL, NULL } |