From 17b8a5219b7bc8bfe8298acc3d4240f1122976ea Mon Sep 17 00:00:00 2001 From: def Date: Mon, 13 Jul 2015 00:02:57 +0200 Subject: [PATCH] Show a nice message to known bot clients --- src/engine/shared/config_variables.h | 1 + src/game/server/gamecontext.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 2f4782784..67fe74fc7 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -326,6 +326,7 @@ MACRO_CONFIG_INT(SvKillProtection, sv_kill_protection, 20, 0, 9999, CFGFLAG_SERV MACRO_CONFIG_INT(SvSoloServer, sv_solo_server, 0, 0, 1, CFGFLAG_SERVER, "Set server to solo mode (no player interactions, has to be set before loading the map)") MACRO_CONFIG_STR(SvClientSuggestion, sv_client_suggestion, 128, "Get DDNet client from DDNet.tw to use all features on DDNet!", CFGFLAG_SERVER, "Broadcast to display to players without DDNet client") MACRO_CONFIG_STR(SvClientSuggestionOld, sv_client_suggestion_old, 128, "Your DDNet client is old, update it on DDNet.tw!", CFGFLAG_SERVER, "Broadcast to display to players with an old version of DDNet client") +MACRO_CONFIG_STR(SvClientSuggestionBot, sv_client_suggestion_bot, 128, "Your client has bots and can be remote controlled!\nPlease use another client like DDNet client from DDNet.tw", CFGFLAG_SERVER, "Broadcast to display to players with an old version of DDNet client") // netlimit MACRO_CONFIG_INT(SvNetlimit, sv_netlimit, 0, 0, 10000, CFGFLAG_SERVER, "Netlimit: Maximum amount of traffic a client is allowed to use (in kb/s)") diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 0a9056a1d..578b70844 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1477,6 +1477,9 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) //tell old clients to update if (Version < VERSION_DDNET_UPDATER_FIXED && g_Config.m_SvClientSuggestionOld[0] != '\0') SendBroadcast(g_Config.m_SvClientSuggestionOld, ClientID); + //tell known bot clients that they're botting and we know it + if ((Version >= 15 && Version < 100) && g_Config.m_SvClientSuggestionBot[0] != '\0') + SendBroadcast(g_Config.m_SvClientSuggestionBot, ClientID); } else if (MsgID == NETMSGTYPE_CL_SHOWOTHERS) {