Merge pull request #6942 from heinrich5991/pr_ddnet_game_settings_cleanup

ResetServerGameSettings → ResetGameSettings, remove flag argument
This commit is contained in:
Robert Müller 2023-07-29 08:48:05 +00:00 committed by GitHub
commit 3b273500c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View file

@ -119,7 +119,7 @@ public:
virtual void SetAccessLevel(int AccessLevel) = 0; virtual void SetAccessLevel(int AccessLevel) = 0;
virtual void ResetServerGameSettings(int FlagMask) = 0; virtual void ResetGameSettings() = 0;
static LEVEL ToLogLevel(int ConsoleLevel); static LEVEL ToLogLevel(int ConsoleLevel);

View file

@ -1263,13 +1263,13 @@ const IConsole::CCommandInfo *CConsole::GetCommandInfo(const char *pName, int Fl
std::unique_ptr<IConsole> CreateConsole(int FlagMask) { return std::make_unique<CConsole>(FlagMask); } std::unique_ptr<IConsole> CreateConsole(int FlagMask) { return std::make_unique<CConsole>(FlagMask); }
void CConsole::ResetServerGameSettings(int FlagMask) void CConsole::ResetGameSettings()
{ {
#define MACRO_CONFIG_INT(Name, ScriptName, Def, Min, Max, Flags, Desc) \ #define MACRO_CONFIG_INT(Name, ScriptName, Def, Min, Max, Flags, Desc) \
{ \ { \
if(((Flags) & (CFGFLAG_SERVER | CFGFLAG_GAME)) == (CFGFLAG_SERVER | CFGFLAG_GAME)) \ if(((Flags)&CFGFLAG_GAME) == CFGFLAG_GAME) \
{ \ { \
CCommand *pCommand = FindCommand(#ScriptName, FlagMask); \ CCommand *pCommand = FindCommand(#ScriptName, CFGFLAG_GAME); \
void *pUserData = pCommand->m_pUserData; \ void *pUserData = pCommand->m_pUserData; \
FCommandCallback pfnCallback = pCommand->m_pfnCallback; \ FCommandCallback pfnCallback = pCommand->m_pfnCallback; \
TraverseChain(&pfnCallback, &pUserData); \ TraverseChain(&pfnCallback, &pUserData); \
@ -1282,9 +1282,9 @@ void CConsole::ResetServerGameSettings(int FlagMask)
#define MACRO_CONFIG_STR(Name, ScriptName, Len, Def, Flags, Desc) \ #define MACRO_CONFIG_STR(Name, ScriptName, Len, Def, Flags, Desc) \
{ \ { \
if(((Flags) & (CFGFLAG_SERVER | CFGFLAG_GAME)) == (CFGFLAG_SERVER | CFGFLAG_GAME)) \ if(((Flags)&CFGFLAG_GAME) == CFGFLAG_GAME) \
{ \ { \
CCommand *pCommand = FindCommand(#ScriptName, FlagMask); \ CCommand *pCommand = FindCommand(#ScriptName, CFGFLAG_GAME); \
void *pUserData = pCommand->m_pUserData; \ void *pUserData = pCommand->m_pUserData; \
FCommandCallback pfnCallback = pCommand->m_pfnCallback; \ FCommandCallback pfnCallback = pCommand->m_pfnCallback; \
TraverseChain(&pfnCallback, &pUserData); \ TraverseChain(&pfnCallback, &pUserData); \

View file

@ -223,7 +223,7 @@ public:
void InitChecksum(CChecksumData *pData) const override; void InitChecksum(CChecksumData *pData) const override;
void SetAccessLevel(int AccessLevel) override { m_AccessLevel = clamp(AccessLevel, (int)(ACCESS_LEVEL_ADMIN), (int)(ACCESS_LEVEL_USER)); } void SetAccessLevel(int AccessLevel) override { m_AccessLevel = clamp(AccessLevel, (int)(ACCESS_LEVEL_ADMIN), (int)(ACCESS_LEVEL_USER)); }
void ResetServerGameSettings(int FlagMask) override; void ResetGameSettings() override;
// DDRace // DDRace
static void ConUserCommandStatus(IConsole::IResult *pResult, void *pUser); static void ConUserCommandStatus(IConsole::IResult *pResult, void *pUser);

View file

@ -522,7 +522,7 @@ void CGameClient::OnConnected()
m_GameWorld.m_WorldConfig.m_InfiniteAmmo = true; m_GameWorld.m_WorldConfig.m_InfiniteAmmo = true;
mem_zero(&m_GameInfo, sizeof(m_GameInfo)); mem_zero(&m_GameInfo, sizeof(m_GameInfo));
m_PredictedDummyID = -1; m_PredictedDummyID = -1;
Console()->ResetServerGameSettings(CFGFLAG_GAME); Console()->ResetGameSettings();
LoadMapSettings(); LoadMapSettings();
if(Client()->State() != IClient::STATE_DEMOPLAYBACK && g_Config.m_ClAutoDemoOnConnect) if(Client()->State() != IClient::STATE_DEMOPLAYBACK && g_Config.m_ClAutoDemoOnConnect)

View file

@ -3813,7 +3813,7 @@ void CGameContext::OnShutdown()
} }
DeleteTempfile(); DeleteTempfile();
Console()->ResetServerGameSettings(CFGFLAG_SERVER); Console()->ResetGameSettings();
Collision()->Dest(); Collision()->Dest();
delete m_pController; delete m_pController;
m_pController = 0; m_pController = 0;