diff options
-rw-r--r-- | NorthstarDLL/misccommands.cpp | 23 | ||||
-rw-r--r-- | NorthstarDLL/printcommands.cpp | 2 |
2 files changed, 17 insertions, 8 deletions
diff --git a/NorthstarDLL/misccommands.cpp b/NorthstarDLL/misccommands.cpp index f5698448..b316571c 100644 --- a/NorthstarDLL/misccommands.cpp +++ b/NorthstarDLL/misccommands.cpp @@ -95,15 +95,24 @@ void FixupCvarFlags() spdlog::info("Removed {} hidden/devonly cvar flags", iNumCvarsAltered); } + // make all engine client commands FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS + // these are usually checked through CGameClient::IsEngineClientCommand, but we get more control over this if we just do it through + // cvar flags + const char** ppEngineClientCommands = CModule("engine.dll").Offset(0x7C5EF0).As<const char**>(); + + int i = 0; + do + { + ConCommandBase* pCommand = R2::g_pCVar->FindCommandBase(ppEngineClientCommands[i]); + if (pCommand) // not all the commands in this array actually exist in respawn source + pCommand->m_nFlags |= FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS; + } while (ppEngineClientCommands[++i]); + const std::vector<std::tuple<const char*, uint32_t>> CVAR_FIXUP_ADD_FLAGS = { // system commands (i.e. necessary for proper functionality) // servers need to be able to disconnect {"disconnect", FCVAR_SERVER_CAN_EXECUTE}, - // clients need to be able to run these on server, which will then print the results of them on client - {"status", FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS}, - {"ping", FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS}, - // cheat commands {"give", FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS}, {"give_server", FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS}, @@ -131,8 +140,10 @@ void FixupCvarFlags() const std::vector<std::tuple<const char*, uint32_t>> CVAR_FIXUP_REMOVE_FLAGS = { // unsure how this command works, not even sure it's used on retail servers, deffo shouldn't be used on northstar - {"migrateme", FCVAR_SERVER_CAN_EXECUTE}, - }; + {"migrateme", FCVAR_SERVER_CAN_EXECUTE | FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS}, + {"recheck", FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS}, // we don't need this on northstar servers, it's for communities + {"rpt_client_enable", FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS}, + {"rpt_password", FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS}}; for (auto& fixup : CVAR_FIXUP_ADD_FLAGS) R2::g_pCVar->FindCommandBase(std::get<0>(fixup))->m_nFlags |= std::get<1>(fixup); diff --git a/NorthstarDLL/printcommands.cpp b/NorthstarDLL/printcommands.cpp index d03d92c4..90af1575 100644 --- a/NorthstarDLL/printcommands.cpp +++ b/NorthstarDLL/printcommands.cpp @@ -13,8 +13,6 @@ void PrintCommandHelpDialogue(const ConCommandBase* command, const char* name) // temp because command->IsCommand does not currently work ConVar* cvar = R2::g_pCVar->FindVar(command->m_pszName); - if (cvar) - return; // build string for flags if not FCVAR_NONE std::string flagString; |