mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Changed behavior of ConCommandBase::IsFlagSet (read description)
This commit breaks the indev branch for the time being (this will be solved very soon). We no longer mask off dev flags from every commandbase, we only mask them off from the essential ones (map, connect, give, etc..), unless the SDK is launched as dev, then we mask everything off like usual, but this time at initialization and not whenever we encounter a var with this flag.
This commit is contained in:
parent
fad1a092e4
commit
515487c63a
@ -5,6 +5,7 @@
|
||||
//=============================================================================//
|
||||
|
||||
#include "core/stdafx.h"
|
||||
#include "tier0/commandline.h"
|
||||
#include "tier1/cvar.h"
|
||||
#include "vpc/interfaces.h"
|
||||
#include "launcher/IApplication.h"
|
||||
@ -66,6 +67,12 @@ bool CModAppSystemGroup::Create(CModAppSystemGroup* pModAppSystemGroup)
|
||||
g_pConsole->m_vsvCommandBases.push_back(
|
||||
CSuggest(map.first, map.second->GetFlags()));
|
||||
}
|
||||
if (CommandLine()->CheckParm("-devsdk"))
|
||||
{
|
||||
cv->EnableDevCvars();
|
||||
cv->EnableHiddenCvars();
|
||||
}
|
||||
|
||||
#endif // !DEDICATED
|
||||
if (pModAppSystemGroup->IsServerOnly())
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ int HWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int
|
||||
int LauncherMain(HINSTANCE hInstance)
|
||||
{
|
||||
int results = v_LauncherMain(hInstance);
|
||||
spdlog::info("LauncherMain: {:s}\n", ExitCodeToString(results));
|
||||
spdlog::info("LauncherMain returned: {:s}\n", ExitCodeToString(results));
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -68,10 +68,7 @@ void ConVar::Init(void) const
|
||||
hostdesc = ConVar::Create("hostdesc", "", FCVAR_RELEASE, "Host game server description.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
staticProp_defaultBuildFrustum = ConVar::Create("staticProp_defaultBuildFrustum", "0", FCVAR_DEVELOPMENTONLY, "Use the old solution for building static prop frustum culling.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
|
||||
cm_debug_cmdquery = ConVar::Create("cm_debug_cmdquery" , "0", FCVAR_DEVELOPMENTONLY, "Prints the flags of each ConVar/ConCommand query to the console ( !slower! ).", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cm_unset_all_cmdquery = ConVar::Create("cm_unset_all_cmdquery" , "0", FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED, "Returns false on every ConVar/ConCommand query ( !warning! ).", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cm_unset_dev_cmdquery = ConVar::Create("cm_unset_dev_cmdquery" , "1", FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED, "Returns false on all FCVAR_DEVELOPMENTONLY ConVar/ConCommand queries ( !warning! ).", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cm_unset_cheat_cmdquery = ConVar::Create("cm_unset_cheat_cmdquery", "0", FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED, "Returns false on all FCVAR_DEVELOPMENTONLY and FCVAR_CHEAT ConVar/ConCommand queries ( !warning! ).", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
|
||||
rcon_address = ConVar::Create("rcon_address", "::", FCVAR_SERVER_CANNOT_QUERY | FCVAR_DONTRECORD | FCVAR_RELEASE, "Remote server access address.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
rcon_password = ConVar::Create("rcon_password", "" , FCVAR_SERVER_CANNOT_QUERY | FCVAR_DONTRECORD | FCVAR_RELEASE, "Remote server access password (rcon is disabled if empty).", false, 0.f, false, 0.f, &RCON_PasswordChanged_f, nullptr);
|
||||
@ -885,33 +882,8 @@ bool ConVar::IsCommand(void) const
|
||||
// Input : *pConVar - nFlags
|
||||
// Output : False if change is permitted, true if not.
|
||||
//-----------------------------------------------------------------------------
|
||||
bool ConVar::IsFlagSetInternal(ConVar* pConVar, int nFlags)
|
||||
bool ConVar::IsFlagSetInternal(const ConVar* pConVar, int nFlags)
|
||||
{
|
||||
if (cm_debug_cmdquery->GetBool())
|
||||
{
|
||||
printf("--------------------------------------------------\n");
|
||||
printf(" Flaged: %08X\n", pConVar->m_nFlags);
|
||||
}
|
||||
if (cm_unset_cheat_cmdquery->GetBool())
|
||||
{
|
||||
// Mask off FCVAR_CHEATS and FCVAR_DEVELOPMENTONLY.
|
||||
pConVar->RemoveFlags(FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT);
|
||||
}
|
||||
else if(cm_unset_dev_cmdquery->GetBool())// Mask off FCVAR_DEVELOPMENTONLY.
|
||||
{
|
||||
pConVar->RemoveFlags(FCVAR_DEVELOPMENTONLY);
|
||||
}
|
||||
if (cm_debug_cmdquery->GetBool())
|
||||
{
|
||||
printf(" Masked: %08X\n", pConVar->m_nFlags);
|
||||
printf(" Verify: %08X\n", nFlags);
|
||||
printf("--------------------------------------------------\n");
|
||||
}
|
||||
if (nFlags & FCVAR_RELEASE && !cm_unset_all_cmdquery->GetBool())
|
||||
{
|
||||
// Default retail behaviour.
|
||||
return IConVar_IsFlagSet(pConVar, nFlags);
|
||||
}
|
||||
if (cm_unset_all_cmdquery->GetBool())
|
||||
{
|
||||
// Returning false on all queries may cause problems.
|
||||
|
@ -70,8 +70,8 @@ public:
|
||||
bool IsRegistered(void) const;
|
||||
bool IsCommand(void) const;
|
||||
|
||||
bool IsFlagSet(int nFlags) { return IsFlagSetInternal(this, nFlags); };
|
||||
static bool IsFlagSetInternal(ConVar* pConVar, int nFlags);
|
||||
bool IsFlagSet(int nFlags) const { return IsFlagSetInternal(this, nFlags); };
|
||||
static bool IsFlagSetInternal(const ConVar* pConVar, int nFlags);
|
||||
|
||||
struct CVValue_t
|
||||
{
|
||||
|
@ -483,33 +483,8 @@ bool ConCommandBase::IsRegistered(void) const
|
||||
// Input : *pCommandBase - nFlags
|
||||
// Output : False if execution is permitted, true if not.
|
||||
//-----------------------------------------------------------------------------
|
||||
bool ConCommandBase::IsFlagSetInternal(ConCommandBase* pCommandBase, int nFlags)
|
||||
bool ConCommandBase::IsFlagSetInternal(const ConCommandBase* pCommandBase, int nFlags)
|
||||
{
|
||||
if (cm_debug_cmdquery->GetBool())
|
||||
{
|
||||
printf("--------------------------------------------------\n");
|
||||
printf(" Flaged: %08X\n", pCommandBase->m_nFlags);
|
||||
}
|
||||
// Mask off FCVAR_CHEATS and FCVAR_DEVELOPMENTONLY.
|
||||
if (cm_unset_cheat_cmdquery->GetBool())
|
||||
{
|
||||
pCommandBase->RemoveFlags(FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT);
|
||||
}
|
||||
else if (cm_unset_dev_cmdquery->GetBool())// Mask off FCVAR_DEVELOPMENTONLY.
|
||||
{
|
||||
pCommandBase->RemoveFlags(FCVAR_DEVELOPMENTONLY);
|
||||
}
|
||||
if (cm_debug_cmdquery->GetBool())
|
||||
{
|
||||
printf(" Masked: %08X\n", pCommandBase->m_nFlags);
|
||||
printf(" Verify: %08X\n", nFlags);
|
||||
printf("--------------------------------------------------\n");
|
||||
}
|
||||
if (nFlags & FCVAR_RELEASE && !cm_unset_all_cmdquery->GetBool())
|
||||
{
|
||||
// Default retail behaviour.
|
||||
return ConCommandBase_IsFlagSet(pCommandBase, nFlags);
|
||||
}
|
||||
if (cm_unset_all_cmdquery->GetBool())
|
||||
{
|
||||
// Returning false on all queries may cause problems.
|
||||
|
@ -96,8 +96,8 @@ public:
|
||||
bool IsCommand(void) const;
|
||||
bool IsRegistered(void) const;
|
||||
|
||||
bool IsFlagSet(int nFlags) { return IsFlagSetInternal(this, nFlags); };
|
||||
static bool IsFlagSetInternal(ConCommandBase* pCommandBase, int nFlags);
|
||||
bool IsFlagSet(int nFlags) const { return IsFlagSetInternal(this, nFlags); };
|
||||
static bool IsFlagSetInternal(const ConCommandBase* pCommandBase, int nFlags);
|
||||
|
||||
int GetFlags(void) const;
|
||||
ConCommandBase* GetNext(void) const;
|
||||
|
@ -11,6 +11,7 @@
|
||||
ConVar* single_frame_shutdown_for_reload = nullptr;
|
||||
ConVar* old_gather_props = nullptr;
|
||||
ConVar* enable_debug_overlays = nullptr;
|
||||
ConVar* cm_unset_all_cmdquery = nullptr;
|
||||
|
||||
ConVar* staticProp_defaultBuildFrustum = nullptr;
|
||||
ConVar* staticProp_no_fade_scalar = nullptr;
|
||||
@ -26,11 +27,6 @@ ConVar* hostport = nullptr;
|
||||
ConVar* host_hasIrreversibleShutdown = nullptr;
|
||||
ConVar* mp_gamemode = nullptr;
|
||||
|
||||
ConVar* cm_debug_cmdquery = nullptr;
|
||||
ConVar* cm_unset_all_cmdquery = nullptr;
|
||||
ConVar* cm_unset_dev_cmdquery = nullptr;
|
||||
ConVar* cm_unset_cheat_cmdquery = nullptr;
|
||||
|
||||
ConVar* rcon_address = nullptr;
|
||||
ConVar* rcon_password = nullptr;
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
extern ConVar* single_frame_shutdown_for_reload;
|
||||
extern ConVar* old_gather_props;
|
||||
extern ConVar* enable_debug_overlays;
|
||||
extern ConVar* cm_unset_all_cmdquery;
|
||||
|
||||
extern ConVar* staticProp_defaultBuildFrustum;
|
||||
extern ConVar* staticProp_no_fade_scalar;
|
||||
@ -23,11 +24,6 @@ extern ConVar* host_hasIrreversibleShutdown;
|
||||
|
||||
extern ConVar* mp_gamemode;
|
||||
|
||||
extern ConVar* cm_debug_cmdquery;
|
||||
extern ConVar* cm_unset_all_cmdquery;
|
||||
extern ConVar* cm_unset_dev_cmdquery;
|
||||
extern ConVar* cm_unset_cheat_cmdquery;
|
||||
|
||||
extern ConVar* rcon_address;
|
||||
extern ConVar* rcon_password;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user