mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #6942 from heinrich5991/pr_ddnet_game_settings_cleanup
ResetServerGameSettings → ResetGameSettings, remove flag argument
This commit is contained in:
commit
3b273500c5
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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); \
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue