increased client version and send maplist infos only to clients that can handle them

This commit is contained in:
oy 2019-01-12 21:11:18 +01:00
parent bc38f67750
commit 8df97e42cf
3 changed files with 5 additions and 3 deletions

View file

@ -1015,7 +1015,8 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
m_aClients[ClientID].m_Authed = AUTHED_ADMIN;
m_aClients[ClientID].m_pRconCmdToSend = Console()->FirstCommandInfo(IConsole::ACCESS_LEVEL_ADMIN, CFGFLAG_SERVER);
m_aClients[ClientID].m_pMapListEntryToSend = m_pFirstMapEntry;
if(m_aClients[ClientID].m_Version >= MIN_MAPLIST_CLIENTVERSION)
m_aClients[ClientID].m_pMapListEntryToSend = m_pFirstMapEntry;
SendRconLine(ClientID, "Admin authentication successful. Full remote console access granted.");
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "ClientID=%d authed (admin)", ClientID);
@ -1030,7 +1031,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
m_aClients[ClientID].m_pRconCmdToSend = Console()->FirstCommandInfo(IConsole::ACCESS_LEVEL_MOD, CFGFLAG_SERVER);
SendRconLine(ClientID, "Moderator authentication successful. Limited remote console access granted.");
const IConsole::CCommandInfo *pInfo = Console()->GetCommandInfo("sv_map", CFGFLAG_SERVER, false);
if(pInfo && pInfo->GetAccessLevel() == IConsole::ACCESS_LEVEL_MOD)
if(pInfo && pInfo->GetAccessLevel() == IConsole::ACCESS_LEVEL_MOD && m_aClients[ClientID].m_Version >= MIN_MAPLIST_CLIENTVERSION)
m_aClients[ClientID].m_pMapListEntryToSend = m_pFirstMapEntry;
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "ClientID=%d authed (moderator)", ClientID);

View file

@ -77,6 +77,7 @@ public:
MAX_RCONCMD_SEND=16,
MAX_MAPLISTENTRY_SEND = 32,
MIN_MAPLIST_CLIENTVERSION=0x0703, // todo 0.8: remove me
MAX_RCONCMD_RATIO=8,
};

View file

@ -5,6 +5,6 @@
#include <generated/nethash.cpp>
#define GAME_VERSION "0.7.2"
#define GAME_NETVERSION "0.7 " GAME_NETVERSION_HASH
#define CLIENT_VERSION 0x0702
#define CLIENT_VERSION 0x0703
static const char GAME_RELEASE_VERSION[8] = "0.7.2";
#endif