diff --git a/cl_dll/aghl/agglobal.h b/cl_dll/aghl/agglobal.h index 83809226..cf3ebc83 100644 --- a/cl_dll/aghl/agglobal.h +++ b/cl_dll/aghl/agglobal.h @@ -23,6 +23,7 @@ #else #include #define MAX_PATH PATH_MAX +#define _MAX_PATH MAX_PATH #endif #define _bool_h 1 #include diff --git a/cl_dll/aghl/aghudglobal.cpp b/cl_dll/aghl/aghudglobal.cpp index 099e0876..bbc7219d 100644 --- a/cl_dll/aghl/aghudglobal.cpp +++ b/cl_dll/aghl/aghudglobal.cpp @@ -244,10 +244,9 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf) AgCRC32EnforceFiles(); g_VariableChecker.Activate(); - +#ifdef _DEBUG DWORD dwTime = GetTickCount(); -#ifdef _DEBUG AgLog( "Checking for spikes\n" ); #endif //_DEBUG if (!g_ModelCheck.Check()) @@ -255,7 +254,7 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf) if (s_iCheckWallhack) { -#ifdef AG_USE_CHEATPROTECTION +#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32) #ifdef _DEBUG AgLog( "Checking for wallhack\n" ); #endif //_DEBUG @@ -280,7 +279,7 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf) int AgHudGlobal::MsgFunc_WhString(const char *pszName, int iSize, void *pbuf) { BEGIN_READ( pbuf, iSize ); -#ifdef AG_USE_CHEATPROTECTION +#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32) g_Wallhack.AddBadStrings(READ_STRING()); #else READ_STRING(); diff --git a/cl_dll/aghl/agmodel.cpp b/cl_dll/aghl/agmodel.cpp index 4f2ce5ce..3ccb25e5 100644 --- a/cl_dll/aghl/agmodel.cpp +++ b/cl_dll/aghl/agmodel.cpp @@ -9,7 +9,7 @@ #include "com_model.h" #include "studio.h" #include "com_weapons.h" -#include "AgModel.h" +#include "agmodel.h" #ifdef AG_USE_CHEATPROTECTION diff --git a/cl_dll/aghl/agmodel.h b/cl_dll/aghl/agmodel.h index 7e557ad8..62d39b50 100644 --- a/cl_dll/aghl/agmodel.h +++ b/cl_dll/aghl/agmodel.h @@ -9,7 +9,7 @@ #ifdef AG_USE_CHEATPROTECTION -#include "AgGlobal.h" +#include "agglobal.h" class AgModel { diff --git a/cl_dll/aghl/agvariablechecker.cpp b/cl_dll/aghl/agvariablechecker.cpp index d26539c5..e1444c69 100644 --- a/cl_dll/aghl/agvariablechecker.cpp +++ b/cl_dll/aghl/agvariablechecker.cpp @@ -11,8 +11,8 @@ #include "triangleapi.h" #include "studio_util.h" #include "r_studioint.h" -#include "AgVariableChecker.h" -#include "AgModelCheck.h" +#include "agvariablechecker.h" +#include "agmodelcheck.h" ////////////////////////////////////////////////////////////////////// diff --git a/cl_dll/aghl/agvariablechecker.h b/cl_dll/aghl/agvariablechecker.h index 4da46cbf..d86fced8 100644 --- a/cl_dll/aghl/agvariablechecker.h +++ b/cl_dll/aghl/agvariablechecker.h @@ -8,6 +8,17 @@ #ifdef AG_USE_CHEATPROTECTION +#ifndef _WIN32 +#include +typedef unsigned long DWORD; + +static inline DWORD GetTickCount( void ) +{ + tms tm; + return times( &tm ); +} +#endif + class AgVariableChecker { bool m_bActive; diff --git a/cl_dll/aghl/agversioninfo.cpp b/cl_dll/aghl/agversioninfo.cpp index 45570057..d1db744e 100644 --- a/cl_dll/aghl/agversioninfo.cpp +++ b/cl_dll/aghl/agversioninfo.cpp @@ -1,6 +1,6 @@ #include -#ifdef AG_USE_CHEATPROTECTION +#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32) #include "AgGlobal.h" #include "AgVersionInfo.h" @@ -195,4 +195,4 @@ BOOL AgVersionInfo::IsRequiredVersion(int iReqMajor, int iReqMinor, int iReqMicr return FALSE; } -#endif //AG_USE_CHEATPROTECTION \ No newline at end of file +#endif //AG_USE_CHEATPROTECTION diff --git a/cl_dll/aghl/agwallhack.cpp b/cl_dll/aghl/agwallhack.cpp index 6da2b257..14f9f8df 100644 --- a/cl_dll/aghl/agwallhack.cpp +++ b/cl_dll/aghl/agwallhack.cpp @@ -2,7 +2,7 @@ #include "hud.h" #include "cl_util.h" -#ifdef AG_USE_CHEATPROTECTION +#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32) #include "AgWallhack.h" #include "AgVersionInfo.h" diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index f2146b6e..5abfc7aa 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -141,7 +141,7 @@ void DLLEXPORT HUD_PlayerMove( struct playermove_s *ppmove, int server ) PM_Move( ppmove, server ); } -#ifdef AG_USE_CHEATPROTECTION +#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32) void* pFromModuleAddress = 0; int DLLEXPORT Initialize_Body( cl_enginefunc_t *pEnginefuncs, int iVersion ) #else @@ -160,7 +160,7 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ) //++ BulliT AgInitClientDll(); -#ifdef AG_USE_CHEATPROTECTION +#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32) g_Wallhack.SetHLAddressToValidate( (DWORD)pFromModuleAddress ); #endif //-- Martin Webrant @@ -168,7 +168,7 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ) return 1; } -#ifdef AG_USE_CHEATPROTECTION +#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32) __declspec(naked) int Initialize( cl_enginefunc_t *pEnginefuncs, int Version ) { __asm pop pFromModuleAddress;