From 65299affa1523e842bd56c5765ff3e4ae1aaff2f Mon Sep 17 00:00:00 2001 From: Amos <48657826+Mauler125@users.noreply.github.com> Date: Fri, 28 Jan 2022 01:32:27 +0100 Subject: [PATCH] Fix issue where connected clients could kick/ban players This was caused by a bad mistake I made when setting flags for ConVars and ConCommands. Set 'IsFlagSet()' query debug ConVars as Replicated. --- r5dev/tier0/ConCommand.cpp | 16 ++++++++-------- r5dev/tier0/IConVar.cpp | 4 ++-- r5dev/tier0/IConVar.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/r5dev/tier0/ConCommand.cpp b/r5dev/tier0/ConCommand.cpp index 15845da2..2fa28853 100644 --- a/r5dev/tier0/ConCommand.cpp +++ b/r5dev/tier0/ConCommand.cpp @@ -43,17 +43,17 @@ void ConCommand::Init(void) { //------------------------------------------------------------------------- // SERVER DLL | - ConCommand* sv_kick = new ConCommand("sv_kick", "Kick a client from the server by name. | Usage: kick .", FCVAR_GAMEDLL, _Kick_f_CompletionFunc, nullptr); - ConCommand* sv_kickid = new ConCommand("sv_kickid", "Kick a client from the server by UserID or OriginID | Usage: kickid /.", FCVAR_GAMEDLL, _KickID_f_CompletionFunc, nullptr); - ConCommand* sv_ban = new ConCommand("sv_ban", "Bans a client from the server by name. | Usage: ban .", FCVAR_GAMEDLL, _Ban_f_CompletionFunc, nullptr); - ConCommand* sv_banid = new ConCommand("sv_banid", "Bans a client from the server by OriginID, UserID or IPAddress | Usage: banid //.", FCVAR_GAMEDLL, _BanID_f_CompletionFunc, nullptr); - ConCommand* sv_unban = new ConCommand("sv_unban", "Unbans a client from the Server by IPAddress or OriginID | Usage: unban /.", FCVAR_GAMEDLL, _Unban_f_CompletionFunc, nullptr); - ConCommand* sv_reloadbanlist = new ConCommand("sv_reloadbanlist", "Reloads the ban list from the disk.", FCVAR_GAMEDLL, _ReloadBanList_f_CompletionFunc, nullptr); + ConCommand* sv_kick = new ConCommand("sv_kick", "Kick a client from the server by name. | Usage: kick .", FCVAR_RELEASE, _Kick_f_CompletionFunc, nullptr); + ConCommand* sv_kickid = new ConCommand("sv_kickid", "Kick a client from the server by UserID or OriginID | Usage: kickid /.", FCVAR_RELEASE, _KickID_f_CompletionFunc, nullptr); + ConCommand* sv_ban = new ConCommand("sv_ban", "Bans a client from the server by name. | Usage: ban .", FCVAR_RELEASE, _Ban_f_CompletionFunc, nullptr); + ConCommand* sv_banid = new ConCommand("sv_banid", "Bans a client from the server by OriginID, UserID or IPAddress | Usage: banid //.", FCVAR_RELEASE, _BanID_f_CompletionFunc, nullptr); + ConCommand* sv_unban = new ConCommand("sv_unban", "Unbans a client from the Server by IPAddress or OriginID | Usage: unban /.", FCVAR_RELEASE, _Unban_f_CompletionFunc, nullptr); + ConCommand* sv_reloadbanlist = new ConCommand("sv_reloadbanlist", "Reloads the ban list from the disk.", FCVAR_RELEASE, _ReloadBanList_f_CompletionFunc, nullptr); #ifndef DEDICATED //------------------------------------------------------------------------- // CLIENT DLL | - ConCommand* cl_showconsole = new ConCommand("cl_showconsole", "Opens the game console.", FCVAR_CLIENTDLL, _CGameConsole_f_CompletionFunc, nullptr); - ConCommand* cl_showbrowser = new ConCommand("cl_showbrowser", "Opens the server browser.", FCVAR_CLIENTDLL, _CCompanion_f_CompletionFunc, nullptr); + ConCommand* cl_showconsole = new ConCommand("cl_showconsole", "Opens the game console.", FCVAR_CLIENTDLL | FCVAR_RELEASE, _CGameConsole_f_CompletionFunc, nullptr); + ConCommand* cl_showbrowser = new ConCommand("cl_showbrowser", "Opens the server browser.", FCVAR_CLIENTDLL | FCVAR_RELEASE, _CCompanion_f_CompletionFunc, nullptr); #endif // !DEDICATED //------------------------------------------------------------------------- // FILESYSTEM API | diff --git a/r5dev/tier0/IConVar.cpp b/r5dev/tier0/IConVar.cpp index 30d44941..75df4a42 100644 --- a/r5dev/tier0/IConVar.cpp +++ b/r5dev/tier0/IConVar.cpp @@ -49,8 +49,8 @@ void ConVar::Init(void) //------------------------------------------------------------------------- // ENGINE | cm_debug_cmdquery = new ConVar("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_return_false_cmdquery_all = new ConVar("cm_return_false_cmdquery_all", "0", FCVAR_DEVELOPMENTONLY, "Returns false on every ConVar/ConCommand query ( !warning! ).", false, 0.f, false, 0.f, nullptr, nullptr); - cm_return_false_cmdquery_cheats = new ConVar("cm_return_false_cmdquery_cheats", "0", FCVAR_DEVELOPMENTONLY, "Returns false on all FCVAR_DEVELOPMENTONLY and FCVAR_CHEAT ConVar/ConCommand queries ( !warning! ).", false, 0.f, false, 0.f, nullptr, nullptr); + cm_return_false_cmdquery_all = new ConVar("cm_return_false_cmdquery_all", "0", FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED, "Returns false on every ConVar/ConCommand query ( !warning! ).", false, 0.f, false, 0.f, nullptr, nullptr); + cm_return_false_cmdquery_cheats = new ConVar("cm_return_false_cmdquery_cheats", "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); r_debug_overlay_nodecay = new ConVar("r_debug_overlay_nodecay", "0", FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT, "Keeps all debug overlays alive regardless of their lifetime. Use command 'clear_debug_overlays' to clear everything.", false, 0.f, false, 0.f, nullptr, nullptr); //------------------------------------------------------------------------- // SERVER | diff --git a/r5dev/tier0/IConVar.h b/r5dev/tier0/IConVar.h index 975c46d5..f157d38c 100644 --- a/r5dev/tier0/IConVar.h +++ b/r5dev/tier0/IConVar.h @@ -14,7 +14,7 @@ #define FCVAR_HIDDEN (1<<4) // Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out. // ConVar only -#define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value +#define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value #define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server. #define FCVAR_ARCHIVE (1<<7) // set to cause it to be saved to vars.rc #define FCVAR_NOTIFY (1<<8) // notifies players when changed