From: Rudolf Polzer Date: Sat, 13 Jul 2013 09:53:30 +0000 (+0200) Subject: typos X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2FdivVerent%2Fanticheat-tricks;p=xonotic%2Fdarkplaces.git typos --- diff --git a/cl_parse.c b/cl_parse.c index 0dc0ab98..1da1fc34 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -3005,7 +3005,7 @@ static void CL_IPLog_Add(const char *address, const char *name, qboolean checkex char name[MAX_OSPATH]; strlcpy(name, cl_iplog_name.string, sizeof(name)); FS_SetExtension(name, ".log", sizeof (name), IS_HARDENED); - Cvar_SetQuick(cl_iplog_name, name); + Cvar_SetQuick(&cl_iplog_name, name); } // TODO: this ought to open the one in the userpath version of the base // gamedir, not the current gamedir @@ -3028,7 +3028,7 @@ static void CL_IPLog_Load(void) char name[MAX_OSPATH]; strlcpy(name, cl_iplog_name.string, sizeof(name)); FS_SetExtension(name, ".log", sizeof (name), IS_HARDENED); - Cvar_SetQuick(cl_iplog_name, name); + Cvar_SetQuick(&cl_iplog_name, name); } // TODO: this ought to open the one in the userpath version of the base // gamedir, not the current gamedir diff --git a/console.c b/console.c index 313dea3d..bddf85fb 100644 --- a/console.c +++ b/console.c @@ -414,7 +414,7 @@ static void Log_Open (void) char name[MAX_OSPATH]; strlcpy(name, log_file.string, sizeof(name)); FS_SetExtension(name, ".log", sizeof (name), IS_HARDENED); - Cvar_SetQuick(log_file, name); + Cvar_SetQuick(&log_file, name); } logfile = FS_OpenRealFile(log_file.string, "a", false); diff --git a/host_cmd.c b/host_cmd.c index 0e932af9..5fc325c1 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -3033,9 +3033,7 @@ void Host_InitCommands (void) Cmd_AddCommand ("pingplreport", Host_PingPLReport_f, "command sent by server containing client ping and packet loss values for scoreboard, triggered by pings command from client (not used by QW servers)"); Cmd_AddCommand ("fixtrans", Image_FixTransparentPixels_f, "change alpha-zero pixels in an image file to sensible values, and write out a new TGA (warning: SLOW)"); -#ifdef ANTICHEAT_UNSAFE Cmd_AddCommand ("checkmemory", Sys_AntiCheat_CheckMemory_f, "check memory for patterns"); -#endif Cvar_RegisterVariable (&r_fixtrans_auto); diff --git a/sys.h b/sys.h index 6d992cd5..10d6284e 100644 --- a/sys.h +++ b/sys.h @@ -117,7 +117,6 @@ void Sys_MakeProcessMean (void); // call this from main(); if it returns false, exit using return qboolean Sys_AntiCheat_Init(char **envp); -#ifdef ANTICHEAT_UNSAFE typedef enum { CHECKMEMORY_N_A, @@ -129,7 +128,6 @@ Sys_AntiCheat_CheckMemory_Result_t; // dllsubstringmode: false = check only dlls without this substring, true = check only dlls with this substring Sys_AntiCheat_CheckMemory_Result_t Sys_AntiCheat_CheckMemory(const char *dllsubstring, qboolean dllsubstringmode, const void *pattern, size_t length); void Sys_AntiCheat_CheckMemory_f(void); -#endif #endif diff --git a/sys_shared.c b/sys_shared.c index 0d2f62fb..4840da68 100644 --- a/sys_shared.c +++ b/sys_shared.c @@ -649,10 +649,10 @@ void Sys_MakeProcessMean (void) # endif #endif -#ifdef ANTICHEAT_UNSAFE // whole function only exists if anticheat is enabled Sys_AntiCheat_CheckMemory_Result_t Sys_AntiCheat_CheckMemory(const char *dllsubstring, qboolean dllsubstringmode, const void *pattern, size_t length) { +#ifdef ANTICHEAT_UNSAFE # ifdef __linux__ Sys_AntiCheat_CheckMemory_Result_t ret = CHECKMEMORY_NODLL; FILE *f = fopen("/proc/self/maps", "r"); @@ -703,6 +703,9 @@ Sys_AntiCheat_CheckMemory_Result_t Sys_AntiCheat_CheckMemory(const char *dllsubs # else return CHECKMEMORY_N_A; # endif +#else + return CHECKMEMORY_N_A; +#endif } void Sys_AntiCheat_CheckMemory_f(void) { @@ -726,7 +729,6 @@ void Sys_AntiCheat_CheckMemory_f(void) break; } } -#endif qboolean Sys_AntiCheat_Init(char **envp) {