aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/host.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/host.cpp')
-rw-r--r--NorthstarDLL/host.cpp46
1 files changed, 2 insertions, 44 deletions
diff --git a/NorthstarDLL/host.cpp b/NorthstarDLL/host.cpp
index 0a44891c..87b1ce4e 100644
--- a/NorthstarDLL/host.cpp
+++ b/NorthstarDLL/host.cpp
@@ -3,6 +3,7 @@
#include "modmanager.h"
#include "printcommand.h"
#include "printmaps.h"
+#include "misccommands.h"
#include "r2engine.h"
#include "tier0.h"
@@ -16,50 +17,7 @@ void, __fastcall, (bool bDedicated))
spdlog::info("Host_Init()");
Host_Init(bDedicated);
- if (Tier0::CommandLine()->CheckParm("-allowdevcvars"))
- {
- // get all mod convars
- std::vector<std::string> vModConvarNames;
- for (auto& mod : g_pModManager->m_LoadedMods)
- for (auto& cvar : mod.ConVars)
- vModConvarNames.push_back(cvar->Name);
-
- // strip hidden and devonly cvar flags
- int iNumCvarsAltered = 0;
- for (auto& pair : R2::g_pCVar->DumpToMap())
- {
- // don't remove from mod cvars
- if (std::find(vModConvarNames.begin(), vModConvarNames.end(), pair.second->m_pszName) != vModConvarNames.end())
- continue;
-
- // strip flags
- int flags = pair.second->GetFlags();
- if (flags & FCVAR_DEVELOPMENTONLY)
- {
- flags &= ~FCVAR_DEVELOPMENTONLY;
- iNumCvarsAltered++;
- }
-
- if (flags & FCVAR_HIDDEN)
- {
- flags &= ~FCVAR_HIDDEN;
- iNumCvarsAltered++;
- }
-
- pair.second->m_nFlags = flags;
- }
-
- spdlog::info("Removed {} hidden/devonly cvar flags", iNumCvarsAltered);
- }
-
- // make servers able to run disconnect on clients
- R2::g_pCVar->FindCommand("disconnect")->m_nFlags |= FCVAR_SERVER_CAN_EXECUTE;
-
- R2::g_pCVar->FindCommand("migrateme")->m_nFlags &= ~FCVAR_SERVER_CAN_EXECUTE;
-
- // make clients able to run status and ping
- R2::g_pCVar->FindCommand("status")->m_nFlags |= FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS;
- R2::g_pCVar->FindCommand("ping")->m_nFlags |= FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS;
+ FixupCvarFlags();
// need to initialise these after host_init since they do stuff to preexisting concommands/convars without being client/server specific
InitialiseCommandPrint();