diff --git a/NorthstarDLL/shared/exploit_fixes/servercommands.cpp b/NorthstarDLL/shared/exploit_fixes/servercommands.cpp index 363c0049a..53f0805cd 100644 --- a/NorthstarDLL/shared/exploit_fixes/servercommands.cpp +++ b/NorthstarDLL/shared/exploit_fixes/servercommands.cpp @@ -11,17 +11,24 @@ ON_DLL_LOAD("engine.dll", ServerCommands, (CModule module)) { GetBaseLocalClient = module.Offset(0x78200).RCast(); - Cvar_ns_restrict_commands = new ConVar("ns_restrict_commands", "1", FCVAR_GAMEDLL, "", 0, 0, 0, 0, [](ConVar* cvar, const char* pOldValue, float flOldValue) { + Cvar_ns_restrict_commands = new ConVar( + "ns_restrict_commands", + "1", + FCVAR_GAMEDLL, + "Whether or not server/client commands should be restricted.", + false, + 0, + false, + 0, + [](ConVar * cvar, const char* pOldValue, float flOldValue) + { // this callback runs even if there was no actual change, so filter that out if (!strcmp(pOldValue, Cvar_ns_restrict_commands->GetString())) return; spdlog::info("ns_restrict_commands was changed from {} to {}", pOldValue, Cvar_ns_restrict_commands->GetString()); - R2::Cbuf_AddText( - R2::Cbuf_GetCurrentPlayer(), - "disconnect \"Command restrictions were changed\"", - R2::cmd_source_t::kCommandSrcCode); + R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "disconnect \"Command restrictions were changed\"", R2::cmd_source_t::kCommandSrcCode); bool shouldRestrict = Cvar_ns_restrict_commands->GetBool(); bool* localClientBase = (bool*)(*GetBaseLocalClient)();