diff options
author | MaeJong <mewiceclair@gmail.com> | 2017-05-04 15:14:32 +0200 |
---|---|---|
committer | MaeJong <mewiceclair@gmail.com> | 2017-05-04 15:14:32 +0200 |
commit | a05e8cbd49a17dfc4023b71da559dcb1b11d8422 (patch) | |
tree | 3f441c8eaad975261a285a9ccd0450094cd8a12f /src | |
parent | 36f8fc13c89ea751456a17be1ec4b5d2110d44c0 (diff) |
Implement cvars for SM2 autobahn & outdated client messages
Remove obsolete int g_updateClientNotice
Add g_outdatedClientMessage & prompt only if it's non-empty
Add g_schachtmeisterAutobahnMessage (existed, was unused)
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_client.c | 15 | ||||
-rw-r--r-- | src/game/g_local.h | 2 | ||||
-rw-r--r-- | src/game/g_main.c | 4 |
3 files changed, 8 insertions, 13 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c index 99d26c7..c670f59 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1571,7 +1571,7 @@ char *ClientConnect( int clientNum, qboolean firstTime ) if( j->rating >= g_schachtmeisterClearThreshold.integer ) break; else if( j->rating <= g_schachtmeisterAutobahnThreshold.integer ) - return "fuck off"; + return g_schachtmeisterAutobahnMessage.string; G_AdminsPrintf( "%s^7 (#%d) has rating %d\n", ent->client->pers.netname, ent - g_entities, j->rating ); } break; @@ -1680,16 +1680,11 @@ void ClientBegin( int clientNum ) G_LogPrintf( "ClientBegin: %i\n", clientNum ); - if( g_clientUpgradeNotice.integer ) + if( !Q_stricmp( ent->client->pers.guid, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ) && + g_outdatedClientMessage.string[0] ) { - if( !Q_stricmp( ent->client->pers.guid, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ) ) - { - trap_SendServerCommand( client->ps.clientNum, va( - "print \"^1Your client is out of date. Please replace your client " - "executable with the one at ^2http://tinyurl.com/upcldl^1 (or " - "^2https://mirror.kdude63.com/mercenaries_guild/archive/Client_Binaries/TremFusion/^1) " - "(choose the right one for your operating system) and reconnect.\n\"" ) ); - } + trap_SendServerCommand( client->ps.clientNum, va( + "print \"%s\n\"", g_outdatedClientMessage.string ) ); } // count current clients and rank for scoreboard diff --git a/src/game/g_local.h b/src/game/g_local.h index d1d232a..a3c02c8 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -1391,7 +1391,7 @@ extern vmCvar_t g_popularMapsVotePercent; extern vmCvar_t g_banIPs; extern vmCvar_t g_filterBan; extern vmCvar_t g_smoothClients; -extern vmCvar_t g_clientUpgradeNotice; +extern vmCvar_t g_outdatedClientMessage; extern vmCvar_t pmove_fixed; extern vmCvar_t pmove_msec; extern vmCvar_t g_rankings; diff --git a/src/game/g_main.c b/src/game/g_main.c index 1ae1029..e539355 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -122,7 +122,7 @@ vmCvar_t g_popularMapsVotePercent; vmCvar_t g_banIPs; vmCvar_t g_filterBan; vmCvar_t g_smoothClients; -vmCvar_t g_clientUpgradeNotice; +vmCvar_t g_outdatedClientMessage; vmCvar_t pmove_fixed; vmCvar_t pmove_msec; vmCvar_t g_rankings; @@ -416,7 +416,7 @@ static cvarTable_t gameCvarTable[ ] = "Set a name by pressing Escape and choosing Options", CVAR_ARCHIVE, 0, qfalse}, { &g_smoothClients, "g_smoothClients", "1", 0, 0, qfalse}, - { &g_clientUpgradeNotice, "g_clientUpgradeNotice", "1", 0, 0, qfalse}, + { &g_outdatedClientMessage, "g_outdatedClientMessage", "", CVAR_ARCHIVE, 0, qfalse}, { &pmove_fixed, "pmove_fixed", "0", CVAR_SYSTEMINFO, 0, qfalse}, { &pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO, 0, qfalse}, |