diff --git a/AMBuildScript b/AMBuildScript index 5d7327c3..cd1c5885 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -247,6 +247,7 @@ class AMXXConfig(object): cfg.defines += ['AMBUILD'] cfg.includes += [os.path.join(builder.buildPath, 'includes')] cfg.includes += [os.path.join(builder.sourcePath, 'public')] + cfg.includes += [os.path.join(builder.sourcePath, 'public', 'sdk')] cfg.includes += [os.path.join(builder.sourcePath, 'public', 'amtl')] cfg.includes += [os.path.join(builder.sourcePath, 'public', 'memtools')] return diff --git a/amxmodx/CTextParsers.h b/amxmodx/CTextParsers.h index 45ebe52c..c05929c1 100644 --- a/amxmodx/CTextParsers.h +++ b/amxmodx/CTextParsers.h @@ -35,8 +35,6 @@ #include #include -using namespace SourceMod; - /** * @param void * IN: Stream pointer * @param char * IN/OUT: Stream buffer diff --git a/amxmodx/msvc10/amxmodx_mm.vcxproj b/amxmodx/msvc10/amxmodx_mm.vcxproj index 43b7cb13..61cca271 100644 --- a/amxmodx/msvc10/amxmodx_mm.vcxproj +++ b/amxmodx/msvc10/amxmodx_mm.vcxproj @@ -92,7 +92,7 @@ Disabled - ..\;..\..\public;..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\public;..\..\public\sdk;..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;PAWN_CELL_SIZE=32;ASM32;JIT;_CRT_SECURE_NO_DEPRECATE;HAVE_STDINT_H;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -143,7 +143,7 @@ true Speed true - ..\;..\..\public;..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\public;..\..\public\sdk;..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT;ASM32;PAWN_CELL_SIZE=32;_CRT_SECURE_NO_DEPRECATE;HAVE_STDINT_H;%(PreprocessorDefinitions) false true @@ -192,8 +192,8 @@ Disabled - ..\;..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\multiplayer\common;$(HLSDK)\multiplayer\engine;$(HLSDK)\multiplayer\dlls;$(HLSDK)\multiplayer\pm_shared;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;PAWN_CELL_SIZE=32;ASM32;JIT;BINLOG_ENABLED;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + ..\;..\..\public;..\..\public\sdk;..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;PAWN_CELL_SIZE=32;ASM32;JIT;BINLOG_ENABLED;_CRT_SECURE_NO_DEPRECATE;HAVE_STDINT_H;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug 4Bytes @@ -243,8 +243,8 @@ true Speed true - ..\;..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\multiplayer\common;$(HLSDK)\multiplayer\engine;$(HLSDK)\multiplayer\dlls;$(HLSDK)\multiplayer\pm_shared;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT;ASM32;PAWN_CELL_SIZE=32;BINLOG_ENABLED;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + ..\;..\..\public;..\..\public\sdk;..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;HAVE_STDINT_H;_USRDLL;amxmodx_EXPORTS;JIT;ASM32;PAWN_CELL_SIZE=32;BINLOG_ENABLED;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) false true MultiThreaded @@ -342,7 +342,7 @@ - + true true true @@ -396,8 +396,8 @@ - - + + diff --git a/amxmodx/msvc10/amxmodx_mm.vcxproj.filters b/amxmodx/msvc10/amxmodx_mm.vcxproj.filters index 3b1d4395..da6557f5 100644 --- a/amxmodx/msvc10/amxmodx_mm.vcxproj.filters +++ b/amxmodx/msvc10/amxmodx_mm.vcxproj.filters @@ -162,9 +162,6 @@ Source Files - - SDK - Source Files @@ -183,6 +180,9 @@ Source Files + + SDK + @@ -314,12 +314,6 @@ Header Files - - SDK - - - SDK - Header Files @@ -329,6 +323,12 @@ Header Files + + SDK + + + SDK + diff --git a/amxmodx/trie_natives.cpp b/amxmodx/trie_natives.cpp index 286a1725..700d1f38 100644 --- a/amxmodx/trie_natives.cpp +++ b/amxmodx/trie_natives.cpp @@ -14,8 +14,6 @@ #include "amxmodx.h" #include "trie_natives.h" -using namespace SourceMod; - TrieHandles g_TrieHandles; TrieHandles g_TrieSnapshotHandles; diff --git a/amxmodx/trie_natives.h b/amxmodx/trie_natives.h index 5f85971d..3bc3b02b 100644 --- a/amxmodx/trie_natives.h +++ b/amxmodx/trie_natives.h @@ -15,8 +15,6 @@ #include #include "CVector.h" -using namespace SourceMod; - enum EntryType { EntryType_Cell, diff --git a/dlls/cstrike/cstrike/AMBuilder b/dlls/cstrike/cstrike/AMBuilder index ec1ac464..9910b69e 100644 --- a/dlls/cstrike/cstrike/AMBuilder +++ b/dlls/cstrike/cstrike/AMBuilder @@ -8,7 +8,7 @@ binary.compiler.defines += [ ] binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../../public/sdk/amxxmodule.cpp', 'amxx_api.cpp', 'CstrikePlayer.cpp', 'CstrikeNatives.cpp', diff --git a/dlls/cstrike/cstrike/CstrikeHacks.cpp b/dlls/cstrike/cstrike/CstrikeHacks.cpp index a631effd..7f789be9 100644 --- a/dlls/cstrike/cstrike/CstrikeHacks.cpp +++ b/dlls/cstrike/cstrike/CstrikeHacks.cpp @@ -16,8 +16,6 @@ #include "CDetour/detours.h" #include -using namespace SourceMod; // hashmap - void CtrlDetours_ClientCommand(bool set); void CtrlDetours_BuyCommands(bool set); diff --git a/dlls/cstrike/cstrike/CstrikeUtils.cpp b/dlls/cstrike/cstrike/CstrikeUtils.cpp index 42b44a75..d65b81a1 100644 --- a/dlls/cstrike/cstrike/CstrikeUtils.cpp +++ b/dlls/cstrike/cstrike/CstrikeUtils.cpp @@ -73,7 +73,6 @@ void *UTIL_FindAddressFromEntry(const char *entry, bool isHidden, const char *li #elif defined(__linux__) || defined(__APPLE__) Dl_info info; - void *handle = NULL; if (dladdr(addressInBase, &info) != 0) { diff --git a/dlls/cstrike/cstrike/Makefile b/dlls/cstrike/cstrike/Makefile index 4e0e9403..a56c9de2 100755 --- a/dlls/cstrike/cstrike/Makefile +++ b/dlls/cstrike/cstrike/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../../hlsdk MM_ROOT = ../../../../metamod/metamod +PUBLIC_ROOT = ../../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,10 +15,8 @@ MM_ROOT = ../../../../metamod/metamod PROJECT = cstrike -OBJECTS = sdk/amxxmodule.cpp amxx_api.cpp CstrikePlayer.cpp CstrikeNatives.cpp CstrikeHacks.cpp CstrikeUtils.cpp \ - ../../../public/memtools/MemoryUtils.cpp \ - ../../../public/memtools/CDetour/detours.cpp \ - ../../../public/memtools/CDetour/asm/asm.c +OBJECTS = amxxmodule.cpp amxx_api.cpp CstrikePlayer.cpp CstrikeNatives.cpp CstrikeHacks.cpp CstrikeUtils.cpp \ + MemoryUtils.cpp detours.cpp asm.c ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -32,8 +31,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I../../../public -I../../../public/amtl -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/memtools -I$(PUBLIC_ROOT)/memtools/CDetour -I$(PUBLIC_ROOT)/memtools/CDetour/asm -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -108,7 +108,10 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp + ln -sf $(PUBLIC_ROOT)/memtools/MemoryUtils.cpp + ln -sf $(PUBLIC_ROOT)/memtools/CDetour/detours.cpp + ln -sf $(PUBLIC_ROOT)/memtools/CDetour/asm/asm.c $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -121,6 +124,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/cstrike/cstrike/sdk/moduleconfig.h b/dlls/cstrike/cstrike/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/cstrike/cstrike/sdk/moduleconfig.h rename to dlls/cstrike/cstrike/moduleconfig.h diff --git a/dlls/cstrike/cstrike/msvc10/cstrike.vcxproj b/dlls/cstrike/cstrike/msvc10/cstrike.vcxproj index 2e39589c..5f3c57a7 100644 --- a/dlls/cstrike/cstrike/msvc10/cstrike.vcxproj +++ b/dlls/cstrike/cstrike/msvc10/cstrike.vcxproj @@ -62,8 +62,8 @@ Disabled - ..\;..\..\..\..\public; ..\..\..\..\public\amtl;..\..\..\..\public\memtools;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_STDINT_H;_CRT_SECURE_NO_DEPRECATE;CSTRIKE_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;..\..\..\..\public\memtools;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_STDINT_H;_CRT_SECURE_NO_DEPRECATE;CSTRIKE_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug false @@ -105,7 +105,7 @@ MaxSpeed OnlyExplicitInline - ..\;..\..\..\..\public; ..\..\..\..\public\amtl;..\..\..\..\public\memtools;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;..\..\..\..\public\memtools;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_STDINT_H;_CRT_SECURE_NO_DEPRECATE;CSTRIKE_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded @@ -143,7 +143,7 @@ - + @@ -152,8 +152,8 @@ - - + + diff --git a/dlls/cstrike/cstrike/msvc10/cstrike.vcxproj.filters b/dlls/cstrike/cstrike/msvc10/cstrike.vcxproj.filters index cdf8c9fa..732df515 100644 --- a/dlls/cstrike/cstrike/msvc10/cstrike.vcxproj.filters +++ b/dlls/cstrike/cstrike/msvc10/cstrike.vcxproj.filters @@ -35,9 +35,6 @@ Source Files - - Module SDK\SDK Base - Source Files @@ -56,17 +53,14 @@ Source Files + + Module SDK\SDK Base + Header Files - - Module SDK - - - Module SDK\SDK Base - Header Files @@ -85,6 +79,12 @@ Header Files + + Module SDK\SDK Base + + + Module SDK + diff --git a/dlls/cstrike/cstrike/sdk/amxxmodule.cpp b/dlls/cstrike/cstrike/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/cstrike/cstrike/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/cstrike/cstrike/sdk/amxxmodule.h b/dlls/cstrike/cstrike/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/cstrike/cstrike/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/cstrike/csx/AMBuilder b/dlls/cstrike/csx/AMBuilder index 3f1546ff..6e9925f5 100644 --- a/dlls/cstrike/csx/AMBuilder +++ b/dlls/cstrike/csx/AMBuilder @@ -4,7 +4,7 @@ import os.path binary = AMXX.MetaModule(builder, 'csx') binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../../public/sdk/amxxmodule.cpp', 'CRank.cpp', 'CMisc.cpp', 'meta_api.cpp', diff --git a/dlls/cstrike/csx/Makefile b/dlls/cstrike/csx/Makefile index 826ceeff..f9d2dd50 100755 --- a/dlls/cstrike/csx/Makefile +++ b/dlls/cstrike/csx/Makefile @@ -6,7 +6,8 @@ ########################################### HLSDK = ../../../../hlsdk -MM_ROOT = ../../../../metamod/metamod +MM_ROOT = ../../../../metamod-am/metamod +PUBLIC_ROOT = ../../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../../metamod/metamod PROJECT = csx -OBJECTS = sdk/amxxmodule.cpp CRank.cpp CMisc.cpp meta_api.cpp rank.cpp usermsg.cpp +OBJECTS = amxxmodule.cpp CRank.cpp CMisc.cpp meta_api.cpp rank.cpp usermsg.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -105,7 +107,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -118,6 +120,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/cstrike/csx/WinCSX/amxxmodule.h b/dlls/cstrike/csx/WinCSX/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/cstrike/csx/WinCSX/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/cstrike/csx/WinCSX/msvc10/WinCSX.vcxproj b/dlls/cstrike/csx/WinCSX/msvc10/WinCSX.vcxproj index 5db1b968..1302ebc8 100644 --- a/dlls/cstrike/csx/WinCSX/msvc10/WinCSX.vcxproj +++ b/dlls/cstrike/csx/WinCSX/msvc10/WinCSX.vcxproj @@ -50,7 +50,7 @@ Disabled - ..\resources;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\..\public;..\..\..\..\..\public\sdk; ..\..\..\..\..\public\amtl;..\resources;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true EnableFastChecks @@ -69,7 +69,7 @@ - ..\resources;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\..\public;..\..\..\..\..\public\sdk; ..\..\..\..\..\public\amtl;..\resources;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreaded Use diff --git a/dlls/cstrike/csx/sdk/moduleconfig.h b/dlls/cstrike/csx/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/cstrike/csx/sdk/moduleconfig.h rename to dlls/cstrike/csx/moduleconfig.h diff --git a/dlls/cstrike/csx/msvc10/csx.vcxproj b/dlls/cstrike/csx/msvc10/csx.vcxproj index e83dd0aa..1b2b498d 100644 --- a/dlls/cstrike/csx/msvc10/csx.vcxproj +++ b/dlls/cstrike/csx/msvc10/csx.vcxproj @@ -63,7 +63,7 @@ MaxSpeed OnlyExplicitInline - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;csx_EXPORTS;JIT;%(PreprocessorDefinitions) true MultiThreaded @@ -104,7 +104,7 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;csx_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -139,15 +139,14 @@ - + - - - + + diff --git a/dlls/cstrike/csx/msvc10/csx.vcxproj.filters b/dlls/cstrike/csx/msvc10/csx.vcxproj.filters index 04a78539..0e95c346 100644 --- a/dlls/cstrike/csx/msvc10/csx.vcxproj.filters +++ b/dlls/cstrike/csx/msvc10/csx.vcxproj.filters @@ -35,7 +35,7 @@ Source Files - + SDK\SDK Base @@ -49,13 +49,10 @@ Header Files - - Header Files - - + SDK - + SDK\SDK Base diff --git a/dlls/cstrike/csx/sdk/amxxmodule.cpp b/dlls/cstrike/csx/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/cstrike/csx/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/cstrike/csx/sdk/amxxmodule.h b/dlls/cstrike/csx/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/cstrike/csx/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/dod/dodfun/AMBuilder b/dlls/dod/dodfun/AMBuilder index cdc4c875..1617ce21 100644 --- a/dlls/dod/dodfun/AMBuilder +++ b/dlls/dod/dodfun/AMBuilder @@ -4,7 +4,7 @@ import os.path binary = AMXX.MetaModule(builder, 'dodfun') binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../../public/sdk/amxxmodule.cpp', 'NBase.cpp', 'CMisc.cpp', 'NPD.cpp', diff --git a/dlls/dod/dodfun/Makefile b/dlls/dod/dodfun/Makefile index 232f52d5..f255a282 100755 --- a/dlls/dod/dodfun/Makefile +++ b/dlls/dod/dodfun/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../../hlsdk MM_ROOT = ../../../../metamod/metamod +PUBLIC_ROOT = ../../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../../metamod/metamod PROJECT = dodfun -OBJECTS = sdk/amxxmodule.cpp NBase.cpp CMisc.cpp NPD.cpp Utils.cpp usermsg.cpp moduleconfig.cpp +OBJECTS = amxxmodule.cpp NBase.cpp CMisc.cpp NPD.cpp Utils.cpp usermsg.cpp moduleconfig.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -105,7 +107,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -118,6 +120,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/dod/dodfun/sdk/moduleconfig.h b/dlls/dod/dodfun/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/dod/dodfun/sdk/moduleconfig.h rename to dlls/dod/dodfun/moduleconfig.h diff --git a/dlls/dod/dodfun/msvc10/dodfun.vcxproj b/dlls/dod/dodfun/msvc10/dodfun.vcxproj index 2c6514d4..57773fc7 100644 --- a/dlls/dod/dodfun/msvc10/dodfun.vcxproj +++ b/dlls/dod/dodfun/msvc10/dodfun.vcxproj @@ -62,7 +62,7 @@ MaxSpeed OnlyExplicitInline - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) dodfun_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded @@ -103,7 +103,7 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;dodfun_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -139,14 +139,13 @@ - + - - - + + diff --git a/dlls/dod/dodfun/msvc10/dodfun.vcxproj.filters b/dlls/dod/dodfun/msvc10/dodfun.vcxproj.filters index 821af5ce..161b72c6 100644 --- a/dlls/dod/dodfun/msvc10/dodfun.vcxproj.filters +++ b/dlls/dod/dodfun/msvc10/dodfun.vcxproj.filters @@ -38,7 +38,7 @@ Source Files - + Module SDK\SDK Base @@ -49,13 +49,10 @@ Header Files - - Header Files - - + Module SDK - + Module SDK\SDK Base diff --git a/dlls/dod/dodfun/sdk/amxxmodule.cpp b/dlls/dod/dodfun/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/dod/dodfun/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/dod/dodfun/sdk/amxxmodule.h b/dlls/dod/dodfun/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/dod/dodfun/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/dod/dodx/AMBuilder b/dlls/dod/dodx/AMBuilder index 458b79cb..67d9b368 100644 --- a/dlls/dod/dodx/AMBuilder +++ b/dlls/dod/dodx/AMBuilder @@ -4,7 +4,7 @@ import os.path binary = AMXX.MetaModule(builder, 'dodx') binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../../public/sdk/amxxmodule.cpp', 'CRank.cpp', 'CMisc.cpp', 'NBase.cpp', diff --git a/dlls/dod/dodx/Makefile b/dlls/dod/dodx/Makefile index c8ef2419..95a83f33 100755 --- a/dlls/dod/dodx/Makefile +++ b/dlls/dod/dodx/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../../hlsdk MM_ROOT = ../../../../metamod/metamod +PUBLIC_ROOT = ../../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../../metamod/metamod PROJECT = dodx -OBJECTS = sdk/amxxmodule.cpp CRank.cpp CMisc.cpp NBase.cpp NRank.cpp usermsg.cpp Utils.cpp moduleconfig.cpp +OBJECTS = amxxmodule.cpp CRank.cpp CMisc.cpp NBase.cpp NRank.cpp usermsg.cpp Utils.cpp moduleconfig.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -105,7 +107,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -118,6 +120,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/dod/dodx/sdk/moduleconfig.h b/dlls/dod/dodx/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/dod/dodx/sdk/moduleconfig.h rename to dlls/dod/dodx/moduleconfig.h diff --git a/dlls/dod/dodx/msvc10/dodx.vcxproj b/dlls/dod/dodx/msvc10/dodx.vcxproj index 318492e8..46ccb5d7 100644 --- a/dlls/dod/dodx/msvc10/dodx.vcxproj +++ b/dlls/dod/dodx/msvc10/dodx.vcxproj @@ -62,7 +62,7 @@ MaxSpeed OnlyExplicitInline - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) dodx_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded @@ -103,7 +103,7 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;dodx_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -140,15 +140,14 @@ - + - - - + + diff --git a/dlls/dod/dodx/msvc10/dodx.vcxproj.filters b/dlls/dod/dodx/msvc10/dodx.vcxproj.filters index 113571e2..5d2f5860 100644 --- a/dlls/dod/dodx/msvc10/dodx.vcxproj.filters +++ b/dlls/dod/dodx/msvc10/dodx.vcxproj.filters @@ -41,7 +41,7 @@ Source Files - + Module SDK\SDK Base @@ -55,13 +55,10 @@ Header Files - - Header Files - - + Module SDK - + Module SDK\SDK Base diff --git a/dlls/dod/dodx/sdk/amxxmodule.cpp b/dlls/dod/dodx/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/dod/dodx/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/dod/dodx/sdk/amxxmodule.h b/dlls/dod/dodx/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/dod/dodx/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/engine/AMBuilder b/dlls/engine/AMBuilder index 10468670..efa278ae 100644 --- a/dlls/engine/AMBuilder +++ b/dlls/engine/AMBuilder @@ -3,8 +3,12 @@ import os.path binary = AMXX.MetaModule(builder, 'engine') +binary.compiler.defines += [ + 'HAVE_STDINT_H', +] + binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'amxxapi.cpp', 'engine.cpp', 'entity.cpp', diff --git a/dlls/engine/Makefile b/dlls/engine/Makefile index bbbbc64c..3df5eb48 100755 --- a/dlls/engine/Makefile +++ b/dlls/engine/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../metamod/metamod PROJECT = engine -OBJECTS = sdk/amxxmodule.cpp amxxapi.cpp engine.cpp entity.cpp globals.cpp forwards.cpp +OBJECTS = amxxmodule.cpp amxxapi.cpp engine.cpp entity.cpp globals.cpp forwards.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/pm_shared -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -105,7 +107,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -118,6 +120,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/engine/amxxapi.cpp b/dlls/engine/amxxapi.cpp index ae1e53a2..d0ed83e7 100755 --- a/dlls/engine/amxxapi.cpp +++ b/dlls/engine/amxxapi.cpp @@ -28,11 +28,11 @@ void ClearHooks() { size_t i; - for (i=0; iClass.assign(clsname); + p->Class = clsname; p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL, FP_DONE); - Thinks.push_back(p); + Thinks.append(p); if (!g_pFunctionTable->pfnThink) g_pFunctionTable->pfnThink=Think; @@ -64,7 +64,7 @@ static cell AMX_NATIVE_CALL register_impulse(AMX *amx, cell *params) p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL, FP_CELL, FP_DONE); - Impulses.push_back(p); + Impulses.append(p); if (!g_pFunctionTable->pfnCmdStart) g_pFunctionTable->pfnCmdStart=CmdStart; @@ -82,19 +82,19 @@ static cell AMX_NATIVE_CALL register_touch(AMX *amx, cell *params) Touch *p = new Touch; if (!strlen(Toucher) || strcmp(Toucher, "*")==0) { - p->Toucher.assign(""); + p->Toucher.setVoid(); } else { - p->Toucher.assign(Toucher); + p->Toucher = Toucher; } if (!strlen(Touched) || strcmp(Touched, "*")==0) { - p->Touched.assign(""); + p->Touched.setVoid(); } else { - p->Touched.assign(Touched); + p->Touched = Touched; } p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[3], 2, &len), FP_CELL, FP_CELL, FP_DONE); - Touches.push_back(p); + Touches.append(p); if (!g_pFunctionTable->pfnTouch) g_pFunctionTable->pfnTouch=pfnTouch; diff --git a/dlls/engine/engine.h b/dlls/engine/engine.h index 4e486a4e..d0415445 100755 --- a/dlls/engine/engine.h +++ b/dlls/engine/engine.h @@ -19,12 +19,12 @@ #include #include #include -#include "CVector.h" -#include "CString.h" #include #include "entity.h" #include "gpglobals.h" #include "entity_state.h" +#include +#include extern DLL_FUNCTIONS *g_pFunctionTable; extern DLL_FUNCTIONS *g_pFunctionTable_Post; @@ -140,8 +140,8 @@ class Touch { public: int Forward; - String Toucher; - String Touched; + ke::AString Toucher; + ke::AString Touched; ~Touch() { if (Forward != -1) @@ -153,7 +153,7 @@ class EntClass { public: int Forward; - String Class; + ke::AString Class; ~EntClass() { if (Forward != -1) @@ -226,9 +226,9 @@ extern struct PlayerInfo plinfo[33]; extern struct GlobalInfo glinfo; extern AMX_NATIVE_INFO engine_Natives[]; extern AMX_NATIVE_INFO engine_NewNatives[]; -extern CVector Impulses; -extern CVector Thinks; -extern CVector Touches; +extern ke::Vector Impulses; +extern ke::Vector Thinks; +extern ke::Vector Touches; #endif //_ENGINE_INCLUDE_H diff --git a/dlls/engine/forwards.cpp b/dlls/engine/forwards.cpp index 0d47326a..7fcf4bc1 100755 --- a/dlls/engine/forwards.cpp +++ b/dlls/engine/forwards.cpp @@ -28,9 +28,9 @@ int CmdStartForward = 0; int StartFrameForward = 0; int VexdTouchForward = 0; int VexdServerForward = 0; -CVector Impulses; -CVector Thinks; -CVector Touches; +ke::Vector Impulses; +ke::Vector Thinks; +ke::Vector Touches; KeyValueData *g_pkvd; bool g_inKeyValue=false; bool g_precachedStuff = false; @@ -139,7 +139,7 @@ void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int edict_t *pEntity = (edict_t *)player; g_cmd = (struct usercmd_s *)_cmd; int origImpulse = g_cmd->impulse; // incase a plugin alters it - for (i=0; iCheck == g_cmd->impulse) { @@ -251,11 +251,11 @@ void pfnTouch(edict_t *pToucher, edict_t *pTouched) int ptrIndex = ENTINDEX(pToucher); int ptdIndex = ENTINDEX(pTouched); META_RES res=MRES_IGNORED; - for (i=0; iToucher.size() == 0) + if (Touches[i]->Toucher.length() == 0) { - if (Touches[i]->Touched.size() == 0) + if (Touches[i]->Touched.length() == 0) { retVal = MF_ExecuteForward(Touches[i]->Forward, (cell)ptrIndex, (cell)ptdIndex); if (retVal & 2/*PLUGIN_HANDLED_MAIN*/) @@ -270,7 +270,7 @@ void pfnTouch(edict_t *pToucher, edict_t *pTouched) res=MRES_SUPERCEDE; } } else if (Touches[i]->Toucher.compare(ptrClass)==0) { - if (Touches[i]->Touched.size() == 0) + if (Touches[i]->Touched.length() == 0) { retVal = MF_ExecuteForward(Touches[i]->Forward, (cell)ptrIndex, (cell)ptdIndex); if (retVal & 2/*PLUGIN_HANDLED_MAIN*/) @@ -307,7 +307,7 @@ void Think(edict_t *pent) const char *cls = STRING(pent->v.classname); META_RES res=MRES_IGNORED; int retVal=0; - for (i=0; iClass.compare(cls)==0) { diff --git a/dlls/engine/sdk/moduleconfig.h b/dlls/engine/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/engine/sdk/moduleconfig.h rename to dlls/engine/moduleconfig.h diff --git a/dlls/engine/msvc10/engine.vcxproj b/dlls/engine/msvc10/engine.vcxproj index 8c66e015..91e7a2e4 100644 --- a/dlls/engine/msvc10/engine.vcxproj +++ b/dlls/engine/msvc10/engine.vcxproj @@ -52,8 +52,8 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug @@ -74,8 +74,8 @@ - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions) MultiThreaded 4Bytes false @@ -99,17 +99,14 @@ - + - - - - - + + diff --git a/dlls/engine/msvc10/engine.vcxproj.filters b/dlls/engine/msvc10/engine.vcxproj.filters index 74ca7ed1..1b2dd4ef 100644 --- a/dlls/engine/msvc10/engine.vcxproj.filters +++ b/dlls/engine/msvc10/engine.vcxproj.filters @@ -12,9 +12,6 @@ {fb945ae1-3977-41e3-a51b-04242aff8c78} - - {a7c79424-2a0f-459d-a4f9-0ccbeb06dd3e} - {aad49737-4d0e-4276-a471-dc77365bf9e0} @@ -38,7 +35,7 @@ Source Files - + Module SDK\SDK Base @@ -52,19 +49,10 @@ Header Files - - Header Files - - + Module SDK - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - - + Module SDK\SDK Base diff --git a/dlls/engine/sdk/CString.h b/dlls/engine/sdk/CString.h deleted file mode 100755 index 9f9b63f3..00000000 --- a/dlls/engine/sdk/CString.h +++ /dev/null @@ -1,367 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef _INCLUDE_CSTRING_H -#define _INCLUDE_CSTRING_H - -#include -#include - -//by David "BAILOPAN" Anderson -class String -{ -public: - String() - { - v = NULL; - a_size = 0; - //assign(""); - } - - ~String() - { - if (v) - delete [] v; - } - - String(const char *src) - { - v = NULL; - a_size = 0; - assign(src); - } - - const char * _fread(FILE *fp) - { - Grow(512, false); - char *ret = fgets(v, 511, fp); - return ret; - } - - String(const String &src) - { - v = NULL; - a_size = 0; - assign(src.c_str()); - } - - const char *c_str() { return v?v:""; } - - const char *c_str() const { return v?v:""; } - - void append(const char *t) - { - Grow(size() + strlen(t) + 1); - strcat(v, t); - } - - void append(const char c) - { - size_t len = size(); - Grow(len + 2); - v[len] = c; - v[len + 1] = '\0'; - } - - void append(String &d) - { - append(d.c_str()); - } - - void assign(const String &src) - { - assign(src.c_str()); - } - - void assign(const char *d) - { - if (!d) - { - clear(); - } else { - size_t len = strlen(d); - Grow(len + 1, false); - memcpy(v, d, len); - v[len] = '\0'; - } - } - - void clear() - { - if (v) - v[0] = '\0'; - } - - int compare (const char *d) const - { - if (!v) - return strcmp("", d); - else - return strcmp(v, d); - } - - //Added this for amxx inclusion - bool empty() - { - if (!v) - return true; - - if (v[0] == '\0') - return true; - - return false; - } - - size_t size() - { - if (v) - return strlen(v); - else - return 0; - } - - int find(const char c, int index = 0) - { - int len = static_cast(size()); - if (len < 1) - return npos; - if (index >= len || index < 0) - return npos; - int i = 0; - for (i=index; i len-start) - num = len - start; - //do the erasing - bool copyflag = false; - for (i=0; i=start && i= len || !v) - return ns; - - if (num == npos) - { - num = len - index; - } else if (index+num >= len) { - num = len - index; - } - - unsigned int i = 0; - unsigned int nslen = num + 2; - - ns.Grow(nslen); - - for (i=index; i= 65 && v[i] <= 90) - v[i] &= ~(1<<5); - } - } - - String & operator = (const String &src) - { - assign(src); - return *this; - } - - String & operator = (const char *src) - { - assign(src); - return *this; - - } - - char operator [] (unsigned int index) - { - if (index > size() || !v) - { - return -1; - } else { - return v[index]; - } - } - - int at(int a) - { - if (a < 0 || a >= (int)size() || !v) - return -1; - - return v[a]; - } - - bool at(int at, char c) - { - if (at < 0 || at >= (int)size() || !v) - return false; - - v[at] = c; - - return true; - } - -private: - void Grow(unsigned int d, bool copy=true) - { - if (d <= a_size) - return; - char *n = new char[d + 1]; - if (copy && v) - strcpy(n, v); - if (v) - delete [] v; - else - strcpy(n, ""); - v = n; - a_size = d + 1; - } - - char *v; - unsigned int a_size; -public: - static const int npos = -1; -}; - -#endif //_INCLUDE_CSTRING_H diff --git a/dlls/engine/sdk/CVector.h b/dlls/engine/sdk/CVector.h deleted file mode 100755 index 44241413..00000000 --- a/dlls/engine/sdk/CVector.h +++ /dev/null @@ -1,480 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef __CVECTOR_H__ -#define __CVECTOR_H__ - -#include - -// Vector -template class CVector -{ - bool Grow(size_t amount) - { - // automatic grow - size_t newSize = m_Size * 2; - - if (newSize == 0) - { - newSize = 8; - } - - while (m_CurrentUsedSize + amount > newSize) - { - newSize *= 2; - } - T *newData = new T[newSize]; - if (!newData) - return false; - if (m_Data) - { - for (size_t i=0; i= m_Size) - { - return Grow(amount); - } - else - { - return true; - } - } - - bool ChangeSize(size_t size) - { - // change size - if (size == m_Size) - return true; - - if (!size) - { - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - m_Size = 0; - } - return true; - } - - T *newData = new T[size]; - if (!newData) - return false; - if (m_Data) - { - size_t end = (m_CurrentUsedSize < size) ? (m_CurrentUsedSize) : size; - for (size_t i=0; i m_Size) - m_CurrentUsedSize = m_Size; - - return true; - } - - void FreeMemIfPossible() - { - if (!m_Data) - return; - - if (!m_CurrentUsedSize) - { - ChangeSize(0); - return; - } - - size_t newSize = m_Size; - while (m_CurrentUsedSize <= newSize / 2) - newSize /= 2; - - if (newSize != m_Size) - ChangeSize(newSize); - } -protected: - T *m_Data; - size_t m_Size; - size_t m_CurrentUsedSize; -public: - class iterator - { - protected: - T *m_Ptr; - public: - // constructors / destructors - iterator() - { - m_Ptr = NULL; - } - - iterator(T * ptr) - { - m_Ptr = ptr; - } - - // member functions - T * base() - { - return m_Ptr; - } - - const T * base() const - { - return m_Ptr; - } - - // operators - T & operator*() - { - return *m_Ptr; - } - - T * operator->() - { - return m_Ptr; - } - - iterator & operator++() // preincrement - { - ++m_Ptr; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Ptr; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Ptr; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Ptr; - return tmp; - } - - bool operator==(T * right) const - { - return (m_Ptr == right); - } - - bool operator==(const iterator & right) const - { - return (m_Ptr == right.m_Ptr); - } - - bool operator!=(T * right) const - { - return (m_Ptr != right); - } - - bool operator!=(const iterator & right) const - { - return (m_Ptr != right.m_Ptr); - } - - iterator & operator+=(size_t offset) - { - m_Ptr += offset; - return (*this); - } - - iterator & operator-=(size_t offset) - { - m_Ptr -= offset; - return (*this); - } - - iterator operator+(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr += offset; - return tmp; - } - - iterator operator-(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr -= offset; - return tmp; - } - - T & operator[](size_t offset) - { - return (*(*this + offset)); - } - - const T & operator[](size_t offset) const - { - return (*(*this + offset)); - } - - bool operator<(const iterator & right) const - { - return m_Ptr < right.m_Ptr; - } - - bool operator>(const iterator & right) const - { - return m_Ptr > right.m_Ptr; - } - - bool operator<=(const iterator & right) const - { - return m_Ptr <= right.m_Ptr; - } - - bool operator>=(const iterator & right) const - { - return m_Ptr >= right.m_Ptr; - } - - size_t operator-(const iterator & right) const - { - return m_Ptr - right.m_Ptr; - } - }; - - // constructors / destructors - CVector() - { - m_Size = 0; - m_CurrentUsedSize = 0; - m_Data = NULL; - } - - CVector(const CVector & other) - { - // copy data - m_Data = new T [other.m_CurrentUsedSize]; - m_Size = other.m_CurrentUsedSize; - m_CurrentUsedSize = other.m_CurrentUsedSize; - for (size_t i=0; i() - { - clear(); - } - - // interface - size_t size() const - { - return m_CurrentUsedSize; - } - - size_t capacity() const - { - return m_Size; - } - - iterator begin() const - { - return iterator(m_Data); - } - - iterator end() const - { - return iterator(m_Data + m_CurrentUsedSize); - } - - iterator iterAt(size_t pos) - { - if (pos > m_CurrentUsedSize) - assert(0); - return iterator(m_Data + pos); - } - - bool reserve(size_t newSize) - { - if (newSize > m_Size) - return ChangeSize(newSize); - return true; - } - - bool push_back(const T & elem) - { - if (!GrowIfNeeded(1)) - { - return false; - } - - m_Data[m_CurrentUsedSize++] = elem; - - return true; - } - - void pop_back() - { - --m_CurrentUsedSize; - if (m_CurrentUsedSize < 0) - m_CurrentUsedSize = 0; - - FreeMemIfPossible(); - } - - bool resize(size_t newSize) - { - if (!ChangeSize(newSize)) - return false; - m_CurrentUsedSize = newSize; - return true; - } - - bool empty() const - { - return (m_CurrentUsedSize == 0); - } - - T & at(size_t pos) - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - const T & at(size_t pos) const - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - T & operator[](size_t pos) - { - return at(pos); - } - - const T & operator[](size_t pos) const - { - return at(pos); - } - - T & front() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - const T & front() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - T & back() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - const T & back() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - iterator insert(iterator where, const T & value) - { - // validate iter - if (where < m_Data || where > (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (!GrowIfNeeded(1)) - { - return false; - } - - ++m_CurrentUsedSize; - - where = begin() + ofs; - - // Move subsequent entries - for (T *ptr = m_Data + m_CurrentUsedSize - 2; ptr >= where.base(); --ptr) - *(ptr + 1) = *ptr; - - *where.base() = value; - - return where; - } - - iterator erase(iterator where) - { - // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (m_CurrentUsedSize > 1) - { - // move - T *theend = m_Data + m_CurrentUsedSize; - for (T *ptr = where.base() + 1; ptr < theend; ++ptr) - *(ptr - 1) = *ptr; - } - - --m_CurrentUsedSize; - - FreeMemIfPossible(); - - return begin() + ofs; - } - - void clear() - { - m_Size = 0; - m_CurrentUsedSize = 0; - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - } - } -}; - -#endif // __CVECTOR_H__ - diff --git a/dlls/engine/sdk/amxxmodule.cpp b/dlls/engine/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/engine/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/engine/sdk/amxxmodule.h b/dlls/engine/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/engine/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/fakemeta/AMBuilder b/dlls/fakemeta/AMBuilder index a6ce3273..3d2a5552 100644 --- a/dlls/fakemeta/AMBuilder +++ b/dlls/fakemeta/AMBuilder @@ -3,8 +3,12 @@ import os.path binary = AMXX.MetaModule(builder, 'fakemeta') +binary.compiler.defines += [ + 'HAVE_STDINT_H', +] + binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'dllfunc.cpp', 'engfunc.cpp', 'fakemeta_amxx.cpp', diff --git a/dlls/fakemeta/Makefile b/dlls/fakemeta/Makefile index 38891e0a..d6bfe91b 100755 --- a/dlls/fakemeta/Makefile +++ b/dlls/fakemeta/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../metamod/metamod PROJECT = fakemeta -OBJECTS = sdk/amxxmodule.cpp dllfunc.cpp engfunc.cpp fakemeta_amxx.cpp pdata.cpp forward.cpp \ +OBJECTS = amxxmodule.cpp dllfunc.cpp engfunc.cpp fakemeta_amxx.cpp pdata.cpp forward.cpp \ fm_tr.cpp pev.cpp glb.cpp fm_tr2.cpp misc.cpp ############################################## @@ -30,8 +31,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/pm_shared -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -107,7 +109,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -120,6 +122,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/fakemeta/fakemeta_amxx.h b/dlls/fakemeta/fakemeta_amxx.h index 4da06c53..094d4bac 100755 --- a/dlls/fakemeta/fakemeta_amxx.h +++ b/dlls/fakemeta/fakemeta_amxx.h @@ -14,16 +14,17 @@ #ifndef _FAKEMETA_INCLUDE_H #define _FAKEMETA_INCLUDE_H -#include "sdk/amxxmodule.h" +#include "amxxmodule.h" #include #include -#include "CVector.h" #include "engfunc.h" #include "dllfunc.h" #include "pev.h" #include "forward.h" #include "fm_tr.h" #include "glb.h" +#include +#include extern edict_t *g_player_edicts[33]; diff --git a/dlls/fakemeta/fm_tr.h b/dlls/fakemeta/fm_tr.h index 8eaf8c00..e381ce17 100755 --- a/dlls/fakemeta/fm_tr.h +++ b/dlls/fakemeta/fm_tr.h @@ -14,7 +14,7 @@ #ifndef _INCLUDE_TR_H #define _INCLUDE_TR_H -#include "CString.h" +#include extern TraceResult *gfm_tr; @@ -31,9 +31,9 @@ extern usercmd_t *g_uc_hook; struct KVD_Wrapper { KeyValueData *kvd; - String cls; - String key; - String val; + ke::AString cls; + ke::AString key; + ke::AString val; }; extern KVD_Wrapper g_kvd_glb; diff --git a/dlls/fakemeta/fm_tr2.cpp b/dlls/fakemeta/fm_tr2.cpp index cbf669fb..7840f238 100644 --- a/dlls/fakemeta/fm_tr2.cpp +++ b/dlls/fakemeta/fm_tr2.cpp @@ -290,22 +290,22 @@ static cell AMX_NATIVE_CALL set_kvd(AMX *amx, cell *params) } case KV_ClassName: { - kvdw->cls.assign(MF_GetAmxString(amx, params[3], 0, &len)); - kvd->szClassName = const_cast(kvdw->cls.c_str()); + kvdw->cls = MF_GetAmxString(amx, params[3], 0, &len); + kvd->szClassName = const_cast(kvdw->cls.chars()); return 1; break; } case KV_KeyName: { - kvdw->key.assign(MF_GetAmxString(amx, params[3], 0, &len)); - kvd->szKeyName = const_cast(kvdw->key.c_str()); + kvdw->key = MF_GetAmxString(amx, params[3], 0, &len); + kvd->szKeyName = const_cast(kvdw->key.chars()); return 1; break; } case KV_Value: { - kvdw->val.assign(MF_GetAmxString(amx, params[3], 0, &len)); - kvd->szValue = const_cast(kvdw->val.c_str()); + kvdw->val = MF_GetAmxString(amx, params[3], 0, &len); + kvd->szValue = const_cast(kvdw->val.chars()); return 1; break; } diff --git a/dlls/fakemeta/forward.cpp b/dlls/fakemeta/forward.cpp index 0c231d2e..dde12a86 100755 --- a/dlls/fakemeta/forward.cpp +++ b/dlls/fakemeta/forward.cpp @@ -13,8 +13,8 @@ #include "fakemeta_amxx.h" -CVector Engine[ENGFUNC_NUM+10]; -CVector EnginePost[ENGFUNC_NUM+10]; +ke::Vector Engine[ENGFUNC_NUM+10]; +ke::Vector EnginePost[ENGFUNC_NUM + 10]; void *EngineAddrs[ENGFUNC_NUM+10]; void *EngineAddrsPost[ENGFUNC_NUM+10]; cell mCellResult; @@ -838,7 +838,7 @@ static cell AMX_NATIVE_CALL unregister_forward(AMX *amx, cell *params) void *patchAddr = NULL; - CVector *peng = NULL; + ke::Vector *peng = NULL; if (post) { peng = &(EnginePost[func]); @@ -847,17 +847,12 @@ static cell AMX_NATIVE_CALL unregister_forward(AMX *amx, cell *params) peng = &(Engine[func]); patchAddr = EngineAddrs[func]; } - - CVector::iterator begin, end=peng->end(); - - for (begin=peng->begin(); begin!=end; begin++) + for (size_t i = 0; i < peng->length(); ++i) { - if ((*begin) == func_id) + if (peng->at(i) == func_id) { - peng->erase(begin); - if (!peng->size() - && patchAddr != NULL - && func != FM_ServerDeactivate) + peng->remove(i); + if (!peng->length() && patchAddr != NULL && func != FM_ServerDeactivate) { /* Clear out this forward if we no longer need it */ *(void **)patchAddr = NULL; @@ -1519,9 +1514,9 @@ static cell AMX_NATIVE_CALL register_forward(AMX *amx, cell *params) if (post) { - EnginePost[func].push_back(fId); + EnginePost[func].append(fId); } else { - Engine[func].push_back(fId); + Engine[func].append(fId); } return fId; diff --git a/dlls/fakemeta/forward.h b/dlls/fakemeta/forward.h index 310869bc..26e3b1db 100755 --- a/dlls/fakemeta/forward.h +++ b/dlls/fakemeta/forward.h @@ -14,6 +14,8 @@ #ifndef _INCLUDE_FORWARD_H #define _INCLUDE_FORWARD_H +#include + #define ENGFUNC_NUM FM_LAST_DONT_USE_ME // 131 #define FMV_STRING 1 @@ -181,8 +183,8 @@ enum { FM_LAST_DONT_USE_ME }; -extern CVector Engine[]; -extern CVector EnginePost[]; +extern ke::Vector Engine[]; +extern ke::Vector EnginePost[]; extern void *EngineAddrs[ENGFUNC_NUM+10]; extern void *EngineAddrsPost[ENGFUNC_NUM+10]; extern cell mCellResult; diff --git a/dlls/fakemeta/forwardmacros.h b/dlls/fakemeta/forwardmacros.h index eada3b9e..1d5e6f2a 100755 --- a/dlls/fakemeta/forwardmacros.h +++ b/dlls/fakemeta/forwardmacros.h @@ -924,7 +924,7 @@ register unsigned int i = 0; \ clfm(); \ int fmres = FMRES_IGNORED; \ - for (i=0; i= lastFmRes) { \ @@ -941,7 +941,7 @@ register unsigned int i = 0; \ clfm(); \ int fmres = FMRES_IGNORED; \ - for (i=0; i= lastFmRes) { \ diff --git a/dlls/fakemeta/sdk/moduleconfig.h b/dlls/fakemeta/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/fakemeta/sdk/moduleconfig.h rename to dlls/fakemeta/moduleconfig.h diff --git a/dlls/fakemeta/msvc10/fakemeta.vcxproj b/dlls/fakemeta/msvc10/fakemeta.vcxproj index a0d4e91f..26643588 100644 --- a/dlls/fakemeta/msvc10/fakemeta.vcxproj +++ b/dlls/fakemeta/msvc10/fakemeta.vcxproj @@ -52,8 +52,8 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;FAKEMETA_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;FAKEMETA_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug @@ -73,8 +73,8 @@ - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;FAKEMETA_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;FAKEMETA_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions) MultiThreaded false @@ -102,22 +102,21 @@ - + - - + - + diff --git a/dlls/fakemeta/msvc10/fakemeta.vcxproj.filters b/dlls/fakemeta/msvc10/fakemeta.vcxproj.filters index 2059971b..014eba4c 100644 --- a/dlls/fakemeta/msvc10/fakemeta.vcxproj.filters +++ b/dlls/fakemeta/msvc10/fakemeta.vcxproj.filters @@ -65,7 +65,7 @@ Globals - + Module SDK\SDK Base @@ -76,9 +76,6 @@ Header Files - - Header Files - Engine Funcs @@ -94,16 +91,16 @@ Globals - - Module SDK - Module SDK\AMXX STL Module SDK\AMXX STL - + + Module SDK + + Module SDK\SDK Base diff --git a/dlls/fakemeta/sdk/CString.h b/dlls/fakemeta/sdk/CString.h deleted file mode 100755 index 8c6ebc95..00000000 --- a/dlls/fakemeta/sdk/CString.h +++ /dev/null @@ -1,391 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef _INCLUDE_CSTRING_H -#define _INCLUDE_CSTRING_H - -#include -#include - -//by David "BAILOPAN" Anderson -class String -{ -public: - String() - { - v = NULL; - a_size = 0; - //assign(""); - } - - ~String() - { - if (v) - delete [] v; - } - - String(const char *src) - { - v = NULL; - a_size = 0; - assign(src); - } - - const char * _fread(FILE *fp) - { - Grow(512, false); - char *ret = fgets(v, 511, fp); - return ret; - } - - String(const String &src) - { - v = NULL; - a_size = 0; - assign(src.c_str()); - } - - const char *c_str() { return v?v:""; } - - const char *c_str() const { return v?v:""; } - - void append(const char *t) - { - Grow(size() + strlen(t) + 1); - strcat(v, t); - } - - void append(const char c) - { - size_t len = size(); - Grow(len + 2); - v[len] = c; - v[len + 1] = '\0'; - } - - void append(String &d) - { - append(d.c_str()); - } - - void assign(const String &src) - { - assign(src.c_str()); - } - - void assign(const char *d) - { - if (!d) - { - clear(); - } else { - size_t len = strlen(d); - Grow(len + 1, false); - memcpy(v, d, len); - v[len] = '\0'; - } - } - - void clear() - { - if (v) - v[0] = '\0'; - } - - int compare (const char *d) const - { - if (!v) - return strcmp("", d); - else - return strcmp(v, d); - } - - //Added this for amxx inclusion - bool empty() - { - if (!v) - return true; - - if (v[0] == '\0') - return true; - - return false; - } - - size_t size() - { - if (v) - return strlen(v); - else - return 0; - } - - int find(const char c, int index = 0) - { - int len = static_cast(size()); - if (len < 1) - return npos; - if (index >= len || index < 0) - return npos; - int i = 0; - for (i=index; i len-start) - num = len - start; - //do the erasing - bool copyflag = false; - for (i=0; i=start && i= len || !v) - return ns; - - if (num == npos) - { - num = len - index; - } else if (index+num >= len) { - num = len - index; - } - - unsigned int i = 0; - unsigned int nslen = num + 2; - - ns.Grow(nslen); - - for (i=index; i= 65 && v[i] <= 90) - v[i] &= ~(1<<5); - } - } - - String & operator = (const String &src) - { - assign(src); - return *this; - } - - String & operator = (const char *src) - { - assign(src); - return *this; - - } - - char operator [] (unsigned int index) - { - if (index > size() || !v) - { - return -1; - } else { - return v[index]; - } - } - - int at(int a) - { - if (a < 0 || a >= (int)size() || !v) - return -1; - - return v[a]; - } - - bool at(int at, char c) - { - if (at < 0 || at >= (int)size() || !v) - return false; - - v[at] = c; - - return true; - } - -private: - void Grow(unsigned int d, bool copy=true) - { - if (d <= a_size) - return; - char *n = new char[d + 1]; - if (copy && v) - strcpy(n, v); - if (v) - delete [] v; - else - strcpy(n, ""); - v = n; - a_size = d + 1; - } - - char *v; - unsigned int a_size; -public: - static const int npos = -1; -}; - -#endif //_INCLUDE_CSTRING_H diff --git a/dlls/fakemeta/sdk/CVector.h b/dlls/fakemeta/sdk/CVector.h deleted file mode 100755 index 44241413..00000000 --- a/dlls/fakemeta/sdk/CVector.h +++ /dev/null @@ -1,480 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef __CVECTOR_H__ -#define __CVECTOR_H__ - -#include - -// Vector -template class CVector -{ - bool Grow(size_t amount) - { - // automatic grow - size_t newSize = m_Size * 2; - - if (newSize == 0) - { - newSize = 8; - } - - while (m_CurrentUsedSize + amount > newSize) - { - newSize *= 2; - } - T *newData = new T[newSize]; - if (!newData) - return false; - if (m_Data) - { - for (size_t i=0; i= m_Size) - { - return Grow(amount); - } - else - { - return true; - } - } - - bool ChangeSize(size_t size) - { - // change size - if (size == m_Size) - return true; - - if (!size) - { - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - m_Size = 0; - } - return true; - } - - T *newData = new T[size]; - if (!newData) - return false; - if (m_Data) - { - size_t end = (m_CurrentUsedSize < size) ? (m_CurrentUsedSize) : size; - for (size_t i=0; i m_Size) - m_CurrentUsedSize = m_Size; - - return true; - } - - void FreeMemIfPossible() - { - if (!m_Data) - return; - - if (!m_CurrentUsedSize) - { - ChangeSize(0); - return; - } - - size_t newSize = m_Size; - while (m_CurrentUsedSize <= newSize / 2) - newSize /= 2; - - if (newSize != m_Size) - ChangeSize(newSize); - } -protected: - T *m_Data; - size_t m_Size; - size_t m_CurrentUsedSize; -public: - class iterator - { - protected: - T *m_Ptr; - public: - // constructors / destructors - iterator() - { - m_Ptr = NULL; - } - - iterator(T * ptr) - { - m_Ptr = ptr; - } - - // member functions - T * base() - { - return m_Ptr; - } - - const T * base() const - { - return m_Ptr; - } - - // operators - T & operator*() - { - return *m_Ptr; - } - - T * operator->() - { - return m_Ptr; - } - - iterator & operator++() // preincrement - { - ++m_Ptr; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Ptr; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Ptr; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Ptr; - return tmp; - } - - bool operator==(T * right) const - { - return (m_Ptr == right); - } - - bool operator==(const iterator & right) const - { - return (m_Ptr == right.m_Ptr); - } - - bool operator!=(T * right) const - { - return (m_Ptr != right); - } - - bool operator!=(const iterator & right) const - { - return (m_Ptr != right.m_Ptr); - } - - iterator & operator+=(size_t offset) - { - m_Ptr += offset; - return (*this); - } - - iterator & operator-=(size_t offset) - { - m_Ptr -= offset; - return (*this); - } - - iterator operator+(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr += offset; - return tmp; - } - - iterator operator-(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr -= offset; - return tmp; - } - - T & operator[](size_t offset) - { - return (*(*this + offset)); - } - - const T & operator[](size_t offset) const - { - return (*(*this + offset)); - } - - bool operator<(const iterator & right) const - { - return m_Ptr < right.m_Ptr; - } - - bool operator>(const iterator & right) const - { - return m_Ptr > right.m_Ptr; - } - - bool operator<=(const iterator & right) const - { - return m_Ptr <= right.m_Ptr; - } - - bool operator>=(const iterator & right) const - { - return m_Ptr >= right.m_Ptr; - } - - size_t operator-(const iterator & right) const - { - return m_Ptr - right.m_Ptr; - } - }; - - // constructors / destructors - CVector() - { - m_Size = 0; - m_CurrentUsedSize = 0; - m_Data = NULL; - } - - CVector(const CVector & other) - { - // copy data - m_Data = new T [other.m_CurrentUsedSize]; - m_Size = other.m_CurrentUsedSize; - m_CurrentUsedSize = other.m_CurrentUsedSize; - for (size_t i=0; i() - { - clear(); - } - - // interface - size_t size() const - { - return m_CurrentUsedSize; - } - - size_t capacity() const - { - return m_Size; - } - - iterator begin() const - { - return iterator(m_Data); - } - - iterator end() const - { - return iterator(m_Data + m_CurrentUsedSize); - } - - iterator iterAt(size_t pos) - { - if (pos > m_CurrentUsedSize) - assert(0); - return iterator(m_Data + pos); - } - - bool reserve(size_t newSize) - { - if (newSize > m_Size) - return ChangeSize(newSize); - return true; - } - - bool push_back(const T & elem) - { - if (!GrowIfNeeded(1)) - { - return false; - } - - m_Data[m_CurrentUsedSize++] = elem; - - return true; - } - - void pop_back() - { - --m_CurrentUsedSize; - if (m_CurrentUsedSize < 0) - m_CurrentUsedSize = 0; - - FreeMemIfPossible(); - } - - bool resize(size_t newSize) - { - if (!ChangeSize(newSize)) - return false; - m_CurrentUsedSize = newSize; - return true; - } - - bool empty() const - { - return (m_CurrentUsedSize == 0); - } - - T & at(size_t pos) - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - const T & at(size_t pos) const - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - T & operator[](size_t pos) - { - return at(pos); - } - - const T & operator[](size_t pos) const - { - return at(pos); - } - - T & front() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - const T & front() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - T & back() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - const T & back() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - iterator insert(iterator where, const T & value) - { - // validate iter - if (where < m_Data || where > (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (!GrowIfNeeded(1)) - { - return false; - } - - ++m_CurrentUsedSize; - - where = begin() + ofs; - - // Move subsequent entries - for (T *ptr = m_Data + m_CurrentUsedSize - 2; ptr >= where.base(); --ptr) - *(ptr + 1) = *ptr; - - *where.base() = value; - - return where; - } - - iterator erase(iterator where) - { - // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (m_CurrentUsedSize > 1) - { - // move - T *theend = m_Data + m_CurrentUsedSize; - for (T *ptr = where.base() + 1; ptr < theend; ++ptr) - *(ptr - 1) = *ptr; - } - - --m_CurrentUsedSize; - - FreeMemIfPossible(); - - return begin() + ofs; - } - - void clear() - { - m_Size = 0; - m_CurrentUsedSize = 0; - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - } - } -}; - -#endif // __CVECTOR_H__ - diff --git a/dlls/fakemeta/sdk/amxxmodule.cpp b/dlls/fakemeta/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/fakemeta/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/fakemeta/sdk/amxxmodule.h b/dlls/fakemeta/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/fakemeta/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/fakemeta/sdk/sh_stack.h b/dlls/fakemeta/sdk/sh_stack.h deleted file mode 100644 index c01021f7..00000000 --- a/dlls/fakemeta/sdk/sh_stack.h +++ /dev/null @@ -1,219 +0,0 @@ -/* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): Pavol "PM OnoTo" Marko -* ============================ -*/ - -#ifndef __SH_STACK_H__ -#define __SH_STACK_H__ - -#define SH_STACK_DEFAULT_SIZE 4 - -//namespace SourceHook -//{/ - // Vector - template class CStack - { - T *m_Elements; - size_t m_AllocatedSize; - size_t m_UsedSize; - public: - friend class iterator; - class iterator - { - CStack *m_pParent; - size_t m_Index; - public: - iterator(CStack *pParent, size_t id) : m_pParent(pParent), m_Index(id) - { - } - - iterator(CStack *pParent) : m_pParent(pParent), m_Index(0) - { - } - - iterator() : m_pParent(NULL), m_Index(0) - { - } - - T &operator *() - { - return m_pParent->m_Elements[m_Index]; - } - const T &operator *() const - { - return m_pParent->m_Elements[m_Index]; - } - - T * operator->() - { - return m_pParent->m_Elements + m_Index; - } - - const T * operator->() const - { - return m_pParent->m_Elements + m_Index; - } - - iterator & operator++() // preincrement - { - ++m_Index; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Index; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Index; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Index; - return tmp; - } - - bool operator==(const iterator & right) const - { - return (m_pParent == right.m_pParent && m_Index == right.m_Index); - } - - bool operator!=(const iterator & right) const - { - return !(*this == right); - } - }; - CStack() : m_Elements(new T[SH_STACK_DEFAULT_SIZE]), - m_AllocatedSize(SH_STACK_DEFAULT_SIZE), - m_UsedSize(0) - { - } - CStack(size_t size) : m_Elements(new T[size]), - m_AllocatedSize(size), - m_UsedSize(0) - { - } - - CStack(const CStack &other) : m_Elements(NULL), - m_AllocatedSize(0), - m_UsedSize(0) - { - reserve(other.m_AllocatedSize); - m_UsedSize = other.m_UsedSize; - for (size_t i = 0; i < m_UsedSize; ++i) - m_Elements[i] = other.m_Elements[i]; - } - - ~CStack() - { - if (m_Elements) - delete [] m_Elements; - } - - void operator=(const CStack &other) - { - if (m_AllocatedSize < other.m_AllocatedSize) - { - if (m_Elements) - delete [] m_Elements; - m_Elements = new T[other.m_AllocatedSize]; - m_AllocatedSize = other.m_AllocatedSize; - } - m_UsedSize = other.m_UsedSize; - for (size_t i = 0; i < m_UsedSize; ++i) - m_Elements[i] = other.m_Elements[i]; - } - - bool push(const T &val) - { - if (m_UsedSize + 1 == m_AllocatedSize) - { - // zOHNOES! REALLOCATE! - m_AllocatedSize *= 2; - T *newElements = new T[m_AllocatedSize]; - if (!newElements) - { - m_AllocatedSize /= 2; - return false; - } - if (m_Elements) - { - for (size_t i = 0; i < m_UsedSize; ++i) - newElements[i] = m_Elements[i]; - delete [] m_Elements; - } - m_Elements = newElements; - } - m_Elements[m_UsedSize++] = val; - return true; - } - void pop() - { - --m_UsedSize; - } - - T &front() - { - return m_Elements[m_UsedSize - 1]; - } - - const T &front() const - { - return m_Elements[m_UsedSize - 1]; - } - - iterator begin() - { - return iterator(this, 0); - } - iterator end() - { - return iterator(this, m_UsedSize); - } - - size_t size() - { - return m_UsedSize; - } - size_t capacity() - { - return m_AllocatedSize; - } - bool empty() - { - return m_UsedSize == 0 ? true : false; - } - bool reserve(size_t size) - { - if (size > m_AllocatedSize) - { - T *newElements = new T[size]; - if (!newElements) - return false; - if (m_Elements) - { - for (size_t i = 0; i < m_UsedSize; ++i) - newElements[i] = m_Elements[i]; - delete [] m_Elements; - } - m_Elements = newElements; - m_AllocatedSize = size; - } - return true; - } - }; -//}; //namespace SourceHook - -#endif diff --git a/dlls/fun/AMBuilder b/dlls/fun/AMBuilder index 11679f83..25b16ff9 100644 --- a/dlls/fun/AMBuilder +++ b/dlls/fun/AMBuilder @@ -4,7 +4,7 @@ import os.path binary = AMXX.MetaModule(builder, 'fun') binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'fun.cpp', ] diff --git a/dlls/fun/Makefile b/dlls/fun/Makefile index 0a7292a3..aa6f4fb8 100755 --- a/dlls/fun/Makefile +++ b/dlls/fun/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../metamod/metamod PROJECT = fun -OBJECTS = sdk/amxxmodule.cpp fun.cpp +OBJECTS = amxxmodule.cpp fun.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -105,7 +107,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -118,6 +120,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/fun/sdk/moduleconfig.h b/dlls/fun/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/fun/sdk/moduleconfig.h rename to dlls/fun/moduleconfig.h diff --git a/dlls/fun/msvc10/fun.vcxproj b/dlls/fun/msvc10/fun.vcxproj index cf2231ac..7676c813 100644 --- a/dlls/fun/msvc10/fun.vcxproj +++ b/dlls/fun/msvc10/fun.vcxproj @@ -63,7 +63,7 @@ MaxSpeed OnlyExplicitInline - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;FUN_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded @@ -104,7 +104,7 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;FUN_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -136,13 +136,12 @@ - + - - - + + diff --git a/dlls/fun/msvc10/fun.vcxproj.filters b/dlls/fun/msvc10/fun.vcxproj.filters index 2a1a8f07..ef6ae9bd 100644 --- a/dlls/fun/msvc10/fun.vcxproj.filters +++ b/dlls/fun/msvc10/fun.vcxproj.filters @@ -23,7 +23,7 @@ Source Files - + Module SDK\SDK Base @@ -31,13 +31,10 @@ Header Files - - Header Files - - + Module SDK - + Module SDK\SDK Base diff --git a/dlls/fun/sdk/amxxmodule.cpp b/dlls/fun/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/fun/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/fun/sdk/amxxmodule.h b/dlls/fun/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/fun/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/geoip/AMBuilder b/dlls/geoip/AMBuilder index 3bc50513..a7a86d98 100644 --- a/dlls/geoip/AMBuilder +++ b/dlls/geoip/AMBuilder @@ -8,7 +8,7 @@ binary.compiler.defines += [ ] binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'GeoIP2/maxminddb.cpp', 'geoip_main.cpp', 'geoip_natives.cpp', diff --git a/dlls/geoip/Makefile b/dlls/geoip/Makefile index 01b27512..5ec18dec 100755 --- a/dlls/geoip/Makefile +++ b/dlls/geoip/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../metamod/metamod PROJECT = geoip -OBJECTS = sdk/amxxmodule.cpp GeoIP2/maxminddb.cpp geoip_main.cpp geoip_natives.cpp geoip_util.cpp +OBJECTS = amxxmodule.cpp GeoIP2/maxminddb.cpp geoip_main.cpp geoip_natives.cpp geoip_util.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -109,7 +111,7 @@ $(BIN_DIR)/%.o: %.c all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -122,6 +124,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/geoip/sdk/moduleconfig.h b/dlls/geoip/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/geoip/sdk/moduleconfig.h rename to dlls/geoip/moduleconfig.h diff --git a/dlls/geoip/msvc10/geoip.vcxproj b/dlls/geoip/msvc10/geoip.vcxproj index 3e1d5b8e..8e0faf72 100644 --- a/dlls/geoip/msvc10/geoip.vcxproj +++ b/dlls/geoip/msvc10/geoip.vcxproj @@ -52,7 +52,7 @@ Disabled - ..\;..\sdk;..\..\..\public\amtl;..\GeoIP2;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\sdk;..\..\..\public\amtl;..\..\..\public\sdk;..\GeoIP2;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;GEOIP_EXPORTS;HAVE_STDINT_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -75,7 +75,7 @@ - ..\;..\sdk;..\..\..\public\amtl;..\GeoIP2;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\sdk;..\..\..\public\amtl;..\..\..\public\sdk;..\GeoIP2;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;GEOIP_EXPORTS;HAVE_STDINT_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreaded false @@ -99,7 +99,7 @@ - + @@ -108,8 +108,8 @@ - - + + diff --git a/dlls/geoip/msvc10/geoip.vcxproj.filters b/dlls/geoip/msvc10/geoip.vcxproj.filters index 87f791de..d6db8744 100644 --- a/dlls/geoip/msvc10/geoip.vcxproj.filters +++ b/dlls/geoip/msvc10/geoip.vcxproj.filters @@ -23,9 +23,6 @@ - - Module SDK\SDK Base - GeoIP2 @@ -38,14 +35,11 @@ Source Files + + Module SDK\SDK Base + - - Module SDK - - - Module SDK\SDK Base - GeoIP2 @@ -64,6 +58,12 @@ Header Files + + Module SDK + + + Module SDK\SDK Base + diff --git a/dlls/geoip/sdk/amxxmodule.cpp b/dlls/geoip/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/geoip/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/geoip/sdk/amxxmodule.h b/dlls/geoip/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/geoip/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/hamsandwich/AMBuilder b/dlls/hamsandwich/AMBuilder index 71736260..c6cd6409 100644 --- a/dlls/hamsandwich/AMBuilder +++ b/dlls/hamsandwich/AMBuilder @@ -8,7 +8,7 @@ binary.compiler.defines += [ ] binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'amxx_api.cpp', 'config_parser.cpp', 'hook_callbacks.cpp', diff --git a/dlls/hamsandwich/DataHandler.cpp b/dlls/hamsandwich/DataHandler.cpp index 6b8286eb..9a36edbf 100644 --- a/dlls/hamsandwich/DataHandler.cpp +++ b/dlls/hamsandwich/DataHandler.cpp @@ -13,9 +13,9 @@ #include "amxxmodule.h" -#include "CVector.h" -#include "CString.h" -#include "sh_stack.h" +#include +#include +#include #include "DataHandler.h" #include "ham_const.h" @@ -24,7 +24,7 @@ CStack< Data * > ReturnStack; CStack< Data * > OrigReturnStack; -CStack< CVector< Data * > * > ParamStack; +CStack< ke::Vector< Data * > * > ParamStack; CStack< int * > ReturnStatus; #define CHECK_STACK(__STACK__) \ if ( ( __STACK__ ).size() <= 0) \ @@ -180,10 +180,10 @@ static cell AMX_NATIVE_CALL SetHamReturnString(AMX *amx, cell *params) static cell AMX_NATIVE_CALL SetHamParamInteger(AMX *amx, cell *params) { CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) + ke::Vector *vec = ParamStack.front(); + if (vec->length() < (unsigned)params[1]) { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->length()); return 0; } Data *dat=vec->at(params[1] - 1); @@ -200,10 +200,10 @@ static cell AMX_NATIVE_CALL SetHamParamTraceResult(AMX *amx, cell *params) return 0; } CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) + ke::Vector *vec = ParamStack.front(); + if (vec->length() < (unsigned)params[1]) { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->length()); return 0; } Data *dat=vec->at(params[1] - 1); @@ -214,10 +214,10 @@ static cell AMX_NATIVE_CALL SetHamParamTraceResult(AMX *amx, cell *params) static cell AMX_NATIVE_CALL SetHamParamFloat(AMX *amx, cell *params) { CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1] || params[1] < 1) + ke::Vector *vec = ParamStack.front(); + if (vec->length() < (unsigned)params[1] || params[1] < 1) { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->length()); return 0; } Data *dat=vec->at(params[1] - 1); @@ -228,10 +228,10 @@ static cell AMX_NATIVE_CALL SetHamParamFloat(AMX *amx, cell *params) static cell AMX_NATIVE_CALL SetHamParamVector(AMX *amx, cell *params) { CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) + ke::Vector *vec = ParamStack.front(); + if (vec->length() < (unsigned)params[1]) { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->length()); return 0; } Data *dat=vec->at(params[1] - 1); @@ -242,10 +242,10 @@ static cell AMX_NATIVE_CALL SetHamParamVector(AMX *amx, cell *params) static cell AMX_NATIVE_CALL SetHamParamEntity(AMX *amx, cell *params) { CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) + ke::Vector *vec = ParamStack.front(); + if (vec->length() < (unsigned)params[1]) { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->length()); return 0; } Data *dat=vec->at(params[1] - 1); @@ -256,10 +256,10 @@ static cell AMX_NATIVE_CALL SetHamParamEntity(AMX *amx, cell *params) static cell AMX_NATIVE_CALL SetHamParamString(AMX *amx, cell *params) { CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) + ke::Vector *vec=ParamStack.front(); + if (vec->length() < (unsigned)params[1]) { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->length()); return 0; } Data *dat=vec->at(params[1] - 1); @@ -277,11 +277,11 @@ static cell AMX_NATIVE_CALL SetHamParamItemInfo(AMX *amx, cell *params) } CHECK_STACK(ParamStack); - CVector *vec = ParamStack.front(); + ke::Vector *vec = ParamStack.front(); - if (vec->size() < (unsigned)params[1]) + if (vec->length() < (unsigned)params[1]) { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->length()); return 0; } diff --git a/dlls/hamsandwich/DataHandler.h b/dlls/hamsandwich/DataHandler.h index 3a5e765f..53cdaf19 100644 --- a/dlls/hamsandwich/DataHandler.h +++ b/dlls/hamsandwich/DataHandler.h @@ -15,9 +15,9 @@ #define RETURNHANDLER_H #include "ham_utils.h" -#include "CVector.h" -#include "CString.h" -#include "sh_stack.h" +#include +#include +#include enum { @@ -184,7 +184,7 @@ public: return -1; } - String *str=reinterpret_cast(m_data); + ke::AString *str=reinterpret_cast(m_data); cell *i=data; size_t len=0; @@ -203,7 +203,7 @@ public: /* nothing */ } - str->assign(temp); + *str = temp; delete[] temp; @@ -330,7 +330,7 @@ public: { return -1; } - const char *i=(reinterpret_cast(m_data)->c_str()); + const char *i=(reinterpret_cast(m_data)->chars()); while (len-- && (*data++=*i++)!='\0') @@ -369,6 +369,6 @@ public: extern CStack< Data * > ReturnStack; extern CStack< Data * > OrigReturnStack; -extern CStack< CVector< Data * > * > ParamStack; +extern CStack< ke::Vector< Data * > * > ParamStack; extern CStack< int * > ReturnStatus; #endif diff --git a/dlls/hamsandwich/Makefile b/dlls/hamsandwich/Makefile index b4caef1f..e9006e2b 100644 --- a/dlls/hamsandwich/Makefile +++ b/dlls/hamsandwich/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../metamod/metamod PROJECT = hamsandwich -OBJECTS = sdk/amxxmodule.cpp amxx_api.cpp config_parser.cpp hook_callbacks.cpp hook_native.cpp \ +OBJECTS = amxxmodule.cpp amxx_api.cpp config_parser.cpp hook_callbacks.cpp hook_native.cpp \ srvcmd.cpp call_funcs.cpp hook_create.cpp DataHandler.cpp pdata.cpp hook_specialbot.cpp ############################################## @@ -30,8 +31,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/pm_shared -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -106,7 +108,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -119,6 +121,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/hamsandwich/amxx_api.cpp b/dlls/hamsandwich/amxx_api.cpp index 40d9be44..561aab91 100644 --- a/dlls/hamsandwich/amxx_api.cpp +++ b/dlls/hamsandwich/amxx_api.cpp @@ -15,7 +15,7 @@ #include #include "NEW_Util.h" -#include "CVector.h" +#include #include "forward.h" #include "hook.h" #include "ham_const.h" @@ -28,7 +28,7 @@ edict_t *NEW_FirstEdict; bool NEW_Initialized; -extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; +extern ke::Vector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; extern CHamSpecialBotHandler SpecialbotHandler; extern AMX_NATIVE_INFO RegisterNatives[]; @@ -106,17 +106,11 @@ void HamCommand(void); void OnPluginsUnloaded(void) { - - CVector ::iterator end; - for (int i = 0; i < HAM_LAST_ENTRY_DONT_USE_ME_LOL; i++) + for (size_t i = 0; i < HAM_LAST_ENTRY_DONT_USE_ME_LOL; i++) { - end=hooks[i].end(); - - for (CVector::iterator j=hooks[i].begin(); - j!=end; - ++j) + for (size_t j = 0; j < hooks[i].length(); ++j) { - delete (*j); + delete hooks[i].at(j); } hooks[i].clear(); } diff --git a/dlls/hamsandwich/call_funcs.cpp b/dlls/hamsandwich/call_funcs.cpp index 32a823fa..92c0db16 100644 --- a/dlls/hamsandwich/call_funcs.cpp +++ b/dlls/hamsandwich/call_funcs.cpp @@ -16,13 +16,12 @@ #include "offsets.h" #include "ham_utils.h" #include "hooklist.h" - -#include "CVector.h" #include "forward.h" #include "hook.h" -#include "CString.h" +#include +#include -extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; +extern ke::Vector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; void FailPlugin(AMX *amx, int id, int err, const char *reason); @@ -34,13 +33,9 @@ inline void *GetFunction(void *pthis, int id, bool &istramp) void *func=GetVTableEntry(pthis, hooklist[id].vtid, Offsets.GetBase()); // Check to see if it's a trampoline - CVector::iterator end=hooks[id].end(); - - for (CVector::iterator i=hooks[id].begin(); - i!=end; - ++i) + for (size_t i = 0; i < hooks[id].length(); ++i) { - if (func==(*i)->tramp) + if (func == hooks[id].at(i)->tramp) { istramp=true; return func; @@ -57,17 +52,13 @@ inline void *_GetFunction(void *pthis, int id) void *func=ivtbl[hooklist[id].vtid]; // Iterate through the hooks for the id, see if the function is found - CVector::iterator end=hooks[id].end(); - - for (CVector::iterator i=hooks[id].begin(); - i!=end; - ++i) + for (size_t i = 0; i < hooks[id].length(); ++i) { // If the function points to a trampoline, then return the original // function. - if (func==(*i)->tramp) + if (func == hooks[id].at(i)->tramp) { - return (*i)->func; + return hooks[id].at(i)->func; } } diff --git a/dlls/hamsandwich/hook.h b/dlls/hamsandwich/hook.h index 68949a00..1e94125a 100644 --- a/dlls/hamsandwich/hook.h +++ b/dlls/hamsandwich/hook.h @@ -16,6 +16,7 @@ #include "forward.h" #include "Trampolines.h" +#include #define ALIGN(ar) ((intptr_t)ar & ~(sysconf(_SC_PAGESIZE)-1)) @@ -25,9 +26,9 @@ class Hook { public: - CVector pre; // pre forwards - CVector post; // post forwards - void *func; // original function + ke::Vector pre; // pre forwards + ke::Vector post; // post forwards + void *func; // original function void **vtable; // vtable of the original location int entry; // vtable entry of the function void *target; // target function being called (the hook) @@ -86,21 +87,16 @@ public: delete[] ent; - CVector::iterator end=pre.end(); + for (size_t i = 0; i < pre.length(); ++i) + { + delete pre.at(i); + } - for (CVector::iterator i=pre.begin(); - i!=end; - ++i) + for (size_t i = 0; i < post.length(); ++i) { - delete (*i); - } - end=post.end(); - for (CVector::iterator i=post.begin(); - i!=end; - ++i) - { - delete (*i); + delete post.at(i); } + pre.clear(); post.clear(); } diff --git a/dlls/hamsandwich/hook_callbacks.cpp b/dlls/hamsandwich/hook_callbacks.cpp index 250adce0..0e0ed091 100644 --- a/dlls/hamsandwich/hook_callbacks.cpp +++ b/dlls/hamsandwich/hook_callbacks.cpp @@ -19,9 +19,9 @@ #include #include "amxxmodule.h" -#include "CVector.h" -#include "CString.h" -#include "sh_stack.h" +#include +#include +#include #include "hook.h" #include "forward.h" @@ -48,29 +48,28 @@ extern bool gDoForwards; // Parameter value pushes #define MAKE_VECTOR() \ int iThis=PrivateToIndex(pthis); \ - CVector *__vec=new CVector; \ + ke::Vector *__vec=new ke::Vector; \ ParamStack.push(__vec); \ P_CBASE(pthis, iThis) -#define P_BOOL(___PARAM) __vec->push_back(new Data(RET_BOOL, (void *) & (___PARAM))); -#define P_INT(___PARAM) __vec->push_back(new Data(RET_INTEGER, (void *) & (___PARAM))); -#define P_SHORT(___PARAM) __vec->push_back(new Data(RET_SHORT, (void *) & (___PARAM))); -#define P_FLOAT(___PARAM) __vec->push_back(new Data(RET_FLOAT, (void *) & (___PARAM))); -#define P_VECTOR(___PARAM) __vec->push_back(new Data(RET_VECTOR, (void *) & (___PARAM))); -#define P_STR(___PARAM) __vec->push_back(new Data(RET_STRING, (void *) & (___PARAM))); -#define P_CBASE(__PARAM, __INDEX) __vec->push_back(new Data(RET_CBASE, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); -#define P_ENTVAR(__PARAM, __INDEX) __vec->push_back(new Data(RET_ENTVAR, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); -#define P_EDICT(__PARAM, __INDEX) __vec->push_back(new Data(RET_EDICT, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); -#define P_TRACE(__PARAM) __vec->push_back(new Data(RET_TRACE, (void *) (__PARAM))); -#define P_PTRVECTOR(__PARAM) __vec->push_back(new Data(RET_VECTOR, (void *) (__PARAM))); -#define P_PTRFLOAT(__PARAM) __vec->push_back(new Data(RET_FLOAT, (void *) (__PARAM))); -#define P_ITEMINFO(__PARAM) __vec->push_back(new Data(RET_ITEMINFO, (void *) & (__PARAM))); +#define P_BOOL(___PARAM) __vec->append(new Data(RET_BOOL, (void *) & (___PARAM))); +#define P_INT(___PARAM) __vec->append(new Data(RET_INTEGER, (void *) & (___PARAM))); +#define P_SHORT(___PARAM) __vec->append(new Data(RET_SHORT, (void *) & (___PARAM))); +#define P_FLOAT(___PARAM) __vec->append(new Data(RET_FLOAT, (void *) & (___PARAM))); +#define P_VECTOR(___PARAM) __vec->append(new Data(RET_VECTOR, (void *) & (___PARAM))); +#define P_STR(___PARAM) __vec->append(new Data(RET_STRING, (void *) & (___PARAM))); +#define P_CBASE(__PARAM, __INDEX) __vec->append(new Data(RET_CBASE, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); +#define P_ENTVAR(__PARAM, __INDEX) __vec->append(new Data(RET_ENTVAR, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); +#define P_EDICT(__PARAM, __INDEX) __vec->append(new Data(RET_EDICT, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); +#define P_TRACE(__PARAM) __vec->append(new Data(RET_TRACE, (void *) (__PARAM))); +#define P_PTRVECTOR(__PARAM) __vec->append(new Data(RET_VECTOR, (void *) (__PARAM))); +#define P_PTRFLOAT(__PARAM) __vec->append(new Data(RET_FLOAT, (void *) (__PARAM))); +#define P_ITEMINFO(__PARAM) __vec->append(new Data(RET_ITEMINFO, (void *) & (__PARAM))); #define KILL_VECTOR() \ - CVector::iterator end=__vec->end(); \ - for (CVector::iterator i=__vec->begin(); i!=end; ++i) \ + for (size_t i = 0; i < __vec->length(); ++i) \ { \ - delete (*i); \ + delete __vec->at(i); \ } \ delete __vec; \ ParamStack.pop(); @@ -83,12 +82,11 @@ extern bool gDoForwards; int thisresult=HAM_UNSET; \ if (DoForwards) \ { \ - CVector::iterator end=hook->pre.end(); \ - for (CVector::iterator i=hook->pre.begin(); i!=end; i++) \ + for (size_t i = 0; i < hook->pre.length(); ++i) \ { \ - if ((*i)->state == FSTATE_OK) \ + if (hook->pre.at(i)->state == FSTATE_OK) \ { \ - thisresult=MF_ExecuteForward((*i)->id,iThis + thisresult = MF_ExecuteForward(hook->pre.at(i)->id, iThis #define PRE_END() \ ); \ @@ -106,12 +104,11 @@ extern bool gDoForwards; } \ if (DoForwards) \ { \ - CVector::iterator end=hook->post.end(); \ - for (CVector::iterator i=hook->post.begin(); i!=end; i++) \ + for (size_t i = 0; i < hook->post.length(); ++i) \ { \ - if ((*i)->state == FSTATE_OK) \ + if (hook->post.at(i)->state == FSTATE_OK) \ { \ - MF_ExecuteForward((*i)->id,iThis + MF_ExecuteForward(hook->post.at(i)->id, iThis #define POST_END() \ ); \ @@ -130,7 +127,7 @@ extern bool gDoForwards; #define CHECK_RETURN_STR() \ if (thisresult < HAM_OVERRIDE) \ { \ - return origret.c_str(); \ + return origret.chars(); \ } #define CHECK_RETURN_VEC() \ if (thisresult < HAM_OVERRIDE) \ @@ -434,7 +431,7 @@ int Hook_Int_Int_Str_Int(Hook *hook, void *pthis, int i1, const char *sz1, int i int origret=0; PUSH_INT() - String a=sz1; + ke::AString a(sz1); MAKE_VECTOR() @@ -443,16 +440,16 @@ int Hook_Int_Int_Str_Int(Hook *hook, void *pthis, int i1, const char *sz1, int i P_INT(i2) PRE_START() - ,i1, a.c_str(), i2 + ,i1, a.chars(), i2 PRE_END() #if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, i1, a.c_str(), i2); + origret=reinterpret_cast(hook->func)(pthis, 0, i1, a.chars(), i2); #elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, i1, a.c_str(), i2); + origret=reinterpret_cast(hook->func)(pthis, i1, a.chars(), i2); #endif POST_START() - ,i1, a.c_str(), i2 + ,i1, a.chars(), i2 POST_END() KILL_VECTOR() @@ -467,7 +464,7 @@ int Hook_Int_Int_Str_Int_Int(Hook *hook, void *pthis, int i1, const char *sz1, i int origret = 0; PUSH_INT() - String a = sz1; + ke::AString a(sz1); MAKE_VECTOR() @@ -477,16 +474,16 @@ int Hook_Int_Int_Str_Int_Int(Hook *hook, void *pthis, int i1, const char *sz1, i P_INT(i3) PRE_START() - , i1, a.c_str(), i2, i3 + , i1, a.chars(), i2, i3 PRE_END() #if defined(_WIN32) - origret = reinterpret_cast(hook->func)(pthis, 0, i1, a.c_str(), i2, i3); + origret = reinterpret_cast(hook->func)(pthis, 0, i1, a.chars(), i2, i3); #elif defined(__linux__) || defined(__APPLE__) - origret = reinterpret_cast(hook->func)(pthis, i1, a.c_str(), i2, i3); + origret = reinterpret_cast(hook->func)(pthis, i1, a.chars(), i2, i3); #endif POST_START() - , i1, a.c_str(), i2, i3 + , i1, a.chars(), i2, i3 POST_END() KILL_VECTOR() @@ -815,8 +812,8 @@ void Hook_Void_Float_Vector_Trace_Int(Hook *hook, void *pthis, float f1, Vector const char *Hook_Str_Void(Hook *hook, void *pthis) { - String ret; - String origret; + ke::AString ret; + ke::AString origret; MAKE_VECTOR() @@ -825,9 +822,9 @@ const char *Hook_Str_Void(Hook *hook, void *pthis) PRE_END() #if defined(_WIN32) - origret.assign(reinterpret_cast(hook->func)(pthis, 0)); + origret = reinterpret_cast(hook->func)(pthis, 0); #elif defined(__linux__) || defined(__APPLE__) - origret.assign(reinterpret_cast(hook->func)(pthis)); + origret = reinterpret_cast(hook->func)(pthis); #endif POST_START() @@ -837,7 +834,7 @@ const char *Hook_Str_Void(Hook *hook, void *pthis) POP() CHECK_RETURN_STR(); - return ret.c_str(); + return ret.chars(); } void *Hook_Cbase_Void(Hook *hook, void *pthis) @@ -1402,7 +1399,7 @@ int Hook_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2) void Hook_Void_Str_Float_Float_Float(Hook *hook, void *pthis, const char *sz1, float f1, float f2, float f3) { PUSH_VOID() - String a=sz1; + ke::AString a(sz1); MAKE_VECTOR() @@ -1412,17 +1409,17 @@ void Hook_Void_Str_Float_Float_Float(Hook *hook, void *pthis, const char *sz1, f P_FLOAT(f3) PRE_START() - ,a.c_str(), f1, f2, f3 + ,a.chars(), f1, f2, f3 PRE_END() #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, a.c_str(), f1, f2, f3); + reinterpret_cast(hook->func)(pthis, 0, a.chars(), f1, f2, f3); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, a.c_str(), f1, f2, f3); + reinterpret_cast(hook->func)(pthis, a.chars(), f1, f2, f3); #endif POST_START() - ,a.c_str(), f1, f2, f3 + ,a.chars(), f1, f2, f3 POST_END() KILL_VECTOR() @@ -1433,7 +1430,7 @@ void Hook_Void_Str_Float_Float_Float_Int_Cbase(Hook *hook, void *pthis, const ch { PUSH_VOID() - String a=sz1; + ke::AString a(sz1); int iEnt=PrivateToIndex(cb); MAKE_VECTOR() @@ -1446,17 +1443,17 @@ void Hook_Void_Str_Float_Float_Float_Int_Cbase(Hook *hook, void *pthis, const ch P_CBASE(cb, iEnt) PRE_START() - ,a.c_str(), f1, f2, f3, i1, iEnt + ,a.chars(), f1, f2, f3, i1, iEnt PRE_END() #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, a.c_str(), f1, f2, f3, i1, cb); + reinterpret_cast(hook->func)(pthis, 0, a.chars(), f1, f2, f3, i1, cb); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, a.c_str(), f1, f2, f3, i1, cb); + reinterpret_cast(hook->func)(pthis, a.chars(), f1, f2, f3, i1, cb); #endif POST_START() - ,a.c_str(), f1, f2, f3, i1, iEnt + ,a.chars(), f1, f2, f3, i1, iEnt POST_END() KILL_VECTOR() @@ -1644,23 +1641,23 @@ int Hook_Int_Str(Hook *hook, void *pthis, const char *sz1) int origret=0; PUSH_INT() - String a=sz1; + ke::AString a(sz1); MAKE_VECTOR() P_STR(a) PRE_START() - , a.c_str() + , a.chars() PRE_END() #if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, a.c_str()); + origret=reinterpret_cast(hook->func)(pthis, 0, a.chars()); #elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, a.c_str()); + origret=reinterpret_cast(hook->func)(pthis, a.chars()); #endif POST_START() - , a.c_str() + , a.chars() POST_END() KILL_VECTOR() @@ -1758,7 +1755,7 @@ void Hook_Void_Vector_Vector(Hook *hook, void *pthis, Vector v1, Vector v2) void Hook_Void_Str_Bool(Hook *hook, void *pthis, const char *sz1, bool b2) { PUSH_VOID() - String a=sz1; + ke::AString a(sz1); MAKE_VECTOR() @@ -1766,17 +1763,17 @@ void Hook_Void_Str_Bool(Hook *hook, void *pthis, const char *sz1, bool b2) P_BOOL(b2) PRE_START() - , a.c_str(), b2 + , a.chars(), b2 PRE_END() #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, a.c_str(), b2); + reinterpret_cast(hook->func)(pthis, 0, a.chars(), b2); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, a.c_str(), b2); + reinterpret_cast(hook->func)(pthis, a.chars(), b2); #endif POST_START() - , a.c_str(), b2 + , a.chars(), b2 POST_END() KILL_VECTOR() @@ -1858,7 +1855,8 @@ int Hook_Int_Int_Int_Float_Int(Hook *hook, void *pthis, int i1, int i2, float f1 void Hook_Void_Str_Int(Hook *hook, void *pthis, const char *sz1, int i2) { PUSH_VOID() - String a=sz1; + + ke::AString a(sz1); MAKE_VECTOR() @@ -1866,17 +1864,17 @@ void Hook_Void_Str_Int(Hook *hook, void *pthis, const char *sz1, int i2) P_INT(i2) PRE_START() - , a.c_str(), i2 + , a.chars(), i2 PRE_END() #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, a.c_str(), i2); + reinterpret_cast(hook->func)(pthis, 0, a.chars(), i2); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, a.c_str(), i2); + reinterpret_cast(hook->func)(pthis, a.chars(), i2); #endif POST_START() - , a.c_str(), i2 + , a.chars(), i2 POST_END() KILL_VECTOR() @@ -1914,24 +1912,24 @@ void Hook_Void_Cbase_Int(Hook *hook, void *pthis, void *p1, int i1) void Hook_Void_Str(Hook *hook, void *pthis, const char *sz1) { PUSH_VOID() - String a=sz1; + ke::AString a(sz1); MAKE_VECTOR() P_STR(a) PRE_START() - , a.c_str() + , a.chars() PRE_END() #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, a.c_str()); + reinterpret_cast(hook->func)(pthis, 0, a.chars()); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, a.c_str()); + reinterpret_cast(hook->func)(pthis, a.chars()); #endif POST_START() - , a.c_str() + , a.chars() POST_END() KILL_VECTOR() @@ -1970,8 +1968,8 @@ int Hook_Int_Str_Vector_Str(Hook *hook, void *pthis, const char *sz1, Vector v2, PUSH_INT() - String a=sz1; - String b=sz2; + ke::AString a(sz1); + ke::AString b(sz2); MAKE_VECTOR() @@ -1980,17 +1978,17 @@ int Hook_Int_Str_Vector_Str(Hook *hook, void *pthis, const char *sz1, Vector v2, P_STR(b) PRE_START() - , a.c_str(), MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false), b.c_str() + , a.chars(), MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false), b.chars() PRE_END() #if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, a.c_str(), v2, b.c_str()); + origret=reinterpret_cast(hook->func)(pthis, 0, a.chars(), v2, b.chars()); #elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, a.c_str(), v2, b.c_str()); + origret=reinterpret_cast(hook->func)(pthis, a.chars(), v2, b.chars()); #endif POST_START() - , a.c_str(), MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false), b.c_str() + , a.chars(), MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false), b.chars() POST_END() KILL_VECTOR() @@ -2007,8 +2005,8 @@ int Hook_Int_Str_Str(Hook *hook, void *pthis, const char *sz1, const char *sz2) PUSH_INT() - String a=sz1; - String b=sz2; + ke::AString a(sz1); + ke::AString b(sz2); MAKE_VECTOR() @@ -2016,17 +2014,17 @@ int Hook_Int_Str_Str(Hook *hook, void *pthis, const char *sz1, const char *sz2) P_STR(b) PRE_START() - , a.c_str(), b.c_str() + , a.chars(), b.chars() PRE_END() #if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, a.c_str(), b.c_str()); + origret=reinterpret_cast(hook->func)(pthis, 0, a.chars(), b.chars()); #elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, a.c_str(), b.c_str()); + origret=reinterpret_cast(hook->func)(pthis, a.chars(), b.chars()); #endif POST_START() - , a.c_str(), b.c_str() + , a.chars(), b.chars() POST_END() KILL_VECTOR() @@ -2066,8 +2064,8 @@ void Hook_Void_Str_Str_Int(Hook *hook, void *pthis, const char *sz1, const char { PUSH_VOID() - String a=sz1; - String b=sz2; + ke::AString a(sz1); + ke::AString b(sz2); MAKE_VECTOR() @@ -2076,17 +2074,17 @@ void Hook_Void_Str_Str_Int(Hook *hook, void *pthis, const char *sz1, const char P_INT(i3) PRE_START() - , a.c_str(), b.c_str(), i3 + , a.chars(), b.chars(), i3 PRE_END() #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, a.c_str(), b.c_str(), i3); + reinterpret_cast(hook->func)(pthis, 0, a.chars(), b.chars(), i3); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, a.c_str(), b.c_str(), i3); + reinterpret_cast(hook->func)(pthis, a.chars(), b.chars(), i3); #endif POST_START() - , a.c_str(), b.c_str(), i3 + , a.chars(), b.chars(), i3 POST_END() KILL_VECTOR() @@ -2746,9 +2744,9 @@ void Hook_Vector_Vector_Vector_Vector(Hook *hook, Vector *out, void *pthis, Vect const char *Hook_Str_Str(Hook *hook, void *pthis, const char* str) { - String ret; - String origret; - String a = str; + ke::AString ret; + ke::AString origret; + ke::AString a(str); MAKE_VECTOR() @@ -2757,24 +2755,24 @@ const char *Hook_Str_Str(Hook *hook, void *pthis, const char* str) P_STR(a) PRE_START() - , a.c_str() + , a.chars() PRE_END() #if defined(_WIN32) - origret.assign(reinterpret_cast(hook->func)(pthis, 0, a.c_str() )); + origret = reinterpret_cast(hook->func)(pthis, 0, a.chars()); #elif defined(__linux__) || defined(__APPLE__) - origret.assign(reinterpret_cast(hook->func)(pthis, a.c_str())); + origret = reinterpret_cast(hook->func)(pthis, a.chars()); #endif POST_START() - , a.c_str() + , a.chars() POST_END() KILL_VECTOR() POP() CHECK_RETURN_STR(); - return ret.c_str(); + return ret.chars(); } void Hook_Void_Short(Hook *hook, void *pthis, short i1) diff --git a/dlls/hamsandwich/hook_native.cpp b/dlls/hamsandwich/hook_native.cpp index c761b3be..161a8915 100644 --- a/dlls/hamsandwich/hook_native.cpp +++ b/dlls/hamsandwich/hook_native.cpp @@ -19,9 +19,6 @@ #include #include "amxxmodule.h" - -#include "CVector.h" - #include "hook.h" #include "forward.h" #include "hook_callbacks.h" @@ -31,12 +28,13 @@ #include "hooklist.h" #include "ham_utils.h" #include "hook_specialbot.h" +#include OffsetManager Offsets; bool gDoForwards=true; -CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; +ke::Vector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; CHamSpecialBotHandler SpecialbotHandler; #define V(__KEYNAME, __STUFF__) 0, 0, __KEYNAME, RT_##__STUFF__, RB_##__STUFF__, PC_##__STUFF__, reinterpret_cast(Hook_##__STUFF__), Create_##__STUFF__, Call_##__STUFF__ @@ -596,22 +594,19 @@ static cell AMX_NATIVE_CALL RegisterHam(AMX *amx, cell *params) // Check the list of this function's hooks, see if the function we have is a hook - CVector::iterator end=hooks[func].end(); - for (CVector::iterator i=hooks[func].begin(); - i!=end; - ++i) + for (size_t i = 0; i < hooks[func].length(); ++i) { - if ((*i)->tramp == vfunction) + if (hooks[func].at(i)->tramp == vfunction) { // Yes, this function is hooked Forward *pfwd=new Forward(fwd); if (post) { - (*i)->post.push_back(pfwd); + hooks[func].at(i)->post.append(pfwd); } else { - (*i)->pre.push_back(pfwd); + hooks[func].at(i)->pre.append(pfwd); } return reinterpret_cast(pfwd); } @@ -619,16 +614,16 @@ static cell AMX_NATIVE_CALL RegisterHam(AMX *amx, cell *params) // If we got here, the function is not hooked Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname); - hooks[func].push_back(hook); + hooks[func].append(hook); Forward *pfwd=new Forward(fwd); if (post) { - hook->post.push_back(pfwd); + hook->post.append(pfwd); } else { - hook->pre.push_back(pfwd); + hook->pre.append(pfwd); } return reinterpret_cast(pfwd); @@ -687,22 +682,19 @@ static cell AMX_NATIVE_CALL RegisterHamFromEntity(AMX *amx, cell *params) // Check the list of this function's hooks, see if the function we have is a hook - CVector::iterator end=hooks[func].end(); - for (CVector::iterator i=hooks[func].begin(); - i!=end; - ++i) + for (size_t i = 0; i < hooks[func].length(); ++i) { - if ((*i)->tramp == vfunction) + if (hooks[func].at(i)->tramp == vfunction) { // Yes, this function is hooked Forward *pfwd=new Forward(fwd); if (post) { - (*i)->post.push_back(pfwd); + hooks[func].at(i)->post.append(pfwd); } else { - (*i)->pre.push_back(pfwd); + hooks[func].at(i)->pre.append(pfwd); } return reinterpret_cast(pfwd); } @@ -716,16 +708,16 @@ static cell AMX_NATIVE_CALL RegisterHamFromEntity(AMX *amx, cell *params) // If we got here, the function is not hooked Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname); - hooks[func].push_back(hook); + hooks[func].append(hook); Forward *pfwd=new Forward(fwd); if (post) { - hook->post.push_back(pfwd); + hook->post.append(pfwd); } else { - hook->pre.push_back(pfwd); + hook->pre.append(pfwd); } return reinterpret_cast(pfwd); diff --git a/dlls/hamsandwich/hook_specialbot.cpp b/dlls/hamsandwich/hook_specialbot.cpp index 0d071f8c..1fb27e7c 100644 --- a/dlls/hamsandwich/hook_specialbot.cpp +++ b/dlls/hamsandwich/hook_specialbot.cpp @@ -15,7 +15,7 @@ #include "hooklist.h" #include "hook.h" -extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; +extern ke::Vector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; extern hook_t hooklist[]; @@ -60,13 +60,12 @@ void CHamSpecialBotHandler::CheckClientKeyValue(int &clientIndex, char *infobuff if(m_RHP_list.empty()) return; - - CVector::iterator i = m_RHP_list.begin(); - CVector::iterator end = m_RHP_list.end(); - for(; i!=end; i++) + + for (size_t i = 0; i < m_RHP_list.length(); ++i) { - RegisterChecked((*i)->amx, (*i)->func, (*i)->function, (*i)->post, (*i)->fwd); - delete *i; + CRegisterHamParams *item = m_RHP_list.at(i); + RegisterChecked(item->amx, item->func, item->function, item->post, item->fwd); + delete item; } m_RHP_list.clear(); @@ -76,7 +75,7 @@ void CHamSpecialBotHandler::RegisterHamSpecialBot(AMX *amx, int &func, const cha { if(m_specialbot_vtable == NULL) { - m_RHP_list.push_back( new CRegisterHamParams(amx, func, function, post, fwd) ); + m_RHP_list.append( new CRegisterHamParams(amx, func, function, post, fwd) ); return; } @@ -90,22 +89,19 @@ void CHamSpecialBotHandler::RegisterChecked(AMX *amx, int &func, const char *fun void *vfunction=(void *)ivtable[hooklist[func].vtid]; - CVector::iterator end=hooks[func].end(); - for (CVector::iterator i=hooks[func].begin(); - i!=end; - ++i) + for (size_t i = 0; i < hooks[func].length(); ++i) { - if ((*i)->tramp == vfunction) + if (hooks[func].at(i)->tramp == vfunction) { // Yes, this function is hooked - Forward *pfwd=new Forward(fwd); + Forward *pfwd = new Forward(fwd); if (post) { - (*i)->post.push_back(pfwd); + hooks[func].at(i)->post.append(pfwd); } else { - (*i)->pre.push_back(pfwd); + hooks[func].at(i)->pre.append(pfwd); } return; } @@ -115,15 +111,15 @@ void CHamSpecialBotHandler::RegisterChecked(AMX *amx, int &func, const char *fun // If we got here, the function is not hooked Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname); - hooks[func].push_back(hook); + hooks[func].append(hook); Forward *pfwd=new Forward(fwd); if (post) { - hook->post.push_back(pfwd); + hook->post.append(pfwd); } else { - hook->pre.push_back(pfwd); + hook->pre.append(pfwd); } } diff --git a/dlls/hamsandwich/hook_specialbot.h b/dlls/hamsandwich/hook_specialbot.h index 26a3a561..85bbb941 100644 --- a/dlls/hamsandwich/hook_specialbot.h +++ b/dlls/hamsandwich/hook_specialbot.h @@ -15,7 +15,7 @@ #define HOOK_SPECIALBOT_H #include "ham_utils.h" -#include "CVector.h" +#include class CRegisterHamParams { @@ -42,7 +42,7 @@ public: private: void RegisterChecked(AMX *amx, int &func, const char *function, int &post, int &fwd); - CVector m_RHP_list; + ke::Vector m_RHP_list; void **m_specialbot_vtable; }; diff --git a/dlls/hamsandwich/sdk/moduleconfig.h b/dlls/hamsandwich/moduleconfig.h similarity index 98% rename from dlls/hamsandwich/sdk/moduleconfig.h rename to dlls/hamsandwich/moduleconfig.h index bab9e69e..d839cf0c 100644 --- a/dlls/hamsandwich/sdk/moduleconfig.h +++ b/dlls/hamsandwich/moduleconfig.h @@ -11,500 +11,500 @@ // // Module Config // - -#ifndef __MODULECONFIG_H__ -#define __MODULECONFIG_H__ - -#if defined AMBUILD -# include -#else -# define SVN_VERSION "dev-local" -#endif - -// Module info -#define MODULE_NAME "Ham Sandwich" -#define MODULE_VERSION SVN_VERSION -#define MODULE_AUTHOR "AMX Mod X Dev Team" -#define MODULE_URL "http://www.amxmodx.org" -#define MODULE_LOGTAG "HAMSANDWICH" -#define MODULE_LIBRARY "hamsandwich" -#define MODULE_LIBCLASS "" -// If you want the module not to be reloaded on mapchange, remove / comment out the next line -// #define MODULE_RELOAD_ON_MAPCHANGE - -#ifdef __DATE__ -#define MODULE_DATE __DATE__ -#else // __DATE__ -#define MODULE_DATE "Unknown" -#endif // __DATE__ - -// metamod plugin? -#define USE_METAMOD - -// use memory manager/tester? -// note that if you use this, you cannot construct/allocate -// anything before the module attached (OnAmxxAttach). -// be careful of default constructors using new/malloc! -// #define MEMORY_TEST - -// Unless you use STL or exceptions, keep this commented. -// It allows you to compile without libstdc++.so as a dependency -// #define NO_ALLOC_OVERRIDES - -// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself -// #define NO_MSVC8_AUTO_COMPAT - -/** - * AMXX Init functions - * Also consider using FN_META_* - */ - -/** AMXX query */ -//#define FN_AMXX_QUERY OnAmxxQuery - -/** AMXX attach - * Do native functions init here (MF_AddNatives) - */ -#define FN_AMXX_ATTACH OnAmxxAttach - -/** AMXX Detach (unload) */ -#define FN_AMXX_DETACH OnAmxxDetach - -/** All plugins loaded - * Do forward functions init here (MF_RegisterForward) - */ -#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded - -/** All plugins are about to be unloaded */ -//#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading - -/** All plugins are now unloaded */ -#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded - - -/**** METAMOD ****/ -// If your module doesn't use metamod, you may close the file now :) -#ifdef USE_METAMOD -// ---- -// Hook Functions -// Uncomment these to be called -// You can also change the function name - -// - Metamod init functions -// Also consider using FN_AMXX_* -// Meta query -//#define FN_META_QUERY OnMetaQuery -// Meta attach -#define FN_META_ATTACH OnMetaAttach -// Meta detach -//#define FN_META_DETACH OnMetaDetach - -// (wd) are Will Day's notes -// - GetEntityAPI2 functions -// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */ -// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */ -// #define FN_DispatchThink DispatchThink /* pfnThink() */ -// #define FN_DispatchUse DispatchUse /* pfnUse() */ -// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */ -// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */ -// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */ -// #define FN_DispatchSave DispatchSave /* pfnSave() */ -// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */ -// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */ -// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */ -// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */ -// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */ -// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */ -// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */ -// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */ -// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */ -// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */ -// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */ -// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */ -// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */ -// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */ -// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */ -// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */ -// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */ -// #define FN_StartFrame StartFrame /* pfnStartFrame() */ -// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */ -// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */ -// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */ -// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */ -// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */ -// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */ -// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */ -// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */ -// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */ -// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */ -// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */ -// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */ -// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */ -// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */ -// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */ -// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */ -// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */ -// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */ -// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */ -// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */ -// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */ -// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */ -// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */ -// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */ - -// - GetEntityAPI2_Post functions -// #define FN_GameDLLInit_Post GameDLLInit_Post -// #define FN_DispatchSpawn_Post DispatchSpawn_Post -// #define FN_DispatchThink_Post DispatchThink_Post -// #define FN_DispatchUse_Post DispatchUse_Post -// #define FN_DispatchTouch_Post DispatchTouch_Post -// #define FN_DispatchBlocked_Post DispatchBlocked_Post -// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post -// #define FN_DispatchSave_Post DispatchSave_Post -// #define FN_DispatchRestore_Post DispatchRestore_Post -// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post -// #define FN_SaveWriteFields_Post SaveWriteFields_Post -// #define FN_SaveReadFields_Post SaveReadFields_Post -// #define FN_SaveGlobalState_Post SaveGlobalState_Post -// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post -// #define FN_ResetGlobalState_Post ResetGlobalState_Post -// #define FN_ClientConnect_Post ClientConnect_Post -// #define FN_ClientDisconnect_Post ClientDisconnect_Post -// #define FN_ClientKill_Post ClientKill_Post -// #define FN_ClientPutInServer_Post ClientPutInServer_Post -// #define FN_ClientCommand_Post ClientCommand_Post -// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post -// #define FN_ServerActivate_Post ServerActivate_Post -// #define FN_ServerDeactivate_Post FMH_ServerDeactivate_Post -// #define FN_PlayerPreThink_Post PlayerPreThink_Post -// #define FN_PlayerPostThink_Post PlayerPostThink_Post -// #define FN_StartFrame_Post StartFrame_Post -// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post -// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post -// #define FN_GetGameDescription_Post GetGameDescription_Post -// #define FN_PlayerCustomization_Post PlayerCustomization_Post -// #define FN_SpectatorConnect_Post SpectatorConnect_Post -// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post -// #define FN_SpectatorThink_Post SpectatorThink_Post -// #define FN_Sys_Error_Post Sys_Error_Post -// #define FN_PM_Move_Post PM_Move_Post -// #define FN_PM_Init_Post PM_Init_Post -// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post -// #define FN_SetupVisibility_Post SetupVisibility_Post -// #define FN_UpdateClientData_Post UpdateClientData_Post -// #define FN_AddToFullPack_Post AddToFullPack_Post -// #define FN_CreateBaseline_Post CreateBaseline_Post -// #define FN_RegisterEncoders_Post RegisterEncoders_Post -// #define FN_GetWeaponData_Post GetWeaponData_Post -// #define FN_CmdStart_Post CmdStart_Post -// #define FN_CmdEnd_Post CmdEnd_Post -// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post -// #define FN_GetHullBounds_Post GetHullBounds_Post -// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post -// #define FN_InconsistentFile_Post InconsistentFile_Post -// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post - -// - GetEngineAPI functions -// #define FN_PrecacheModel PrecacheModel -// #define FN_PrecacheSound PrecacheSound -// #define FN_SetModel SetModel -// #define FN_ModelIndex ModelIndex -// #define FN_ModelFrames ModelFrames -// #define FN_SetSize SetSize -// #define FN_ChangeLevel ChangeLevel -// #define FN_GetSpawnParms GetSpawnParms -// #define FN_SaveSpawnParms SaveSpawnParms -// #define FN_VecToYaw VecToYaw -// #define FN_VecToAngles VecToAngles -// #define FN_MoveToOrigin MoveToOrigin -// #define FN_ChangeYaw ChangeYaw -// #define FN_ChangePitch ChangePitch -// #define FN_FindEntityByString FindEntityByString -// #define FN_GetEntityIllum GetEntityIllum -// #define FN_FindEntityInSphere FindEntityInSphere -// #define FN_FindClientInPVS FindClientInPVS -// #define FN_EntitiesInPVS EntitiesInPVS -// #define FN_MakeVectors MakeVectors -// #define FN_AngleVectors AngleVectors -// #define FN_CreateEntity CreateEntity -// #define FN_RemoveEntity RemoveEntity -// #define FN_CreateNamedEntity CreateNamedEntity -// #define FN_MakeStatic MakeStatic -// #define FN_EntIsOnFloor EntIsOnFloor -// #define FN_DropToFloor DropToFloor -// #define FN_WalkMove WalkMove -// #define FN_SetOrigin SetOrigin -// #define FN_EmitSound EmitSound -// #define FN_EmitAmbientSound EmitAmbientSound -// #define FN_TraceLine TraceLine -// #define FN_TraceToss TraceToss -// #define FN_TraceMonsterHull TraceMonsterHull -// #define FN_TraceHull TraceHull -// #define FN_TraceModel TraceModel -// #define FN_TraceTexture TraceTexture -// #define FN_TraceSphere TraceSphere -// #define FN_GetAimVector GetAimVector -// #define FN_ServerCommand ServerCommand -// #define FN_ServerExecute ServerExecute -// #define FN_engClientCommand engClientCommand -// #define FN_ParticleEffect ParticleEffect -// #define FN_LightStyle LightStyle -// #define FN_DecalIndex DecalIndex -// #define FN_PointContents PointContents -// #define FN_MessageBegin MessageBegin -// #define FN_MessageEnd MessageEnd -// #define FN_WriteByte WriteByte -// #define FN_WriteChar WriteChar -// #define FN_WriteShort WriteShort -// #define FN_WriteLong WriteLong -// #define FN_WriteAngle WriteAngle -// #define FN_WriteCoord WriteCoord -// #define FN_WriteString WriteString -// #define FN_WriteEntity WriteEntity -// #define FN_CVarRegister CVarRegister -// #define FN_CVarGetFloat CVarGetFloat -// #define FN_CVarGetString CVarGetString -// #define FN_CVarSetFloat CVarSetFloat -// #define FN_CVarSetString CVarSetString -// #define FN_AlertMessage AlertMessage -// #define FN_EngineFprintf EngineFprintf -// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData -// #define FN_PvEntPrivateData PvEntPrivateData -// #define FN_FreeEntPrivateData FreeEntPrivateData -// #define FN_SzFromIndex SzFromIndex -// #define FN_AllocString AllocString -// #define FN_GetVarsOfEnt GetVarsOfEnt -// #define FN_PEntityOfEntOffset PEntityOfEntOffset -// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity -// #define FN_IndexOfEdict IndexOfEdict -// #define FN_PEntityOfEntIndex PEntityOfEntIndex -// #define FN_FindEntityByVars FindEntityByVars -// #define FN_GetModelPtr GetModelPtr -// #define FN_RegUserMsg RegUserMsg -// #define FN_AnimationAutomove AnimationAutomove -// #define FN_GetBonePosition GetBonePosition -// #define FN_FunctionFromName FunctionFromName -// #define FN_NameForFunction NameForFunction -// #define FN_ClientPrintf ClientPrintf -// #define FN_ServerPrint ServerPrint -// #define FN_Cmd_Args Cmd_Args -// #define FN_Cmd_Argv Cmd_Argv -// #define FN_Cmd_Argc Cmd_Argc -// #define FN_GetAttachment GetAttachment -// #define FN_CRC32_Init CRC32_Init -// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer -// #define FN_CRC32_ProcessByte CRC32_ProcessByte -// #define FN_CRC32_Final CRC32_Final -// #define FN_RandomLong RandomLong -// #define FN_RandomFloat RandomFloat -// #define FN_SetView SetView -// #define FN_Time Time -// #define FN_CrosshairAngle CrosshairAngle -// #define FN_LoadFileForMe LoadFileForMe -// #define FN_FreeFile FreeFile -// #define FN_EndSection EndSection -// #define FN_CompareFileTime CompareFileTime -// #define FN_GetGameDir GetGameDir -// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable -// #define FN_FadeClientVolume FadeClientVolume -// #define FN_SetClientMaxspeed SetClientMaxspeed -// #define FN_CreateFakeClient CreateFakeClient -// #define FN_RunPlayerMove RunPlayerMove -// #define FN_NumberOfEntities NumberOfEntities -// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer -// #define FN_InfoKeyValue InfoKeyValue -// #define FN_SetKeyValue SetKeyValue -#define FN_SetClientKeyValue SetClientKeyValue -// #define FN_IsMapValid IsMapValid -// #define FN_StaticDecal StaticDecal -// #define FN_PrecacheGeneric PrecacheGeneric -// #define FN_GetPlayerUserId GetPlayerUserId -// #define FN_BuildSoundMsg BuildSoundMsg -// #define FN_IsDedicatedServer IsDedicatedServer -// #define FN_CVarGetPointer CVarGetPointer -// #define FN_GetPlayerWONId GetPlayerWONId -// #define FN_Info_RemoveKey Info_RemoveKey -// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue -// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue -// #define FN_GetPhysicsInfoString GetPhysicsInfoString -// #define FN_PrecacheEvent PrecacheEvent -// #define FN_PlaybackEvent PlaybackEvent -// #define FN_SetFatPVS SetFatPVS -// #define FN_SetFatPAS SetFatPAS -// #define FN_CheckVisibility CheckVisibility -// #define FN_DeltaSetField DeltaSetField -// #define FN_DeltaUnsetField DeltaUnsetField -// #define FN_DeltaAddEncoder DeltaAddEncoder -// #define FN_GetCurrentPlayer GetCurrentPlayer -// #define FN_CanSkipPlayer CanSkipPlayer -// #define FN_DeltaFindField DeltaFindField -// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex -// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex -// #define FN_SetGroupMask SetGroupMask -// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline -// #define FN_Cvar_DirectSet Cvar_DirectSet -// #define FN_ForceUnmodified ForceUnmodified -// #define FN_GetPlayerStats GetPlayerStats -// #define FN_AddServerCommand AddServerCommand -// #define FN_Voice_GetClientListening Voice_GetClientListening -// #define FN_Voice_SetClientListening Voice_SetClientListening -// #define FN_GetPlayerAuthId GetPlayerAuthId - -// - GetEngineAPI_Post functions -// #define FN_PrecacheModel_Post PrecacheModel_Post -// #define FN_PrecacheSound_Post PrecacheSound_Post -// #define FN_SetModel_Post SetModel_Post -// #define FN_ModelIndex_Post ModelIndex_Post -// #define FN_ModelFrames_Post ModelFrames_Post -// #define FN_SetSize_Post SetSize_Post -// #define FN_ChangeLevel_Post ChangeLevel_Post -// #define FN_GetSpawnParms_Post GetSpawnParms_Post -// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post -// #define FN_VecToYaw_Post VecToYaw_Post -// #define FN_VecToAngles_Post VecToAngles_Post -// #define FN_MoveToOrigin_Post MoveToOrigin_Post -// #define FN_ChangeYaw_Post ChangeYaw_Post -// #define FN_ChangePitch_Post ChangePitch_Post -// #define FN_FindEntityByString_Post FindEntityByString_Post -// #define FN_GetEntityIllum_Post GetEntityIllum_Post -// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post -// #define FN_FindClientInPVS_Post FindClientInPVS_Post -// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post -// #define FN_MakeVectors_Post MakeVectors_Post -// #define FN_AngleVectors_Post AngleVectors_Post -// #define FN_CreateEntity_Post CreateEntity_Post -// #define FN_RemoveEntity_Post RemoveEntity_Post -// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post -// #define FN_MakeStatic_Post MakeStatic_Post -// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post -// #define FN_DropToFloor_Post DropToFloor_Post -// #define FN_WalkMove_Post WalkMove_Post -// #define FN_SetOrigin_Post SetOrigin_Post -// #define FN_EmitSound_Post EmitSound_Post -// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post -// #define FN_TraceLine_Post TraceLine_Post -// #define FN_TraceToss_Post TraceToss_Post -// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post -// #define FN_TraceHull_Post TraceHull_Post -// #define FN_TraceModel_Post TraceModel_Post -// #define FN_TraceTexture_Post TraceTexture_Post -// #define FN_TraceSphere_Post TraceSphere_Post -// #define FN_GetAimVector_Post GetAimVector_Post -// #define FN_ServerCommand_Post ServerCommand_Post -// #define FN_ServerExecute_Post ServerExecute_Post -// #define FN_engClientCommand_Post engClientCommand_Post -// #define FN_ParticleEffect_Post ParticleEffect_Post -// #define FN_LightStyle_Post LightStyle_Post -// #define FN_DecalIndex_Post DecalIndex_Post -// #define FN_PointContents_Post PointContents_Post -// #define FN_MessageBegin_Post MessageBegin_Post -// #define FN_MessageEnd_Post MessageEnd_Post -// #define FN_WriteByte_Post WriteByte_Post -// #define FN_WriteChar_Post WriteChar_Post -// #define FN_WriteShort_Post WriteShort_Post -// #define FN_WriteLong_Post WriteLong_Post -// #define FN_WriteAngle_Post WriteAngle_Post -// #define FN_WriteCoord_Post WriteCoord_Post -// #define FN_WriteString_Post WriteString_Post -// #define FN_WriteEntity_Post WriteEntity_Post -// #define FN_CVarRegister_Post CVarRegister_Post -// #define FN_CVarGetFloat_Post CVarGetFloat_Post -// #define FN_CVarGetString_Post CVarGetString_Post -// #define FN_CVarSetFloat_Post CVarSetFloat_Post -// #define FN_CVarSetString_Post CVarSetString_Post -// #define FN_AlertMessage_Post AlertMessage_Post -// #define FN_EngineFprintf_Post EngineFprintf_Post -// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post -// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post -// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post -// #define FN_SzFromIndex_Post SzFromIndex_Post -// #define FN_AllocString_Post AllocString_Post -// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post -// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post -// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post -// #define FN_IndexOfEdict_Post IndexOfEdict_Post -// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post -// #define FN_FindEntityByVars_Post FindEntityByVars_Post -// #define FN_GetModelPtr_Post GetModelPtr_Post -// #define FN_RegUserMsg_Post RegUserMsg_Post -// #define FN_AnimationAutomove_Post AnimationAutomove_Post -// #define FN_GetBonePosition_Post GetBonePosition_Post -// #define FN_FunctionFromName_Post FunctionFromName_Post -// #define FN_NameForFunction_Post NameForFunction_Post -// #define FN_ClientPrintf_Post ClientPrintf_Post -// #define FN_ServerPrint_Post ServerPrint_Post -// #define FN_Cmd_Args_Post Cmd_Args_Post -// #define FN_Cmd_Argv_Post Cmd_Argv_Post -// #define FN_Cmd_Argc_Post Cmd_Argc_Post -// #define FN_GetAttachment_Post GetAttachment_Post -// #define FN_CRC32_Init_Post CRC32_Init_Post -// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post -// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post -// #define FN_CRC32_Final_Post CRC32_Final_Post -// #define FN_RandomLong_Post RandomLong_Post -// #define FN_RandomFloat_Post RandomFloat_Post -// #define FN_SetView_Post SetView_Post -// #define FN_Time_Post Time_Post -// #define FN_CrosshairAngle_Post CrosshairAngle_Post -// #define FN_LoadFileForMe_Post LoadFileForMe_Post -// #define FN_FreeFile_Post FreeFile_Post -// #define FN_EndSection_Post EndSection_Post -// #define FN_CompareFileTime_Post CompareFileTime_Post -// #define FN_GetGameDir_Post GetGameDir_Post -// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post -// #define FN_FadeClientVolume_Post FadeClientVolume_Post -// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post -// #define FN_CreateFakeClient_Post CreateFakeClient_Post -// #define FN_RunPlayerMove_Post RunPlayerMove_Post -// #define FN_NumberOfEntities_Post NumberOfEntities_Post -// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post -// #define FN_InfoKeyValue_Post InfoKeyValue_Post -// #define FN_SetKeyValue_Post SetKeyValue_Post -// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post -// #define FN_IsMapValid_Post IsMapValid_Post -// #define FN_StaticDecal_Post StaticDecal_Post -// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post -// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post -// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post -// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post -// #define FN_CVarGetPointer_Post CVarGetPointer_Post -// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post -// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post -// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post -// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post -// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post -// #define FN_PrecacheEvent_Post PrecacheEvent_Post -// #define FN_PlaybackEvent_Post PlaybackEvent_Post -// #define FN_SetFatPVS_Post SetFatPVS_Post -// #define FN_SetFatPAS_Post SetFatPAS_Post -// #define FN_CheckVisibility_Post CheckVisibility_Post -// #define FN_DeltaSetField_Post DeltaSetField_Post -// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post -// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post -// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post -// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post -// #define FN_DeltaFindField_Post DeltaFindField_Post -// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post -// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post -// #define FN_SetGroupMask_Post SetGroupMask_Post -// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post -// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post -// #define FN_ForceUnmodified_Post ForceUnmodified_Post -// #define FN_GetPlayerStats_Post GetPlayerStats_Post -// #define FN_AddServerCommand_Post AddServerCommand_Post -// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post -// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post -// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post - -// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData -// #define FN_GameShutdown GameShutdown -// #define FN_ShouldCollide ShouldCollide - -// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post -// #define FN_GameShutdown_Post GameShutdown_Post -// #define FN_ShouldCollide_Post ShouldCollide_Post - - -#endif // USE_METAMOD - -#endif // __MODULECONFIG_H__ + +#ifndef __MODULECONFIG_H__ +#define __MODULECONFIG_H__ + +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif + +// Module info +#define MODULE_NAME "Ham Sandwich" +#define MODULE_VERSION SVN_VERSION +#define MODULE_AUTHOR "AMX Mod X Dev Team" +#define MODULE_URL "http://www.amxmodx.org" +#define MODULE_LOGTAG "HAMSANDWICH" +#define MODULE_LIBRARY "hamsandwich" +#define MODULE_LIBCLASS "" +// If you want the module not to be reloaded on mapchange, remove / comment out the next line +// #define MODULE_RELOAD_ON_MAPCHANGE + +#ifdef __DATE__ +#define MODULE_DATE __DATE__ +#else // __DATE__ +#define MODULE_DATE "Unknown" +#endif // __DATE__ + +// metamod plugin? +#define USE_METAMOD + +// use memory manager/tester? +// note that if you use this, you cannot construct/allocate +// anything before the module attached (OnAmxxAttach). +// be careful of default constructors using new/malloc! +// #define MEMORY_TEST + +// Unless you use STL or exceptions, keep this commented. +// It allows you to compile without libstdc++.so as a dependency +// #define NO_ALLOC_OVERRIDES + +// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself +// #define NO_MSVC8_AUTO_COMPAT + +/** + * AMXX Init functions + * Also consider using FN_META_* + */ + +/** AMXX query */ +//#define FN_AMXX_QUERY OnAmxxQuery + +/** AMXX attach + * Do native functions init here (MF_AddNatives) + */ +#define FN_AMXX_ATTACH OnAmxxAttach + +/** AMXX Detach (unload) */ +#define FN_AMXX_DETACH OnAmxxDetach + +/** All plugins loaded + * Do forward functions init here (MF_RegisterForward) + */ +#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded + +/** All plugins are about to be unloaded */ +//#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading + +/** All plugins are now unloaded */ +#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded + + +/**** METAMOD ****/ +// If your module doesn't use metamod, you may close the file now :) +#ifdef USE_METAMOD +// ---- +// Hook Functions +// Uncomment these to be called +// You can also change the function name + +// - Metamod init functions +// Also consider using FN_AMXX_* +// Meta query +//#define FN_META_QUERY OnMetaQuery +// Meta attach +#define FN_META_ATTACH OnMetaAttach +// Meta detach +//#define FN_META_DETACH OnMetaDetach + +// (wd) are Will Day's notes +// - GetEntityAPI2 functions +// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */ +// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */ +// #define FN_DispatchThink DispatchThink /* pfnThink() */ +// #define FN_DispatchUse DispatchUse /* pfnUse() */ +// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */ +// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */ +// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */ +// #define FN_DispatchSave DispatchSave /* pfnSave() */ +// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */ +// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */ +// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */ +// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */ +// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */ +// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */ +// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */ +// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */ +// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */ +// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */ +// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */ +// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */ +// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */ +// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */ +// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */ +// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */ +// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */ +// #define FN_StartFrame StartFrame /* pfnStartFrame() */ +// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */ +// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */ +// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */ +// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */ +// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */ +// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */ +// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */ +// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */ +// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */ +// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */ +// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */ +// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */ +// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */ +// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */ +// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */ +// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */ +// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */ +// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */ +// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */ +// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */ +// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */ +// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */ +// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */ +// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */ + +// - GetEntityAPI2_Post functions +// #define FN_GameDLLInit_Post GameDLLInit_Post +// #define FN_DispatchSpawn_Post DispatchSpawn_Post +// #define FN_DispatchThink_Post DispatchThink_Post +// #define FN_DispatchUse_Post DispatchUse_Post +// #define FN_DispatchTouch_Post DispatchTouch_Post +// #define FN_DispatchBlocked_Post DispatchBlocked_Post +// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post +// #define FN_DispatchSave_Post DispatchSave_Post +// #define FN_DispatchRestore_Post DispatchRestore_Post +// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post +// #define FN_SaveWriteFields_Post SaveWriteFields_Post +// #define FN_SaveReadFields_Post SaveReadFields_Post +// #define FN_SaveGlobalState_Post SaveGlobalState_Post +// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post +// #define FN_ResetGlobalState_Post ResetGlobalState_Post +// #define FN_ClientConnect_Post ClientConnect_Post +// #define FN_ClientDisconnect_Post ClientDisconnect_Post +// #define FN_ClientKill_Post ClientKill_Post +// #define FN_ClientPutInServer_Post ClientPutInServer_Post +// #define FN_ClientCommand_Post ClientCommand_Post +// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post +// #define FN_ServerActivate_Post ServerActivate_Post +// #define FN_ServerDeactivate_Post FMH_ServerDeactivate_Post +// #define FN_PlayerPreThink_Post PlayerPreThink_Post +// #define FN_PlayerPostThink_Post PlayerPostThink_Post +// #define FN_StartFrame_Post StartFrame_Post +// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post +// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post +// #define FN_GetGameDescription_Post GetGameDescription_Post +// #define FN_PlayerCustomization_Post PlayerCustomization_Post +// #define FN_SpectatorConnect_Post SpectatorConnect_Post +// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post +// #define FN_SpectatorThink_Post SpectatorThink_Post +// #define FN_Sys_Error_Post Sys_Error_Post +// #define FN_PM_Move_Post PM_Move_Post +// #define FN_PM_Init_Post PM_Init_Post +// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post +// #define FN_SetupVisibility_Post SetupVisibility_Post +// #define FN_UpdateClientData_Post UpdateClientData_Post +// #define FN_AddToFullPack_Post AddToFullPack_Post +// #define FN_CreateBaseline_Post CreateBaseline_Post +// #define FN_RegisterEncoders_Post RegisterEncoders_Post +// #define FN_GetWeaponData_Post GetWeaponData_Post +// #define FN_CmdStart_Post CmdStart_Post +// #define FN_CmdEnd_Post CmdEnd_Post +// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post +// #define FN_GetHullBounds_Post GetHullBounds_Post +// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post +// #define FN_InconsistentFile_Post InconsistentFile_Post +// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post + +// - GetEngineAPI functions +// #define FN_PrecacheModel PrecacheModel +// #define FN_PrecacheSound PrecacheSound +// #define FN_SetModel SetModel +// #define FN_ModelIndex ModelIndex +// #define FN_ModelFrames ModelFrames +// #define FN_SetSize SetSize +// #define FN_ChangeLevel ChangeLevel +// #define FN_GetSpawnParms GetSpawnParms +// #define FN_SaveSpawnParms SaveSpawnParms +// #define FN_VecToYaw VecToYaw +// #define FN_VecToAngles VecToAngles +// #define FN_MoveToOrigin MoveToOrigin +// #define FN_ChangeYaw ChangeYaw +// #define FN_ChangePitch ChangePitch +// #define FN_FindEntityByString FindEntityByString +// #define FN_GetEntityIllum GetEntityIllum +// #define FN_FindEntityInSphere FindEntityInSphere +// #define FN_FindClientInPVS FindClientInPVS +// #define FN_EntitiesInPVS EntitiesInPVS +// #define FN_MakeVectors MakeVectors +// #define FN_AngleVectors AngleVectors +// #define FN_CreateEntity CreateEntity +// #define FN_RemoveEntity RemoveEntity +// #define FN_CreateNamedEntity CreateNamedEntity +// #define FN_MakeStatic MakeStatic +// #define FN_EntIsOnFloor EntIsOnFloor +// #define FN_DropToFloor DropToFloor +// #define FN_WalkMove WalkMove +// #define FN_SetOrigin SetOrigin +// #define FN_EmitSound EmitSound +// #define FN_EmitAmbientSound EmitAmbientSound +// #define FN_TraceLine TraceLine +// #define FN_TraceToss TraceToss +// #define FN_TraceMonsterHull TraceMonsterHull +// #define FN_TraceHull TraceHull +// #define FN_TraceModel TraceModel +// #define FN_TraceTexture TraceTexture +// #define FN_TraceSphere TraceSphere +// #define FN_GetAimVector GetAimVector +// #define FN_ServerCommand ServerCommand +// #define FN_ServerExecute ServerExecute +// #define FN_engClientCommand engClientCommand +// #define FN_ParticleEffect ParticleEffect +// #define FN_LightStyle LightStyle +// #define FN_DecalIndex DecalIndex +// #define FN_PointContents PointContents +// #define FN_MessageBegin MessageBegin +// #define FN_MessageEnd MessageEnd +// #define FN_WriteByte WriteByte +// #define FN_WriteChar WriteChar +// #define FN_WriteShort WriteShort +// #define FN_WriteLong WriteLong +// #define FN_WriteAngle WriteAngle +// #define FN_WriteCoord WriteCoord +// #define FN_WriteString WriteString +// #define FN_WriteEntity WriteEntity +// #define FN_CVarRegister CVarRegister +// #define FN_CVarGetFloat CVarGetFloat +// #define FN_CVarGetString CVarGetString +// #define FN_CVarSetFloat CVarSetFloat +// #define FN_CVarSetString CVarSetString +// #define FN_AlertMessage AlertMessage +// #define FN_EngineFprintf EngineFprintf +// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData +// #define FN_PvEntPrivateData PvEntPrivateData +// #define FN_FreeEntPrivateData FreeEntPrivateData +// #define FN_SzFromIndex SzFromIndex +// #define FN_AllocString AllocString +// #define FN_GetVarsOfEnt GetVarsOfEnt +// #define FN_PEntityOfEntOffset PEntityOfEntOffset +// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity +// #define FN_IndexOfEdict IndexOfEdict +// #define FN_PEntityOfEntIndex PEntityOfEntIndex +// #define FN_FindEntityByVars FindEntityByVars +// #define FN_GetModelPtr GetModelPtr +// #define FN_RegUserMsg RegUserMsg +// #define FN_AnimationAutomove AnimationAutomove +// #define FN_GetBonePosition GetBonePosition +// #define FN_FunctionFromName FunctionFromName +// #define FN_NameForFunction NameForFunction +// #define FN_ClientPrintf ClientPrintf +// #define FN_ServerPrint ServerPrint +// #define FN_Cmd_Args Cmd_Args +// #define FN_Cmd_Argv Cmd_Argv +// #define FN_Cmd_Argc Cmd_Argc +// #define FN_GetAttachment GetAttachment +// #define FN_CRC32_Init CRC32_Init +// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer +// #define FN_CRC32_ProcessByte CRC32_ProcessByte +// #define FN_CRC32_Final CRC32_Final +// #define FN_RandomLong RandomLong +// #define FN_RandomFloat RandomFloat +// #define FN_SetView SetView +// #define FN_Time Time +// #define FN_CrosshairAngle CrosshairAngle +// #define FN_LoadFileForMe LoadFileForMe +// #define FN_FreeFile FreeFile +// #define FN_EndSection EndSection +// #define FN_CompareFileTime CompareFileTime +// #define FN_GetGameDir GetGameDir +// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable +// #define FN_FadeClientVolume FadeClientVolume +// #define FN_SetClientMaxspeed SetClientMaxspeed +// #define FN_CreateFakeClient CreateFakeClient +// #define FN_RunPlayerMove RunPlayerMove +// #define FN_NumberOfEntities NumberOfEntities +// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer +// #define FN_InfoKeyValue InfoKeyValue +// #define FN_SetKeyValue SetKeyValue +#define FN_SetClientKeyValue SetClientKeyValue +// #define FN_IsMapValid IsMapValid +// #define FN_StaticDecal StaticDecal +// #define FN_PrecacheGeneric PrecacheGeneric +// #define FN_GetPlayerUserId GetPlayerUserId +// #define FN_BuildSoundMsg BuildSoundMsg +// #define FN_IsDedicatedServer IsDedicatedServer +// #define FN_CVarGetPointer CVarGetPointer +// #define FN_GetPlayerWONId GetPlayerWONId +// #define FN_Info_RemoveKey Info_RemoveKey +// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue +// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue +// #define FN_GetPhysicsInfoString GetPhysicsInfoString +// #define FN_PrecacheEvent PrecacheEvent +// #define FN_PlaybackEvent PlaybackEvent +// #define FN_SetFatPVS SetFatPVS +// #define FN_SetFatPAS SetFatPAS +// #define FN_CheckVisibility CheckVisibility +// #define FN_DeltaSetField DeltaSetField +// #define FN_DeltaUnsetField DeltaUnsetField +// #define FN_DeltaAddEncoder DeltaAddEncoder +// #define FN_GetCurrentPlayer GetCurrentPlayer +// #define FN_CanSkipPlayer CanSkipPlayer +// #define FN_DeltaFindField DeltaFindField +// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex +// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex +// #define FN_SetGroupMask SetGroupMask +// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline +// #define FN_Cvar_DirectSet Cvar_DirectSet +// #define FN_ForceUnmodified ForceUnmodified +// #define FN_GetPlayerStats GetPlayerStats +// #define FN_AddServerCommand AddServerCommand +// #define FN_Voice_GetClientListening Voice_GetClientListening +// #define FN_Voice_SetClientListening Voice_SetClientListening +// #define FN_GetPlayerAuthId GetPlayerAuthId + +// - GetEngineAPI_Post functions +// #define FN_PrecacheModel_Post PrecacheModel_Post +// #define FN_PrecacheSound_Post PrecacheSound_Post +// #define FN_SetModel_Post SetModel_Post +// #define FN_ModelIndex_Post ModelIndex_Post +// #define FN_ModelFrames_Post ModelFrames_Post +// #define FN_SetSize_Post SetSize_Post +// #define FN_ChangeLevel_Post ChangeLevel_Post +// #define FN_GetSpawnParms_Post GetSpawnParms_Post +// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post +// #define FN_VecToYaw_Post VecToYaw_Post +// #define FN_VecToAngles_Post VecToAngles_Post +// #define FN_MoveToOrigin_Post MoveToOrigin_Post +// #define FN_ChangeYaw_Post ChangeYaw_Post +// #define FN_ChangePitch_Post ChangePitch_Post +// #define FN_FindEntityByString_Post FindEntityByString_Post +// #define FN_GetEntityIllum_Post GetEntityIllum_Post +// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post +// #define FN_FindClientInPVS_Post FindClientInPVS_Post +// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post +// #define FN_MakeVectors_Post MakeVectors_Post +// #define FN_AngleVectors_Post AngleVectors_Post +// #define FN_CreateEntity_Post CreateEntity_Post +// #define FN_RemoveEntity_Post RemoveEntity_Post +// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post +// #define FN_MakeStatic_Post MakeStatic_Post +// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post +// #define FN_DropToFloor_Post DropToFloor_Post +// #define FN_WalkMove_Post WalkMove_Post +// #define FN_SetOrigin_Post SetOrigin_Post +// #define FN_EmitSound_Post EmitSound_Post +// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post +// #define FN_TraceLine_Post TraceLine_Post +// #define FN_TraceToss_Post TraceToss_Post +// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post +// #define FN_TraceHull_Post TraceHull_Post +// #define FN_TraceModel_Post TraceModel_Post +// #define FN_TraceTexture_Post TraceTexture_Post +// #define FN_TraceSphere_Post TraceSphere_Post +// #define FN_GetAimVector_Post GetAimVector_Post +// #define FN_ServerCommand_Post ServerCommand_Post +// #define FN_ServerExecute_Post ServerExecute_Post +// #define FN_engClientCommand_Post engClientCommand_Post +// #define FN_ParticleEffect_Post ParticleEffect_Post +// #define FN_LightStyle_Post LightStyle_Post +// #define FN_DecalIndex_Post DecalIndex_Post +// #define FN_PointContents_Post PointContents_Post +// #define FN_MessageBegin_Post MessageBegin_Post +// #define FN_MessageEnd_Post MessageEnd_Post +// #define FN_WriteByte_Post WriteByte_Post +// #define FN_WriteChar_Post WriteChar_Post +// #define FN_WriteShort_Post WriteShort_Post +// #define FN_WriteLong_Post WriteLong_Post +// #define FN_WriteAngle_Post WriteAngle_Post +// #define FN_WriteCoord_Post WriteCoord_Post +// #define FN_WriteString_Post WriteString_Post +// #define FN_WriteEntity_Post WriteEntity_Post +// #define FN_CVarRegister_Post CVarRegister_Post +// #define FN_CVarGetFloat_Post CVarGetFloat_Post +// #define FN_CVarGetString_Post CVarGetString_Post +// #define FN_CVarSetFloat_Post CVarSetFloat_Post +// #define FN_CVarSetString_Post CVarSetString_Post +// #define FN_AlertMessage_Post AlertMessage_Post +// #define FN_EngineFprintf_Post EngineFprintf_Post +// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post +// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post +// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post +// #define FN_SzFromIndex_Post SzFromIndex_Post +// #define FN_AllocString_Post AllocString_Post +// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post +// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post +// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post +// #define FN_IndexOfEdict_Post IndexOfEdict_Post +// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post +// #define FN_FindEntityByVars_Post FindEntityByVars_Post +// #define FN_GetModelPtr_Post GetModelPtr_Post +// #define FN_RegUserMsg_Post RegUserMsg_Post +// #define FN_AnimationAutomove_Post AnimationAutomove_Post +// #define FN_GetBonePosition_Post GetBonePosition_Post +// #define FN_FunctionFromName_Post FunctionFromName_Post +// #define FN_NameForFunction_Post NameForFunction_Post +// #define FN_ClientPrintf_Post ClientPrintf_Post +// #define FN_ServerPrint_Post ServerPrint_Post +// #define FN_Cmd_Args_Post Cmd_Args_Post +// #define FN_Cmd_Argv_Post Cmd_Argv_Post +// #define FN_Cmd_Argc_Post Cmd_Argc_Post +// #define FN_GetAttachment_Post GetAttachment_Post +// #define FN_CRC32_Init_Post CRC32_Init_Post +// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post +// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post +// #define FN_CRC32_Final_Post CRC32_Final_Post +// #define FN_RandomLong_Post RandomLong_Post +// #define FN_RandomFloat_Post RandomFloat_Post +// #define FN_SetView_Post SetView_Post +// #define FN_Time_Post Time_Post +// #define FN_CrosshairAngle_Post CrosshairAngle_Post +// #define FN_LoadFileForMe_Post LoadFileForMe_Post +// #define FN_FreeFile_Post FreeFile_Post +// #define FN_EndSection_Post EndSection_Post +// #define FN_CompareFileTime_Post CompareFileTime_Post +// #define FN_GetGameDir_Post GetGameDir_Post +// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post +// #define FN_FadeClientVolume_Post FadeClientVolume_Post +// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post +// #define FN_CreateFakeClient_Post CreateFakeClient_Post +// #define FN_RunPlayerMove_Post RunPlayerMove_Post +// #define FN_NumberOfEntities_Post NumberOfEntities_Post +// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post +// #define FN_InfoKeyValue_Post InfoKeyValue_Post +// #define FN_SetKeyValue_Post SetKeyValue_Post +// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post +// #define FN_IsMapValid_Post IsMapValid_Post +// #define FN_StaticDecal_Post StaticDecal_Post +// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post +// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post +// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post +// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post +// #define FN_CVarGetPointer_Post CVarGetPointer_Post +// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post +// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post +// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post +// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post +// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post +// #define FN_PrecacheEvent_Post PrecacheEvent_Post +// #define FN_PlaybackEvent_Post PlaybackEvent_Post +// #define FN_SetFatPVS_Post SetFatPVS_Post +// #define FN_SetFatPAS_Post SetFatPAS_Post +// #define FN_CheckVisibility_Post CheckVisibility_Post +// #define FN_DeltaSetField_Post DeltaSetField_Post +// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post +// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post +// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post +// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post +// #define FN_DeltaFindField_Post DeltaFindField_Post +// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post +// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post +// #define FN_SetGroupMask_Post SetGroupMask_Post +// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post +// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post +// #define FN_ForceUnmodified_Post ForceUnmodified_Post +// #define FN_GetPlayerStats_Post GetPlayerStats_Post +// #define FN_AddServerCommand_Post AddServerCommand_Post +// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post +// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post +// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post + +// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData +// #define FN_GameShutdown GameShutdown +// #define FN_ShouldCollide ShouldCollide + +// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post +// #define FN_GameShutdown_Post GameShutdown_Post +// #define FN_ShouldCollide_Post ShouldCollide_Post + + +#endif // USE_METAMOD + +#endif // __MODULECONFIG_H__ diff --git a/dlls/hamsandwich/msvc10/hamsandwich.vcxproj b/dlls/hamsandwich/msvc10/hamsandwich.vcxproj index 4cfb4428..9d293d23 100644 --- a/dlls/hamsandwich/msvc10/hamsandwich.vcxproj +++ b/dlls/hamsandwich/msvc10/hamsandwich.vcxproj @@ -52,7 +52,7 @@ Disabled - ..\;..\sdk;..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;HAMSANDWICH_EXPORTS; HAVE_STDINT_H;%(PreprocessorDefinitions) true EnableFastChecks @@ -77,7 +77,7 @@ - ..\;..\sdk;..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;HAMSANDWICH_EXPORTS; HAVE_STDINT_H;%(PreprocessorDefinitions) MultiThreaded false @@ -101,7 +101,7 @@ - + @@ -118,11 +118,8 @@ - - - - - + + diff --git a/dlls/hamsandwich/msvc10/hamsandwich.vcxproj.filters b/dlls/hamsandwich/msvc10/hamsandwich.vcxproj.filters index d55677bc..08a62575 100644 --- a/dlls/hamsandwich/msvc10/hamsandwich.vcxproj.filters +++ b/dlls/hamsandwich/msvc10/hamsandwich.vcxproj.filters @@ -13,9 +13,6 @@ {4fb419c2-3177-4389-9713-a7b032b57c1c} - - {a97b8a80-4ea7-4972-ab41-235e19831dff} - {f626de6a-9bea-468b-97e9-4f5d62307d78} @@ -47,9 +44,6 @@ Hooks - - Module SDK\SDK Base - Config File @@ -68,6 +62,9 @@ Hooks + + Module SDK\SDK Base + @@ -94,21 +91,6 @@ Hooks\Trampolines - - Module SDK - - - Module SDK\SDK Base - - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - Data Handler @@ -127,6 +109,12 @@ Hooks + + Module SDK\SDK Base + + + Module SDK + diff --git a/dlls/hamsandwich/sdk/CString.h b/dlls/hamsandwich/sdk/CString.h deleted file mode 100644 index 745457ba..00000000 --- a/dlls/hamsandwich/sdk/CString.h +++ /dev/null @@ -1,391 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef _INCLUDE_CSTRING_H -#define _INCLUDE_CSTRING_H - -#include -#include - -//by David "BAILOPAN" Anderson -class String -{ -public: - String() - { - v = NULL; - a_size = 0; - //assign(""); - } - - ~String() - { - if (v) - delete [] v; - } - - String(const char *src) - { - v = NULL; - a_size = 0; - assign(src); - } - - const char * _fread(FILE *fp) - { - Grow(512, false); - char *ret = fgets(v, 511, fp); - return ret; - } - - String(const String &src) - { - v = NULL; - a_size = 0; - assign(src.c_str()); - } - - const char *c_str() { return v?v:""; } - - const char *c_str() const { return v?v:""; } - - void append(const char *t) - { - Grow(size() + strlen(t) + 1); - strcat(v, t); - } - - void append(const char c) - { - size_t len = size(); - Grow(len + 2); - v[len] = c; - v[len + 1] = '\0'; - } - - void append(String &d) - { - append(d.c_str()); - } - - void assign(const String &src) - { - assign(src.c_str()); - } - - void assign(const char *d) - { - if (!d) - { - clear(); - } else { - size_t len = strlen(d); - Grow(len + 1, false); - memcpy(v, d, len); - v[len] = '\0'; - } - } - - void clear() - { - if (v) - v[0] = '\0'; - } - - int compare (const char *d) const - { - if (!v) - return strcmp("", d); - else - return strcmp(v, d); - } - - //Added this for amxx inclusion - bool empty() const - { - if (!v) - return true; - - if (v[0] == '\0') - return true; - - return false; - } - - size_t size() const - { - if (v) - return strlen(v); - else - return 0; - } - - int find(const char c, int index = 0) - { - int len = static_cast(size()); - if (len < 1) - return npos; - if (index >= len || index < 0) - return npos; - int i = 0; - for (i=index; i len-start) - num = len - start; - //do the erasing - bool copyflag = false; - for (i=0; i=start && i= len || !v) - return ns; - - if (num == npos) - { - num = len - index; - } else if (index+num >= len) { - num = len - index; - } - - unsigned int i = 0; - unsigned int nslen = num + 2; - - ns.Grow(nslen); - - for (i=index; i= 65 && v[i] <= 90) - v[i] &= ~(1<<5); - } - } - - String & operator = (const String &src) - { - assign(src); - return *this; - } - - String & operator = (const char *src) - { - assign(src); - return *this; - - } - - char operator [] (unsigned int index) - { - if (index > size() || !v) - { - return -1; - } else { - return v[index]; - } - } - - int at(int a) - { - if (a < 0 || a >= (int)size() || !v) - return -1; - - return v[a]; - } - - bool at(int at, char c) - { - if (at < 0 || at >= (int)size() || !v) - return false; - - v[at] = c; - - return true; - } - -private: - void Grow(unsigned int d, bool copy=true) - { - if (d <= a_size) - return; - char *n = new char[d + 1]; - if (copy && v) - strcpy(n, v); - if (v) - delete [] v; - else - strcpy(n, ""); - v = n; - a_size = d + 1; - } - - char *v; - unsigned int a_size; -public: - static const int npos = -1; -}; - -#endif //_INCLUDE_CSTRING_H diff --git a/dlls/hamsandwich/sdk/CVector.h b/dlls/hamsandwich/sdk/CVector.h deleted file mode 100644 index da13eceb..00000000 --- a/dlls/hamsandwich/sdk/CVector.h +++ /dev/null @@ -1,480 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef __CVECTOR_H__ -#define __CVECTOR_H__ - -#include - -// Vector -template class CVector -{ - bool Grow(size_t amount) - { - // automatic grow - size_t newSize = m_Size * 2; - - if (newSize == 0) - { - newSize = 8; - } - - while (m_CurrentUsedSize + amount > newSize) - { - newSize *= 2; - } - T *newData = new T[newSize]; - if (!newData) - return false; - if (m_Data) - { - for (size_t i=0; i= m_Size) - { - return Grow(amount); - } - else - { - return true; - } - } - - bool ChangeSize(size_t size) - { - // change size - if (size == m_Size) - return true; - - if (!size) - { - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - m_Size = 0; - } - return true; - } - - T *newData = new T[size]; - if (!newData) - return false; - if (m_Data) - { - size_t end = (m_CurrentUsedSize < size) ? (m_CurrentUsedSize) : size; - for (size_t i=0; i m_Size) - m_CurrentUsedSize = m_Size; - - return true; - } - - void FreeMemIfPossible() - { - if (!m_Data) - return; - - if (!m_CurrentUsedSize) - { - ChangeSize(0); - return; - } - - size_t newSize = m_Size; - while (m_CurrentUsedSize <= newSize / 2) - newSize /= 2; - - if (newSize != m_Size) - ChangeSize(newSize); - } -protected: - T *m_Data; - size_t m_Size; - size_t m_CurrentUsedSize; -public: - class iterator - { - protected: - T *m_Ptr; - public: - // constructors / destructors - iterator() - { - m_Ptr = NULL; - } - - iterator(T * ptr) - { - m_Ptr = ptr; - } - - // member functions - T * base() - { - return m_Ptr; - } - - const T * base() const - { - return m_Ptr; - } - - // operators - T & operator*() - { - return *m_Ptr; - } - - T * operator->() - { - return m_Ptr; - } - - iterator & operator++() // preincrement - { - ++m_Ptr; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Ptr; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Ptr; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Ptr; - return tmp; - } - - bool operator==(T * right) const - { - return (m_Ptr == right); - } - - bool operator==(const iterator & right) const - { - return (m_Ptr == right.m_Ptr); - } - - bool operator!=(T * right) const - { - return (m_Ptr != right); - } - - bool operator!=(const iterator & right) const - { - return (m_Ptr != right.m_Ptr); - } - - iterator & operator+=(size_t offset) - { - m_Ptr += offset; - return (*this); - } - - iterator & operator-=(size_t offset) - { - m_Ptr -= offset; - return (*this); - } - - iterator operator+(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr += offset; - return tmp; - } - - iterator operator-(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr -= offset; - return tmp; - } - - T & operator[](size_t offset) - { - return (*(*this + offset)); - } - - const T & operator[](size_t offset) const - { - return (*(*this + offset)); - } - - bool operator<(const iterator & right) const - { - return m_Ptr < right.m_Ptr; - } - - bool operator>(const iterator & right) const - { - return m_Ptr > right.m_Ptr; - } - - bool operator<=(const iterator & right) const - { - return m_Ptr <= right.m_Ptr; - } - - bool operator>=(const iterator & right) const - { - return m_Ptr >= right.m_Ptr; - } - - size_t operator-(const iterator & right) const - { - return m_Ptr - right.m_Ptr; - } - }; - - // constructors / destructors - CVector() - { - m_Size = 0; - m_CurrentUsedSize = 0; - m_Data = NULL; - } - - CVector(const CVector & other) - { - // copy data - m_Data = new T [other.m_CurrentUsedSize]; - m_Size = other.m_CurrentUsedSize; - m_CurrentUsedSize = other.m_CurrentUsedSize; - for (size_t i=0; i() - { - clear(); - } - - // interface - size_t size() const - { - return m_CurrentUsedSize; - } - - size_t capacity() const - { - return m_Size; - } - - iterator begin() const - { - return iterator(m_Data); - } - - iterator end() const - { - return iterator(m_Data + m_CurrentUsedSize); - } - - iterator iterAt(size_t pos) - { - if (pos > m_CurrentUsedSize) - assert(0); - return iterator(m_Data + pos); - } - - bool reserve(size_t newSize) - { - if (newSize > m_Size) - return ChangeSize(newSize); - return true; - } - - bool push_back(const T & elem) - { - if (!GrowIfNeeded(1)) - { - return false; - } - - m_Data[m_CurrentUsedSize++] = elem; - - return true; - } - - void pop_back() - { - --m_CurrentUsedSize; - if (m_CurrentUsedSize < 0) - m_CurrentUsedSize = 0; - - FreeMemIfPossible(); - } - - bool resize(size_t newSize) - { - if (!ChangeSize(newSize)) - return false; - m_CurrentUsedSize = newSize; - return true; - } - - bool empty() const - { - return (m_CurrentUsedSize == 0); - } - - T & at(size_t pos) - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - const T & at(size_t pos) const - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - T & operator[](size_t pos) - { - return at(pos); - } - - const T & operator[](size_t pos) const - { - return at(pos); - } - - T & front() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - const T & front() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - T & back() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - const T & back() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - iterator insert(iterator where, const T & value) - { - // validate iter - if (where < m_Data || where > (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (!GrowIfNeeded(1)) - { - return false; - } - - ++m_CurrentUsedSize; - - where = begin() + ofs; - - // Move subsequent entries - for (T *ptr = m_Data + m_CurrentUsedSize - 2; ptr >= where.base(); --ptr) - *(ptr + 1) = *ptr; - - *where.base() = value; - - return where; - } - - iterator erase(iterator where) - { - // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (m_CurrentUsedSize > 1) - { - // move - T *theend = m_Data + m_CurrentUsedSize; - for (T *ptr = where.base() + 1; ptr < theend; ++ptr) - *(ptr - 1) = *ptr; - } - - --m_CurrentUsedSize; - - FreeMemIfPossible(); - - return begin() + ofs; - } - - void clear() - { - m_Size = 0; - m_CurrentUsedSize = 0; - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - } - } -}; - -#endif // __CVECTOR_H__ - diff --git a/dlls/hamsandwich/sdk/amxxmodule.cpp b/dlls/hamsandwich/sdk/amxxmodule.cpp deleted file mode 100644 index 864d68a5..00000000 --- a/dlls/hamsandwich/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/hamsandwich/sdk/amxxmodule.h b/dlls/hamsandwich/sdk/amxxmodule.h deleted file mode 100644 index 8cb820fa..00000000 --- a/dlls/hamsandwich/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/hamsandwich/sdk/sh_stack.h b/dlls/hamsandwich/sdk/sh_stack.h deleted file mode 100644 index c01021f7..00000000 --- a/dlls/hamsandwich/sdk/sh_stack.h +++ /dev/null @@ -1,219 +0,0 @@ -/* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): Pavol "PM OnoTo" Marko -* ============================ -*/ - -#ifndef __SH_STACK_H__ -#define __SH_STACK_H__ - -#define SH_STACK_DEFAULT_SIZE 4 - -//namespace SourceHook -//{/ - // Vector - template class CStack - { - T *m_Elements; - size_t m_AllocatedSize; - size_t m_UsedSize; - public: - friend class iterator; - class iterator - { - CStack *m_pParent; - size_t m_Index; - public: - iterator(CStack *pParent, size_t id) : m_pParent(pParent), m_Index(id) - { - } - - iterator(CStack *pParent) : m_pParent(pParent), m_Index(0) - { - } - - iterator() : m_pParent(NULL), m_Index(0) - { - } - - T &operator *() - { - return m_pParent->m_Elements[m_Index]; - } - const T &operator *() const - { - return m_pParent->m_Elements[m_Index]; - } - - T * operator->() - { - return m_pParent->m_Elements + m_Index; - } - - const T * operator->() const - { - return m_pParent->m_Elements + m_Index; - } - - iterator & operator++() // preincrement - { - ++m_Index; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Index; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Index; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Index; - return tmp; - } - - bool operator==(const iterator & right) const - { - return (m_pParent == right.m_pParent && m_Index == right.m_Index); - } - - bool operator!=(const iterator & right) const - { - return !(*this == right); - } - }; - CStack() : m_Elements(new T[SH_STACK_DEFAULT_SIZE]), - m_AllocatedSize(SH_STACK_DEFAULT_SIZE), - m_UsedSize(0) - { - } - CStack(size_t size) : m_Elements(new T[size]), - m_AllocatedSize(size), - m_UsedSize(0) - { - } - - CStack(const CStack &other) : m_Elements(NULL), - m_AllocatedSize(0), - m_UsedSize(0) - { - reserve(other.m_AllocatedSize); - m_UsedSize = other.m_UsedSize; - for (size_t i = 0; i < m_UsedSize; ++i) - m_Elements[i] = other.m_Elements[i]; - } - - ~CStack() - { - if (m_Elements) - delete [] m_Elements; - } - - void operator=(const CStack &other) - { - if (m_AllocatedSize < other.m_AllocatedSize) - { - if (m_Elements) - delete [] m_Elements; - m_Elements = new T[other.m_AllocatedSize]; - m_AllocatedSize = other.m_AllocatedSize; - } - m_UsedSize = other.m_UsedSize; - for (size_t i = 0; i < m_UsedSize; ++i) - m_Elements[i] = other.m_Elements[i]; - } - - bool push(const T &val) - { - if (m_UsedSize + 1 == m_AllocatedSize) - { - // zOHNOES! REALLOCATE! - m_AllocatedSize *= 2; - T *newElements = new T[m_AllocatedSize]; - if (!newElements) - { - m_AllocatedSize /= 2; - return false; - } - if (m_Elements) - { - for (size_t i = 0; i < m_UsedSize; ++i) - newElements[i] = m_Elements[i]; - delete [] m_Elements; - } - m_Elements = newElements; - } - m_Elements[m_UsedSize++] = val; - return true; - } - void pop() - { - --m_UsedSize; - } - - T &front() - { - return m_Elements[m_UsedSize - 1]; - } - - const T &front() const - { - return m_Elements[m_UsedSize - 1]; - } - - iterator begin() - { - return iterator(this, 0); - } - iterator end() - { - return iterator(this, m_UsedSize); - } - - size_t size() - { - return m_UsedSize; - } - size_t capacity() - { - return m_AllocatedSize; - } - bool empty() - { - return m_UsedSize == 0 ? true : false; - } - bool reserve(size_t size) - { - if (size > m_AllocatedSize) - { - T *newElements = new T[size]; - if (!newElements) - return false; - if (m_Elements) - { - for (size_t i = 0; i < m_UsedSize; ++i) - newElements[i] = m_Elements[i]; - delete [] m_Elements; - } - m_Elements = newElements; - m_AllocatedSize = size; - } - return true; - } - }; -//}; //namespace SourceHook - -#endif diff --git a/dlls/hamsandwich/srvcmd.cpp b/dlls/hamsandwich/srvcmd.cpp index e03f3093..62d1ea70 100644 --- a/dlls/hamsandwich/srvcmd.cpp +++ b/dlls/hamsandwich/srvcmd.cpp @@ -12,11 +12,8 @@ // #include "amxxmodule.h" - #include - -#include "CVector.h" - +#include #include "ham_const.h" #include "hooklist.h" #include "offsets.h" @@ -25,7 +22,7 @@ extern hook_t hooklist[]; -extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; +extern ke::Vector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; void print_srvconsole(const char *fmt, ...) { @@ -95,16 +92,12 @@ void HamCommand(void) int count = 0; for (int i=0; i::iterator end=hooks[i].end(); - - for (CVector::iterator j=hooks[i].begin(); - j!=end; - ++j) + for (size_t j = 0; j < hooks[i].length(); ++i) { HookCount++; - ForwardCount+=(*j)->pre.size() + (*j)->post.size(); + ForwardCount += hooks[i].at(j)->pre.length() + hooks[i].at(j)->post.length(); - print_srvconsole("%-24s | %-27s | %10d | %10d\n",hooklist[i].name, (*j)->ent, (*j)->pre.size(), (*j)->post.size()); + print_srvconsole("%-24s | %-27s | %10d | %10d\n", hooklist[i].name, hooks[i].at(j)->ent, hooks[i].at(j)->pre.length(), hooks[i].at(j)->post.length()); if (count >= 5) { print_srvconsole("--------------------------------------------------------------------------------\n"); diff --git a/dlls/hamsandwich/typetocell.h b/dlls/hamsandwich/typetocell.h index 63ddefea..f428d078 100644 --- a/dlls/hamsandwich/typetocell.h +++ b/dlls/hamsandwich/typetocell.h @@ -17,8 +17,6 @@ #include #include "amxxmodule.h" -#include "CVector.h" - #include "hook.h" #include "forward.h" diff --git a/dlls/mysqlx/AMBuilder b/dlls/mysqlx/AMBuilder index 29946890..3ebb7cfb 100644 --- a/dlls/mysqlx/AMBuilder +++ b/dlls/mysqlx/AMBuilder @@ -34,7 +34,7 @@ if AMXX.mysql_path: 'handles.cpp', 'module.cpp', 'threading.cpp', - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'oldcompat_sql.cpp', 'thread/BaseWorker.cpp', 'thread/ThreadWorker.cpp', diff --git a/dlls/mysqlx/Makefile b/dlls/mysqlx/Makefile index 3213b29d..ef097389 100755 --- a/dlls/mysqlx/Makefile +++ b/dlls/mysqlx/Makefile @@ -8,6 +8,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod MYSQL_DIR = ../../../mysql-5.0 +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -15,7 +16,7 @@ MYSQL_DIR = ../../../mysql-5.0 PROJECT = mysql -OBJECTS = basic_sql.cpp handles.cpp module.cpp threading.cpp sdk/amxxmodule.cpp oldcompat_sql.cpp \ +OBJECTS = basic_sql.cpp handles.cpp module.cpp threading.cpp amxxmodule.cpp oldcompat_sql.cpp \ thread/BaseWorker.cpp thread/ThreadWorker.cpp thread/PosixThreads.cpp \ mysql/MysqlQuery.cpp mysql/MysqlResultSet.cpp mysql/MysqlDatabase.cpp mysql/MysqlDriver.cpp @@ -32,8 +33,10 @@ CPP_OSX = clang LINK = $(MYSQL_DIR)/lib/libmysqlclient_r.a -lz -lpthread -L$(MYSQL_DIR)/lib -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -I$(MYSQL_DIR)/include -Ithread -Imysql -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MYSQL_DIR)/include -Ithread -Imysql \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -111,7 +114,7 @@ all: mkdir -p $(BIN_DIR) mkdir -p $(BIN_DIR)/mysql mkdir -p $(BIN_DIR)/thread - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -126,6 +129,5 @@ clean: rm -rf $(BIN_DIR)/*.o rm -rf $(BIN_DIR)/mysql/*.o rm -rf $(BIN_DIR)/thread/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/mysqlx/basic_sql.cpp b/dlls/mysqlx/basic_sql.cpp index da4d7e12..b2cdebc7 100644 --- a/dlls/mysqlx/basic_sql.cpp +++ b/dlls/mysqlx/basic_sql.cpp @@ -12,12 +12,10 @@ // #include -#include "sh_list.h" #include "mysql2_header.h" #include "sqlheaders.h" using namespace SourceMod; -using namespace SourceHook; MysqlDriver g_Mysql; diff --git a/dlls/mysqlx/handles.cpp b/dlls/mysqlx/handles.cpp index b48b33f7..db251638 100644 --- a/dlls/mysqlx/handles.cpp +++ b/dlls/mysqlx/handles.cpp @@ -12,8 +12,8 @@ // #include -#include "sh_stack.h" -#include "CVector.h" +#include +#include #include "mysql2_header.h" struct QHandle @@ -24,7 +24,7 @@ struct QHandle bool isfree; }; -CVector g_Handles; +ke::Vector g_Handles; CStack g_FreeHandles; unsigned int MakeHandle(void *ptr, HandleType type, FREEHANDLE f) @@ -39,8 +39,8 @@ unsigned int MakeHandle(void *ptr, HandleType type, FREEHANDLE f) h = g_Handles[num]; } else { h = new QHandle; - g_Handles.push_back(h); - num = static_cast(g_Handles.size()) - 1; + g_Handles.append(h); + num = static_cast(g_Handles.length()) - 1; } h->_ptr = ptr; @@ -57,7 +57,7 @@ void *GetHandle(unsigned int num, HandleType type) return NULL; num--; - if (num >= g_Handles.size()) + if (num >= g_Handles.length()) return NULL; QHandle *h = g_Handles[num]; @@ -75,7 +75,7 @@ bool FreeHandle(unsigned int num) unsigned int _num = num; num--; - if (num >= g_Handles.size()) + if (num >= g_Handles.length()) return false; QHandle *h = g_Handles[num]; @@ -95,7 +95,7 @@ bool FreeHandle(unsigned int num) void FreeAllHandles(HandleType type) { QHandle *q; - for (size_t i = 0; i < g_Handles.size(); i++) + for (size_t i = 0; i < g_Handles.length(); i++) { q = g_Handles[i]; if (q && !q->isfree && q->type == type) @@ -108,7 +108,7 @@ void FreeAllHandles(HandleType type) void FreeHandleTable() { QHandle *q; - for (size_t i = 0; i < g_Handles.size(); i++) + for (size_t i = 0; i < g_Handles.length(); i++) { q = g_Handles[i]; if (q && !q->isfree) diff --git a/dlls/mysqlx/sdk/moduleconfig.h b/dlls/mysqlx/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/mysqlx/sdk/moduleconfig.h rename to dlls/mysqlx/moduleconfig.h diff --git a/dlls/mysqlx/msvc10/mysqlx.vcxproj b/dlls/mysqlx/msvc10/mysqlx.vcxproj index 5b31016f..da7a9d30 100644 --- a/dlls/mysqlx/msvc10/mysqlx.vcxproj +++ b/dlls/mysqlx/msvc10/mysqlx.vcxproj @@ -52,8 +52,8 @@ Disabled - ..\;..\..\..\..\mysql-5.0\include;..\mysql;..\sdk;..\thread;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\public;$(MYSQL5)\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;MYSQL2_EXPORTS;SM_DEFAULT_THREADER;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;..\..\..\..\mysql-5.0\include;..\mysql;..\sdk;..\thread;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\public;$(MYSQL5)\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;MYSQL2_EXPORTS;SM_DEFAULT_THREADER;HAVE_STDINT_H;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug @@ -75,8 +75,8 @@ - ..\;..\..\..\..\mysql-5.0\include;..\mysql;..\sdk;..\thread;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\public;$(MYSQL5)\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;MYSQL2_EXPORTS;SM_DEFAULT_THREADER;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;..\..\..\..\mysql-5.0\include;..\mysql;..\sdk;..\thread;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\public;$(MYSQL5)\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;MYSQL2_EXPORTS;SM_DEFAULT_THREADER;HAVE_STDINT_H;%(PreprocessorDefinitions) MultiThreaded false @@ -108,12 +108,11 @@ - + - @@ -126,11 +125,8 @@ - - - - - + + diff --git a/dlls/mysqlx/msvc10/mysqlx.vcxproj.filters b/dlls/mysqlx/msvc10/mysqlx.vcxproj.filters index e93be133..1e6c0ca3 100644 --- a/dlls/mysqlx/msvc10/mysqlx.vcxproj.filters +++ b/dlls/mysqlx/msvc10/mysqlx.vcxproj.filters @@ -30,9 +30,6 @@ {15c62ca4-f448-4a1e-8277-9bee3e572408} - - {915eac13-018c-4e63-b9b1-080e89173ce6} - {41c3be98-7cfc-4071-b7fd-be17c2ee7279} @@ -77,7 +74,7 @@ Database\Source Files - + Module SDK\SDK Base @@ -88,9 +85,6 @@ Header Files - - Header Files - Header Files @@ -127,19 +121,10 @@ Database\Header Files - + Module SDK - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - - + Module SDK\SDK Base diff --git a/dlls/mysqlx/oldcompat_sql.cpp b/dlls/mysqlx/oldcompat_sql.cpp index bd82a733..0a535993 100644 --- a/dlls/mysqlx/oldcompat_sql.cpp +++ b/dlls/mysqlx/oldcompat_sql.cpp @@ -12,7 +12,6 @@ // #include -#include "sh_list.h" #include "mysql2_header.h" using namespace SourceMod; diff --git a/dlls/mysqlx/sdk/CVector.h b/dlls/mysqlx/sdk/CVector.h deleted file mode 100755 index 44241413..00000000 --- a/dlls/mysqlx/sdk/CVector.h +++ /dev/null @@ -1,480 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef __CVECTOR_H__ -#define __CVECTOR_H__ - -#include - -// Vector -template class CVector -{ - bool Grow(size_t amount) - { - // automatic grow - size_t newSize = m_Size * 2; - - if (newSize == 0) - { - newSize = 8; - } - - while (m_CurrentUsedSize + amount > newSize) - { - newSize *= 2; - } - T *newData = new T[newSize]; - if (!newData) - return false; - if (m_Data) - { - for (size_t i=0; i= m_Size) - { - return Grow(amount); - } - else - { - return true; - } - } - - bool ChangeSize(size_t size) - { - // change size - if (size == m_Size) - return true; - - if (!size) - { - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - m_Size = 0; - } - return true; - } - - T *newData = new T[size]; - if (!newData) - return false; - if (m_Data) - { - size_t end = (m_CurrentUsedSize < size) ? (m_CurrentUsedSize) : size; - for (size_t i=0; i m_Size) - m_CurrentUsedSize = m_Size; - - return true; - } - - void FreeMemIfPossible() - { - if (!m_Data) - return; - - if (!m_CurrentUsedSize) - { - ChangeSize(0); - return; - } - - size_t newSize = m_Size; - while (m_CurrentUsedSize <= newSize / 2) - newSize /= 2; - - if (newSize != m_Size) - ChangeSize(newSize); - } -protected: - T *m_Data; - size_t m_Size; - size_t m_CurrentUsedSize; -public: - class iterator - { - protected: - T *m_Ptr; - public: - // constructors / destructors - iterator() - { - m_Ptr = NULL; - } - - iterator(T * ptr) - { - m_Ptr = ptr; - } - - // member functions - T * base() - { - return m_Ptr; - } - - const T * base() const - { - return m_Ptr; - } - - // operators - T & operator*() - { - return *m_Ptr; - } - - T * operator->() - { - return m_Ptr; - } - - iterator & operator++() // preincrement - { - ++m_Ptr; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Ptr; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Ptr; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Ptr; - return tmp; - } - - bool operator==(T * right) const - { - return (m_Ptr == right); - } - - bool operator==(const iterator & right) const - { - return (m_Ptr == right.m_Ptr); - } - - bool operator!=(T * right) const - { - return (m_Ptr != right); - } - - bool operator!=(const iterator & right) const - { - return (m_Ptr != right.m_Ptr); - } - - iterator & operator+=(size_t offset) - { - m_Ptr += offset; - return (*this); - } - - iterator & operator-=(size_t offset) - { - m_Ptr -= offset; - return (*this); - } - - iterator operator+(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr += offset; - return tmp; - } - - iterator operator-(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr -= offset; - return tmp; - } - - T & operator[](size_t offset) - { - return (*(*this + offset)); - } - - const T & operator[](size_t offset) const - { - return (*(*this + offset)); - } - - bool operator<(const iterator & right) const - { - return m_Ptr < right.m_Ptr; - } - - bool operator>(const iterator & right) const - { - return m_Ptr > right.m_Ptr; - } - - bool operator<=(const iterator & right) const - { - return m_Ptr <= right.m_Ptr; - } - - bool operator>=(const iterator & right) const - { - return m_Ptr >= right.m_Ptr; - } - - size_t operator-(const iterator & right) const - { - return m_Ptr - right.m_Ptr; - } - }; - - // constructors / destructors - CVector() - { - m_Size = 0; - m_CurrentUsedSize = 0; - m_Data = NULL; - } - - CVector(const CVector & other) - { - // copy data - m_Data = new T [other.m_CurrentUsedSize]; - m_Size = other.m_CurrentUsedSize; - m_CurrentUsedSize = other.m_CurrentUsedSize; - for (size_t i=0; i() - { - clear(); - } - - // interface - size_t size() const - { - return m_CurrentUsedSize; - } - - size_t capacity() const - { - return m_Size; - } - - iterator begin() const - { - return iterator(m_Data); - } - - iterator end() const - { - return iterator(m_Data + m_CurrentUsedSize); - } - - iterator iterAt(size_t pos) - { - if (pos > m_CurrentUsedSize) - assert(0); - return iterator(m_Data + pos); - } - - bool reserve(size_t newSize) - { - if (newSize > m_Size) - return ChangeSize(newSize); - return true; - } - - bool push_back(const T & elem) - { - if (!GrowIfNeeded(1)) - { - return false; - } - - m_Data[m_CurrentUsedSize++] = elem; - - return true; - } - - void pop_back() - { - --m_CurrentUsedSize; - if (m_CurrentUsedSize < 0) - m_CurrentUsedSize = 0; - - FreeMemIfPossible(); - } - - bool resize(size_t newSize) - { - if (!ChangeSize(newSize)) - return false; - m_CurrentUsedSize = newSize; - return true; - } - - bool empty() const - { - return (m_CurrentUsedSize == 0); - } - - T & at(size_t pos) - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - const T & at(size_t pos) const - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - T & operator[](size_t pos) - { - return at(pos); - } - - const T & operator[](size_t pos) const - { - return at(pos); - } - - T & front() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - const T & front() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - T & back() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - const T & back() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - iterator insert(iterator where, const T & value) - { - // validate iter - if (where < m_Data || where > (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (!GrowIfNeeded(1)) - { - return false; - } - - ++m_CurrentUsedSize; - - where = begin() + ofs; - - // Move subsequent entries - for (T *ptr = m_Data + m_CurrentUsedSize - 2; ptr >= where.base(); --ptr) - *(ptr + 1) = *ptr; - - *where.base() = value; - - return where; - } - - iterator erase(iterator where) - { - // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (m_CurrentUsedSize > 1) - { - // move - T *theend = m_Data + m_CurrentUsedSize; - for (T *ptr = where.base() + 1; ptr < theend; ++ptr) - *(ptr - 1) = *ptr; - } - - --m_CurrentUsedSize; - - FreeMemIfPossible(); - - return begin() + ofs; - } - - void clear() - { - m_Size = 0; - m_CurrentUsedSize = 0; - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - } - } -}; - -#endif // __CVECTOR_H__ - diff --git a/dlls/mysqlx/sdk/amxxmodule.cpp b/dlls/mysqlx/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/mysqlx/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/mysqlx/sdk/amxxmodule.h b/dlls/mysqlx/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/mysqlx/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/mysqlx/thread/BaseWorker.cpp b/dlls/mysqlx/thread/BaseWorker.cpp index f02758a4..e8e9e474 100644 --- a/dlls/mysqlx/thread/BaseWorker.cpp +++ b/dlls/mysqlx/thread/BaseWorker.cpp @@ -8,6 +8,7 @@ // https://alliedmods.net/amxmodx-license #include "BaseWorker.h" +#include BaseWorker::BaseWorker() : m_perFrame(SM_DEFAULT_THREADS_PER_FRAME), @@ -20,7 +21,7 @@ BaseWorker::~BaseWorker() if (m_state != Worker_Stopped || m_state != Worker_Invalid) Stop(true); - if (m_ThreadQueue.size()) + if (m_ThreadQueue.length()) Flush(true); } @@ -83,10 +84,10 @@ unsigned int BaseWorker::Flush(bool flush_cancel) SWThreadHandle *BaseWorker::PopThreadFromQueue() { - if (!m_ThreadQueue.size()) + if (!m_ThreadQueue.length()) return NULL; - SourceHook::List::iterator begin; + ke::LinkedList::iterator begin; SWThreadHandle *swt; begin = m_ThreadQueue.begin(); @@ -98,7 +99,7 @@ SWThreadHandle *BaseWorker::PopThreadFromQueue() void BaseWorker::AddThreadToQueue(SWThreadHandle *pHandle) { - m_ThreadQueue.push_back(pHandle); + m_ThreadQueue.append(pHandle); } unsigned int BaseWorker::GetMaxThreadsPerFrame() diff --git a/dlls/mysqlx/thread/BaseWorker.h b/dlls/mysqlx/thread/BaseWorker.h index b2a218cf..1dcfbc2a 100644 --- a/dlls/mysqlx/thread/BaseWorker.h +++ b/dlls/mysqlx/thread/BaseWorker.h @@ -10,7 +10,7 @@ #ifndef _INCLUDE_SOURCEMOD_BASEWORKER_H #define _INCLUDE_SOURCEMOD_BASEWORKER_H -#include "sh_list.h" +#include #include "ThreadSupport.h" #define SM_DEFAULT_THREADS_PER_FRAME 1 @@ -73,7 +73,7 @@ public: //BaseWorker virtual void SetMaxThreadsPerFrame(unsigned int threads); virtual unsigned int GetMaxThreadsPerFrame(); protected: - SourceHook::List m_ThreadQueue; + ke::LinkedList m_ThreadQueue; unsigned int m_perFrame; volatile WorkerState m_state; }; diff --git a/dlls/mysqlx/thread/ThreadWorker.cpp b/dlls/mysqlx/thread/ThreadWorker.cpp index a2393949..e7bb6f96 100644 --- a/dlls/mysqlx/thread/ThreadWorker.cpp +++ b/dlls/mysqlx/thread/ThreadWorker.cpp @@ -43,7 +43,7 @@ ThreadWorker::~ThreadWorker() if (m_state != Worker_Stopped || m_state != Worker_Invalid) Stop(true); - if (m_ThreadQueue.size()) + if (m_ThreadQueue.length()) Flush(true); } @@ -69,7 +69,7 @@ void ThreadWorker::RunThread(IThreadHandle *pHandle) if (this_state != Worker_Stopped) { m_QueueLock->Lock(); - num = m_ThreadQueue.size(); + num = m_ThreadQueue.length(); if (!num) { /** @@ -106,7 +106,7 @@ void ThreadWorker::RunThread(IThreadHandle *pHandle) // run all of the remaining frames first. if (!m_FlushType) { - while (m_ThreadQueue.size()) + while (m_ThreadQueue.length()) RunFrame(); } break; diff --git a/dlls/mysqlx/threading.cpp b/dlls/mysqlx/threading.cpp index 3dfa1301..ef642c72 100644 --- a/dlls/mysqlx/threading.cpp +++ b/dlls/mysqlx/threading.cpp @@ -16,7 +16,6 @@ #include "threading.h" using namespace SourceMod; -using namespace SourceHook; MainThreader g_Threader; ThreadWorker *g_pWorker = NULL; @@ -144,10 +143,10 @@ void MysqlThread::SetForward(int forward) void MysqlThread::SetInfo(const char *host, const char *user, const char *pass, const char *db, int port, unsigned int max_timeout) { - m_host.assign(host); - m_user.assign(user); - m_pass.assign(pass); - m_db.assign(db); + m_host = host; + m_user = user; + m_pass = pass; + m_db = db; m_max_timeout = max_timeout; m_port = port; m_qrInfo.queue_time = gpGlobals->time; @@ -155,25 +154,25 @@ void MysqlThread::SetInfo(const char *host, const char *user, const char *pass, void MysqlThread::SetCharacterSet(const char *charset) { - m_charset.assign(charset); + m_charset = charset; } void MysqlThread::SetQuery(const char *query) { - m_query.assign(query); + m_query = query; } void MysqlThread::RunThread(IThreadHandle *pHandle) { DatabaseInfo info; - info.database = m_db.c_str(); - info.pass = m_pass.c_str(); - info.user = m_user.c_str(); - info.host = m_host.c_str(); + info.database = m_db.chars(); + info.pass = m_pass.chars(); + info.user = m_user.chars(); + info.host = m_host.chars(); info.port = m_port; info.max_timeout = m_max_timeout; - info.charset = m_charset.c_str(); + info.charset = m_charset.chars(); float save_time = m_qrInfo.queue_time; @@ -191,7 +190,7 @@ void MysqlThread::RunThread(IThreadHandle *pHandle) else { m_qrInfo.connect_success = true; - pQuery = pDatabase->PrepareQuery(m_query.c_str()); + pQuery = pDatabase->PrepareQuery(m_query.chars()); if (!pQuery->Execute2(&m_qrInfo.amxinfo.info, m_qrInfo.amxinfo.error, 254)) { m_qrInfo.query_success = false; @@ -215,8 +214,8 @@ void MysqlThread::RunThread(IThreadHandle *pHandle) } m_qrInfo.amxinfo.pQuery = NULL; - m_qrInfo.amxinfo.opt_ptr = new char[m_query.size() + 1]; - strcpy(m_qrInfo.amxinfo.opt_ptr, m_query.c_str()); + m_qrInfo.amxinfo.opt_ptr = new char[m_query.length() + 1]; + strcpy(m_qrInfo.amxinfo.opt_ptr, m_query.chars()); if (pDatabase) { @@ -440,7 +439,7 @@ bool AtomicResult::FieldNameToNum(const char *name, unsigned int *columnId) for (unsigned int i=0; ic_str(), name) == 0) + if (strcmp(m_Table[i]->chars(), name) == 0) { if (columnId) { @@ -460,7 +459,7 @@ const char *AtomicResult::FieldNumToName(unsigned int num) assert(m_Table[num] != NULL); - return m_Table[num]->c_str(); + return m_Table[num]->chars(); } double AtomicResult::GetDouble(unsigned int columnId) @@ -501,7 +500,7 @@ const char *AtomicResult::GetString(unsigned int columnId) assert(m_Table[idx] != NULL); - return m_Table[idx]->c_str(); + return m_Table[idx]->chars(); } IResultRow *AtomicResult::GetRow() @@ -551,11 +550,11 @@ void AtomicResult::CopyFrom(IResultSet *rs) size_t newTotal = (m_RowCount * m_FieldCount) + m_FieldCount; if (newTotal > m_AllocSize) { - SourceHook::String **table = new SourceHook::String *[newTotal]; - memset(table, 0, newTotal * sizeof(SourceHook::String *)); + ke::AString **table = new ke::AString *[newTotal]; + memset(table, 0, newTotal * sizeof(ke::AString *)); if (m_Table) { - memcpy(table, m_Table, m_AllocSize * sizeof(SourceHook::String *)); + memcpy(table, m_Table, m_AllocSize * sizeof(ke::AString *)); delete [] m_Table; } m_Table = table; @@ -566,9 +565,9 @@ void AtomicResult::CopyFrom(IResultSet *rs) { if (m_Table[i]) { - m_Table[i]->assign(rs->FieldNumToName(i)); + *m_Table[i] = rs->FieldNumToName(i); } else { - m_Table[i] = new SourceHook::String(rs->FieldNumToName(i)); + m_Table[i] = new ke::AString(rs->FieldNumToName(i)); } } @@ -581,9 +580,9 @@ void AtomicResult::CopyFrom(IResultSet *rs) { if (m_Table[idx]) { - m_Table[idx]->assign(row->GetString(i)); + *m_Table[idx] = row->GetString(i); } else { - m_Table[idx] = new SourceHook::String(row->GetString(i)); + m_Table[idx] = new ke::AString(row->GetString(i)); } } rs->NextRow(); diff --git a/dlls/mysqlx/threading.h b/dlls/mysqlx/threading.h index 6949049d..ef99a30a 100644 --- a/dlls/mysqlx/threading.h +++ b/dlls/mysqlx/threading.h @@ -16,9 +16,8 @@ #include "IThreader.h" #include "ISQLDriver.h" -#include "sh_string.h" -#include "CVector.h" -#include "sh_stack.h" +#include +#include struct QueuedResultInfo { @@ -64,7 +63,7 @@ private: unsigned int m_RowCount; unsigned int m_FieldCount; size_t m_AllocSize; - SourceHook::String **m_Table; + ke::AString **m_Table; unsigned int m_CurRow; bool m_IsFree; }; @@ -86,13 +85,13 @@ public: void RunThread(IThreadHandle *pHandle); void OnTerminate(IThreadHandle *pHandle, bool cancel); private: - SourceHook::String m_query; - SourceHook::String m_host; - SourceHook::String m_user; - SourceHook::String m_pass; - SourceHook::String m_db; + ke::AString m_query; + ke::AString m_host; + ke::AString m_user; + ke::AString m_pass; + ke::AString m_db; unsigned int m_max_timeout; - SourceHook::String m_charset; + ke::AString m_charset; int m_port; cell *m_data; ucell m_datalen; diff --git a/dlls/ns/AMBuilder b/dlls/ns/AMBuilder index cb199fb9..10498892 100644 --- a/dlls/ns/AMBuilder +++ b/dlls/ns/AMBuilder @@ -3,8 +3,12 @@ import os.path binary = AMXX.MetaModule(builder, 'ns') +binary.compiler.defines += [ + 'HAVE_STDINT_H', +] + binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'dllapi.cpp', 'utils.cpp', 'amxxapi.cpp', diff --git a/dlls/ns/AllocString.h b/dlls/ns/AllocString.h index 6179227b..aca00519 100644 --- a/dlls/ns/AllocString.h +++ b/dlls/ns/AllocString.h @@ -23,13 +23,13 @@ #ifndef ALLOCSTRING_H #define ALLOCSTRING_H -#include "CString.h" -#include "sh_list.h" +#include +#include class StringManager { private: - List m_StringList; + ke::LinkedList m_StringList; public: /** @@ -38,8 +38,8 @@ public: */ inline void Clear(void) { - List::iterator end; - List::iterator iter; + ke::LinkedList::iterator end; + ke::LinkedList::iterator iter; iter=m_StringList.begin(); end=m_StringList.end(); @@ -59,30 +59,28 @@ public: */ inline int Allocate(const char *str) { - List::iterator end; - List::iterator iter; + ke::LinkedList::iterator end; + ke::LinkedList::iterator iter; iter=m_StringList.begin(); end=m_StringList.end(); while (iter!=end) { - if (strcmp(str, (*iter)->c_str()) == 0) + if (strcmp(str, (*iter)->chars()) == 0) { // String is already in the list, do not allocate it again - return MAKE_STRING((*iter)->c_str()); + return MAKE_STRING((*iter)->chars()); } ++iter; } // Was not found in the linked list, allocate it and add it to the list - String *AllocStr = new String; + ke::AString *AllocStr = new ke::AString(str); - AllocStr->assign(str); + m_StringList.append(AllocStr); - m_StringList.push_back(AllocStr); - - return MAKE_STRING(AllocStr->c_str()); + return MAKE_STRING(AllocStr->chars()); }; diff --git a/dlls/ns/CString.h b/dlls/ns/CString.h deleted file mode 100644 index f7c9c374..00000000 --- a/dlls/ns/CString.h +++ /dev/null @@ -1,406 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef _INCLUDE_CSTRING_H -#define _INCLUDE_CSTRING_H - -#include -#include -#include - -//by David "BAILOPAN" Anderson -class String -{ -public: - String() - { - v = new char[33]; - v[0]='\0'; - a_size = 0; - //assign(""); - } - - ~String() - { - delete [] v; - } - - String(const char *src) - { - v = NULL; - a_size = 0; - assign(src); - } - - const char * _fread(FILE *fp) - { - Grow(512, false); - char *ret = fgets(v, 511, fp); - return ret; - } - - String(const String &src) - { - v = NULL; - a_size = 0; - assign(src.c_str()); - } - - const char *c_str() { return v?v:""; } - - const char *c_str() const { return v?v:""; } - - void append(const char *t) - { - Grow(size() + strlen(t) + 1); - strcat(v, t); - } - - void append(const char c) - { - size_t len = size(); - Grow(len + 2); - v[len] = c; - v[len + 1] = '\0'; - } - - void append(String &d) - { - append(d.c_str()); - } - - void assign(const String &src) - { - assign(src.c_str()); - } - - void assign(const char *d) - { - if (!d) - { - clear(); - } else { - size_t len = strlen(d); - Grow(len + 1, false); - memcpy(v, d, len); - v[len] = '\0'; - } - } - - void clear() - { - if (v) - v[0] = '\0'; - } - - int compare (const char *d) const - { - if (!v) - return strcmp("", d); - else - return strcmp(v, d); - } - - //Added this for amxx inclusion - bool empty() const - { - if (!v) - return true; - - if (v[0] == '\0') - return true; - - return false; - } - - size_t size() const - { - if (v) - return strlen(v); - else - return 0; - } - - int find(const char c, int index = 0) - { - int len = static_cast(size()); - if (len < 1) - return npos; - if (index >= len || index < 0) - return npos; - int i = 0; - for (i=index; i len-start) - num = len - start; - //do the erasing - bool copyflag = false; - for (i=0; i=start && i= len || !v) - return ns; - - if (num == npos) - { - num = len - index; - } else if (index+num >= len) { - num = len - index; - } - - unsigned int i = 0; - unsigned int nslen = num + 2; - - ns.Grow(nslen); - - for (i=index; i= 65 && v[i] <= 90) - v[i] &= ~(1<<5); - } - } - - String & operator = (const String &src) - { - assign(src); - return *this; - } - - String & operator = (const char *src) - { - assign(src); - return *this; - - } - - char operator [] (unsigned int index) - { - if (index > size() || !v) - { - return -1; - } else { - return v[index]; - } - } - - int at(int a) - { - if (a < 0 || a >= (int)size() || !v) - return -1; - - return v[a]; - } - - bool at(int at, char c) - { - if (at < 0 || at >= (int)size() || !v) - return false; - - v[at] = c; - - return true; - } - -private: - void Grow(unsigned int d, bool copy=true) - { - if (d <= a_size) - return; - char *n = new char[d + 1]; - if (copy && v) - strcpy(n, v); - if (v) - delete [] v; - else - strcpy(n, ""); - v = n; - a_size = d + 1; - } - - char *v; - unsigned int a_size; -public: - static const int npos = -1; -}; - -#endif //_INCLUDE_CSTRING_H diff --git a/dlls/ns/CVector.h b/dlls/ns/CVector.h deleted file mode 100644 index 670c5cae..00000000 --- a/dlls/ns/CVector.h +++ /dev/null @@ -1,479 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef __CVECTOR_H__ -#define __CVECTOR_H__ - -#include - -// Vector -template class CVector -{ - bool Grow(size_t amount) - { - // automatic grow - size_t newSize = m_Size * 2; - - if (newSize == 0) - { - newSize = 8; - } - - while (m_CurrentUsedSize + amount > newSize) - { - newSize *= 2; - } - T *newData = new T[newSize]; - if (!newData) - return false; - if (m_Data) - { - for (size_t i=0; i= m_Size) - { - return Grow(amount); - } - else - { - return true; - } - } - - bool ChangeSize(size_t size) - { - // change size - if (size == m_Size) - return true; - - if (!size) - { - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - m_Size = 0; - } - return true; - } - - T *newData = new T[size]; - if (!newData) - return false; - if (m_Data) - { - size_t end = (m_CurrentUsedSize < size) ? (m_CurrentUsedSize) : size; - for (size_t i=0; i m_Size) - m_CurrentUsedSize = m_Size; - - return true; - } - - void FreeMemIfPossible() - { - if (!m_Data) - return; - - if (!m_CurrentUsedSize) - { - ChangeSize(0); - return; - } - - size_t newSize = m_Size; - while (m_CurrentUsedSize <= newSize / 2) - newSize /= 2; - - if (newSize != m_Size) - ChangeSize(newSize); - } -protected: - T *m_Data; - size_t m_Size; - size_t m_CurrentUsedSize; -public: - class iterator - { - protected: - T *m_Ptr; - public: - // constructors / destructors - iterator() - { - m_Ptr = NULL; - } - - iterator(T * ptr) - { - m_Ptr = ptr; - } - - // member functions - T * base() - { - return m_Ptr; - } - - const T * base() const - { - return m_Ptr; - } - - // operators - T & operator*() - { - return *m_Ptr; - } - - T * operator->() - { - return m_Ptr; - } - - iterator & operator++() // preincrement - { - ++m_Ptr; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Ptr; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Ptr; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Ptr; - return tmp; - } - - bool operator==(T * right) const - { - return (m_Ptr == right); - } - - bool operator==(const iterator & right) const - { - return (m_Ptr == right.m_Ptr); - } - - bool operator!=(T * right) const - { - return (m_Ptr != right); - } - - bool operator!=(const iterator & right) const - { - return (m_Ptr != right.m_Ptr); - } - - iterator & operator+=(size_t offset) - { - m_Ptr += offset; - return (*this); - } - - iterator & operator-=(size_t offset) - { - m_Ptr -= offset; - return (*this); - } - - iterator operator+(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr += offset; - return tmp; - } - - iterator operator-(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr -= offset; - return tmp; - } - - T & operator[](size_t offset) - { - return (*(*this + offset)); - } - - const T & operator[](size_t offset) const - { - return (*(*this + offset)); - } - - bool operator<(const iterator & right) const - { - return m_Ptr < right.m_Ptr; - } - - bool operator>(const iterator & right) const - { - return m_Ptr > right.m_Ptr; - } - - bool operator<=(const iterator & right) const - { - return m_Ptr <= right.m_Ptr; - } - - bool operator>=(const iterator & right) const - { - return m_Ptr >= right.m_Ptr; - } - - size_t operator-(const iterator & right) const - { - return m_Ptr - right.m_Ptr; - } - }; - - // constructors / destructors - CVector() - { - m_Size = 0; - m_CurrentUsedSize = 0; - m_Data = NULL; - } - - CVector(const CVector & other) - { - // copy data - m_Data = new T [other.m_CurrentUsedSize]; - m_Size = other.m_CurrentUsedSize; - m_CurrentUsedSize = other.m_CurrentUsedSize; - for (size_t i=0; i() - { - clear(); - } - - // interface - size_t size() const - { - return m_CurrentUsedSize; - } - - size_t capacity() const - { - return m_Size; - } - - iterator begin() const - { - return iterator(m_Data); - } - - iterator end() const - { - return iterator(m_Data + m_CurrentUsedSize); - } - - iterator iterAt(size_t pos) - { - if (pos > m_CurrentUsedSize) - assert(0); - return iterator(m_Data + pos); - } - - bool reserve(size_t newSize) - { - if (newSize > m_Size) - return ChangeSize(newSize); - return true; - } - - bool push_back(const T & elem) - { - if (!GrowIfNeeded(1)) - { - return false; - } - - m_Data[m_CurrentUsedSize++] = elem; - - return true; - } - - void pop_back() - { - if (m_CurrentUsedSize > 0) - --m_CurrentUsedSize; - - FreeMemIfPossible(); - } - - bool resize(size_t newSize) - { - if (!ChangeSize(newSize)) - return false; - m_CurrentUsedSize = newSize; - return true; - } - - bool empty() const - { - return (m_CurrentUsedSize == 0); - } - - T & at(size_t pos) - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - const T & at(size_t pos) const - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - T & operator[](size_t pos) - { - return at(pos); - } - - const T & operator[](size_t pos) const - { - return at(pos); - } - - T & front() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - const T & front() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - T & back() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - const T & back() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - iterator insert(iterator where, const T & value) - { - // validate iter - if (where < m_Data || where > (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (!GrowIfNeeded(1)) - { - return false; - } - - ++m_CurrentUsedSize; - - where = begin() + ofs; - - // Move subsequent entries - for (T *ptr = m_Data + m_CurrentUsedSize - 2; ptr >= where.base(); --ptr) - *(ptr + 1) = *ptr; - - *where.base() = value; - - return where; - } - - iterator erase(iterator where) - { - // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (m_CurrentUsedSize > 1) - { - // move - T *theend = m_Data + m_CurrentUsedSize; - for (T *ptr = where.base() + 1; ptr < theend; ++ptr) - *(ptr - 1) = *ptr; - } - - --m_CurrentUsedSize; - - FreeMemIfPossible(); - - return begin() + ofs; - } - - void clear() - { - m_Size = 0; - m_CurrentUsedSize = 0; - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - } - } -}; - -#endif // __CVECTOR_H__ - diff --git a/dlls/ns/GameManager.cpp b/dlls/ns/GameManager.cpp index ca09fef7..9d8bc061 100644 --- a/dlls/ns/GameManager.cpp +++ b/dlls/ns/GameManager.cpp @@ -13,12 +13,9 @@ /* This holds the functions which determine which hooks I need forwareded */ -#include "sdk/amxxmodule.h" - +#include "amxxmodule.h" #include "ns.h" - #include "utilfunctions.h" - #include "GameManager.h" #include "CPlayer.h" diff --git a/dlls/ns/GameManager.h b/dlls/ns/GameManager.h index 22e4e26f..d7f985b0 100644 --- a/dlls/ns/GameManager.h +++ b/dlls/ns/GameManager.h @@ -17,7 +17,7 @@ #ifndef GAMEMANAGER_H #define GAMEMANAGER_H -#include "CString.h" +#include class GameManager { @@ -62,23 +62,21 @@ public: }; inline void CheckMap(void) { - String MapName; + ke::AString MapName; - MapName.assign(STRING(gpGlobals->mapname)); - - MapName.ToLower(); + MapName = UTIL_ToLowerCase(STRING(gpGlobals->mapname)); m_iTitlesMap=0; - if (strcmp(MapName.c_str(),"ns_bast")==0 || - strcmp(MapName.c_str(),"ns_bast_classic")==0 || - strcmp(MapName.c_str(),"ns_hera")==0 || - strcmp(MapName.c_str(),"ns_nothing")==0 || - strcmp(MapName.c_str(),"ns_caged")==0 || - strcmp(MapName.c_str(),"ns_tanith")==0 || - strcmp(MapName.c_str(),"ns_eclipse")==0 || - strcmp(MapName.c_str(),"ns_veil")==0 || - strcmp(MapName.c_str(),"ns_nancy")==0) + if (MapName.compare("ns_bast")==0 || + MapName.compare("ns_bast_classic") == 0 || + MapName.compare("ns_hera") == 0 || + MapName.compare("ns_nothing") == 0 || + MapName.compare("ns_caged") == 0 || + MapName.compare("ns_tanith") == 0 || + MapName.compare("ns_eclipse") == 0 || + MapName.compare("ns_veil") == 0 || + MapName.compare("ns_nancy") == 0) { m_iTitlesMap=1; } diff --git a/dlls/ns/Hash.h b/dlls/ns/Hash.h index 9b9b579b..0ec09a65 100644 --- a/dlls/ns/Hash.h +++ b/dlls/ns/Hash.h @@ -14,13 +14,14 @@ #ifndef _HASH_H_ #define _HASH_H_ -#include "CVector.h" +#include +#include // Just a very simple hash map, no iteration or anything of the like (not needed) -inline int HashFunction(const String& name) +inline int HashFunction(const ke::AString& name) { static const int kHashNumTable[128] = { @@ -41,21 +42,21 @@ inline int HashFunction(const String& name) 0x245152A2, 0x49A38093, 0x36727833, 0x5E0FA501, 0x10E5FEC6, 0x52F42C4D, 0x1B54D3E3, 0x18C7F6AC, 0x45BC2D01, 0x064757EF, 0x2DA79EBC, 0x0309BED4, 0x5A56A608, 0x215AF6DE, 0x3B09613A, 0x35EDF071 }; - size_t size = name.size(); + size_t size = name.length(); if (size == 0) { return 0; } - int hasha = kHashNumTable[(*(name.c_str() + (size - 1))) & 0x7F]; + int hasha = kHashNumTable[(*(name.chars() + (size - 1))) & 0x7F]; int hashb = kHashNumTable[size % 128]; unsigned char c = 0; for (size_t i = 0; i < size; i++) { - c = (*(name.c_str() + (size - 1))) & 0x7F; + c = (*(name.chars() + (size - 1))) & 0x7F; hasha = (hasha + hashb) ^ kHashNumTable[c]; hashb = hasha + hashb + c + (hasha << 8) + (hashb & 0xFF); @@ -74,13 +75,13 @@ inline int HashFunction(const String& name) -template +template class Hash { protected: - CVector m_HashBuckets[B]; - CVector m_KeyBuckets[B]; - CVector m_DataBuckets[B]; + ke::Vector m_HashBuckets[B]; + ke::Vector m_KeyBuckets[B]; + ke::Vector m_DataBuckets[B]; inline int GetBucket(int hash) { @@ -116,9 +117,9 @@ public: int bucketnum = GetBucket(hash); - m_HashBuckets[bucketnum].push_back(hash); - m_KeyBuckets[bucketnum].push_back(key); - m_DataBuckets[bucketnum].push_back(value); + m_HashBuckets[bucketnum].append(hash); + m_KeyBuckets[bucketnum].append(key); + m_DataBuckets[bucketnum].append(value); return; @@ -135,9 +136,9 @@ public: int bucketnum = GetBucket(hash); - m_HashBuckets[bucketnum].push_back(hash); - m_KeyBuckets[bucketnum].push_back(key); - m_DataBuckets[bucketnum].push_back(D()); + m_HashBuckets[bucketnum].append(hash); + m_KeyBuckets[bucketnum].append(key); + m_DataBuckets[bucketnum].append(D()); return m_DataBuckets[bucketnum].at(m_DataBuckets[bucketnum].size() - 1); @@ -154,16 +155,16 @@ public: // TODO: Possibly make this binary search? // insertion would be annoying, don't think it is worth it - CVector* hashbucket = &m_HashBuckets[bucketnum]; - CVector* keybucket = &m_KeyBuckets[bucketnum]; + ke::Vector* hashbucket = &m_HashBuckets[bucketnum]; + ke::Vector* keybucket = &m_KeyBuckets[bucketnum]; - size_t bucketsize = hashbucket->size(); + size_t bucketsize = hashbucket->length(); for (size_t i = 0; i < bucketsize; i++) { if (hashbucket->at(i) == hash) { - if (key.compare(keybucket->at(i).c_str()) == 0) + if (key.compare(keybucket->at(i).chars()) == 0) { return &(m_DataBuckets[bucketnum].at(i)); } diff --git a/dlls/ns/LocationManager.h b/dlls/ns/LocationManager.h index b9823054..d60abb36 100644 --- a/dlls/ns/LocationManager.h +++ b/dlls/ns/LocationManager.h @@ -14,11 +14,10 @@ #ifndef LOCATIONMANAGER_H #define LOCATIONMANAGER_H -#include "CVector.h" +#include #include "GameManager.h" #include "TitleManager.h" - typedef struct location_data_s { char name[128]; @@ -32,7 +31,7 @@ typedef struct location_data_s class LocationManager { private: - CVector m_LocationList; + ke::Vector m_LocationList; public: LocationManager() @@ -43,7 +42,7 @@ public: inline void Clear(void) { m_LocationList.clear(); - m_LocationList.reserve(32); + m_LocationList.ensure(32); }; inline void Add(const char *Name, edict_t *Entity) @@ -55,19 +54,17 @@ public: strncpy(Temp.name,Name,sizeof(Temp.name)-1); - String NameString(Name); - - NameString.toLower(); + ke::AString NameString(UTIL_ToLowerCase(Name)); Temp.titlelookup=TitleMan.Lookup(NameString); - m_LocationList.push_back(Temp); + m_LocationList.append(Temp); }; inline const char *Lookup(vec3_t origin, cell titlelookup) { unsigned int i=0; location_data_t Temp; - while (iPrune(); diff --git a/dlls/ns/ParticleManager.h b/dlls/ns/ParticleManager.h index 9e06e499..5c30423e 100644 --- a/dlls/ns/ParticleManager.h +++ b/dlls/ns/ParticleManager.h @@ -14,9 +14,12 @@ #ifndef PARTICLEMANAGER_H #define PARTICLEMANAGER_H +#include +#include + typedef struct psystem_s { - String Name; + ke::AString Name; int id; int IsStatic; // Set to 1 if the particle system is loaded from ns.ps @@ -25,43 +28,36 @@ typedef struct psystem_s class ParticleManager { private: - CVector Systems; - int m_iFileLoaded; - unsigned short m_iEventID; + ke::Vector Systems; + int m_iFileLoaded; + unsigned short m_iEventID; public: ParticleManager() { m_iFileLoaded=0; m_iEventID=0; - Systems.reserve(64); + Systems.ensure(64); }; // Remove all non-static particle systems inline void Prune() { - if (Systems.size()==0) + for (size_t i = 0; i < Systems.length(); ++i) { - return; + if (Systems[i]->IsStatic) + { + break; + } + + Systems.remove(i); + delete Systems.at(i); + + if (!Systems.length()) + { + break; + } } - CVector::iterator iter; - while (1) - { - if (Systems.size()==0) - { - break; - } - iter=Systems.end(); - iter--; - - if ((*iter)->IsStatic) - { - break; - } - - delete (*iter); - Systems.pop_back(); - }; }; void ReadFile(void); @@ -70,13 +66,13 @@ public: { ParticleSystem *ps=new ParticleSystem; - ps->id=Systems.size(); + ps->id=Systems.length(); ps->IsStatic=Static; - ps->Name.assign(Start); + ps->Name = Start; - Systems.push_back(ps); + Systems.append(ps); - return Systems.size()-1; + return Systems.length()-1; }; inline void FireSystem(int id, float *Origin, float *Angles, int flags) { @@ -110,16 +106,12 @@ public: }; inline int Find(const char *Needle) { - CVector::iterator iter=Systems.begin(); - CVector::iterator end=Systems.end(); - - while (iter!=end) + for (size_t i = 0; i < Systems.length(); ++i) { - if (strcmp(Needle,(*iter)->Name.c_str())==0) + if (strcmp(Needle, Systems[i]->Name.chars()) == 0) { - return (*iter)->id; + return Systems[i]->id; } - ++iter; } return -1; diff --git a/dlls/ns/SpawnManager.h b/dlls/ns/SpawnManager.h index ca14020a..f57e486d 100644 --- a/dlls/ns/SpawnManager.h +++ b/dlls/ns/SpawnManager.h @@ -14,7 +14,7 @@ #ifndef SPAWNMANAGER_H #define SPAWNMANAGER_H -#include "CVector.h" +#include typedef struct spawndata_s { @@ -25,7 +25,7 @@ typedef struct spawndata_s class SpawnManager { private: - CVector TeamSpawns[5]; + ke::Vector TeamSpawns[5]; public: SpawnManager() @@ -43,9 +43,9 @@ public: // Reserve data for a "typical" map layout // makes data entry faster on map load - TeamSpawns[0].reserve(32); - TeamSpawns[1].reserve(16); - TeamSpawns[2].reserve(48); + TeamSpawns[0].ensure(32); + TeamSpawns[1].ensure(16); + TeamSpawns[2].ensure(48); }; inline void Insert(const edict_t *Entity) @@ -61,7 +61,7 @@ public: Entity->v.origin.CopyToArray(TemporaryData.Location); Entity->v.angles.CopyToArray(TemporaryData.Angle); - TeamSpawns[Entity->v.team].push_back(TemporaryData); + TeamSpawns[Entity->v.team].append(TemporaryData); }; inline void InsertReadyRoom(const edict_t *Entity) { @@ -70,7 +70,7 @@ public: Entity->v.origin.CopyToArray(TemporaryData.Location); Entity->v.angles.CopyToArray(TemporaryData.Angle); - TeamSpawns[0].push_back(TemporaryData); + TeamSpawns[0].append(TemporaryData); }; // ns_get_spawn(team,number=0,Float:ret[3]); @@ -82,10 +82,10 @@ public: } if (params[2]==0) { - return static_cast(TeamSpawns[params[1]].size()); + return static_cast(TeamSpawns[params[1]].length()); } - if (params[2]>=(int)TeamSpawns[params[1]].size()) + if (params[2]>=(int)TeamSpawns[params[1]].length()) { return 0; } diff --git a/dlls/ns/TitleManager.cpp b/dlls/ns/TitleManager.cpp index ba0ee1e5..5e129b14 100644 --- a/dlls/ns/TitleManager.cpp +++ b/dlls/ns/TitleManager.cpp @@ -11,11 +11,10 @@ // Natural Selection Module // -#include "sdk/amxxmodule.h" +#include "amxxmodule.h" #include "ns.h" #include "TitleManager.h" - - +#include "utilfunctions.h" void TitleManager::LoadTitles(void) { @@ -136,10 +135,9 @@ scan_for_data: if (*TempPointer=='}') // end of data { // insert KeyName & Data into the hash - String key(KeyName); + ke::AString key(UTIL_ToLowerCase(KeyName)); - key.toLower(); - this->m_Hash.insert(key, new String(Data)); + this->m_Hash.insert(key, new ke::AString(Data)); goto scan_for_key; } diff --git a/dlls/ns/TitleManager.h b/dlls/ns/TitleManager.h index c65dcecc..6f4e9b24 100644 --- a/dlls/ns/TitleManager.h +++ b/dlls/ns/TitleManager.h @@ -18,7 +18,7 @@ #include #include -#include "CString.h" +#include #include "Hash.h" @@ -29,7 +29,7 @@ private: // Use a string pointer for the data type because the location manager // stores a direct pointer to the c_str() of the title - Hash m_Hash; + Hash m_Hash; public: @@ -38,9 +38,9 @@ public: m_Loaded=0; }; - inline const char *Lookup(String &input) + inline const char *Lookup(ke::AString &input) { - String** ret = m_Hash.find(input); + ke::AString** ret = m_Hash.find(input); if (ret == NULL || *ret == NULL) { @@ -48,8 +48,7 @@ public: return NULL; } - - return (*ret)->c_str(); + return (*ret)->chars(); }; void LoadTitles(void); }; diff --git a/dlls/ns/amxxapi.cpp b/dlls/ns/amxxapi.cpp index 55a1144e..05aa56f2 100644 --- a/dlls/ns/amxxapi.cpp +++ b/dlls/ns/amxxapi.cpp @@ -17,10 +17,6 @@ #include "ns.h" #include "utilfunctions.h" - -#include "CVector.h" -#include "CString.h" - #include "GameManager.h" #include "TitleManager.h" #include "MessageHandler.h" diff --git a/dlls/ns/dllapi.cpp b/dlls/ns/dllapi.cpp index 6680f57a..777134b7 100644 --- a/dlls/ns/dllapi.cpp +++ b/dlls/ns/dllapi.cpp @@ -13,14 +13,14 @@ /* Calls going from the engine to the game dll are handled here */ -#include "sdk/amxxmodule.h" - +#ifndef HAVE_STDINT_H +#define HAVE_STDINT_H +#endif +#include "amxxmodule.h" #include "ns.h" #include "utilfunctions.h" - #include "SpawnManager.h" - #include "GameManager.h" #include "CPlayer.h" #include "MessageHandler.h" diff --git a/dlls/ns/engineapi.cpp b/dlls/ns/engineapi.cpp index 7cc0e987..fa2374a4 100644 --- a/dlls/ns/engineapi.cpp +++ b/dlls/ns/engineapi.cpp @@ -13,14 +13,9 @@ /* Calls going from the game dll to the engine are handled here */ -#include "sdk/amxxmodule.h" - +#include "amxxmodule.h" #include "ns.h" - #include "utilfunctions.h" -#include "CVector.h" -#include "CString.h" - #include "GameManager.h" #include "ParticleManager.h" #include "CPlayer.h" diff --git a/dlls/ns/sdk/moduleconfig.h b/dlls/ns/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/ns/sdk/moduleconfig.h rename to dlls/ns/moduleconfig.h diff --git a/dlls/ns/msvc10/ns.vcxproj b/dlls/ns/msvc10/ns.vcxproj index 1d5cbcf5..1a132a69 100644 --- a/dlls/ns/msvc10/ns.vcxproj +++ b/dlls/ns/msvc10/ns.vcxproj @@ -63,8 +63,8 @@ MaxSpeed OnlyExplicitInline - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;ns_amxx_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + HAVE_STDINT_H;WIN32;NDEBUG;_WINDOWS;_USRDLL;ns_amxx_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded true @@ -102,8 +102,8 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;ns_amxx_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + HAVE_STDINT_H;WIN32;_DEBUG;_WINDOWS;_USRDLL;ns_amxx_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug false @@ -154,13 +154,11 @@ - + - - @@ -170,12 +168,11 @@ - - - + + diff --git a/dlls/ns/msvc10/ns.vcxproj.filters b/dlls/ns/msvc10/ns.vcxproj.filters index bd368493..787879ac 100644 --- a/dlls/ns/msvc10/ns.vcxproj.filters +++ b/dlls/ns/msvc10/ns.vcxproj.filters @@ -12,9 +12,12 @@ {e619584d-fe78-4fa8-9b61-715f075c990c} h;hpp;hxx;hm;inl - + {d6f08195-ccd3-49f9-be66-8064cf182a41} + + {28f804b5-b177-4048-b0c6-36ba103593b9} + @@ -62,8 +65,8 @@ Source Files\Natives - - sdk + + Module SDK\SDK Base @@ -73,12 +76,6 @@ Header Files - - Header Files - - - Header Files - Header Files @@ -106,9 +103,6 @@ Header Files - - Header Files - Header Files @@ -118,11 +112,11 @@ Header Files - - sdk + + Module SDK\SDK Base - - sdk + + Module SDK \ No newline at end of file diff --git a/dlls/ns/natives/general.cpp b/dlls/ns/natives/general.cpp index 690b780e..d6fd93f2 100644 --- a/dlls/ns/natives/general.cpp +++ b/dlls/ns/natives/general.cpp @@ -13,21 +13,21 @@ #include -#include "../sdk/amxxmodule.h" +#include "amxxmodule.h" #include "cbase.h" // TakeDamage -#include "../ns.h" +#include "ns.h" -#include "../utilfunctions.h" -#include "../NEW_Util.h" +#include "utilfunctions.h" +#include "NEW_Util.h" -#include "../GameManager.h" -#include "../SpawnManager.h" -#include "../LocationManager.h" -#include "../TitleManager.h" +#include "GameManager.h" +#include "SpawnManager.h" +#include "LocationManager.h" +#include "TitleManager.h" -#include "../CPlayer.h" +#include "CPlayer.h" edict_t* avhgameplay=NULL; @@ -229,9 +229,7 @@ static cell AMX_NATIVE_CALL ns_get_locationname(AMX *amx, cell *params) static cell AMX_NATIVE_CALL ns_lookup_title(AMX *amx, cell *params) { // FIX: some keys have upper case characters; to fix i store all keys as lower case - String Input(MF_GetAmxString(amx,params[1],0,NULL)); - - Input.toLower(); + ke::AString Input(UTIL_ToLowerCase(MF_GetAmxString(amx,params[1],0,NULL))); const char *Output=TitleMan.Lookup(Input); diff --git a/dlls/ns/natives/memberfuncs.cpp b/dlls/ns/natives/memberfuncs.cpp index def4f8c6..891b2b5d 100644 --- a/dlls/ns/natives/memberfuncs.cpp +++ b/dlls/ns/natives/memberfuncs.cpp @@ -13,15 +13,15 @@ #include -#include "../sdk/amxxmodule.h" +#include "amxxmodule.h" -#include "../ns.h" -#include "../ns_const.h" +#include "ns.h" +#include "ns_const.h" -#include "../utilfunctions.h" +#include "utilfunctions.h" -#include "../FastDelegate.h" -#include "../GameManager.h" +#include "FastDelegate.h" +#include "GameManager.h" extern int IsValidBuilding[AVH_USER3_MAX + 1]; diff --git a/dlls/ns/natives/particles.cpp b/dlls/ns/natives/particles.cpp index 45c1d810..b9a19382 100644 --- a/dlls/ns/natives/particles.cpp +++ b/dlls/ns/natives/particles.cpp @@ -11,15 +11,14 @@ // Natural Selection Module // -#include "../sdk/amxxmodule.h" +#include "amxxmodule.h" -#include "../ns.h" -#include "../utilfunctions.h" -#include "../NEW_Util.h" - -#include "../CVector.h" -#include "../CString.h" -#include "../ParticleManager.h" +#include "ns.h" +#include "utilfunctions.h" +#include "NEW_Util.h" +#include "ParticleManager.h" +#include +#include #define KVI(__KEY) PSKeyValueI(__KEY,amx,params) #define KVF(__KEY) PSKeyValueF(__KEY,amx,params) diff --git a/dlls/ns/natives/player.cpp b/dlls/ns/natives/player.cpp index 5c72e830..f92f79f9 100644 --- a/dlls/ns/natives/player.cpp +++ b/dlls/ns/natives/player.cpp @@ -11,17 +11,17 @@ // Natural Selection Module // -#include "../sdk/amxxmodule.h" +#include "amxxmodule.h" -#include "../ns.h" +#include "ns.h" -#include "../utilfunctions.h" -#include "../NEW_Util.h" +#include "utilfunctions.h" +#include "NEW_Util.h" -#include "../GameManager.h" -#include "../CPlayer.h" +#include "GameManager.h" +#include "CPlayer.h" -#include "../AllocString.h" +#include "AllocString.h" StringManager AllocStringList; diff --git a/dlls/ns/natives/player_memory.cpp b/dlls/ns/natives/player_memory.cpp index d773d678..373b6449 100644 --- a/dlls/ns/natives/player_memory.cpp +++ b/dlls/ns/natives/player_memory.cpp @@ -11,15 +11,15 @@ // Natural Selection Module // -#include "../sdk/amxxmodule.h" +#include "amxxmodule.h" -#include "../ns.h" +#include "ns.h" -#include "../utilfunctions.h" -#include "../NEW_Util.h" +#include "utilfunctions.h" +#include "NEW_Util.h" -#include "../GameManager.h" -#include "../CPlayer.h" +#include "GameManager.h" +#include "CPlayer.h" // Float:ns_get_res(Player) static cell AMX_NATIVE_CALL ns_get_res(AMX *amx, cell *params) diff --git a/dlls/ns/natives/structure.cpp b/dlls/ns/natives/structure.cpp index 74cb15b0..a0a1c8ed 100644 --- a/dlls/ns/natives/structure.cpp +++ b/dlls/ns/natives/structure.cpp @@ -11,12 +11,12 @@ // Natural Selection Module // -#include "../sdk/amxxmodule.h" +#include "amxxmodule.h" -#include "../ns.h" +#include "ns.h" -#include "../utilfunctions.h" -#include "../NEW_Util.h" +#include "utilfunctions.h" +#include "NEW_Util.h" int IsValidBuilding[AVH_USER3_MAX + 1] = { 0, // AVH_USER3_NONE = 0, diff --git a/dlls/ns/natives/weapons.cpp b/dlls/ns/natives/weapons.cpp index 8fcfb2e9..683fa2c0 100644 --- a/dlls/ns/natives/weapons.cpp +++ b/dlls/ns/natives/weapons.cpp @@ -11,15 +11,15 @@ // Natural Selection Module // -#include "../sdk/amxxmodule.h" +#include "amxxmodule.h" -#include "../ns.h" +#include "ns.h" -#include "../utilfunctions.h" -#include "../NEW_Util.h" +#include "utilfunctions.h" +#include "NEW_Util.h" -#include "../GameManager.h" -#include "../CPlayer.h" +#include "GameManager.h" +#include "CPlayer.h" // ns_has_weapon(idPlayer,NsWeapon,set=0) static cell AMX_NATIVE_CALL ns_has_weapon(AMX *amx,cell *params) diff --git a/dlls/ns/sdk/amxxmodule.cpp b/dlls/ns/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/ns/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/ns/sdk/amxxmodule.h b/dlls/ns/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/ns/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/ns/sh_list.h b/dlls/ns/sh_list.h deleted file mode 100644 index ba300dc1..00000000 --- a/dlls/ns/sh_list.h +++ /dev/null @@ -1,297 +0,0 @@ -/* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): David "BAILOPAN" Anderson -* ============================ -*/ - -#ifndef _INCLUDE_SMM_LIST_H -#define _INCLUDE_SMM_LIST_H - -// MSVC8 fix for offsetof macro redefition warnings -#ifdef _MSC_VER - #if _MSC_VER >= 1400 - #undef offsetof - #endif -#endif - -#include -#include - -//namespace SourceHook -//{ - //This class is from CSDM for AMX Mod X - /* - A circular, doubly-linked list with one sentinel node - - Empty: - m_Head = sentinel - m_Head->next = m_Head; - m_Head->prev = m_Head; - One element: - m_Head = sentinel - m_Head->next = node1 - m_Head->prev = node1 - node1->next = m_Head - node1->prev = m_Head - Two elements: - m_Head = sentinel - m_Head->next = node1 - m_Head->prev = node2 - node1->next = node2 - node1->prev = m_Head - node2->next = m_Head - node2->prev = node1 - */ - template - class List - { - public: - class iterator; - friend class iterator; - class ListNode - { - public: - ListNode(const T & o) : obj(o) { }; - ListNode() { }; - T obj; - ListNode *next; - ListNode *prev; - }; - private: - // Initializes the sentinel node. - // BAIL used malloc instead of new in order to bypass the need for a constructor. - ListNode *_Initialize() - { - ListNode *n = (ListNode *)malloc(sizeof(ListNode)); - n->next = n; - n->prev = n; - return n; - } - public: - List() : m_Head(_Initialize()), m_Size(0) - { - } - List(const List &src) : m_Head(_Initialize()), m_Size(0) - { - iterator iter; - for (iter=src.begin(); iter!=src.end(); iter++) - push_back( (*iter) ); - } - ~List() - { - clear(); - - // Don't forget to free the sentinel - if (m_Head) - { - free(m_Head); - m_Head = NULL; - } - } - void push_back(const T &obj) - { - ListNode *node = new ListNode(obj); - - node->prev = m_Head->prev; - node->next = m_Head; - m_Head->prev->next = node; - m_Head->prev = node; - - m_Size++; - } - size_t size() - { - return m_Size; - } - - void clear() - { - ListNode *node = m_Head->next; - ListNode *temp; - m_Head->next = m_Head; - m_Head->prev = m_Head; - - // Iterate through the nodes until we find g_Head (the sentinel) again - while (node != m_Head) - { - temp = node->next; - delete node; - node = temp; - } - m_Size = 0; - } - bool empty() - { - return (m_Size == 0); - } - T & back() - { - return m_Head->prev->obj; - } - private: - ListNode *m_Head; - size_t m_Size; - public: - class iterator - { - friend class List; - public: - iterator() - { - m_This = NULL; - } - iterator(const List &src) - { - m_This = src.m_Head; - } - iterator(ListNode *n) : m_This(n) - { - } - iterator(const iterator &where) - { - m_This = where.m_This; - } - //pre decrement - iterator & operator--() - { - if (m_This) - m_This = m_This->prev; - return *this; - } - //post decrement - iterator operator--(int) - { - iterator old(*this); - if (m_This) - m_This = m_This->prev; - return old; - } - - //pre increment - iterator & operator++() - { - if (m_This) - m_This = m_This->next; - return *this; - } - //post increment - iterator operator++(int) - { - iterator old(*this); - if (m_This) - m_This = m_This->next; - return old; - } - - const T & operator * () const - { - return m_This->obj; - } - T & operator * () - { - return m_This->obj; - } - - T * operator -> () - { - return &(m_This->obj); - } - const T * operator -> () const - { - return &(m_This->obj); - } - - bool operator != (const iterator &where) const - { - return (m_This != where.m_This); - } - bool operator ==(const iterator &where) const - { - return (m_This == where.m_This); - } - private: - ListNode *m_This; - }; - public: - iterator begin() const - { - return iterator(m_Head->next); - } - iterator end() const - { - return iterator(m_Head); - } - iterator erase(iterator &where) - { - ListNode *pNode = where.m_This; - iterator iter(where); - iter++; - - - // Works for all cases: empty list, erasing first element, erasing tail, erasing in the middle... - pNode->prev->next = pNode->next; - pNode->next->prev = pNode->prev; - - delete pNode; - m_Size--; - - return iter; - } - - iterator insert(iterator where, const T &obj) - { - // Insert obj right before where - - ListNode *node = new ListNode(obj); - ListNode *pWhereNode = where.m_This; - - pWhereNode->prev->next = node; - node->prev = pWhereNode->prev; - pWhereNode->prev = node; - node->next = pWhereNode; - - m_Size++; - - return iterator(node); - } - - public: - void remove(const T & obj) - { - iterator b; - for (b=begin(); b!=end(); b++) - { - if ( (*b) == obj ) - { - erase( b ); - break; - } - } - } - template - iterator find(const U & equ) - { - iterator iter; - for (iter=begin(); iter!=end(); iter++) - { - if ( (*iter) == equ ) - return iter; - } - return end(); - } - List & operator =(const List &src) - { - clear(); - iterator iter; - for (iter=src.begin(); iter!=src.end(); iter++) - push_back( (*iter) ); - return *this; - } - }; -//}; //NAMESPACE - -#endif //_INCLUDE_CSDM_LIST_H diff --git a/dlls/ns/utilfunctions.h b/dlls/ns/utilfunctions.h index da6c4c7d..5984a487 100755 --- a/dlls/ns/utilfunctions.h +++ b/dlls/ns/utilfunctions.h @@ -99,6 +99,8 @@ int UTIL_FindBuildingHive(void); BOOL UTIL_CheckForPublic(const char *publicname); BOOL UTIL_CheckForNative(const char *NativeName); +char *UTIL_ToLowerCase(const char *str); + class CPlayer; CPlayer *UTIL_PlayerByCID(int CID); diff --git a/dlls/ns/utils.cpp b/dlls/ns/utils.cpp index 88638f2d..3ae4b969 100644 --- a/dlls/ns/utils.cpp +++ b/dlls/ns/utils.cpp @@ -11,12 +11,9 @@ // Natural Selection Module // -#include "sdk/amxxmodule.h" - - +#include "amxxmodule.h" #include "ns.h" #include "utilfunctions.h" - #include "CPlayer.h" @@ -170,3 +167,17 @@ int UTIL_LogToIndex(const char *LogLine) return 0; } +char *UTIL_ToLowerCase(const char *str) +{ + size_t len = strlen(str); + char *buffer = new char[len + 1]; + for (size_t i = 0; i < len; i++) + { + if (str[i] >= 'A' && str[i] <= 'Z') + buffer[i] = tolower(str[i]); + else + buffer[i] = str[i]; + } + buffer[len] = '\0'; + return buffer; +} diff --git a/dlls/nvault/AMBuilder b/dlls/nvault/AMBuilder index 3cb1e0e9..11685b90 100644 --- a/dlls/nvault/AMBuilder +++ b/dlls/nvault/AMBuilder @@ -3,8 +3,12 @@ import os.path binary = AMXX.Module(builder, 'nvault') +binary.compiler.defines += [ + 'HAVE_STDINT_H', +] + binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'amxxapi.cpp', 'Binary.cpp', 'Journal.cpp', diff --git a/dlls/nvault/Journal.cpp b/dlls/nvault/Journal.cpp index dcc08982..2b71d208 100755 --- a/dlls/nvault/Journal.cpp +++ b/dlls/nvault/Journal.cpp @@ -20,17 +20,17 @@ Journal::Journal(const char *file) { - m_File.assign(file); + m_File = file; } bool Journal::Erase() { - return (unlink(m_File.c_str()) == 0); + return (unlink(m_File.chars()) == 0); } int Journal::Replay(VaultMap *pMap) { - m_fp = fopen(m_File.c_str(), "rb"); + m_fp = fopen(m_File.chars(), "rb"); if (!m_fp) { return -1; @@ -42,8 +42,8 @@ int Journal::Replay(VaultMap *pMap) uint16_t len16; char *key = NULL; char *val = NULL; - String sKey; - String sVal; + ke::AString sKey; + ke::AString sVal; time_t stamp; JOp op; int ops = 0; @@ -59,8 +59,10 @@ int Journal::Replay(VaultMap *pMap) op = static_cast(temp8); if (op == Journal_Clear) { - pMap->Clear(); - } else if (op == Journal_Prune) { + pMap->clear(); + } + else if (op == Journal_Prune) + { time_t start; time_t end; @@ -70,11 +72,31 @@ int Journal::Replay(VaultMap *pMap) if (!br.ReadUInt32(itemp)) goto fail; end = static_cast(itemp); - pMap->Prune(start, end); - - } else if (op == Journal_Insert) { - - + for (StringHashMap::iterator iter = pMap->iter(); !iter.empty(); iter.next()) + { + time_t stamp = iter->value.stamp; + bool remove = false; + + if (stamp != 0) + { + if (start == 0 && end == 0) + remove = true; + else if (start == 0 && stamp < end) + remove = true; + else if (end == 0 && stamp > start) + remove = true; + else if (stamp > start && stamp < end) + remove = true; + + if (remove) + { + iter.erase(); + } + } + } + } + else if (op == Journal_Insert) + { if (!br.ReadUInt32(itemp)) goto fail; stamp = static_cast(itemp); @@ -90,9 +112,10 @@ int Journal::Replay(VaultMap *pMap) key[len8] = '\0'; val[len16] = '\0'; - sKey.assign(key); - sVal.assign(val); - pMap->Insert(sKey, sVal, stamp); + + ArrayInfo info; info.value = val; info.stamp = stamp; + pMap->replace(key, info); + //clean up delete [] key; key = NULL; @@ -105,8 +128,8 @@ int Journal::Replay(VaultMap *pMap) key = new char[len8+1]; if (!br.ReadChars(key, len8)) goto fail; key[len8] = '\0'; - sKey.assign(key); - pMap->Remove(sKey); + + pMap->remove(key); } ops++; } while (op < Journal_TotalOps && op); @@ -135,7 +158,7 @@ success: bool Journal::Begin() { - m_fp = fopen(m_File.c_str(), "wb"); + m_fp = fopen(m_File.chars(), "wb"); m_Bw.SetFilePtr(m_fp); return (m_fp != NULL); } diff --git a/dlls/nvault/Journal.h b/dlls/nvault/Journal.h index afa49706..bf51c1a1 100755 --- a/dlls/nvault/Journal.h +++ b/dlls/nvault/Journal.h @@ -15,9 +15,9 @@ #define _INCLUDE_JOURNAL_H #include "Binary.h" -#include "sh_list.h" -#include "sh_tinyhash.h" -#include "CString.h" +#include +#include +#include enum JOp { @@ -35,7 +35,13 @@ enum Encode Encode_Medium, }; -typedef THash VaultMap; +struct ArrayInfo +{ + ke::AString value; + time_t stamp; +}; + +typedef StringHashMap VaultMap; class Journal { @@ -56,7 +62,7 @@ private: bool WriteInt32(int num); bool WriteString(const char *str, Encode enc); private: - String m_File; + ke::AString m_File; FILE *m_fp; BinaryWriter m_Bw; }; diff --git a/dlls/nvault/Makefile b/dlls/nvault/Makefile index ae637778..ef775fa0 100755 --- a/dlls/nvault/Makefile +++ b/dlls/nvault/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../metamod/metamod PROJECT = nvault -OBJECTS = sdk/amxxmodule.cpp amxxapi.cpp Binary.cpp Journal.cpp NVault.cpp +OBJECTS = amxxmodule.cpp amxxapi.cpp Binary.cpp Journal.cpp NVault.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -105,7 +107,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -118,6 +120,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/nvault/NVault.cpp b/dlls/nvault/NVault.cpp index c781bac2..6ad1d75d 100755 --- a/dlls/nvault/NVault.cpp +++ b/dlls/nvault/NVault.cpp @@ -15,7 +15,7 @@ #include "amxxmodule.h" #include "NVault.h" #include "Binary.h" -#include "CString.h" +#include /** * :TODO: This beast calls strcpy()/new() way too much by creating new strings on the stack. @@ -23,35 +23,16 @@ * ---bail */ -template <> -int HashFunction(const String & k) -{ - unsigned long hash = 5381; - const char *str = k.c_str(); - char c; - while ((c = *str++)) - { - hash = ((hash << 5) + hash) + c; // hash*33 + c - } - return hash; -} - -template <> -int Compare(const String & k1, const String & k2) -{ - return strcmp(k1.c_str(),k2.c_str()); -} - NVault::NVault(const char *file) { - m_File.assign(file); + m_File = file; m_Journal = NULL; m_Open = false; - FILE *fp = fopen(m_File.c_str(), "rb"); + FILE *fp = fopen(m_File.chars(), "rb"); if (!fp) { - fp = fopen(m_File.c_str(), "wb"); + fp = fopen(m_File.chars(), "wb"); if (!fp) { this->m_Valid = false; @@ -70,7 +51,7 @@ NVault::~NVault() VaultError NVault::_ReadFromFile() { - FILE *fp = fopen(m_File.c_str(), "rb"); + FILE *fp = fopen(m_File.chars(), "rb"); if (!fp) { @@ -90,8 +71,6 @@ VaultError NVault::_ReadFromFile() time_t stamp; char *key = NULL; char *val = NULL; - String sKey; - String sVal; // try // { @@ -123,14 +102,14 @@ VaultError NVault::_ReadFromFile() if (!br.ReadUInt8(keylen)) goto fail; if (!br.ReadUInt16(vallen)) goto fail; - if (keylen > oldkeylen) + if (!keylen || keylen > oldkeylen) { if (key) delete [] key; key = new char[keylen + 1]; oldkeylen = keylen; } - if (vallen > oldvallen) + if (!vallen || vallen > oldvallen) { if (val) delete [] val; @@ -143,9 +122,9 @@ VaultError NVault::_ReadFromFile() key[keylen] = '\0'; val[vallen] = '\0'; - sKey.assign(key); - sVal.assign(val); - m_Hash.Insert(sKey, sVal, stamp); + + ArrayInfo info; info.value = val; info.stamp = stamp; + m_Hash.replace(key, info); } // } catch (...) { @@ -174,7 +153,7 @@ success: bool NVault::_SaveToFile() { - FILE *fp = fopen(m_File.c_str(), "wb"); + FILE *fp = fopen(m_File.chars(), "wb"); if (!fp) { @@ -189,28 +168,29 @@ bool NVault::_SaveToFile() uint16_t version = VAULT_VERSION; time_t stamp; - String key; - String val; + ke::AString key; + ke::AString val; - THash::iterator iter = m_Hash.begin(); + StringHashMap::iterator iter = m_Hash.iter(); if (!bw.WriteUInt32(magic)) goto fail; if (!bw.WriteUInt16(version)) goto fail; - if (!bw.WriteUInt32( m_Hash.Size() )) goto fail; + if (!bw.WriteUInt32( m_Hash.elements() )) goto fail; - while (iter != m_Hash.end()) + while (!iter.empty()) { key = (*iter).key; - val = (*iter).val; - stamp = (*iter).stamp; + val = (*iter).value.value; + stamp = (*iter).value.stamp; if (!bw.WriteInt32(static_cast(stamp))) goto fail;; - if (!bw.WriteUInt8( key.size() )) goto fail; - if (!bw.WriteUInt16( val.size() )) goto fail; - if (!bw.WriteChars( key.c_str(), key.size() )) goto fail; - if (!bw.WriteChars( val.c_str(), val.size() )) goto fail; - iter++; + if (!bw.WriteUInt8( key.length() )) goto fail; + if (!bw.WriteUInt16( val.length() )) goto fail; + if (!bw.WriteChars( key.chars(), key.length() )) goto fail; + if (!bw.WriteChars( val.chars(), val.length() )) goto fail; + + iter.next(); } goto success; @@ -229,21 +209,21 @@ success: const char *NVault::GetValue(const char *key) { - String sKey(key); - if (!m_Hash.Exists(sKey)) + StringHashMap::Result r = m_Hash.find(key); + if (!r.found()) { return ""; - } else { - return m_Hash.Retrieve(sKey).c_str(); } + + return r->value.value.chars(); } bool NVault::Open() { _ReadFromFile(); - char *journal_name = new char[m_File.size() + 10]; - strcpy(journal_name, m_File.c_str()); + char *journal_name = new char[m_File.length() + 10]; + strcpy(journal_name, m_File.chars()); char *pos = strstr(journal_name, ".vault"); if (pos) @@ -291,78 +271,103 @@ void NVault::SetValue(const char *key, const char *val) { if (m_Journal) m_Journal->Write_Insert(key, val, time(NULL)); - String sKey; - String sVal; - sKey.assign(key); - sVal.assign(val); - m_Hash.Insert(sKey, sVal); + + ArrayInfo info; info.value = val; info.stamp = time(NULL); + m_Hash.replace(key, info); } void NVault::SetValue(const char *key, const char *val, time_t stamp) { if (m_Journal) m_Journal->Write_Insert(key, val, stamp); - String sKey; - String sVal; - sKey.assign(key); - sVal.assign(val); - m_Hash.Insert(sKey, sVal, stamp); + + ArrayInfo info; info.value = val; info.stamp = stamp; + m_Hash.replace(key, info); } void NVault::Remove(const char *key) { if (m_Journal) m_Journal->Write_Remove(key); - String sKey(key); - m_Hash.Remove(sKey); + + m_Hash.remove(ke::AString(key).chars()); } void NVault::Clear() { if (m_Journal) m_Journal->Write_Clear(); - m_Hash.Clear(); + + m_Hash.clear(); } size_t NVault::Items() { - return m_Hash.Size(); + return m_Hash.elements(); } size_t NVault::Prune(time_t start, time_t end) { if (m_Journal) m_Journal->Write_Prune(start, end); - return m_Hash.Prune(start, end); + + size_t removed = 0; + + for (StringHashMap::iterator iter = m_Hash.iter(); !iter.empty(); iter.next()) + { + time_t stamp = iter->value.stamp; + bool remove = false; + + if (stamp != 0) + { + if (start == 0 && end == 0) + remove = true; + else if (start == 0 && stamp < end) + remove = true; + else if (end == 0 && stamp > start) + remove = true; + else if (stamp > start && stamp < end) + remove = true; + + if (remove) + { + iter.erase(); + removed++; + } + } + } + + return removed; } void NVault::Touch(const char *key, time_t stamp) { - String sKey(key); - - if (!m_Hash.Exists(sKey)) + StringHashMap::Insert i = m_Hash.findForAdd(key); + if (!i.found()) { + if (!m_Hash.add(i, key)) + { + return; + } + SetValue(key, "", time(NULL)); } - m_Hash.Touch(key, stamp); + i->value.stamp = stamp; } bool NVault::GetValue(const char *key, time_t &stamp, char buffer[], size_t len) { - String sKey(key); - if (!m_Hash.Exists(sKey)) + ArrayInfo result; + + if (!m_Hash.retrieve(key, &result)) { buffer[0] = '\0'; return false; } - time_t st; - String sVal; - - sVal = m_Hash.Retrieve(sKey, st); - stamp = st; - UTIL_Format(buffer, len, "%s", sVal.c_str()); + stamp = result.stamp; + UTIL_Format(buffer, len, "%s", result.value.chars()); return true; } diff --git a/dlls/nvault/NVault.h b/dlls/nvault/NVault.h index 291018d2..09958670 100755 --- a/dlls/nvault/NVault.h +++ b/dlls/nvault/NVault.h @@ -14,10 +14,9 @@ #ifndef _INCLUDE_NVAULT_H #define _INCLUDE_NVAULT_H -#include "sh_list.h" -#include "sh_tinyhash.h" +#include +#include #include "IVault.h" -#include "CString.h" #include "Journal.h" #define VAULT_MAGIC 0x6E564C54 //nVLT @@ -61,13 +60,13 @@ public: bool Open(); bool Close(); size_t Items(); - const char *GetFilename() { return m_File.c_str(); } + const char *GetFilename() { return m_File.chars(); } private: VaultError _ReadFromFile(); bool _SaveToFile(); private: - String m_File; - THash m_Hash; + ke::AString m_File; + StringHashMap m_Hash; Journal *m_Journal; bool m_Open; diff --git a/dlls/nvault/amxxapi.cpp b/dlls/nvault/amxxapi.cpp index 1621aa60..bb8f9618 100755 --- a/dlls/nvault/amxxapi.cpp +++ b/dlls/nvault/amxxapi.cpp @@ -14,7 +14,7 @@ #include #include "amxxapi.h" #include "NVault.h" -#include "CQueue.h" +#include #ifdef WIN32 #define MKDIR(p) mkdir(p) @@ -30,8 +30,8 @@ #include #endif -CVector g_Vaults; -CQueue g_OldVaults; +ke::Vector g_Vaults; +Queue g_OldVaults; VaultMngr g_VaultMngr; @@ -48,7 +48,7 @@ static cell nvault_open(AMX *amx, cell *params) char path[255], file[255]; MF_BuildPathnameR(path, sizeof(path)-1, "%s/vault", MF_GetLocalInfo("amxx_datadir", "addons/amxmodx/data")); sprintf(file, "%s/%s.vault", path, name); - for (size_t i=0; i= g_Vaults.size() || !g_Vaults.at(id)) + if (id >= g_Vaults.length() || !g_Vaults.at(id)) { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id); return 0; @@ -102,7 +102,7 @@ static cell nvault_touch(AMX *amx, cell *params) static cell nvault_get(AMX *amx, cell *params) { unsigned int id = params[1]; - if (id >= g_Vaults.size() || !g_Vaults.at(id)) + if (id >= g_Vaults.length() || !g_Vaults.at(id)) { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id); return 0; @@ -140,7 +140,7 @@ static cell nvault_get(AMX *amx, cell *params) static cell nvault_lookup(AMX *amx, cell *params) { unsigned int id = params[1]; - if (id >= g_Vaults.size() || !g_Vaults.at(id)) + if (id >= g_Vaults.length() || !g_Vaults.at(id)) { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id); return 0; @@ -165,7 +165,7 @@ static cell nvault_lookup(AMX *amx, cell *params) static cell nvault_set(AMX *amx, cell *params) { unsigned int id = params[1]; - if (id >= g_Vaults.size() || !g_Vaults.at(id)) + if (id >= g_Vaults.length() || !g_Vaults.at(id)) { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id); return 0; @@ -183,7 +183,7 @@ static cell nvault_set(AMX *amx, cell *params) static cell nvault_pset(AMX *amx, cell *params) { unsigned int id = params[1]; - if (id >= g_Vaults.size() || !g_Vaults.at(id)) + if (id >= g_Vaults.length() || !g_Vaults.at(id)) { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id); return 0; @@ -201,7 +201,7 @@ static cell nvault_pset(AMX *amx, cell *params) static cell nvault_close(AMX *amx, cell *params) { unsigned int id = params[1]; - if (id >= g_Vaults.size() || !g_Vaults.at(id)) + if (id >= g_Vaults.length() || !g_Vaults.at(id)) { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id); return 0; @@ -218,7 +218,7 @@ static cell nvault_close(AMX *amx, cell *params) static cell AMX_NATIVE_CALL nvault_prune(AMX *amx, cell *params) { unsigned int id = params[1]; - if (id >= g_Vaults.size() || !g_Vaults.at(id)) + if (id >= g_Vaults.length() || !g_Vaults.at(id)) { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id); return 0; @@ -233,7 +233,7 @@ static cell AMX_NATIVE_CALL nvault_prune(AMX *amx, cell *params) static cell AMX_NATIVE_CALL nvault_remove(AMX *amx, cell *params) { unsigned int id = params[1]; - if (id >= g_Vaults.size() || !g_Vaults.at(id)) + if (id >= g_Vaults.length() || !g_Vaults.at(id)) { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id); return 0; @@ -261,7 +261,7 @@ void OnAmxxAttach() void OnPluginsUnloaded() { - for (size_t i=0; i +#include +#include extern AMX_NATIVE_INFO nVault_natives[]; diff --git a/dlls/nvault/compat.h b/dlls/nvault/compat.h index 33faca47..7c478232 100755 --- a/dlls/nvault/compat.h +++ b/dlls/nvault/compat.h @@ -15,15 +15,23 @@ #define _INCLUDE_COMPAT_H #ifdef WIN32 -typedef __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef __int8 int8_t; -typedef unsigned __int8 uint8_t; - + #if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif #else - -#include - + #include #endif #endif //_INCLUDE_COMPAT_H diff --git a/dlls/nvault/sdk/moduleconfig.h b/dlls/nvault/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/nvault/sdk/moduleconfig.h rename to dlls/nvault/moduleconfig.h diff --git a/dlls/nvault/msvc10/nvault.vcxproj b/dlls/nvault/msvc10/nvault.vcxproj index 861a7879..1b927345 100644 --- a/dlls/nvault/msvc10/nvault.vcxproj +++ b/dlls/nvault/msvc10/nvault.vcxproj @@ -52,8 +52,8 @@ Disabled - ..\;..\sdk;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;NVAULT_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;NVAULT_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions) true Sync EnableFastChecks @@ -75,8 +75,8 @@ - ..\;..\sdk;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;NVAULT_EXPORTS;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;NVAULT_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions) MultiThreaded 4Bytes false @@ -99,7 +99,7 @@ - + @@ -108,14 +108,8 @@ - - - - - - - - + + diff --git a/dlls/nvault/msvc10/nvault.vcxproj.filters b/dlls/nvault/msvc10/nvault.vcxproj.filters index 567935b6..3b89475e 100644 --- a/dlls/nvault/msvc10/nvault.vcxproj.filters +++ b/dlls/nvault/msvc10/nvault.vcxproj.filters @@ -12,9 +12,6 @@ {3ba100b1-c511-4a2b-bd4f-d4793e871082} - - {aa2aa172-b8f1-4e12-a51b-c3892e2d1f9c} - {300ce24d-2a06-4b65-8c00-8b0f757656ec} @@ -35,7 +32,7 @@ Source Files - + Module SDK\SDK Base @@ -58,30 +55,12 @@ Header Files - - Header Files - - - Module SDK - - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - - - Module SDK\AMXX STL - - + Module SDK\SDK Base + + Module SDK + diff --git a/dlls/nvault/sdk/CQueue.h b/dlls/nvault/sdk/CQueue.h deleted file mode 100755 index f45abffc..00000000 --- a/dlls/nvault/sdk/CQueue.h +++ /dev/null @@ -1,104 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -//by David "BAILOPAN" Anderson -#ifndef _INCLUDE_CQUEUE_H -#define _INCLUDE_CQUEUE_H - -template -class CQueue -{ -public: - class CQueueItem - { - public: - CQueueItem(const T &i, CQueueItem *n) - { - item = i; - next = n; - } - CQueueItem *GetNext() - { - return next; - } - T & GetItem() - { - return item; - } - void SetNext(CQueueItem *n) - { - next = n; - } - private: - T item; - CQueueItem *next; - }; -public: - CQueue() - { - mSize = 0; - mFirst = NULL; - mLast = NULL; - } - - bool empty() - { - return ((mSize==0)?true:false); - } - - void push(const T &v) - { - CQueueItem *p = new CQueueItem(v, NULL); - if (empty()) - { - mFirst = p; - } else { - mLast->SetNext(p); - } - mLast = p; - mSize++; - } - - void pop() - { - if (mFirst == mLast) - { - delete mFirst; - mFirst = NULL; - mLast = NULL; - } else { - CQueueItem *p = mFirst->GetNext(); - delete mFirst; - mFirst = p; - } - mSize--; - } - - T & front() - { - return mFirst->GetItem(); - } - - T & back() - { - return mLast->GetItem(); - } - - unsigned int size() - { - return mSize; - } -private: - CQueueItem *mFirst; - CQueueItem *mLast; - unsigned int mSize; -}; - -#endif //_INCLUDE_CQUEUE_H - diff --git a/dlls/nvault/sdk/CString.h b/dlls/nvault/sdk/CString.h deleted file mode 100755 index 9f9b63f3..00000000 --- a/dlls/nvault/sdk/CString.h +++ /dev/null @@ -1,367 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef _INCLUDE_CSTRING_H -#define _INCLUDE_CSTRING_H - -#include -#include - -//by David "BAILOPAN" Anderson -class String -{ -public: - String() - { - v = NULL; - a_size = 0; - //assign(""); - } - - ~String() - { - if (v) - delete [] v; - } - - String(const char *src) - { - v = NULL; - a_size = 0; - assign(src); - } - - const char * _fread(FILE *fp) - { - Grow(512, false); - char *ret = fgets(v, 511, fp); - return ret; - } - - String(const String &src) - { - v = NULL; - a_size = 0; - assign(src.c_str()); - } - - const char *c_str() { return v?v:""; } - - const char *c_str() const { return v?v:""; } - - void append(const char *t) - { - Grow(size() + strlen(t) + 1); - strcat(v, t); - } - - void append(const char c) - { - size_t len = size(); - Grow(len + 2); - v[len] = c; - v[len + 1] = '\0'; - } - - void append(String &d) - { - append(d.c_str()); - } - - void assign(const String &src) - { - assign(src.c_str()); - } - - void assign(const char *d) - { - if (!d) - { - clear(); - } else { - size_t len = strlen(d); - Grow(len + 1, false); - memcpy(v, d, len); - v[len] = '\0'; - } - } - - void clear() - { - if (v) - v[0] = '\0'; - } - - int compare (const char *d) const - { - if (!v) - return strcmp("", d); - else - return strcmp(v, d); - } - - //Added this for amxx inclusion - bool empty() - { - if (!v) - return true; - - if (v[0] == '\0') - return true; - - return false; - } - - size_t size() - { - if (v) - return strlen(v); - else - return 0; - } - - int find(const char c, int index = 0) - { - int len = static_cast(size()); - if (len < 1) - return npos; - if (index >= len || index < 0) - return npos; - int i = 0; - for (i=index; i len-start) - num = len - start; - //do the erasing - bool copyflag = false; - for (i=0; i=start && i= len || !v) - return ns; - - if (num == npos) - { - num = len - index; - } else if (index+num >= len) { - num = len - index; - } - - unsigned int i = 0; - unsigned int nslen = num + 2; - - ns.Grow(nslen); - - for (i=index; i= 65 && v[i] <= 90) - v[i] &= ~(1<<5); - } - } - - String & operator = (const String &src) - { - assign(src); - return *this; - } - - String & operator = (const char *src) - { - assign(src); - return *this; - - } - - char operator [] (unsigned int index) - { - if (index > size() || !v) - { - return -1; - } else { - return v[index]; - } - } - - int at(int a) - { - if (a < 0 || a >= (int)size() || !v) - return -1; - - return v[a]; - } - - bool at(int at, char c) - { - if (at < 0 || at >= (int)size() || !v) - return false; - - v[at] = c; - - return true; - } - -private: - void Grow(unsigned int d, bool copy=true) - { - if (d <= a_size) - return; - char *n = new char[d + 1]; - if (copy && v) - strcpy(n, v); - if (v) - delete [] v; - else - strcpy(n, ""); - v = n; - a_size = d + 1; - } - - char *v; - unsigned int a_size; -public: - static const int npos = -1; -}; - -#endif //_INCLUDE_CSTRING_H diff --git a/dlls/nvault/sdk/CVector.h b/dlls/nvault/sdk/CVector.h deleted file mode 100755 index 44241413..00000000 --- a/dlls/nvault/sdk/CVector.h +++ /dev/null @@ -1,480 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef __CVECTOR_H__ -#define __CVECTOR_H__ - -#include - -// Vector -template class CVector -{ - bool Grow(size_t amount) - { - // automatic grow - size_t newSize = m_Size * 2; - - if (newSize == 0) - { - newSize = 8; - } - - while (m_CurrentUsedSize + amount > newSize) - { - newSize *= 2; - } - T *newData = new T[newSize]; - if (!newData) - return false; - if (m_Data) - { - for (size_t i=0; i= m_Size) - { - return Grow(amount); - } - else - { - return true; - } - } - - bool ChangeSize(size_t size) - { - // change size - if (size == m_Size) - return true; - - if (!size) - { - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - m_Size = 0; - } - return true; - } - - T *newData = new T[size]; - if (!newData) - return false; - if (m_Data) - { - size_t end = (m_CurrentUsedSize < size) ? (m_CurrentUsedSize) : size; - for (size_t i=0; i m_Size) - m_CurrentUsedSize = m_Size; - - return true; - } - - void FreeMemIfPossible() - { - if (!m_Data) - return; - - if (!m_CurrentUsedSize) - { - ChangeSize(0); - return; - } - - size_t newSize = m_Size; - while (m_CurrentUsedSize <= newSize / 2) - newSize /= 2; - - if (newSize != m_Size) - ChangeSize(newSize); - } -protected: - T *m_Data; - size_t m_Size; - size_t m_CurrentUsedSize; -public: - class iterator - { - protected: - T *m_Ptr; - public: - // constructors / destructors - iterator() - { - m_Ptr = NULL; - } - - iterator(T * ptr) - { - m_Ptr = ptr; - } - - // member functions - T * base() - { - return m_Ptr; - } - - const T * base() const - { - return m_Ptr; - } - - // operators - T & operator*() - { - return *m_Ptr; - } - - T * operator->() - { - return m_Ptr; - } - - iterator & operator++() // preincrement - { - ++m_Ptr; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Ptr; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Ptr; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Ptr; - return tmp; - } - - bool operator==(T * right) const - { - return (m_Ptr == right); - } - - bool operator==(const iterator & right) const - { - return (m_Ptr == right.m_Ptr); - } - - bool operator!=(T * right) const - { - return (m_Ptr != right); - } - - bool operator!=(const iterator & right) const - { - return (m_Ptr != right.m_Ptr); - } - - iterator & operator+=(size_t offset) - { - m_Ptr += offset; - return (*this); - } - - iterator & operator-=(size_t offset) - { - m_Ptr -= offset; - return (*this); - } - - iterator operator+(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr += offset; - return tmp; - } - - iterator operator-(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr -= offset; - return tmp; - } - - T & operator[](size_t offset) - { - return (*(*this + offset)); - } - - const T & operator[](size_t offset) const - { - return (*(*this + offset)); - } - - bool operator<(const iterator & right) const - { - return m_Ptr < right.m_Ptr; - } - - bool operator>(const iterator & right) const - { - return m_Ptr > right.m_Ptr; - } - - bool operator<=(const iterator & right) const - { - return m_Ptr <= right.m_Ptr; - } - - bool operator>=(const iterator & right) const - { - return m_Ptr >= right.m_Ptr; - } - - size_t operator-(const iterator & right) const - { - return m_Ptr - right.m_Ptr; - } - }; - - // constructors / destructors - CVector() - { - m_Size = 0; - m_CurrentUsedSize = 0; - m_Data = NULL; - } - - CVector(const CVector & other) - { - // copy data - m_Data = new T [other.m_CurrentUsedSize]; - m_Size = other.m_CurrentUsedSize; - m_CurrentUsedSize = other.m_CurrentUsedSize; - for (size_t i=0; i() - { - clear(); - } - - // interface - size_t size() const - { - return m_CurrentUsedSize; - } - - size_t capacity() const - { - return m_Size; - } - - iterator begin() const - { - return iterator(m_Data); - } - - iterator end() const - { - return iterator(m_Data + m_CurrentUsedSize); - } - - iterator iterAt(size_t pos) - { - if (pos > m_CurrentUsedSize) - assert(0); - return iterator(m_Data + pos); - } - - bool reserve(size_t newSize) - { - if (newSize > m_Size) - return ChangeSize(newSize); - return true; - } - - bool push_back(const T & elem) - { - if (!GrowIfNeeded(1)) - { - return false; - } - - m_Data[m_CurrentUsedSize++] = elem; - - return true; - } - - void pop_back() - { - --m_CurrentUsedSize; - if (m_CurrentUsedSize < 0) - m_CurrentUsedSize = 0; - - FreeMemIfPossible(); - } - - bool resize(size_t newSize) - { - if (!ChangeSize(newSize)) - return false; - m_CurrentUsedSize = newSize; - return true; - } - - bool empty() const - { - return (m_CurrentUsedSize == 0); - } - - T & at(size_t pos) - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - const T & at(size_t pos) const - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - T & operator[](size_t pos) - { - return at(pos); - } - - const T & operator[](size_t pos) const - { - return at(pos); - } - - T & front() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - const T & front() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - T & back() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - const T & back() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - iterator insert(iterator where, const T & value) - { - // validate iter - if (where < m_Data || where > (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (!GrowIfNeeded(1)) - { - return false; - } - - ++m_CurrentUsedSize; - - where = begin() + ofs; - - // Move subsequent entries - for (T *ptr = m_Data + m_CurrentUsedSize - 2; ptr >= where.base(); --ptr) - *(ptr + 1) = *ptr; - - *where.base() = value; - - return where; - } - - iterator erase(iterator where) - { - // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (m_CurrentUsedSize > 1) - { - // move - T *theend = m_Data + m_CurrentUsedSize; - for (T *ptr = where.base() + 1; ptr < theend; ++ptr) - *(ptr - 1) = *ptr; - } - - --m_CurrentUsedSize; - - FreeMemIfPossible(); - - return begin() + ofs; - } - - void clear() - { - m_Size = 0; - m_CurrentUsedSize = 0; - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - } - } -}; - -#endif // __CVECTOR_H__ - diff --git a/dlls/nvault/sdk/amxxmodule.cpp b/dlls/nvault/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/nvault/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/nvault/sdk/amxxmodule.h b/dlls/nvault/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/nvault/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/nvault/sdk/sh_list.h b/dlls/nvault/sdk/sh_list.h deleted file mode 100755 index e45a2f8a..00000000 --- a/dlls/nvault/sdk/sh_list.h +++ /dev/null @@ -1,297 +0,0 @@ -/* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): David "BAILOPAN" Anderson -* ============================ -*/ - -#ifndef _INCLUDE_SMM_LIST_H -#define _INCLUDE_SMM_LIST_H - -// MSVC8 fix for offsetof macro redefition warnings -#ifdef _MSC_VER - #if _MSC_VER >= 1400 - #undef offsetof - #endif -#endif - -#include -#include - -//namespace SourceHook -//{ -//This class is from CSDM for AMX Mod X -/* - A circular, doubly-linked list with one sentinel node - - Empty: - m_Head = sentinel - m_Head->next = m_Head; - m_Head->prev = m_Head; - One element: - m_Head = sentinel - m_Head->next = node1 - m_Head->prev = node1 - node1->next = m_Head - node1->prev = m_Head - Two elements: - m_Head = sentinel - m_Head->next = node1 - m_Head->prev = node2 - node1->next = node2 - node1->prev = m_Head - node2->next = m_Head - node2->prev = node1 -*/ -template -class List -{ -public: - class iterator; - friend class iterator; - class ListNode - { - public: - ListNode(const T & o) : obj(o) { }; - ListNode() { }; - T obj; - ListNode *next; - ListNode *prev; - }; -private: - // Initializes the sentinel node. - // BAIL used malloc instead of new in order to bypass the need for a constructor. - ListNode *_Initialize() - { - ListNode *n = (ListNode *)malloc(sizeof(ListNode)); - n->next = n; - n->prev = n; - return n; - } -public: - List() : m_Head(_Initialize()), m_Size(0) - { - } - List(const List &src) : m_Head(_Initialize()), m_Size(0) - { - iterator iter; - for (iter=src.begin(); iter!=src.end(); iter++) - push_back( (*iter) ); - } - ~List() - { - clear(); - - // Don't forget to free the sentinel - if (m_Head) - { - free(m_Head); - m_Head = NULL; - } - } - void push_back(const T &obj) - { - ListNode *node = new ListNode(obj); - - node->prev = m_Head->prev; - node->next = m_Head; - m_Head->prev->next = node; - m_Head->prev = node; - - m_Size++; - } - size_t size() - { - return m_Size; - } - - void clear() - { - ListNode *node = m_Head->next; - ListNode *temp; - m_Head->next = m_Head; - m_Head->prev = m_Head; - - // Iterate through the nodes until we find g_Head (the sentinel) again - while (node != m_Head) - { - temp = node->next; - delete node; - node = temp; - } - m_Size = 0; - } - bool empty() - { - return (m_Size == 0); - } - T & back() - { - return m_Head->prev->obj; - } -private: - ListNode *m_Head; - size_t m_Size; -public: - class iterator - { - friend class List; - public: - iterator() - { - m_This = NULL; - } - iterator(const List &src) - { - m_This = src.m_Head; - } - iterator(ListNode *n) : m_This(n) - { - } - iterator(const iterator &where) - { - m_This = where.m_This; - } - //pre decrement - iterator & operator--() - { - if (m_This) - m_This = m_This->prev; - return *this; - } - //post decrement - iterator operator--(int) - { - iterator old(*this); - if (m_This) - m_This = m_This->prev; - return old; - } - - //pre increment - iterator & operator++() - { - if (m_This) - m_This = m_This->next; - return *this; - } - //post increment - iterator operator++(int) - { - iterator old(*this); - if (m_This) - m_This = m_This->next; - return old; - } - - const T & operator * () const - { - return m_This->obj; - } - T & operator * () - { - return m_This->obj; - } - - T * operator -> () - { - return &(m_This->obj); - } - const T * operator -> () const - { - return &(m_This->obj); - } - - bool operator != (const iterator &where) const - { - return (m_This != where.m_This); - } - bool operator ==(const iterator &where) const - { - return (m_This == where.m_This); - } - private: - ListNode *m_This; - }; -public: - iterator begin() const - { - return iterator(m_Head->next); - } - iterator end() const - { - return iterator(m_Head); - } - iterator erase(iterator &where) - { - ListNode *pNode = where.m_This; - iterator iter(where); - iter++; - - - // Works for all cases: empty list, erasing first element, erasing tail, erasing in the middle... - pNode->prev->next = pNode->next; - pNode->next->prev = pNode->prev; - - delete pNode; - m_Size--; - - return iter; - } - - iterator insert(iterator where, const T &obj) - { - // Insert obj right before where - - ListNode *node = new ListNode(obj); - ListNode *pWhereNode = where.m_This; - - pWhereNode->prev->next = node; - node->prev = pWhereNode->prev; - pWhereNode->prev = node; - node->next = pWhereNode; - - m_Size++; - - return iterator(node); - } - -public: - void remove(const T & obj) - { - iterator b; - for (b=begin(); b!=end(); b++) - { - if ( (*b) == obj ) - { - erase( b ); - break; - } - } - } - template - iterator find(const U & equ) - { - iterator iter; - for (iter=begin(); iter!=end(); iter++) - { - if ( (*iter) == equ ) - return iter; - } - return end(); - } - List & operator =(const List &src) - { - clear(); - iterator iter; - for (iter=src.begin(); iter!=src.end(); iter++) - push_back( (*iter) ); - return *this; - } -}; -//}; //NAMESPACE - -#endif //_INCLUDE_CSDM_LIST_H diff --git a/dlls/nvault/sdk/sh_tinyhash.h b/dlls/nvault/sdk/sh_tinyhash.h deleted file mode 100755 index 07ef5ec6..00000000 --- a/dlls/nvault/sdk/sh_tinyhash.h +++ /dev/null @@ -1,582 +0,0 @@ -/* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): David "BAILOPAN" Anderson -* ============================ -*/ - -#ifndef _INCLUDE_SH_TINYHASH_H_ -#define _INCLUDE_SH_TINYHASH_H_ - -#include -#include "sh_list.h" - -#define _T_INIT_HASH_SIZE 32 - -//namespace SourceHook -//{ -template -int HashFunction(const K & k); - -template -int Compare(const K & k1, const K & k2); - -/** -* This is a tiny, growable hash class. -* Meant for quick and dirty dictionaries only! -*/ -template -class THash -{ -public: - struct THashNode - { - THashNode(const K & k, const V & v) : - key(k), val(v) - { - }; - THashNode & operator =(const THashNode &other) - { - key = other.key; - val = other.val; - } - K key; - V val; - time_t stamp; - }; - typedef List * NodePtr; -public: - class const_iterator; - THash() : m_Buckets(NULL), m_numBuckets(0), m_percentUsed(0.0f), m_Items(0) - { - _Refactor(); - } - THash(const THash &other) : m_Buckets(new NodePtr[other.numBuckets]), - m_numBuckets(other.m_numBuckets), - m_percentUsed(other.m_percentUsed) - { - for (size_t i=0; ikey)->val = iter->val; - } - void operator=(const THash &other) - { - Clear(); - for (const_iterator iter=other.begin(); iter!=other.end(); ++iter) - _FindOrInsert(iter->key)->val = iter->val; - } - ~THash() - { - _Clear(); - } - void Clear() - { - _Clear(); - _Refactor(); - } - void Insert(const K & key, const V & val) - { - Insert(key, val, time(NULL)); - } - void Insert(const K & key, const V & val, time_t stamp) - { - THashNode *pNode = _FindOrInsert(key); - pNode->val = val; - pNode->stamp = stamp; - } - bool Exists(const K & key) - { - size_t place = HashFunction(key) % m_numBuckets; - - if (!m_Buckets[place]) - return false; - - typename List::iterator iter; - for (iter = m_Buckets[place]->begin(); iter != m_Buckets[place]->end(); iter++) - { - if (Compare(key, (*iter)->key) == 0) - return true; - } - return false; - } - V & Retrieve(const K & k, time_t & stamp) - { - THashNode *pNode = _FindOrInsert(k); - stamp = pNode->stamp; - return pNode->val; - } - void Touch(const K & k, time_t stamp) - { - THashNode *pNode = _FindOrInsert(k); - pNode->stamp = stamp; - } - V & Retrieve(const K & k) - { - time_t stamp; - return Retrieve(k, stamp); - } - void Remove(const K & key) - { - size_t place = HashFunction(key) % m_numBuckets; - - if (!m_Buckets[place]) - return; - - typename List::iterator iter; - for (iter = m_Buckets[place]->begin(); iter != m_Buckets[place]->end(); iter++) - { - if (Compare(key, (*iter)->key) == 0) - { - iter = m_Buckets[place]->erase(iter); - m_Items--; - return; - } - } - } - size_t Prune(time_t start=0, time_t end=0) - { - typename List::iterator iter; - time_t stamp; - size_t removed = 0; - for (size_t i=0; ibegin(); - bool remove; - while (iter != m_Buckets[i]->end()) - { - stamp = (*iter)->stamp; - remove = false; - if (stamp != 0) - { - if (start == 0 && end == 0) - remove = true; - else if (start == 0 && stamp < end) - remove = true; - else if (end == 0 && stamp > start) - remove = true; - else if (stamp > start && stamp < end) - remove = true; - if (remove) - { - iter = m_Buckets[i]->erase(iter); - removed++; - } else { - iter++; - } - } else { - iter++; - } - } - } - m_Items -= removed; - return removed; - } - size_t Size() - { - return m_Items; - } - size_t GetBuckets() - { - return m_numBuckets; - } - float PercentUsed() - { - return m_percentUsed; - } - V & operator [](const K & key) - { - THashNode *pNode = _FindOrInsert(key); - return pNode->val; - } -private: - void _Clear() - { - typename List::iterator iter, end; - for (size_t i=0; iend(); - iter = m_Buckets[i]->begin(); - while (iter != end) - { - delete (*iter); - iter++; - } - m_Buckets[i]->clear(); - delete m_Buckets[i]; - } - } - if (m_Buckets) - delete [] m_Buckets; - m_numBuckets = 0; - m_Items = 0; - m_Buckets = NULL; - } - THashNode *_FindOrInsert(const K & key) - { - size_t place = HashFunction(key) % m_numBuckets; - THashNode *pNode = NULL; - if (!m_Buckets[place]) - { - m_Buckets[place] = new List; - pNode = new THashNode(key, V()); - m_Buckets[place]->push_back(pNode); - m_percentUsed += (1.0f / (float)m_numBuckets); - m_Items++; - } else { - typename List::iterator iter; - for (iter=m_Buckets[place]->begin(); iter!=m_Buckets[place]->end(); iter++) - { - if (Compare((*iter)->key, key) == 0) - return (*iter); - } - //node does not exist - pNode = new THashNode(key, V()); - m_Buckets[place]->push_back(pNode); - m_Items++; - } - if (PercentUsed() > 0.75f) - _Refactor(); - return pNode; - } - void _Refactor() - { - m_percentUsed = 0.0f; - if (!m_numBuckets) - { - m_numBuckets = _T_INIT_HASH_SIZE; - m_Buckets = new NodePtr[m_numBuckets]; - for (size_t i=0; i::iterator iter; - size_t place; - THashNode *pHashNode; - NodePtr *temp = new NodePtr[m_numBuckets]; - for (size_t i=0; ibegin(); iter != m_Buckets[i]->end(); iter++) - { - pHashNode = (*iter); - //rehash it with the new bucket filter - place = HashFunction(pHashNode->key) % m_numBuckets; - //add it to the new hash table - if (!temp[place]) - { - temp[place] = new List; - m_percentUsed += (1.0f / (float)m_numBuckets); - } - temp[place]->push_back(pHashNode); - } - //delete that bucket! - delete m_Buckets[i]; - m_Buckets[i] = NULL; - } - } - //reassign bucket table - delete [] m_Buckets; - m_Buckets = temp; - } - } -public: - friend class iterator; - friend class const_iterator; - class iterator - { - friend class THash; - public: - iterator() : curbucket(-1), hash(NULL), end(true) - { - }; - iterator(THash *h) : curbucket(-1), hash(h), end(false) - { - if (!h->m_Buckets) - end = true; - else - _Inc(); - }; - //pre increment - iterator & operator++() - { - _Inc(); - return *this; - } - //post increment - iterator operator++(int) - { - iterator old(*this); - _Inc(); - return old; - } - const THashNode & operator * () const - { - return *(*iter); - } - THashNode & operator * () - { - return *(*iter); - } - const THashNode * operator ->() const - { - return (*iter); - } - THashNode * operator ->() - { - return (*iter); - } - bool operator ==(const iterator &where) const - { - if (where.hash == this->hash - && where.end == this->end - && - (this->end || - ((where.curbucket == this->curbucket) - && (where.iter == iter)) - )) - return true; - return false; - } - bool operator !=(const iterator &where) const - { - return !( (*this) == where ); - } - private: - void _Inc() - { - if (end || !hash || curbucket >= static_cast(hash->m_numBuckets)) - return; - if (curbucket < 0) - { - for (int i=0; i<(int)hash->m_numBuckets; i++) - { - if (hash->m_Buckets[i]) - { - iter = hash->m_Buckets[i]->begin(); - if (iter == hash->m_Buckets[i]->end()) - continue; - curbucket = i; - break; - } - } - if (curbucket < 0) - end = true; - } else { - if (iter != hash->m_Buckets[curbucket]->end()) - iter++; - if (iter == hash->m_Buckets[curbucket]->end()) - { - int oldbucket = curbucket; - for (int i=curbucket+1; i<(int)hash->m_numBuckets; i++) - { - if (hash->m_Buckets[i]) - { - iter = hash->m_Buckets[i]->begin(); - if (iter == hash->m_Buckets[i]->end()) - continue; - curbucket = i; - break; - } - } - if (curbucket == oldbucket) - end = true; - } - } - } - private: - int curbucket; - typename List::iterator iter; - THash *hash; - bool end; - }; - class const_iterator - { - friend class THash; - public: - const_iterator() : curbucket(-1), hash(NULL), end(true) - { - }; - const_iterator(const THash *h) : curbucket(-1), hash(h), end(true) - { - if (!h->m_Buckets) - end = true; - else - _Inc(); - }; - const_iterator & operator++() - { - _Inc(); - return *this; - } - const_iterator operator++(int) - { - iterator old(*this); - _Inc(); - return old; - } - void erase() - { - if (end || !hash || curbucket < 0 || curbucket >= static_cast(hash->m_numBuckets)) - return; - - iterator tmp = *this; - ++tmp; - delete (*iter); - hash->m_Items--; - hash->m_Buckets[curbucket]->erase(iter); - *this = tmp; - } - const THashNode & operator *() const - { - return *(*iter); - } - const THashNode * operator ->() const - { - return (*iter); - } - bool operator ==(const const_iterator &where) const - { - if (where.hash == this->hash - && where.end == this->end - && - (this->end || - ((where.curbucket == this->curbucket) - && (where.iter == iter)) - )) - return true; - return false; - } - bool operator !=(const const_iterator &where) const - { - return !((*this)==where); - } - private: - void _Inc() - { - if (end || !hash || curbucket >= static_cast(hash->m_numBuckets)) - return; - if (curbucket < 0) - { - for (int i=0; i<(int)hash->m_numBuckets; i++) - { - if (hash->m_Buckets[i]) - { - iter = hash->m_Buckets[i]->begin(); - if (iter == hash->m_Buckets[i]->end()) - continue; - curbucket = i; - break; - } - } - if (curbucket < 0) - end = true; - } else { - if (iter != hash->m_Buckets[curbucket]->end()) - iter++; - if (iter == hash->m_Buckets[curbucket]->end()) - { - int oldbucket = curbucket; - for (int i=curbucket+1; i<(int)hash->m_numBuckets; i++) - { - if (hash->m_Buckets[i]) - { - iter = hash->m_Buckets[i]->begin(); - if (iter == hash->m_Buckets[i]->end()) - continue; - curbucket = i; - break; - } - } - if (curbucket == oldbucket) - end = true; - } - } - } - private: - int curbucket; - typename List::iterator iter; - const THash *hash; - bool end; - }; -public: - iterator begin() - { - return iterator(this); - } - iterator end() - { - iterator iter; - iter.hash = this; - return iter; - } - const_iterator begin() const - { - return const_iterator(this); - } - const_iterator end() const - { - const_iterator iter; - iter.hash = this; - return iter; - } - iterator erase(iterator where) - { - where.erase(); - return where; - } - template - void erase(const U & u) - { - iterator iter = find(u); - if (iter == end()) - return; - iter.erase(); - } - template - iterator find(const U & u) const - { - iterator b = begin(); - iterator e = end(); - for (iterator iter = b; iter != e; iter++) - { - if ( (*iter).key == u ) - return iter; - } - return end(); - } - template - iterator find(const U & u) - { - iterator b = begin(); - iterator e = end(); - for (iterator iter = b; iter != e; iter++) - { - if ( (*iter).key == u ) - return iter; - } - return end(); - } -private: - NodePtr *m_Buckets; - size_t m_numBuckets; - float m_percentUsed; - size_t m_Items; -}; -//}; - -#endif //_INCLUDE_SH_TINYHASH_H_ diff --git a/dlls/regex/AMBuilder b/dlls/regex/AMBuilder index ae88213a..0775e479 100644 --- a/dlls/regex/AMBuilder +++ b/dlls/regex/AMBuilder @@ -15,7 +15,7 @@ binary.compiler.defines += [ 'HAVE_STDINT_H', ] binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'module.cpp', 'CRegEx.cpp', 'utils.cpp', diff --git a/dlls/regex/Makefile b/dlls/regex/Makefile index 36785782..f1bc3f98 100755 --- a/dlls/regex/Makefile +++ b/dlls/regex/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../metamod/metamod PROJECT = regex -OBJECTS = sdk/amxxmodule.cpp module.cpp CRegEx.cpp +OBJECTS = amxxmodule.cpp module.cpp CRegEx.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -lpcre -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -106,7 +108,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -119,6 +121,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/regex/sdk/moduleconfig.h b/dlls/regex/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/regex/sdk/moduleconfig.h rename to dlls/regex/moduleconfig.h diff --git a/dlls/regex/msvc10/regex.vcxproj b/dlls/regex/msvc10/regex.vcxproj index 96257caf..e7f70b65 100644 --- a/dlls/regex/msvc10/regex.vcxproj +++ b/dlls/regex/msvc10/regex.vcxproj @@ -52,7 +52,7 @@ Disabled - ..\;..\..\..\public\amtl;..\sdk;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;REGEX_EXPORTS;HAVE_STDINT_H;PCRE_STATIC;%(PreprocessorDefinitions) true EnableFastChecks @@ -75,7 +75,7 @@ - ..\;..\..\..\public\amtl;..\sdk;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;REGEX_EXPORTS;HAVE_STDINT_H;PCRE_STATIC;%(PreprocessorDefinitions) MultiThreaded false @@ -98,16 +98,14 @@ - + - - - - + + diff --git a/dlls/regex/msvc10/regex.vcxproj.filters b/dlls/regex/msvc10/regex.vcxproj.filters index b3be6a74..dd7779fa 100644 --- a/dlls/regex/msvc10/regex.vcxproj.filters +++ b/dlls/regex/msvc10/regex.vcxproj.filters @@ -12,9 +12,6 @@ {105aae8e-12cf-4550-8a4e-38ae0f0bc98b} - - {48ab1482-e0f3-41f0-bb0a-0aca5800115a} - {fece8d7d-8799-45fa-b9d8-7a1e51a65103} @@ -29,12 +26,12 @@ Source Files - - Module SDK\SDK Base - Source Files + + Module SDK\SDK Base + @@ -43,21 +40,15 @@ Header Files - - Header Files - - - Module SDK - - - Module SDK\AMXX STL - - - Module SDK\SDK Base - Header Files + + Module SDK\SDK Base + + + Module SDK + diff --git a/dlls/regex/sdk/CVector.h b/dlls/regex/sdk/CVector.h deleted file mode 100755 index 44241413..00000000 --- a/dlls/regex/sdk/CVector.h +++ /dev/null @@ -1,480 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef __CVECTOR_H__ -#define __CVECTOR_H__ - -#include - -// Vector -template class CVector -{ - bool Grow(size_t amount) - { - // automatic grow - size_t newSize = m_Size * 2; - - if (newSize == 0) - { - newSize = 8; - } - - while (m_CurrentUsedSize + amount > newSize) - { - newSize *= 2; - } - T *newData = new T[newSize]; - if (!newData) - return false; - if (m_Data) - { - for (size_t i=0; i= m_Size) - { - return Grow(amount); - } - else - { - return true; - } - } - - bool ChangeSize(size_t size) - { - // change size - if (size == m_Size) - return true; - - if (!size) - { - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - m_Size = 0; - } - return true; - } - - T *newData = new T[size]; - if (!newData) - return false; - if (m_Data) - { - size_t end = (m_CurrentUsedSize < size) ? (m_CurrentUsedSize) : size; - for (size_t i=0; i m_Size) - m_CurrentUsedSize = m_Size; - - return true; - } - - void FreeMemIfPossible() - { - if (!m_Data) - return; - - if (!m_CurrentUsedSize) - { - ChangeSize(0); - return; - } - - size_t newSize = m_Size; - while (m_CurrentUsedSize <= newSize / 2) - newSize /= 2; - - if (newSize != m_Size) - ChangeSize(newSize); - } -protected: - T *m_Data; - size_t m_Size; - size_t m_CurrentUsedSize; -public: - class iterator - { - protected: - T *m_Ptr; - public: - // constructors / destructors - iterator() - { - m_Ptr = NULL; - } - - iterator(T * ptr) - { - m_Ptr = ptr; - } - - // member functions - T * base() - { - return m_Ptr; - } - - const T * base() const - { - return m_Ptr; - } - - // operators - T & operator*() - { - return *m_Ptr; - } - - T * operator->() - { - return m_Ptr; - } - - iterator & operator++() // preincrement - { - ++m_Ptr; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Ptr; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Ptr; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Ptr; - return tmp; - } - - bool operator==(T * right) const - { - return (m_Ptr == right); - } - - bool operator==(const iterator & right) const - { - return (m_Ptr == right.m_Ptr); - } - - bool operator!=(T * right) const - { - return (m_Ptr != right); - } - - bool operator!=(const iterator & right) const - { - return (m_Ptr != right.m_Ptr); - } - - iterator & operator+=(size_t offset) - { - m_Ptr += offset; - return (*this); - } - - iterator & operator-=(size_t offset) - { - m_Ptr -= offset; - return (*this); - } - - iterator operator+(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr += offset; - return tmp; - } - - iterator operator-(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr -= offset; - return tmp; - } - - T & operator[](size_t offset) - { - return (*(*this + offset)); - } - - const T & operator[](size_t offset) const - { - return (*(*this + offset)); - } - - bool operator<(const iterator & right) const - { - return m_Ptr < right.m_Ptr; - } - - bool operator>(const iterator & right) const - { - return m_Ptr > right.m_Ptr; - } - - bool operator<=(const iterator & right) const - { - return m_Ptr <= right.m_Ptr; - } - - bool operator>=(const iterator & right) const - { - return m_Ptr >= right.m_Ptr; - } - - size_t operator-(const iterator & right) const - { - return m_Ptr - right.m_Ptr; - } - }; - - // constructors / destructors - CVector() - { - m_Size = 0; - m_CurrentUsedSize = 0; - m_Data = NULL; - } - - CVector(const CVector & other) - { - // copy data - m_Data = new T [other.m_CurrentUsedSize]; - m_Size = other.m_CurrentUsedSize; - m_CurrentUsedSize = other.m_CurrentUsedSize; - for (size_t i=0; i() - { - clear(); - } - - // interface - size_t size() const - { - return m_CurrentUsedSize; - } - - size_t capacity() const - { - return m_Size; - } - - iterator begin() const - { - return iterator(m_Data); - } - - iterator end() const - { - return iterator(m_Data + m_CurrentUsedSize); - } - - iterator iterAt(size_t pos) - { - if (pos > m_CurrentUsedSize) - assert(0); - return iterator(m_Data + pos); - } - - bool reserve(size_t newSize) - { - if (newSize > m_Size) - return ChangeSize(newSize); - return true; - } - - bool push_back(const T & elem) - { - if (!GrowIfNeeded(1)) - { - return false; - } - - m_Data[m_CurrentUsedSize++] = elem; - - return true; - } - - void pop_back() - { - --m_CurrentUsedSize; - if (m_CurrentUsedSize < 0) - m_CurrentUsedSize = 0; - - FreeMemIfPossible(); - } - - bool resize(size_t newSize) - { - if (!ChangeSize(newSize)) - return false; - m_CurrentUsedSize = newSize; - return true; - } - - bool empty() const - { - return (m_CurrentUsedSize == 0); - } - - T & at(size_t pos) - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - const T & at(size_t pos) const - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - T & operator[](size_t pos) - { - return at(pos); - } - - const T & operator[](size_t pos) const - { - return at(pos); - } - - T & front() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - const T & front() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - T & back() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - const T & back() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - iterator insert(iterator where, const T & value) - { - // validate iter - if (where < m_Data || where > (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (!GrowIfNeeded(1)) - { - return false; - } - - ++m_CurrentUsedSize; - - where = begin() + ofs; - - // Move subsequent entries - for (T *ptr = m_Data + m_CurrentUsedSize - 2; ptr >= where.base(); --ptr) - *(ptr + 1) = *ptr; - - *where.base() = value; - - return where; - } - - iterator erase(iterator where) - { - // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (m_CurrentUsedSize > 1) - { - // move - T *theend = m_Data + m_CurrentUsedSize; - for (T *ptr = where.base() + 1; ptr < theend; ++ptr) - *(ptr - 1) = *ptr; - } - - --m_CurrentUsedSize; - - FreeMemIfPossible(); - - return begin() + ofs; - } - - void clear() - { - m_Size = 0; - m_CurrentUsedSize = 0; - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - } - } -}; - -#endif // __CVECTOR_H__ - diff --git a/dlls/regex/sdk/amxxmodule.cpp b/dlls/regex/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/regex/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/regex/sdk/amxxmodule.h b/dlls/regex/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/regex/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/sockets/AMBuilder b/dlls/sockets/AMBuilder index cbdf3ad8..7ceb5c74 100644 --- a/dlls/sockets/AMBuilder +++ b/dlls/sockets/AMBuilder @@ -4,7 +4,7 @@ import os.path binary = AMXX.Module(builder, 'sockets') binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'sockets.cpp', ] diff --git a/dlls/sockets/Makefile b/dlls/sockets/Makefile index e2677aed..664931a3 100755 --- a/dlls/sockets/Makefile +++ b/dlls/sockets/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -106,7 +108,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -119,6 +121,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/sockets/sdk/moduleconfig.h b/dlls/sockets/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/sockets/sdk/moduleconfig.h rename to dlls/sockets/moduleconfig.h diff --git a/dlls/sockets/msvc10/sockets.vcxproj b/dlls/sockets/msvc10/sockets.vcxproj index ceee300f..3f5581e4 100644 --- a/dlls/sockets/msvc10/sockets.vcxproj +++ b/dlls/sockets/msvc10/sockets.vcxproj @@ -52,7 +52,7 @@ Disabled - ..\;..\sdk;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;SOCKETS_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks @@ -74,7 +74,7 @@ - ..\;..\sdk;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;SOCKETS_EXPORTS;%(PreprocessorDefinitions) MultiThreaded false @@ -95,12 +95,11 @@ - + - - - + + diff --git a/dlls/sockets/msvc10/sockets.vcxproj.filters b/dlls/sockets/msvc10/sockets.vcxproj.filters index 4e761dc5..c46c17ac 100644 --- a/dlls/sockets/msvc10/sockets.vcxproj.filters +++ b/dlls/sockets/msvc10/sockets.vcxproj.filters @@ -23,20 +23,17 @@ Source Files - + Module SDK\SDK Base - - Header Files - - - Module SDK - - + Module SDK\SDK Base + + Module SDK + diff --git a/dlls/sockets/sdk/amxxmodule.cpp b/dlls/sockets/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/sockets/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/sockets/sdk/amxxmodule.h b/dlls/sockets/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/sockets/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/sqlite/AMBuilder b/dlls/sqlite/AMBuilder index 3d2903df..2c29b612 100644 --- a/dlls/sqlite/AMBuilder +++ b/dlls/sqlite/AMBuilder @@ -10,6 +10,7 @@ binary.compiler.cxxincludes += [ binary.compiler.defines += [ 'SM_DEFAULT_THREADER', 'stricmp=strcasecmp', + 'HAVE_STDINT_H', ] if builder.target_platform == 'linux': @@ -20,7 +21,7 @@ binary.sources += [ 'handles.cpp', 'module.cpp', 'threading.cpp', - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'oldcompat_sql.cpp', 'thread/BaseWorker.cpp', 'thread/ThreadWorker.cpp', diff --git a/dlls/sqlite/Makefile b/dlls/sqlite/Makefile index 0e92be87..a3616833 100755 --- a/dlls/sqlite/Makefile +++ b/dlls/sqlite/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public SQL = sqlite-source ##################################### @@ -15,7 +16,7 @@ SQL = sqlite-source PROJECT = sqlite -OBJECTS = basic_sql.cpp handles.cpp module.cpp threading.cpp sdk/amxxmodule.cpp oldcompat_sql.cpp \ +OBJECTS = basic_sql.cpp handles.cpp module.cpp threading.cpp amxxmodule.cpp oldcompat_sql.cpp \ thread/BaseWorker.cpp thread/ThreadWorker.cpp thread/PosixThreads.cpp \ sqlitepp/SqliteQuery.cpp sqlitepp/SqliteResultSet.cpp sqlitepp/SqliteDatabase.cpp \ sqlitepp/SqliteDriver.cpp @@ -41,8 +42,10 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -I$(SQL) -Isqlitepp -Ithread -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(SQL) -Isqlitepp -Ithread \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -127,10 +130,10 @@ $(BIN_DIR)/%.o: %.c all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk mkdir -p $(BIN_DIR)/thread mkdir -p $(BIN_DIR)/sqlitepp mkdir -p $(BIN_DIR)/$(SQL) + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -143,7 +146,6 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -rf $(BIN_DIR)/thread/*.o rm -rf $(BIN_DIR)/sqlitepp/*.o rm -rf $(BIN_DIR)/$(SQL)/*.o diff --git a/dlls/sqlite/basic_sql.cpp b/dlls/sqlite/basic_sql.cpp index 4d606c62..6dd2fb3d 100644 --- a/dlls/sqlite/basic_sql.cpp +++ b/dlls/sqlite/basic_sql.cpp @@ -16,9 +16,6 @@ #include "sqlite_header.h" #include "sqlheaders.h" -using namespace SourceMod; -using namespace SourceHook; - SqliteDriver g_Sqlite; void FreeConnection(void *p, unsigned int num) diff --git a/dlls/sqlite/handles.cpp b/dlls/sqlite/handles.cpp index e418a0f6..0f02d379 100644 --- a/dlls/sqlite/handles.cpp +++ b/dlls/sqlite/handles.cpp @@ -12,8 +12,8 @@ // #include -#include "sh_stack.h" -#include "CVector.h" +#include +#include #include "sqlite_header.h" struct QHandle @@ -24,7 +24,7 @@ struct QHandle bool isfree; }; -CVector g_Handles; +ke::Vector g_Handles; CStack g_FreeHandles; unsigned int MakeHandle(void *ptr, HandleType type, FREEHANDLE f) @@ -39,8 +39,8 @@ unsigned int MakeHandle(void *ptr, HandleType type, FREEHANDLE f) h = g_Handles[num]; } else { h = new QHandle; - g_Handles.push_back(h); - num = static_cast(g_Handles.size()) - 1; + g_Handles.append(h); + num = static_cast(g_Handles.length()) - 1; } h->_ptr = ptr; @@ -57,7 +57,7 @@ void *GetHandle(unsigned int num, HandleType type) return NULL; num--; - if (num >= g_Handles.size()) + if (num >= g_Handles.length()) return NULL; QHandle *h = g_Handles[num]; @@ -75,7 +75,7 @@ bool FreeHandle(unsigned int num) unsigned int _num = num; num--; - if (num >= g_Handles.size()) + if (num >= g_Handles.length()) return false; QHandle *h = g_Handles[num]; @@ -95,7 +95,7 @@ bool FreeHandle(unsigned int num) void FreeAllHandles(HandleType type) { QHandle *q; - for (size_t i = 0; i < g_Handles.size(); i++) + for (size_t i = 0; i < g_Handles.length(); i++) { q = g_Handles[i]; if (q && !q->isfree && q->type == type) @@ -108,7 +108,7 @@ void FreeAllHandles(HandleType type) void FreeHandleTable() { QHandle *q; - for (size_t i = 0; i < g_Handles.size(); i++) + for (size_t i = 0; i < g_Handles.length(); i++) { q = g_Handles[i]; if (q && !q->isfree) diff --git a/dlls/sqlite/sdk/moduleconfig.h b/dlls/sqlite/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/sqlite/sdk/moduleconfig.h rename to dlls/sqlite/moduleconfig.h diff --git a/dlls/sqlite/msvc10/sqlite.vcxproj b/dlls/sqlite/msvc10/sqlite.vcxproj index 123184fb..888aa95d 100644 --- a/dlls/sqlite/msvc10/sqlite.vcxproj +++ b/dlls/sqlite/msvc10/sqlite.vcxproj @@ -53,8 +53,8 @@ /D "NO_TCL" %(AdditionalOptions) Disabled - ..\;..\sdk;..\sqlite-source;..\sqlitepp;..\thread;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;sqlite_EXPORTS;SM_DEFAULT_THREADER;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;..\sqlite-source;..\sqlitepp;..\thread;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;sqlite_EXPORTS;SM_DEFAULT_THREADER;HAVE_STDINT_H;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug @@ -82,8 +82,8 @@ MaxSpeed OnlyExplicitInline true - ..\;..\sdk;..\sqlite-source;..\sqlitepp;..\thread;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\public;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;sqlite_EXPORTS;SM_DEFAULT_THREADER;%(PreprocessorDefinitions) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;..\sqlite-source;..\sqlitepp;..\thread;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\public;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;sqlite_EXPORTS;SM_DEFAULT_THREADER;HAVE_STDINT_H;%(PreprocessorDefinitions) true MultiThreaded 4Bytes @@ -157,12 +157,11 @@ - + - @@ -189,9 +188,8 @@ - - - + + diff --git a/dlls/sqlite/msvc10/sqlite.vcxproj.filters b/dlls/sqlite/msvc10/sqlite.vcxproj.filters index 9c234162..3ffdd237 100644 --- a/dlls/sqlite/msvc10/sqlite.vcxproj.filters +++ b/dlls/sqlite/msvc10/sqlite.vcxproj.filters @@ -33,9 +33,6 @@ {b24e595e-f6a9-4358-bbe3-094ef6383e53} - - {a5586883-461e-4f33-a5df-d7a9226a4cb2} - {c60d3c45-e23b-4c5a-aae2-2c3c5441bac6} @@ -203,7 +200,7 @@ SQLite Source - + Module SDK\SDK Base @@ -214,9 +211,6 @@ Header Files - - Header Files - Header Files @@ -295,15 +289,12 @@ SQLite Source - - Module SDK - - - Module SDK\AMXX STL - - + Module SDK\SDK Base + + Module SDK + diff --git a/dlls/sqlite/sdk/CVector.h b/dlls/sqlite/sdk/CVector.h deleted file mode 100755 index 44241413..00000000 --- a/dlls/sqlite/sdk/CVector.h +++ /dev/null @@ -1,480 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -#ifndef __CVECTOR_H__ -#define __CVECTOR_H__ - -#include - -// Vector -template class CVector -{ - bool Grow(size_t amount) - { - // automatic grow - size_t newSize = m_Size * 2; - - if (newSize == 0) - { - newSize = 8; - } - - while (m_CurrentUsedSize + amount > newSize) - { - newSize *= 2; - } - T *newData = new T[newSize]; - if (!newData) - return false; - if (m_Data) - { - for (size_t i=0; i= m_Size) - { - return Grow(amount); - } - else - { - return true; - } - } - - bool ChangeSize(size_t size) - { - // change size - if (size == m_Size) - return true; - - if (!size) - { - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - m_Size = 0; - } - return true; - } - - T *newData = new T[size]; - if (!newData) - return false; - if (m_Data) - { - size_t end = (m_CurrentUsedSize < size) ? (m_CurrentUsedSize) : size; - for (size_t i=0; i m_Size) - m_CurrentUsedSize = m_Size; - - return true; - } - - void FreeMemIfPossible() - { - if (!m_Data) - return; - - if (!m_CurrentUsedSize) - { - ChangeSize(0); - return; - } - - size_t newSize = m_Size; - while (m_CurrentUsedSize <= newSize / 2) - newSize /= 2; - - if (newSize != m_Size) - ChangeSize(newSize); - } -protected: - T *m_Data; - size_t m_Size; - size_t m_CurrentUsedSize; -public: - class iterator - { - protected: - T *m_Ptr; - public: - // constructors / destructors - iterator() - { - m_Ptr = NULL; - } - - iterator(T * ptr) - { - m_Ptr = ptr; - } - - // member functions - T * base() - { - return m_Ptr; - } - - const T * base() const - { - return m_Ptr; - } - - // operators - T & operator*() - { - return *m_Ptr; - } - - T * operator->() - { - return m_Ptr; - } - - iterator & operator++() // preincrement - { - ++m_Ptr; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Ptr; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Ptr; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Ptr; - return tmp; - } - - bool operator==(T * right) const - { - return (m_Ptr == right); - } - - bool operator==(const iterator & right) const - { - return (m_Ptr == right.m_Ptr); - } - - bool operator!=(T * right) const - { - return (m_Ptr != right); - } - - bool operator!=(const iterator & right) const - { - return (m_Ptr != right.m_Ptr); - } - - iterator & operator+=(size_t offset) - { - m_Ptr += offset; - return (*this); - } - - iterator & operator-=(size_t offset) - { - m_Ptr -= offset; - return (*this); - } - - iterator operator+(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr += offset; - return tmp; - } - - iterator operator-(size_t offset) const - { - iterator tmp(*this); - tmp.m_Ptr -= offset; - return tmp; - } - - T & operator[](size_t offset) - { - return (*(*this + offset)); - } - - const T & operator[](size_t offset) const - { - return (*(*this + offset)); - } - - bool operator<(const iterator & right) const - { - return m_Ptr < right.m_Ptr; - } - - bool operator>(const iterator & right) const - { - return m_Ptr > right.m_Ptr; - } - - bool operator<=(const iterator & right) const - { - return m_Ptr <= right.m_Ptr; - } - - bool operator>=(const iterator & right) const - { - return m_Ptr >= right.m_Ptr; - } - - size_t operator-(const iterator & right) const - { - return m_Ptr - right.m_Ptr; - } - }; - - // constructors / destructors - CVector() - { - m_Size = 0; - m_CurrentUsedSize = 0; - m_Data = NULL; - } - - CVector(const CVector & other) - { - // copy data - m_Data = new T [other.m_CurrentUsedSize]; - m_Size = other.m_CurrentUsedSize; - m_CurrentUsedSize = other.m_CurrentUsedSize; - for (size_t i=0; i() - { - clear(); - } - - // interface - size_t size() const - { - return m_CurrentUsedSize; - } - - size_t capacity() const - { - return m_Size; - } - - iterator begin() const - { - return iterator(m_Data); - } - - iterator end() const - { - return iterator(m_Data + m_CurrentUsedSize); - } - - iterator iterAt(size_t pos) - { - if (pos > m_CurrentUsedSize) - assert(0); - return iterator(m_Data + pos); - } - - bool reserve(size_t newSize) - { - if (newSize > m_Size) - return ChangeSize(newSize); - return true; - } - - bool push_back(const T & elem) - { - if (!GrowIfNeeded(1)) - { - return false; - } - - m_Data[m_CurrentUsedSize++] = elem; - - return true; - } - - void pop_back() - { - --m_CurrentUsedSize; - if (m_CurrentUsedSize < 0) - m_CurrentUsedSize = 0; - - FreeMemIfPossible(); - } - - bool resize(size_t newSize) - { - if (!ChangeSize(newSize)) - return false; - m_CurrentUsedSize = newSize; - return true; - } - - bool empty() const - { - return (m_CurrentUsedSize == 0); - } - - T & at(size_t pos) - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - const T & at(size_t pos) const - { - if (pos > m_CurrentUsedSize) - { - assert(0); - } - return m_Data[pos]; - } - - T & operator[](size_t pos) - { - return at(pos); - } - - const T & operator[](size_t pos) const - { - return at(pos); - } - - T & front() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - const T & front() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[0]; - } - - T & back() - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - const T & back() const - { - if (m_CurrentUsedSize < 1) - { - assert(0); - } - return m_Data[m_CurrentUsedSize - 1]; - } - - iterator insert(iterator where, const T & value) - { - // validate iter - if (where < m_Data || where > (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (!GrowIfNeeded(1)) - { - return false; - } - - ++m_CurrentUsedSize; - - where = begin() + ofs; - - // Move subsequent entries - for (T *ptr = m_Data + m_CurrentUsedSize - 2; ptr >= where.base(); --ptr) - *(ptr + 1) = *ptr; - - *where.base() = value; - - return where; - } - - iterator erase(iterator where) - { - // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) - return iterator(0); - - size_t ofs = where - begin(); - - if (m_CurrentUsedSize > 1) - { - // move - T *theend = m_Data + m_CurrentUsedSize; - for (T *ptr = where.base() + 1; ptr < theend; ++ptr) - *(ptr - 1) = *ptr; - } - - --m_CurrentUsedSize; - - FreeMemIfPossible(); - - return begin() + ofs; - } - - void clear() - { - m_Size = 0; - m_CurrentUsedSize = 0; - if (m_Data) - { - delete [] m_Data; - m_Data = NULL; - } - } -}; - -#endif // __CVECTOR_H__ - diff --git a/dlls/sqlite/sdk/amxxmodule.cpp b/dlls/sqlite/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/sqlite/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/sqlite/sdk/amxxmodule.h b/dlls/sqlite/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/sqlite/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/sqlite/sdk/sh_list.h b/dlls/sqlite/sdk/sh_list.h deleted file mode 100644 index f7276989..00000000 --- a/dlls/sqlite/sdk/sh_list.h +++ /dev/null @@ -1,298 +0,0 @@ -/* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): David "BAILOPAN" Anderson -* ============================ -*/ - -#ifndef _INCLUDE_SMM_LIST_H -#define _INCLUDE_SMM_LIST_H - -// MSVC8 fix for offsetof macro redefition warnings -#ifdef _MSC_VER - #if _MSC_VER >= 1400 - #undef offsetof - #endif -#endif - -#include -#include - -namespace SourceHook -{ - - //This class is from CSDM for AMX Mod X - /* - A circular, doubly-linked list with one sentinel node - - Empty: - m_Head = sentinel - m_Head->next = m_Head; - m_Head->prev = m_Head; - One element: - m_Head = sentinel - m_Head->next = node1 - m_Head->prev = node1 - node1->next = m_Head - node1->prev = m_Head - Two elements: - m_Head = sentinel - m_Head->next = node1 - m_Head->prev = node2 - node1->next = node2 - node1->prev = m_Head - node2->next = m_Head - node2->prev = node1 - */ - template - class List - { - public: - class iterator; - friend class iterator; - class ListNode - { - public: - ListNode(const T & o) : obj(o) { }; - ListNode() { }; - T obj; - ListNode *next; - ListNode *prev; - }; - private: - // Initializes the sentinel node. - // BAIL used malloc instead of new in order to bypass the need for a constructor. - ListNode *_Initialize() - { - ListNode *n = (ListNode *)malloc(sizeof(ListNode)); - n->next = n; - n->prev = n; - return n; - } - public: - List() : m_Head(_Initialize()), m_Size(0) - { - } - List(const List &src) : m_Head(_Initialize()), m_Size(0) - { - iterator iter; - for (iter=src.begin(); iter!=src.end(); iter++) - push_back( (*iter) ); - } - ~List() - { - clear(); - - // Don't forget to free the sentinel - if (m_Head) - { - free(m_Head); - m_Head = NULL; - } - } - void push_back(const T &obj) - { - ListNode *node = new ListNode(obj); - - node->prev = m_Head->prev; - node->next = m_Head; - m_Head->prev->next = node; - m_Head->prev = node; - - m_Size++; - } - size_t size() - { - return m_Size; - } - - void clear() - { - ListNode *node = m_Head->next; - ListNode *temp; - m_Head->next = m_Head; - m_Head->prev = m_Head; - - // Iterate through the nodes until we find g_Head (the sentinel) again - while (node != m_Head) - { - temp = node->next; - delete node; - node = temp; - } - m_Size = 0; - } - bool empty() - { - return (m_Size == 0); - } - T & back() - { - return m_Head->prev->obj; - } - private: - ListNode *m_Head; - size_t m_Size; - public: - class iterator - { - friend class List; - public: - iterator() - { - m_This = NULL; - } - iterator(const List &src) - { - m_This = src.m_Head; - } - iterator(ListNode *n) : m_This(n) - { - } - iterator(const iterator &where) - { - m_This = where.m_This; - } - //pre decrement - iterator & operator--() - { - if (m_This) - m_This = m_This->prev; - return *this; - } - //post decrement - iterator operator--(int) - { - iterator old(*this); - if (m_This) - m_This = m_This->prev; - return old; - } - - //pre increment - iterator & operator++() - { - if (m_This) - m_This = m_This->next; - return *this; - } - //post increment - iterator operator++(int) - { - iterator old(*this); - if (m_This) - m_This = m_This->next; - return old; - } - - const T & operator * () const - { - return m_This->obj; - } - T & operator * () - { - return m_This->obj; - } - - T * operator -> () - { - return &(m_This->obj); - } - const T * operator -> () const - { - return &(m_This->obj); - } - - bool operator != (const iterator &where) const - { - return (m_This != where.m_This); - } - bool operator ==(const iterator &where) const - { - return (m_This == where.m_This); - } - private: - ListNode *m_This; - }; - public: - iterator begin() const - { - return iterator(m_Head->next); - } - iterator end() const - { - return iterator(m_Head); - } - iterator erase(iterator &where) - { - ListNode *pNode = where.m_This; - iterator iter(where); - iter++; - - - // Works for all cases: empty list, erasing first element, erasing tail, erasing in the middle... - pNode->prev->next = pNode->next; - pNode->next->prev = pNode->prev; - - delete pNode; - m_Size--; - - return iter; - } - - iterator insert(iterator where, const T &obj) - { - // Insert obj right before where - - ListNode *node = new ListNode(obj); - ListNode *pWhereNode = where.m_This; - - pWhereNode->prev->next = node; - node->prev = pWhereNode->prev; - pWhereNode->prev = node; - node->next = pWhereNode; - - m_Size++; - - return iterator(node); - } - - public: - void remove(const T & obj) - { - iterator b; - for (b=begin(); b!=end(); b++) - { - if ( (*b) == obj ) - { - erase( b ); - break; - } - } - } - template - iterator find(const U & equ) - { - iterator iter; - for (iter=begin(); iter!=end(); iter++) - { - if ( (*iter) == equ ) - return iter; - } - return end(); - } - List & operator =(const List &src) - { - clear(); - iterator iter; - for (iter=src.begin(); iter!=src.end(); iter++) - push_back( (*iter) ); - return *this; - } - }; -}; //NAMESPACE - -#endif //_INCLUDE_CSDM_LIST_H diff --git a/dlls/sqlite/sdk/sh_stack.h b/dlls/sqlite/sdk/sh_stack.h deleted file mode 100755 index 04158ca1..00000000 --- a/dlls/sqlite/sdk/sh_stack.h +++ /dev/null @@ -1,219 +0,0 @@ -/* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): Pavol "PM OnoTo" Marko -* ============================ -*/ - -#ifndef __SH_STACK_H__ -#define __SH_STACK_H__ - -#define SH_STACK_DEFAULT_SIZE 4 - -//namespace SourceHook -//{/ - // Vector - template class CStack - { - T *m_Elements; - size_t m_AllocatedSize; - size_t m_UsedSize; - public: - friend class iterator; - class iterator - { - CStack *m_pParent; - size_t m_Index; - public: - iterator(CStack *pParent, size_t id) : m_pParent(pParent), m_Index(id) - { - } - - iterator(CStack *pParent) : m_pParent(pParent), m_Index(0) - { - } - - iterator() : m_pParent(NULL), m_Index(0) - { - } - - T &operator *() - { - return m_pParent->m_Elements[m_Index]; - } - const T &operator *() const - { - return m_pParent->m_Elements[m_Index]; - } - - T * operator->() - { - return m_pParent->m_Elements + m_Index; - } - - const T * operator->() const - { - return m_pParent->m_Elements + m_Index; - } - - iterator & operator++() // preincrement - { - ++m_Index; - return (*this); - } - - iterator operator++(int) // postincrement - { - iterator tmp = *this; - ++m_Index; - return tmp; - } - - iterator & operator--() // predecrement - { - --m_Index; - return (*this); - } - - iterator operator--(int) // postdecrememnt - { - iterator tmp = *this; - --m_Index; - return tmp; - } - - bool operator==(const iterator & right) const - { - return (m_pParent == right.m_pParent && m_Index == right.m_Index); - } - - bool operator!=(const iterator & right) const - { - return !(*this == right); - } - }; - CStack() : m_Elements(new T[SH_STACK_DEFAULT_SIZE]), - m_AllocatedSize(SH_STACK_DEFAULT_SIZE), - m_UsedSize(0) - { - } - CStack(size_t size) : m_Elements(new T[size]), - m_AllocatedSize(size), - m_UsedSize(0) - { - } - - CStack(const CStack &other) : m_Elements(NULL), - m_AllocatedSize(0), - m_UsedSize(0) - { - reserve(other.m_AllocatedSize); - m_UsedSize = other.m_UsedSize; - for (size_t i = 0; i < m_UsedSize; ++i) - m_Elements[i] = other.m_Elements[i]; - } - - ~CStack() - { - if (m_Elements) - delete [] m_Elements; - } - - void operator=(const CStack &other) - { - if (m_AllocatedSize < other.m_AllocatedSize) - { - if (m_Elements) - delete [] m_Elements; - m_Elements = new T[other.m_AllocatedSize]; - m_AllocatedSize = other.m_AllocatedSize; - } - m_UsedSize = other.m_UsedSize; - for (size_t i = 0; i < m_UsedSize; ++i) - m_Elements[i] = other.m_Elements[i]; - } - - bool push(const T &val) - { - if (m_UsedSize + 1 == m_AllocatedSize) - { - // zOHNOES! REALLOCATE! - m_AllocatedSize *= 2; - T *newElements = new T[m_AllocatedSize]; - if (!newElements) - { - m_AllocatedSize /= 2; - return false; - } - if (m_Elements) - { - for (size_t i = 0; i < m_UsedSize; ++i) - newElements[i] = m_Elements[i]; - delete [] m_Elements; - } - m_Elements = newElements; - } - m_Elements[m_UsedSize++] = val; - return true; - } - void pop() - { - --m_UsedSize; - } - - T &front() - { - return m_Elements[m_UsedSize - 1]; - } - - const T &front() const - { - return m_Elements[m_UsedSize - 1]; - } - - iterator begin() - { - return iterator(this, 0); - } - iterator end() - { - return iterator(this, m_UsedSize); - } - - size_t size() - { - return m_UsedSize; - } - size_t capacity() - { - return m_AllocatedSize; - } - bool empty() - { - return m_UsedSize == 0 ? true : false; - } - bool reserve(size_t size) - { - if (size > m_AllocatedSize) - { - T *newElements = new T[size]; - if (!newElements) - return false; - if (m_Elements) - { - for (size_t i = 0; i < m_UsedSize; ++i) - newElements[i] = m_Elements[i]; - delete [] m_Elements; - } - m_Elements = newElements; - m_AllocatedSize = size; - } - return true; - } - }; -//}; //namespace SourceHook - -#endif diff --git a/dlls/sqlite/sdk/sh_string.h b/dlls/sqlite/sdk/sh_string.h deleted file mode 100755 index e1cc54d6..00000000 --- a/dlls/sqlite/sdk/sh_string.h +++ /dev/null @@ -1,367 +0,0 @@ -/* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): David "BAILOPAN" Anderson -* ============================ -*/ - -/* AMX Mod X - * - * by the AMX Mod X Development Team - */ - -#ifndef _INCLUDE_CSTRING_H -#define _INCLUDE_CSTRING_H - -#include -#include - -namespace SourceHook -{ -class String -{ -public: - String() - { - v = NULL; - a_size = 0; - //assign(""); - } - - ~String() - { - if (v) - delete [] v; - } - - String(const char *src) - { - v = NULL; - a_size = 0; - assign(src); - } - - String(const String &src) - { - v = NULL; - a_size = 0; - assign(src.c_str()); - } - - const char *c_str() { return v?v:""; } - - const char *c_str() const { return v?v:""; } - - void append(const char *t) - { - Grow(size() + strlen(t) + 1); - strcat(v, t); - } - - void append(const char c) - { - size_t len = size(); - Grow(len + 2); - v[len] = c; - v[len + 1] = '\0'; - } - - void append(String &d) - { - append(d.c_str()); - } - - void assign(const String &src) - { - assign(src.c_str()); - } - - void assign(const char *d) - { - if (!d) - { - clear(); - } else { - Grow(strlen(d) + 1, false); - strcpy(v, d); - } - } - - void clear() - { - if (v) - v[0] = '\0'; - } - - int compare (const char *d) - { - if (!v) - return strcmp("", d); - else - return strcmp(v, d); - } - - //Added this for amxx inclusion - bool empty() - { - if (!v) - return true; - - if (v[0] == '\0') - return true; - - return false; - } - - size_t size() - { - if (v) - return strlen(v); - else - return 0; - } - - int find(const char c, int index = 0) - { - int len = static_cast(size()); - if (len < 1) - return npos; - if (index >= len || index < 0) - return npos; - int i = 0; - for (i=index; i len-start) - num = len - start; - //do the erasing - bool copyflag = false; - for (i=0; i=start && i= len || !v) - return ns; - - if (num == npos) - { - num = len - index; - } else if (index+num >= len) { - num = len - index; - } - - unsigned int i = 0; - unsigned int nslen = num + 2; - - ns.Grow(nslen); - - for (i=index; i= 65 && v[i] <= 90) - v[i] &= ~(1<<5); - } - } - - String & operator = (const String &src) - { - assign(src); - return *this; - } - - String & operator = (const char *src) - { - assign(src); - return *this; - - } - - char operator [] (unsigned int index) - { - if (index > size() || !v) - { - return -1; - } else { - return v[index]; - } - } - - int at(int a) - { - if (a < 0 || a >= (int)size() || !v) - return -1; - - return v[a]; - } - - bool at(int at, char c) - { - if (at < 0 || at >= (int)size() || !v) - return false; - - v[at] = c; - - return true; - } - -private: - void Grow(unsigned int d, bool copy=true) - { - if (d <= a_size) - return; - char *n = new char[d + 1]; - if (copy && v) - strcpy(n, v); - if (v) - delete [] v; - else - strcpy(n, ""); - v = n; - a_size = d + 1; - } - - char *v; - unsigned int a_size; -public: - static const int npos = -1; -}; - -}; //NAMESPACE - -#endif //_INCLUDE_CSTRING_H diff --git a/dlls/sqlite/sqlite-source/sqliteInt.h b/dlls/sqlite/sqlite-source/sqliteInt.h index 0b531d24..6716ae36 100644 --- a/dlls/sqlite/sqlite-source/sqliteInt.h +++ b/dlls/sqlite/sqlite-source/sqliteInt.h @@ -16,7 +16,7 @@ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ -#if defined _MSC_VER && _MSC_VER >= 1400 +#if defined _MSC_VER && _MSC_VER >= 1400 && !defined _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE #endif diff --git a/dlls/sqlite/thread/BaseWorker.cpp b/dlls/sqlite/thread/BaseWorker.cpp index f02758a4..932eb6d5 100644 --- a/dlls/sqlite/thread/BaseWorker.cpp +++ b/dlls/sqlite/thread/BaseWorker.cpp @@ -86,7 +86,7 @@ SWThreadHandle *BaseWorker::PopThreadFromQueue() if (!m_ThreadQueue.size()) return NULL; - SourceHook::List::iterator begin; + List::iterator begin; SWThreadHandle *swt; begin = m_ThreadQueue.begin(); diff --git a/dlls/sqlite/thread/BaseWorker.h b/dlls/sqlite/thread/BaseWorker.h index b2a218cf..12eb407c 100644 --- a/dlls/sqlite/thread/BaseWorker.h +++ b/dlls/sqlite/thread/BaseWorker.h @@ -10,7 +10,7 @@ #ifndef _INCLUDE_SOURCEMOD_BASEWORKER_H #define _INCLUDE_SOURCEMOD_BASEWORKER_H -#include "sh_list.h" +#include #include "ThreadSupport.h" #define SM_DEFAULT_THREADS_PER_FRAME 1 @@ -73,7 +73,7 @@ public: //BaseWorker virtual void SetMaxThreadsPerFrame(unsigned int threads); virtual unsigned int GetMaxThreadsPerFrame(); protected: - SourceHook::List m_ThreadQueue; + List m_ThreadQueue; unsigned int m_perFrame; volatile WorkerState m_state; }; diff --git a/dlls/sqlite/threading.cpp b/dlls/sqlite/threading.cpp index f80350c8..de5953b6 100644 --- a/dlls/sqlite/threading.cpp +++ b/dlls/sqlite/threading.cpp @@ -14,9 +14,7 @@ #include "amxxmodule.h" #include "sqlite_header.h" #include "threading.h" - -using namespace SourceMod; -using namespace SourceHook; +#include MainThreader g_Threader; ThreadWorker *g_pWorker = NULL; @@ -141,20 +139,20 @@ void MysqlThread::SetForward(int forward) void MysqlThread::SetInfo(const char *db) { - m_db.assign(db); + m_db = db; m_qrInfo.queue_time = gpGlobals->time; } void MysqlThread::SetQuery(const char *query) { - m_query.assign(query); + m_query = query; } void MysqlThread::RunThread(IThreadHandle *pHandle) { DatabaseInfo info; - info.database = m_db.c_str(); + info.database = m_db.chars(); info.pass = ""; info.user = ""; info.host = ""; @@ -174,7 +172,7 @@ void MysqlThread::RunThread(IThreadHandle *pHandle) m_qrInfo.query_success = false; } else { m_qrInfo.connect_success = true; - pQuery = pDatabase->PrepareQuery(m_query.c_str()); + pQuery = pDatabase->PrepareQuery(m_query.chars()); if (!pQuery->Execute2(&m_qrInfo.amxinfo.info, m_qrInfo.amxinfo.error, 254)) { m_qrInfo.query_success = false; @@ -193,8 +191,8 @@ void MysqlThread::RunThread(IThreadHandle *pHandle) { m_qrInfo.amxinfo.pQuery = pQuery; } else { - m_qrInfo.amxinfo.opt_ptr = new char[m_query.size() + 1]; - strcpy(m_qrInfo.amxinfo.opt_ptr, m_query.c_str()); + m_qrInfo.amxinfo.opt_ptr = new char[m_query.length() + 1]; + strcpy(m_qrInfo.amxinfo.opt_ptr, m_query.chars()); } if (pDatabase) @@ -418,7 +416,7 @@ bool AtomicResult::FieldNameToNum(const char *name, unsigned int *columnId) for (unsigned int i=0; ic_str(), name) == 0) + if (strcmp(m_Table[i]->chars(), name) == 0) { if (columnId) { @@ -438,7 +436,7 @@ const char *AtomicResult::FieldNumToName(unsigned int num) assert(m_Table[num] != NULL); - return m_Table[num]->c_str(); + return m_Table[num]->chars(); } double AtomicResult::GetDouble(unsigned int columnId) @@ -479,7 +477,7 @@ const char *AtomicResult::GetString(unsigned int columnId) assert(m_Table[idx] != NULL); - return m_Table[idx]->c_str(); + return m_Table[idx]->chars(); } IResultRow *AtomicResult::GetRow() @@ -529,11 +527,11 @@ void AtomicResult::CopyFrom(IResultSet *rs) size_t newTotal = (m_RowCount * m_FieldCount) + m_FieldCount; if (newTotal > m_AllocSize) { - SourceHook::String **table = new SourceHook::String *[newTotal]; - memset(table, 0, newTotal * sizeof(SourceHook::String *)); + ke::AString **table = new ke::AString *[newTotal]; + memset(table, 0, newTotal * sizeof(ke::AString *)); if (m_Table) { - memcpy(table, m_Table, m_AllocSize * sizeof(SourceHook::String *)); + memcpy(table, m_Table, m_AllocSize * sizeof(ke::AString *)); delete [] m_Table; } m_Table = table; @@ -544,9 +542,9 @@ void AtomicResult::CopyFrom(IResultSet *rs) { if (m_Table[i]) { - m_Table[i]->assign(rs->FieldNumToName(i)); + *m_Table[i] = rs->FieldNumToName(i); } else { - m_Table[i] = new SourceHook::String(rs->FieldNumToName(i)); + m_Table[i] = new ke::AString(rs->FieldNumToName(i)); } } @@ -559,9 +557,9 @@ void AtomicResult::CopyFrom(IResultSet *rs) { if (m_Table[idx]) { - m_Table[idx]->assign(row->GetString(i)); + *m_Table[idx] = row->GetString(i); } else { - m_Table[idx] = new SourceHook::String(row->GetString(i)); + m_Table[idx] = new ke::AString(row->GetString(i)); } } rs->NextRow(); diff --git a/dlls/sqlite/threading.h b/dlls/sqlite/threading.h index a3c640c7..7de0cbb2 100644 --- a/dlls/sqlite/threading.h +++ b/dlls/sqlite/threading.h @@ -16,9 +16,9 @@ #include "IThreader.h" #include "ISQLDriver.h" -#include "sh_string.h" -#include "CVector.h" -#include "sh_stack.h" +#include +#include +#include struct QueuedResultInfo { @@ -64,7 +64,7 @@ private: unsigned int m_RowCount; unsigned int m_FieldCount; size_t m_AllocSize; - SourceHook::String **m_Table; + ke::AString **m_Table; unsigned int m_CurRow; bool m_IsFree; }; @@ -85,8 +85,8 @@ public: void RunThread(IThreadHandle *pHandle); void OnTerminate(IThreadHandle *pHandle, bool cancel); private: - SourceHook::String m_query; - SourceHook::String m_db; + ke::AString m_query; + ke::AString m_db; cell *m_data; ucell m_datalen; size_t m_maxdatalen; diff --git a/dlls/tfcx/AMBuilder b/dlls/tfcx/AMBuilder index b297f772..80e95188 100644 --- a/dlls/tfcx/AMBuilder +++ b/dlls/tfcx/AMBuilder @@ -4,7 +4,7 @@ import os.path binary = AMXX.MetaModule(builder, 'tfcx') binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../public/sdk/amxxmodule.cpp', 'CRank.cpp', 'CMisc.cpp', 'NBase.cpp', diff --git a/dlls/tfcx/Makefile b/dlls/tfcx/Makefile index 3482fd45..2c76bf10 100755 --- a/dlls/tfcx/Makefile +++ b/dlls/tfcx/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../hlsdk MM_ROOT = ../../../metamod/metamod +PUBLIC_ROOT = ../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../metamod/metamod PROJECT = tfcx -OBJECTS = sdk/amxxmodule.cpp CRank.cpp CMisc.cpp NBase.cpp NRank.cpp usermsg.cpp Utils.cpp \ +OBJECTS = amxxmodule.cpp CRank.cpp CMisc.cpp NBase.cpp NRank.cpp usermsg.cpp Utils.cpp \ moduleconfig.cpp ############################################## @@ -30,8 +31,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -106,7 +108,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -119,6 +121,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/tfcx/sdk/moduleconfig.h b/dlls/tfcx/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/tfcx/sdk/moduleconfig.h rename to dlls/tfcx/moduleconfig.h diff --git a/dlls/tfcx/msvc10/tfcx.vcxproj b/dlls/tfcx/msvc10/tfcx.vcxproj index 41a5d4f5..44e04609 100644 --- a/dlls/tfcx/msvc10/tfcx.vcxproj +++ b/dlls/tfcx/msvc10/tfcx.vcxproj @@ -61,7 +61,7 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;tfcx_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -103,7 +103,7 @@ MaxSpeed OnlyExplicitInline - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;tfcx_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded @@ -140,15 +140,14 @@ - + - - - + + diff --git a/dlls/tfcx/msvc10/tfcx.vcxproj.filters b/dlls/tfcx/msvc10/tfcx.vcxproj.filters index 82cc62d0..785a76eb 100644 --- a/dlls/tfcx/msvc10/tfcx.vcxproj.filters +++ b/dlls/tfcx/msvc10/tfcx.vcxproj.filters @@ -41,7 +41,7 @@ Source Files - + Module SDK\Base SDK @@ -52,18 +52,15 @@ Header Files - - Header Files - Header Files - - Module SDK - - + Module SDK\Base SDK + + Module SDK + diff --git a/dlls/tfcx/sdk/amxxmodule.cpp b/dlls/tfcx/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/tfcx/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/tfcx/sdk/amxxmodule.h b/dlls/tfcx/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/tfcx/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/ts/tsfun/AMBuilder b/dlls/ts/tsfun/AMBuilder index 58a82734..97d90a77 100644 --- a/dlls/ts/tsfun/AMBuilder +++ b/dlls/ts/tsfun/AMBuilder @@ -4,7 +4,7 @@ import os.path binary = AMXX.MetaModule(builder, 'tsfun') binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../../public/sdk/amxxmodule.cpp', ] AMXX.modules += [builder.Add(binary)] diff --git a/dlls/ts/tsfun/Makefile b/dlls/ts/tsfun/Makefile index ee5436b3..194edbcb 100755 --- a/dlls/ts/tsfun/Makefile +++ b/dlls/ts/tsfun/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../../hlsdk MM_ROOT = ../../../../metamod/metamod +PUBLIC_ROOT = ../../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../../metamod/metamod PROJECT = tsfun -OBJECTS = sdk/amxxmodule.cpp +OBJECTS = amxxmodule.cpp ############################################## ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### @@ -29,8 +30,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/memtools -I$(PUBLIC_ROOT)/memtools/CDetour -I$(PUBLIC_ROOT)/memtools/CDetour/asm -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -105,7 +107,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -118,6 +120,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/ts/tsfun/sdk/moduleconfig.h b/dlls/ts/tsfun/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/ts/tsfun/sdk/moduleconfig.h rename to dlls/ts/tsfun/moduleconfig.h diff --git a/dlls/ts/tsfun/msvc10/tsfun.vcxproj b/dlls/ts/tsfun/msvc10/tsfun.vcxproj index 4979c079..a656a723 100644 --- a/dlls/ts/tsfun/msvc10/tsfun.vcxproj +++ b/dlls/ts/tsfun/msvc10/tsfun.vcxproj @@ -62,7 +62,7 @@ Disabled - ..\;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;TSFUN_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks @@ -104,7 +104,7 @@ MaxSpeed OnlyExplicitInline - ..\;%(AdditionalIncludeDirectories) + ..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;TSFUN_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded @@ -132,12 +132,11 @@ - - - + + - + diff --git a/dlls/ts/tsfun/msvc10/tsfun.vcxproj.filters b/dlls/ts/tsfun/msvc10/tsfun.vcxproj.filters index 850e4ae0..a50ed80a 100644 --- a/dlls/ts/tsfun/msvc10/tsfun.vcxproj.filters +++ b/dlls/ts/tsfun/msvc10/tsfun.vcxproj.filters @@ -13,18 +13,15 @@ - - Header Files - - + Module SDK - + Module SDK\SDK Base - + Module SDK\SDK Base diff --git a/dlls/ts/tsfun/sdk/amxxmodule.cpp b/dlls/ts/tsfun/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/ts/tsfun/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/ts/tsfun/sdk/amxxmodule.h b/dlls/ts/tsfun/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/ts/tsfun/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/dlls/ts/tsx/AMBuilder b/dlls/ts/tsx/AMBuilder index 8b7bc52e..6b9945c4 100644 --- a/dlls/ts/tsx/AMBuilder +++ b/dlls/ts/tsx/AMBuilder @@ -4,7 +4,7 @@ import os.path binary = AMXX.MetaModule(builder, 'tsx') binary.sources = [ - 'sdk/amxxmodule.cpp', + '../../../public/sdk/amxxmodule.cpp', 'CMisc.cpp', 'CRank.cpp', 'NBase.cpp', diff --git a/dlls/ts/tsx/Makefile b/dlls/ts/tsx/Makefile index ada599b2..c31b4549 100755 --- a/dlls/ts/tsx/Makefile +++ b/dlls/ts/tsx/Makefile @@ -7,6 +7,7 @@ HLSDK = ../../../../hlsdk MM_ROOT = ../../../../metamod/metamod +PUBLIC_ROOT = ../../../public ##################################### ### EDIT BELOW FOR OTHER PROJECTS ### @@ -14,7 +15,7 @@ MM_ROOT = ../../../../metamod/metamod PROJECT = tsx -OBJECTS = sdk/amxxmodule.cpp CMisc.cpp CRank.cpp NBase.cpp NRank.cpp Utils.cpp moduleconfig.cpp \ +OBJECTS = amxxmodule.cpp CMisc.cpp CRank.cpp NBase.cpp NRank.cpp Utils.cpp moduleconfig.cpp \ usermsg.cpp ############################################## @@ -30,8 +31,9 @@ CPP_OSX = clang LINK = -INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ - -I$(HLSDK)/public -I$(MM_ROOT) -Isdk +INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/memtools -I$(PUBLIC_ROOT)/memtools/CDetour -I$(PUBLIC_ROOT)/memtools/CDetour/asm -I$(PUBLIC_ROOT)/amtl \ + -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \ + -I$(MM_ROOT) ################################################ ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### @@ -106,7 +108,7 @@ $(BIN_DIR)/%.o: %.cpp all: mkdir -p $(BIN_DIR) - mkdir -p $(BIN_DIR)/sdk + ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT) $(PROJECT): $(OBJ_BIN) @@ -119,6 +121,5 @@ default: all clean: rm -rf $(BIN_DIR)/*.o - rm -rf $(BIN_DIR)/sdk/*.o rm -f $(BIN_DIR)/$(BINARY) diff --git a/dlls/ts/tsx/sdk/moduleconfig.h b/dlls/ts/tsx/moduleconfig.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/ts/tsx/sdk/moduleconfig.h rename to dlls/ts/tsx/moduleconfig.h diff --git a/dlls/ts/tsx/msvc10/tsx.vcxproj b/dlls/ts/tsx/msvc10/tsx.vcxproj index 968220f9..b674b449 100644 --- a/dlls/ts/tsx/msvc10/tsx.vcxproj +++ b/dlls/ts/tsx/msvc10/tsx.vcxproj @@ -61,7 +61,7 @@ Disabled - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;tsx_amxx_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -103,7 +103,7 @@ MaxSpeed OnlyExplicitInline - ..\;..\sdk;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) + ..\;..\..\..\..\public;..\..\..\..\public\sdk; ..\..\..\..\public\amtl;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories) tsx_amxx_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded @@ -140,16 +140,15 @@ - + - - - + + diff --git a/dlls/ts/tsx/msvc10/tsx.vcxproj.filters b/dlls/ts/tsx/msvc10/tsx.vcxproj.filters index 4e0af061..35d1a746 100644 --- a/dlls/ts/tsx/msvc10/tsx.vcxproj.filters +++ b/dlls/ts/tsx/msvc10/tsx.vcxproj.filters @@ -38,7 +38,7 @@ Source Files - + Module SDK\Base SDK @@ -49,20 +49,17 @@ Header Files - - Header Files - Header Files Header Files - - Module SDK - - + Module SDK\Base SDK + + Module SDK + \ No newline at end of file diff --git a/dlls/ts/tsx/sdk/amxxmodule.cpp b/dlls/ts/tsx/sdk/amxxmodule.cpp deleted file mode 100755 index 864d68a5..00000000 --- a/dlls/ts/tsx/sdk/amxxmodule.cpp +++ /dev/null @@ -1,3144 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// Parts Copyright (C) 2001-2003 Will Day -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - -// -// Module SDK -// - -#include -#include -#include -#include -#include -#include "amxxmodule.h" - -/************* METAMOD SUPPORT *************/ -#ifdef USE_METAMOD - -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; - -DLL_FUNCTIONS *g_pFunctionTable; -DLL_FUNCTIONS *g_pFunctionTable_Post; -enginefuncs_t *g_pengfuncsTable; -enginefuncs_t *g_pengfuncsTable_Post; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable; -NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post; - -// GetEntityAPI2 functions -static DLL_FUNCTIONS g_EntityAPI_Table = -{ -#ifdef FN_GameDLLInit - FN_GameDLLInit, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn - FN_DispatchSpawn, -#else - NULL, -#endif -#ifdef FN_DispatchThink - FN_DispatchThink, -#else - NULL, -#endif -#ifdef FN_DispatchUse - FN_DispatchUse, -#else - NULL, -#endif -#ifdef FN_DispatchTouch - FN_DispatchTouch, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked - FN_DispatchBlocked, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue - FN_DispatchKeyValue, -#else - NULL, -#endif -#ifdef FN_DispatchSave - FN_DispatchSave, -#else - NULL, -#endif -#ifdef FN_DispatchRestore - FN_DispatchRestore, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox - FN_DispatchObjectCollsionBox, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields - FN_SaveWriteFields, -#else - NULL, -#endif -#ifdef FN_SaveReadFields - FN_SaveReadFields, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState - FN_SaveGlobalState, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState - FN_RestoreGlobalState, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState - FN_ResetGlobalState, -#else - NULL, -#endif -#ifdef FN_ClientConnect - FN_ClientConnect, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect - FN_ClientDisconnect, -#else - NULL, -#endif -#ifdef FN_ClientKill - FN_ClientKill, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer - FN_ClientPutInServer, -#else - NULL, -#endif -#ifdef FN_ClientCommand - FN_ClientCommand, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged - FN_ClientUserInfoChanged, -#else - NULL, -#endif -#ifdef FN_ServerActivate - FN_ServerActivate, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate - FN_ServerDeactivate, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink - FN_PlayerPreThink, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink - FN_PlayerPostThink, -#else - NULL, -#endif -#ifdef FN_StartFrame - FN_StartFrame, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel - FN_ParmsNewLevel, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel - FN_ParmsChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetGameDescription - FN_GetGameDescription, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization - FN_PlayerCustomization, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect - FN_SpectatorConnect, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect - FN_SpectatorDisconnect, -#else - NULL, -#endif -#ifdef FN_SpectatorThink - FN_SpectatorThink, -#else - NULL, -#endif -#ifdef FN_Sys_Error - FN_Sys_Error, -#else - NULL, -#endif -#ifdef FN_PM_Move - FN_PM_Move, -#else - NULL, -#endif -#ifdef FN_PM_Init - FN_PM_Init, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType - FN_PM_FindTextureType, -#else - NULL, -#endif -#ifdef FN_SetupVisibility - FN_SetupVisibility, -#else - NULL, -#endif -#ifdef FN_UpdateClientData - FN_UpdateClientData, -#else - NULL, -#endif -#ifdef FN_AddToFullPack - FN_AddToFullPack, -#else - NULL, -#endif -#ifdef FN_CreateBaseline - FN_CreateBaseline, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders - FN_RegisterEncoders, -#else - NULL, -#endif -#ifdef FN_GetWeaponData - FN_GetWeaponData, -#else - NULL, -#endif -#ifdef FN_CmdStart - FN_CmdStart, -#else - NULL, -#endif -#ifdef FN_CmdEnd - FN_CmdEnd, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket - FN_ConnectionlessPacket, -#else - NULL, -#endif -#ifdef FN_GetHullBounds - FN_GetHullBounds, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines - FN_CreateInstancedBaselines, -#else - NULL, -#endif -#ifdef FN_InconsistentFile - FN_InconsistentFile, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation -#else - NULL -#endif -}; // g_EntityAPI2_Table - -// GetEntityAPI2_Post functions -static DLL_FUNCTIONS g_EntityAPI_Post_Table = -{ -#ifdef FN_GameDLLInit_Post - FN_GameDLLInit_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSpawn_Post - FN_DispatchSpawn_Post, -#else - NULL, -#endif -#ifdef FN_DispatchThink_Post - FN_DispatchThink_Post, -#else - NULL, -#endif -#ifdef FN_DispatchUse_Post - FN_DispatchUse_Post, -#else - NULL, -#endif -#ifdef FN_DispatchTouch_Post - FN_DispatchTouch_Post, -#else - NULL, -#endif -#ifdef FN_DispatchBlocked_Post - FN_DispatchBlocked_Post, -#else - NULL, -#endif -#ifdef FN_DispatchKeyValue_Post - FN_DispatchKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_DispatchSave_Post - FN_DispatchSave_Post, -#else - NULL, -#endif -#ifdef FN_DispatchRestore_Post - FN_DispatchRestore_Post, -#else - NULL, -#endif -#ifdef FN_DispatchObjectCollsionBox_Post - FN_DispatchObjectCollsionBox_Post, -#else - NULL, -#endif -#ifdef FN_SaveWriteFields_Post - FN_SaveWriteFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveReadFields_Post - FN_SaveReadFields_Post, -#else - NULL, -#endif -#ifdef FN_SaveGlobalState_Post - FN_SaveGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_RestoreGlobalState_Post - FN_RestoreGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ResetGlobalState_Post - FN_ResetGlobalState_Post, -#else - NULL, -#endif -#ifdef FN_ClientConnect_Post - FN_ClientConnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientDisconnect_Post - FN_ClientDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_ClientKill_Post - FN_ClientKill_Post, -#else - NULL, -#endif -#ifdef FN_ClientPutInServer_Post - FN_ClientPutInServer_Post, -#else - NULL, -#endif -#ifdef FN_ClientCommand_Post - FN_ClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ClientUserInfoChanged_Post - FN_ClientUserInfoChanged_Post, -#else - NULL, -#endif -#ifdef FN_ServerActivate_Post - FN_ServerActivate_Post, -#else - NULL, -#endif -#ifdef FN_ServerDeactivate_Post - FN_ServerDeactivate_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPreThink_Post - FN_PlayerPreThink_Post, -#else - NULL, -#endif -#ifdef FN_PlayerPostThink_Post - FN_PlayerPostThink_Post, -#else - NULL, -#endif -#ifdef FN_StartFrame_Post - FN_StartFrame_Post, -#else - NULL, -#endif -#ifdef FN_ParmsNewLevel_Post - FN_ParmsNewLevel_Post, -#else - NULL, -#endif -#ifdef FN_ParmsChangeLevel_Post - FN_ParmsChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDescription_Post - FN_GetGameDescription_Post, -#else - NULL, -#endif -#ifdef FN_PlayerCustomization_Post - FN_PlayerCustomization_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorConnect_Post - FN_SpectatorConnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorDisconnect_Post - FN_SpectatorDisconnect_Post, -#else - NULL, -#endif -#ifdef FN_SpectatorThink_Post - FN_SpectatorThink_Post, -#else - NULL, -#endif -#ifdef FN_Sys_Error_Post - FN_Sys_Error_Post, -#else - NULL, -#endif -#ifdef FN_PM_Move_Post - FN_PM_Move_Post, -#else - NULL, -#endif -#ifdef FN_PM_Init_Post - FN_PM_Init_Post, -#else - NULL, -#endif -#ifdef FN_PM_FindTextureType_Post - FN_PM_FindTextureType_Post, -#else - NULL, -#endif -#ifdef FN_SetupVisibility_Post - FN_SetupVisibility_Post, -#else - NULL, -#endif -#ifdef FN_UpdateClientData_Post - FN_UpdateClientData_Post, -#else - NULL, -#endif -#ifdef FN_AddToFullPack_Post - FN_AddToFullPack_Post, -#else - NULL, -#endif -#ifdef FN_CreateBaseline_Post - FN_CreateBaseline_Post, -#else - NULL, -#endif -#ifdef FN_RegisterEncoders_Post - FN_RegisterEncoders_Post, -#else - NULL, -#endif -#ifdef FN_GetWeaponData_Post - FN_GetWeaponData_Post, -#else - NULL, -#endif -#ifdef FN_CmdStart_Post - FN_CmdStart_Post, -#else - NULL, -#endif -#ifdef FN_CmdEnd_Post - FN_CmdEnd_Post, -#else - NULL, -#endif -#ifdef FN_ConnectionlessPacket_Post - FN_ConnectionlessPacket_Post, -#else - NULL, -#endif -#ifdef FN_GetHullBounds_Post - FN_GetHullBounds_Post, -#else - NULL, -#endif -#ifdef FN_CreateInstancedBaselines_Post - FN_CreateInstancedBaselines_Post, -#else - NULL, -#endif -#ifdef FN_InconsistentFile_Post - FN_InconsistentFile_Post, -#else - NULL, -#endif -#ifdef FN_AllowLagCompensation - FN_AllowLagCompensation, -#else - NULL, -#endif -}; // g_EntityAPI2_Table - -static enginefuncs_t g_EngineFuncs_Table = -{ -#ifdef FN_PrecacheModel - FN_PrecacheModel, -#else - NULL, -#endif -#ifdef FN_PrecacheSound - FN_PrecacheSound, -#else - NULL, -#endif -#ifdef FN_SetModel - FN_SetModel, -#else - NULL, -#endif -#ifdef FN_ModelIndex - FN_ModelIndex, -#else - NULL, -#endif -#ifdef FN_ModelFrames - FN_ModelFrames, -#else - NULL, -#endif -#ifdef FN_SetSize - FN_SetSize, -#else - NULL, -#endif -#ifdef FN_ChangeLevel - FN_ChangeLevel, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms - FN_GetSpawnParms, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms - FN_SaveSpawnParms, -#else - NULL, -#endif -#ifdef FN_VecToYaw - FN_VecToYaw, -#else - NULL, -#endif -#ifdef FN_VecToAngles - FN_VecToAngles, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin - FN_MoveToOrigin, -#else - NULL, -#endif -#ifdef FN_ChangeYaw - FN_ChangeYaw, -#else - NULL, -#endif -#ifdef FN_ChangePitch - FN_ChangePitch, -#else - NULL, -#endif -#ifdef FN_FindEntityByString - FN_FindEntityByString, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum - FN_GetEntityIllum, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere - FN_FindEntityInSphere, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS - FN_FindClientInPVS, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS - FN_EntitiesInPVS, -#else - NULL, -#endif -#ifdef FN_MakeVectors - FN_MakeVectors, -#else - NULL, -#endif -#ifdef FN_AngleVectors - FN_AngleVectors, -#else - NULL, -#endif -#ifdef FN_CreateEntity - FN_CreateEntity, -#else - NULL, -#endif -#ifdef FN_RemoveEntity - FN_RemoveEntity, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity - FN_CreateNamedEntity, -#else - NULL, -#endif -#ifdef FN_MakeStatic - FN_MakeStatic, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor - FN_EntIsOnFloor, -#else - NULL, -#endif -#ifdef FN_DropToFloor - FN_DropToFloor, -#else - NULL, -#endif -#ifdef FN_WalkMove - FN_WalkMove, -#else - NULL, -#endif -#ifdef FN_SetOrigin - FN_SetOrigin, -#else - NULL, -#endif -#ifdef FN_EmitSound - FN_EmitSound, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound - FN_EmitAmbientSound, -#else - NULL, -#endif -#ifdef FN_TraceLine - FN_TraceLine, -#else - NULL, -#endif -#ifdef FN_TraceToss - FN_TraceToss, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull - FN_TraceMonsterHull, -#else - NULL, -#endif -#ifdef FN_TraceHull - FN_TraceHull, -#else - NULL, -#endif -#ifdef FN_TraceModel - FN_TraceModel, -#else - NULL, -#endif -#ifdef FN_TraceTexture - FN_TraceTexture, -#else - NULL, -#endif -#ifdef FN_TraceSphere - FN_TraceSphere, -#else - NULL, -#endif -#ifdef FN_GetAimVector - FN_GetAimVector, -#else - NULL, -#endif -#ifdef FN_ServerCommand - FN_ServerCommand, -#else - NULL, -#endif -#ifdef FN_ServerExecute - FN_ServerExecute, -#else - NULL, -#endif -#ifdef FN_engClientCommand - FN_engClientCommand, -#else - NULL, -#endif -#ifdef FN_ParticleEffect - FN_ParticleEffect, -#else - NULL, -#endif -#ifdef FN_LightStyle - FN_LightStyle, -#else - NULL, -#endif -#ifdef FN_DecalIndex - FN_DecalIndex, -#else - NULL, -#endif -#ifdef FN_PointContents - FN_PointContents, -#else - NULL, -#endif -#ifdef FN_MessageBegin - FN_MessageBegin, -#else - NULL, -#endif -#ifdef FN_MessageEnd - FN_MessageEnd, -#else - NULL, -#endif -#ifdef FN_WriteByte - FN_WriteByte, -#else - NULL, -#endif -#ifdef FN_WriteChar - FN_WriteChar, -#else - NULL, -#endif -#ifdef FN_WriteShort - FN_WriteShort, -#else - NULL, -#endif -#ifdef FN_WriteLong - FN_WriteLong, -#else - NULL, -#endif -#ifdef FN_WriteAngle - FN_WriteAngle, -#else - NULL, -#endif -#ifdef FN_WriteCoord - FN_WriteCoord, -#else - NULL, -#endif -#ifdef FN_WriteString - FN_WriteString, -#else - NULL, -#endif -#ifdef FN_WriteEntity - FN_WriteEntity, -#else - NULL, -#endif -#ifdef FN_CVarRegister - FN_CVarRegister, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat - FN_CVarGetFloat, -#else - NULL, -#endif -#ifdef FN_CVarGetString - FN_CVarGetString, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat - FN_CVarSetFloat, -#else - NULL, -#endif -#ifdef FN_CVarSetString - FN_CVarSetString, -#else - NULL, -#endif -#ifdef FN_AlertMessage - FN_AlertMessage, -#else - NULL, -#endif -#ifdef FN_EngineFprintf - FN_EngineFprintf, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData - FN_PvAllocEntPrivateData, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData - FN_PvEntPrivateData, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData - FN_FreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_SzFromIndex - FN_SzFromIndex, -#else - NULL, -#endif -#ifdef FN_AllocString - FN_AllocString, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt - FN_GetVarsOfEnt, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset - FN_PEntityOfEntOffset, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity - FN_EntOffsetOfPEntity, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict - FN_IndexOfEdict, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex - FN_PEntityOfEntIndex, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars - FN_FindEntityByVars, -#else - NULL, -#endif -#ifdef FN_GetModelPtr - FN_GetModelPtr, -#else - NULL, -#endif -#ifdef FN_RegUserMsg - FN_RegUserMsg, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove - FN_AnimationAutomove, -#else - NULL, -#endif -#ifdef FN_GetBonePosition - FN_GetBonePosition, -#else - NULL, -#endif -#ifdef FN_FunctionFromName - FN_FunctionFromName, -#else - NULL, -#endif -#ifdef FN_NameForFunction - FN_NameForFunction, -#else - NULL, -#endif -#ifdef FN_ClientPrintf - FN_ClientPrintf, -#else - NULL, -#endif -#ifdef FN_ServerPrint - FN_ServerPrint, -#else - NULL, -#endif -#ifdef FN_Cmd_Args - FN_Cmd_Args, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv - FN_Cmd_Argv, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc - FN_Cmd_Argc, -#else - NULL, -#endif -#ifdef FN_GetAttachment - FN_GetAttachment, -#else - NULL, -#endif -#ifdef FN_CRC32_Init - FN_CRC32_Init, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer - FN_CRC32_ProcessBuffer, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte - FN_CRC32_ProcessByte, -#else - NULL, -#endif -#ifdef FN_CRC32_Final - FN_CRC32_Final, -#else - NULL, -#endif -#ifdef FN_RandomLong - FN_RandomLong, -#else - NULL, -#endif -#ifdef FN_RandomFloat - FN_RandomFloat, -#else - NULL, -#endif -#ifdef FN_SetView - FN_SetView, -#else - NULL, -#endif -#ifdef FN_Time - FN_Time, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle - FN_CrosshairAngle, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe - FN_LoadFileForMe, -#else - NULL, -#endif -#ifdef FN_FreeFile - FN_FreeFile, -#else - NULL, -#endif -#ifdef FN_EndSection - FN_EndSection, -#else - NULL, -#endif -#ifdef FN_CompareFileTime - FN_CompareFileTime, -#else - NULL, -#endif -#ifdef FN_GetGameDir - FN_GetGameDir, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable - FN_Cvar_RegisterVariable, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume - FN_FadeClientVolume, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed - FN_SetClientMaxspeed, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient - FN_CreateFakeClient, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove - FN_RunPlayerMove, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities - FN_NumberOfEntities, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer - FN_GetInfoKeyBuffer, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue - FN_InfoKeyValue, -#else - NULL, -#endif -#ifdef FN_SetKeyValue - FN_SetKeyValue, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue - FN_SetClientKeyValue, -#else - NULL, -#endif -#ifdef FN_IsMapValid - FN_IsMapValid, -#else - NULL, -#endif -#ifdef FN_StaticDecal - FN_StaticDecal, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric - FN_PrecacheGeneric, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId - FN_GetPlayerUserId, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg - FN_BuildSoundMsg, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer - FN_IsDedicatedServer, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer - FN_CVarGetPointer, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId - FN_GetPlayerWONId, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey - FN_Info_RemoveKey, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue - FN_GetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue - FN_SetPhysicsKeyValue, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString - FN_GetPhysicsInfoString, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent - FN_PrecacheEvent, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent - FN_PlaybackEvent, -#else - NULL, -#endif -#ifdef FN_SetFatPVS - FN_SetFatPVS, -#else - NULL, -#endif -#ifdef FN_SetFatPAS - FN_SetFatPAS, -#else - NULL, -#endif -#ifdef FN_CheckVisibility - FN_CheckVisibility, -#else - NULL, -#endif -#ifdef FN_DeltaSetField - FN_DeltaSetField, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField - FN_DeltaUnsetField, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder - FN_DeltaAddEncoder, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer - FN_GetCurrentPlayer, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer - FN_CanSkipPlayer, -#else - NULL, -#endif -#ifdef FN_DeltaFindField - FN_DeltaFindField, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex - FN_DeltaSetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex - FN_DeltaUnsetFieldByIndex, -#else - NULL, -#endif -#ifdef FN_SetGroupMask - FN_SetGroupMask, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline - FN_engCreateInstancedBaseline, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet - FN_Cvar_DirectSet, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified - FN_ForceUnmodified, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats - FN_GetPlayerStats, -#else - NULL, -#endif -#ifdef FN_AddServerCommand - FN_AddServerCommand, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening - FN_Voice_GetClientListening, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening - FN_Voice_SetClientListening, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId - FN_GetPlayerAuthId -#else - NULL -#endif -}; // g_EngineFuncs_Table - - -static enginefuncs_t g_EngineFuncs_Post_Table = -{ -#ifdef FN_PrecacheModel_Post - FN_PrecacheModel_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheSound_Post - FN_PrecacheSound_Post, -#else - NULL, -#endif -#ifdef FN_SetModel_Post - FN_SetModel_Post, -#else - NULL, -#endif -#ifdef FN_ModelIndex_Post - FN_ModelIndex_Post, -#else - NULL, -#endif -#ifdef FN_ModelFrames_Post - FN_ModelFrames_Post, -#else - NULL, -#endif -#ifdef FN_SetSize_Post - FN_SetSize_Post, -#else - NULL, -#endif -#ifdef FN_ChangeLevel_Post - FN_ChangeLevel_Post, -#else - NULL, -#endif -#ifdef FN_GetSpawnParms_Post - FN_GetSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_SaveSpawnParms_Post - FN_SaveSpawnParms_Post, -#else - NULL, -#endif -#ifdef FN_VecToYaw_Post - FN_VecToYaw_Post, -#else - NULL, -#endif -#ifdef FN_VecToAngles_Post - FN_VecToAngles_Post, -#else - NULL, -#endif -#ifdef FN_MoveToOrigin_Post - FN_MoveToOrigin_Post, -#else - NULL, -#endif -#ifdef FN_ChangeYaw_Post - FN_ChangeYaw_Post, -#else - NULL, -#endif -#ifdef FN_ChangePitch_Post - FN_ChangePitch_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByString_Post - FN_FindEntityByString_Post, -#else - NULL, -#endif -#ifdef FN_GetEntityIllum_Post - FN_GetEntityIllum_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityInSphere_Post - FN_FindEntityInSphere_Post, -#else - NULL, -#endif -#ifdef FN_FindClientInPVS_Post - FN_FindClientInPVS_Post, -#else - NULL, -#endif -#ifdef FN_EntitiesInPVS_Post - FN_EntitiesInPVS_Post, -#else - NULL, -#endif -#ifdef FN_MakeVectors_Post - FN_MakeVectors_Post, -#else - NULL, -#endif -#ifdef FN_AngleVectors_Post - FN_AngleVectors_Post, -#else - NULL, -#endif -#ifdef FN_CreateEntity_Post - FN_CreateEntity_Post, -#else - NULL, -#endif -#ifdef FN_RemoveEntity_Post - FN_RemoveEntity_Post, -#else - NULL, -#endif -#ifdef FN_CreateNamedEntity_Post - FN_CreateNamedEntity_Post, -#else - NULL, -#endif -#ifdef FN_MakeStatic_Post - FN_MakeStatic_Post, -#else - NULL, -#endif -#ifdef FN_EntIsOnFloor_Post - FN_EntIsOnFloor_Post, -#else - NULL, -#endif -#ifdef FN_DropToFloor_Post - FN_DropToFloor_Post, -#else - NULL, -#endif -#ifdef FN_WalkMove_Post - FN_WalkMove_Post, -#else - NULL, -#endif -#ifdef FN_SetOrigin_Post - FN_SetOrigin_Post, -#else - NULL, -#endif -#ifdef FN_EmitSound_Post - FN_EmitSound_Post, -#else - NULL, -#endif -#ifdef FN_EmitAmbientSound_Post - FN_EmitAmbientSound_Post, -#else - NULL, -#endif -#ifdef FN_TraceLine_Post - FN_TraceLine_Post, -#else - NULL, -#endif -#ifdef FN_TraceToss_Post - FN_TraceToss_Post, -#else - NULL, -#endif -#ifdef FN_TraceMonsterHull_Post - FN_TraceMonsterHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceHull_Post - FN_TraceHull_Post, -#else - NULL, -#endif -#ifdef FN_TraceModel_Post - FN_TraceModel_Post, -#else - NULL, -#endif -#ifdef FN_TraceTexture_Post - FN_TraceTexture_Post, -#else - NULL, -#endif -#ifdef FN_TraceSphere_Post - FN_TraceSphere_Post, -#else - NULL, -#endif -#ifdef FN_GetAimVector_Post - FN_GetAimVector_Post, -#else - NULL, -#endif -#ifdef FN_ServerCommand_Post - FN_ServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_ServerExecute_Post - FN_ServerExecute_Post, -#else - NULL, -#endif -#ifdef FN_engClientCommand_Post - FN_engClientCommand_Post, -#else - NULL, -#endif -#ifdef FN_ParticleEffect_Post - FN_ParticleEffect_Post, -#else - NULL, -#endif -#ifdef FN_LightStyle_Post - FN_LightStyle_Post, -#else - NULL, -#endif -#ifdef FN_DecalIndex_Post - FN_DecalIndex_Post, -#else - NULL, -#endif -#ifdef FN_PointContents_Post - FN_PointContents_Post, -#else - NULL, -#endif -#ifdef FN_MessageBegin_Post - FN_MessageBegin_Post, -#else - NULL, -#endif -#ifdef FN_MessageEnd_Post - FN_MessageEnd_Post, -#else - NULL, -#endif -#ifdef FN_WriteByte_Post - FN_WriteByte_Post, -#else - NULL, -#endif -#ifdef FN_WriteChar_Post - FN_WriteChar_Post, -#else - NULL, -#endif -#ifdef FN_WriteShort_Post - FN_WriteShort_Post, -#else - NULL, -#endif -#ifdef FN_WriteLong_Post - FN_WriteLong_Post, -#else - NULL, -#endif -#ifdef FN_WriteAngle_Post - FN_WriteAngle_Post, -#else - NULL, -#endif -#ifdef FN_WriteCoord_Post - FN_WriteCoord_Post, -#else - NULL, -#endif -#ifdef FN_WriteString_Post - FN_WriteString_Post, -#else - NULL, -#endif -#ifdef FN_WriteEntity_Post - FN_WriteEntity_Post, -#else - NULL, -#endif -#ifdef FN_CVarRegister_Post - FN_CVarRegister_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetFloat_Post - FN_CVarGetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetString_Post - FN_CVarGetString_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetFloat_Post - FN_CVarSetFloat_Post, -#else - NULL, -#endif -#ifdef FN_CVarSetString_Post - FN_CVarSetString_Post, -#else - NULL, -#endif -#ifdef FN_AlertMessage_Post - FN_AlertMessage_Post, -#else - NULL, -#endif -#ifdef FN_EngineFprintf_Post - FN_EngineFprintf_Post, -#else - NULL, -#endif -#ifdef FN_PvAllocEntPrivateData_Post - FN_PvAllocEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_PvEntPrivateData_Post - FN_PvEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_FreeEntPrivateData_Post - FN_FreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_SzFromIndex_Post - FN_SzFromIndex_Post, -#else - NULL, -#endif -#ifdef FN_AllocString_Post - FN_AllocString_Post, -#else - NULL, -#endif -#ifdef FN_GetVarsOfEnt_Post - FN_GetVarsOfEnt_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntOffset_Post - FN_PEntityOfEntOffset_Post, -#else - NULL, -#endif -#ifdef FN_EntOffsetOfPEntity_Post - FN_EntOffsetOfPEntity_Post, -#else - NULL, -#endif -#ifdef FN_IndexOfEdict_Post - FN_IndexOfEdict_Post, -#else - NULL, -#endif -#ifdef FN_PEntityOfEntIndex_Post - FN_PEntityOfEntIndex_Post, -#else - NULL, -#endif -#ifdef FN_FindEntityByVars_Post - FN_FindEntityByVars_Post, -#else - NULL, -#endif -#ifdef FN_GetModelPtr_Post - FN_GetModelPtr_Post, -#else - NULL, -#endif -#ifdef FN_RegUserMsg_Post - FN_RegUserMsg_Post, -#else - NULL, -#endif -#ifdef FN_AnimationAutomove_Post - FN_AnimationAutomove_Post, -#else - NULL, -#endif -#ifdef FN_GetBonePosition_Post - FN_GetBonePosition_Post, -#else - NULL, -#endif -#ifdef FN_FunctionFromName_Post - FN_FunctionFromName_Post, -#else - NULL, -#endif -#ifdef FN_NameForFunction_Post - FN_NameForFunction_Post, -#else - NULL, -#endif -#ifdef FN_ClientPrintf_Post - FN_ClientPrintf_Post, -#else - NULL, -#endif -#ifdef FN_ServerPrint_Post - FN_ServerPrint_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Args_Post - FN_Cmd_Args_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argv_Post - FN_Cmd_Argv_Post, -#else - NULL, -#endif -#ifdef FN_Cmd_Argc_Post - FN_Cmd_Argc_Post, -#else - NULL, -#endif -#ifdef FN_GetAttachment_Post - FN_GetAttachment_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Init_Post - FN_CRC32_Init_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessBuffer_Post - FN_CRC32_ProcessBuffer_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_ProcessByte_Post - FN_CRC32_ProcessByte_Post, -#else - NULL, -#endif -#ifdef FN_CRC32_Final_Post - FN_CRC32_Final_Post, -#else - NULL, -#endif -#ifdef FN_RandomLong_Post - FN_RandomLong_Post, -#else - NULL, -#endif -#ifdef FN_RandomFloat_Post - FN_RandomFloat_Post, -#else - NULL, -#endif -#ifdef FN_SetView_Post - FN_SetView_Post, -#else - NULL, -#endif -#ifdef FN_Time_Post - FN_Time_Post, -#else - NULL, -#endif -#ifdef FN_CrosshairAngle_Post - FN_CrosshairAngle_Post, -#else - NULL, -#endif -#ifdef FN_LoadFileForMe_Post - FN_LoadFileForMe_Post, -#else - NULL, -#endif -#ifdef FN_FreeFile_Post - FN_FreeFile_Post, -#else - NULL, -#endif -#ifdef FN_EndSection_Post - FN_EndSection_Post, -#else - NULL, -#endif -#ifdef FN_CompareFileTime_Post - FN_CompareFileTime_Post, -#else - NULL, -#endif -#ifdef FN_GetGameDir_Post - FN_GetGameDir_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_RegisterVariable_Post - FN_Cvar_RegisterVariable_Post, -#else - NULL, -#endif -#ifdef FN_FadeClientVolume_Post - FN_FadeClientVolume_Post, -#else - NULL, -#endif -#ifdef FN_SetClientMaxspeed_Post - FN_SetClientMaxspeed_Post, -#else - NULL, -#endif -#ifdef FN_CreateFakeClient_Post - FN_CreateFakeClient_Post, -#else - NULL, -#endif -#ifdef FN_RunPlayerMove_Post - FN_RunPlayerMove_Post, -#else - NULL, -#endif -#ifdef FN_NumberOfEntities_Post - FN_NumberOfEntities_Post, -#else - NULL, -#endif -#ifdef FN_GetInfoKeyBuffer_Post - FN_GetInfoKeyBuffer_Post, -#else - NULL, -#endif -#ifdef FN_InfoKeyValue_Post - FN_InfoKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetKeyValue_Post - FN_SetKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetClientKeyValue_Post - FN_SetClientKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_IsMapValid_Post - FN_IsMapValid_Post, -#else - NULL, -#endif -#ifdef FN_StaticDecal_Post - FN_StaticDecal_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheGeneric_Post - FN_PrecacheGeneric_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerUserId_Post - FN_GetPlayerUserId_Post, -#else - NULL, -#endif -#ifdef FN_BuildSoundMsg_Post - FN_BuildSoundMsg_Post, -#else - NULL, -#endif -#ifdef FN_IsDedicatedServer_Post - FN_IsDedicatedServer_Post, -#else - NULL, -#endif -#ifdef FN_CVarGetPointer_Post - FN_CVarGetPointer_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerWONId_Post - FN_GetPlayerWONId_Post, -#else - NULL, -#endif -#ifdef FN_Info_RemoveKey_Post - FN_Info_RemoveKey_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsKeyValue_Post - FN_GetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_SetPhysicsKeyValue_Post - FN_SetPhysicsKeyValue_Post, -#else - NULL, -#endif -#ifdef FN_GetPhysicsInfoString_Post - FN_GetPhysicsInfoString_Post, -#else - NULL, -#endif -#ifdef FN_PrecacheEvent_Post - FN_PrecacheEvent_Post, -#else - NULL, -#endif -#ifdef FN_PlaybackEvent_Post - FN_PlaybackEvent_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPVS_Post - FN_SetFatPVS_Post, -#else - NULL, -#endif -#ifdef FN_SetFatPAS_Post - FN_SetFatPAS_Post, -#else - NULL, -#endif -#ifdef FN_CheckVisibility_Post - FN_CheckVisibility_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetField_Post - FN_DeltaSetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetField_Post - FN_DeltaUnsetField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaAddEncoder_Post - FN_DeltaAddEncoder_Post, -#else - NULL, -#endif -#ifdef FN_GetCurrentPlayer_Post - FN_GetCurrentPlayer_Post, -#else - NULL, -#endif -#ifdef FN_CanSkipPlayer_Post - FN_CanSkipPlayer_Post, -#else - NULL, -#endif -#ifdef FN_DeltaFindField_Post - FN_DeltaFindField_Post, -#else - NULL, -#endif -#ifdef FN_DeltaSetFieldByIndex_Post - FN_DeltaSetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_DeltaUnsetFieldByIndex_Post - FN_DeltaUnsetFieldByIndex_Post, -#else - NULL, -#endif -#ifdef FN_SetGroupMask_Post - FN_SetGroupMask_Post, -#else - NULL, -#endif -#ifdef FN_engCreateInstancedBaseline_Post - FN_engCreateInstancedBaseline_Post, -#else - NULL, -#endif -#ifdef FN_Cvar_DirectSet_Post - FN_Cvar_DirectSet_Post, -#else - NULL, -#endif -#ifdef FN_ForceUnmodified_Post - FN_ForceUnmodified_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerStats_Post - FN_GetPlayerStats_Post, -#else - NULL, -#endif -#ifdef FN_AddServerCommand_Post - FN_AddServerCommand_Post, -#else - NULL, -#endif -#ifdef FN_Voice_GetClientListening_Post - FN_Voice_GetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_Voice_SetClientListening_Post - FN_Voice_SetClientListening_Post, -#else - NULL, -#endif -#ifdef FN_GetPlayerAuthId_Post - FN_GetPlayerAuthId_Post -#else - NULL -#endif -}; // g_EngineFuncs_Post_Table - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Table = -{ -#ifdef FN_OnFreeEntPrivateData - FN_OnFreeEntPrivateData, -#else - NULL, -#endif -#ifdef FN_GameShutdown - FN_GameShutdown, -#else - NULL, -#endif -#ifdef FN_ShouldCollide - ShouldCollide, -#else - NULL, -#endif -}; - - -static NEW_DLL_FUNCTIONS g_NewFuncs_Post_Table = -{ -#ifdef FN_OnFreeEntPrivateData_Post - FN_OnFreeEntPrivateData_Post, -#else - NULL, -#endif -#ifdef FN_GameShutdown_Post - FN_GameShutdown_Post, -#else - NULL, -#endif -#ifdef FN_ShouldCollide_Post - ShouldCollide_Post, -#else - NULL, -#endif -}; - -// Global variables from metamod. These variable names are referenced by -// various macros. -meta_globals_t *gpMetaGlobals; // metamod globals -gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables -mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions - - -plugin_info_t Plugin_info = { - META_INTERFACE_VERSION, - MODULE_NAME, - MODULE_VERSION, - MODULE_DATE, - MODULE_AUTHOR, - MODULE_URL, - MODULE_LOGTAG, - PT_ANYTIME, - PT_ANYTIME -}; - -/* -C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof( DLL_FUNCTIONS ) ); - - return (TRUE); -} - -C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable"); - return(FALSE); - } - else if(interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION); - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - - return(TRUE); -} -*/ - -C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEntityAPI2 version mismatch; requested=%d ours=%d", - *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS)); - g_pFunctionTable=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion); - if(!pFunctionTable) { - LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return(FALSE); - } - memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) ); - g_pFunctionTable_Post=pFunctionTable; - return(TRUE); -} - -C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", - *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, - "GetEngineFunctions called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, - "GetEngineFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is - // out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable=pengfuncsFromEngine; - return TRUE; -} - -C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion); - if(!pengfuncsFromEngine) { - LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine"); - return(FALSE); - } - else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { - LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); - // Tell metamod what version we had, so it can figure out who is out of date. - *interfaceVersion = ENGINE_INTERFACE_VERSION; - return(FALSE); - } - memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t)); - g_pengfuncsTable_Post=pengfuncsFromEngine; - return TRUE; - -} - -C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, - int *interfaceVersion) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", - *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, - "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, - "GetNewDLLFunctions version mismatch; requested=%d ours=%d", - *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is - //! out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable=pNewFunctionTable; - return TRUE; -} - -C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) -{ - LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion); - if(!pNewFunctionTable) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable"); - return(FALSE); - } - else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { - LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); - //! Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; - return(FALSE); - } - memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS)); - g_pNewFunctionsTable_Post=pNewFunctionTable; - return TRUE; -} - - -static META_FUNCTIONS g_MetaFunctions_Table = -{ - NULL, - NULL, - GetEntityAPI2, - GetEntityAPI2_Post, - GetNewDLLFunctions, - GetNewDLLFunctions_Post, - GetEngineFunctions, - GetEngineFunctions_Post -}; - -C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) -{ - if ((int) CVAR_GET_FLOAT("developer") != 0) - UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", - Plugin_info.logtag, ifvers, Plugin_info.ifvers); - - // Check for valid pMetaUtilFuncs before we continue. - if(!pMetaUtilFuncs) { - UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag); - return(FALSE); - } - - gpMetaUtilFuncs = pMetaUtilFuncs; - - *pPlugInfo = &Plugin_info; - - // Check for interface version compatibility. - if(!FStrEq(ifvers, Plugin_info.ifvers)) { - int mmajor=0, mminor=0, pmajor=0, pminor=0; - LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s", - Plugin_info.logtag, ifvers); - // If plugin has later interface version, it's incompatible (update - // metamod). - sscanf(ifvers, "%d:%d", &mmajor, &mminor); - sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor); - if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) { - LOG_ERROR(PLID, "metamod version is too old for this module; update metamod"); - return(FALSE); - } - // If plugin has older major interface version, it's incompatible - // (update plugin). - else if(pmajor < mmajor) { - LOG_ERROR(PLID, "metamod version is incompatible with this module; please find a newer version of this module"); - return(FALSE); - } - // Minor interface is older, but this is guaranteed to be backwards - // compatible, so we warn, but we still accept it. - else if(pmajor==mmajor && pminor < mminor) - LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this module"); - else - LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor); - } - -#ifdef FN_META_QUERY - FN_META_QUERY(); -#endif // FN_META_QUERY - - return 1; -} - - -C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) -{ - if(now > Plugin_info.loadable) { - LOG_ERROR(PLID, "Can't load module right now"); - return(FALSE); - } - if(!pMGlobals) { - LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals"); - return(FALSE); - } - gpMetaGlobals=pMGlobals; - if(!pFunctionTable) { - LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable"); - return(FALSE); - } - - memcpy(pFunctionTable, &g_MetaFunctions_Table, sizeof(META_FUNCTIONS)); - gpGamedllFuncs=pGamedllFuncs; - - // Let's go. - -#ifdef FN_META_ATTACH - FN_META_ATTACH(); -#endif // FN_META_ATTACH - - return TRUE; -} - -C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) -{ - if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { - LOG_ERROR(PLID, "Can't unload plugin right now"); - return(FALSE); - } - -#ifdef FN_META_DETACH - FN_META_DETACH(); -#endif // FN_META_DETACH - return TRUE; -} - - - -#if defined(__linux__) || defined(__APPLE__) -// linux prototype -C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { - -#else -#ifdef _MSC_VER -// MSVC: Simulate __stdcall calling convention -C_DLLEXPORT __declspec(naked) void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ - __asm // Prolog - { - // Save ebp - push ebp - // Set stack frame pointer - mov ebp, esp - // Allocate space for local variables - // The MSVC compiler gives us the needed size in __LOCAL_SIZE. - sub esp, __LOCAL_SIZE - // Push registers - push ebx - push esi - push edi - } -#else // _MSC_VER -#ifdef __GNUC__ -// GCC can also work with this -C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) -{ -#else // __GNUC__ -// compiler not known -#error There is no support (yet) for your compiler. Please use MSVC or GCC compilers or contact the AMX Mod X dev team. -#endif // __GNUC__ -#endif // _MSC_VER -#endif // __linux__ - - // ** Function core <-- - memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); - gpGlobals = pGlobals; - // NOTE! Have to call logging function _after_ copying into g_engfuncs, so - // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :) - // UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag); - // --> ** Function core - -#ifdef _MSC_VER - // Epilog - if (sizeof(int*) == 8) - { // 64 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 16 on 64 bit - ret 16 - } - } - else - { // 32 bit - __asm - { - // Pop registers - pop edi - pop esi - pop ebx - // Restore stack frame pointer - mov esp, ebp - // Restore ebp - pop ebp - // 2 * sizeof(int*) = 8 on 32 bit - ret 8 - } - } -#endif // #ifdef _MSC_VER -} - -#endif // #ifdef USE_METAMOD - -/************* AMXX Stuff *************/ - -// *** Globals *** -// Module info -static amxx_module_info_s g_ModuleInfo = -{ - MODULE_NAME, - MODULE_AUTHOR, - MODULE_VERSION, -#ifdef MODULE_RELOAD_ON_MAPCHANGE - 1, -#else // MODULE_RELOAD_ON_MAPCHANGE - 0, -#endif // MODULE_RELOAD_ON_MAPCHANGE - MODULE_LOGTAG, - MODULE_LIBRARY, - MODULE_LIBCLASS -}; - -// Storage for the requested functions -PFN_ADD_NATIVES g_fn_AddNatives; -PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -PFN_BUILD_PATHNAME g_fn_BuildPathname; -PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -PFN_GET_AMXADDR g_fn_GetAmxAddr; -PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -PFN_GET_MODNAME g_fn_GetModname; -PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -PFN_SET_AMXSTRING g_fn_SetAmxString; -PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -PFN_GET_AMXSTRING g_fn_GetAmxString; -PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -PFN_LOG g_fn_Log; -PFN_LOG_ERROR g_fn_LogErrorFunc; -PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -PFN_REGISTER_FORWARD g_fn_RegisterForward; -PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -#ifdef MEMORY_TEST -PFN_ALLOCATOR g_fn_Allocator; -PFN_REALLOCATOR g_fn_Reallocator; -PFN_DEALLOCATOR g_fn_Deallocator; -#endif -PFN_AMX_EXEC g_fn_AmxExec; -PFN_AMX_EXECV g_fn_AmxExecv; -PFN_AMX_ALLOT g_fn_AmxAllot; -PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -PFN_REAL_TO_CELL g_fn_RealToCell; -PFN_CELL_TO_REAL g_fn_CellToReal; -PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -PFN_FORMAT g_fn_Format; -PFN_REGISTERFUNCTION g_fn_RegisterFunction; -PFN_REQ_FNPTR g_fn_RequestFunction; -PFN_AMX_PUSH g_fn_AmxPush; -PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -PFN_FINDLIBRARY g_fn_FindLibrary; -PFN_ADDLIBRARIES g_fn_AddLibraries; -PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -PFN_OVERRIDENATIVES g_fn_OverrideNatives; -PFN_GETLOCALINFO g_fn_GetLocalInfo; -PFN_AMX_REREGISTER g_fn_AmxReRegister; -PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -// *** Exports *** -C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) -{ - // check parameters - if (!interfaceVersion || !moduleInfo) - return AMXX_PARAM; - - // check interface version - if (*interfaceVersion != AMXX_INTERFACE_VERSION) - { - // Tell amxx core our interface version - *interfaceVersion = AMXX_INTERFACE_VERSION; - return AMXX_IFVERS; - } - - // copy module info - memcpy(moduleInfo, &g_ModuleInfo, sizeof(amxx_module_info_s)); - -#ifdef FN_AMXX_QUERY - FN_AMXX_QUERY(); -#endif // FN_AMXX_QUERY - // Everything ok :) - return AMXX_OK; -} - -// request function -#define REQFUNC(name, fptr, type) if ((fptr = (type)reqFnptrFunc(name)) == 0) return AMXX_FUNC_NOT_PRESENT -// request optional function -#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name) - -C_DLLEXPORT int AMXX_CheckGame(const char *game) -{ -#ifdef FN_AMXX_CHECKGAME - return FN_AMXX_CHECKGAME(game); -#else - return AMXX_GAME_OK; -#endif -} -C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) -{ - // Check pointer - if (!reqFnptrFunc) - return AMXX_PARAM; - - g_fn_RequestFunction = reqFnptrFunc; - - // Req all known functions - // Misc - REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); - REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R); - REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE); - REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME); - REQFUNC("Log", g_fn_Log, PFN_LOG); - REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR); - REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE); - REQFUNC("Format", g_fn_Format, PFN_FORMAT); - REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION); - REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX); - - // Amx scripts - REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT); - REQFUNC("FindAmxScriptByAmx", g_fn_FindAmxScriptByAmx, PFN_FIND_AMXSCRIPT_BYAMX); - REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME); - REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT); - REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT); - REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME); - - // String / mem in amx scripts support - REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING); - REQFUNC("SetAmxStringUTF8Char", g_fn_SetAmxStringUTF8Char, PFN_SET_AMXSTRING_UTF8_CHAR); - REQFUNC("SetAmxStringUTF8Cell", g_fn_SetAmxStringUTF8Cell, PFN_SET_AMXSTRING_UTF8_CELL); - REQFUNC("GetAmxString", g_fn_GetAmxString, PFN_GET_AMXSTRING); - REQFUNC("GetAmxStringLen", g_fn_GetAmxStringLen, PFN_GET_AMXSTRINGLEN); - REQFUNC("FormatAmxString", g_fn_FormatAmxString, PFN_FORMAT_AMXSTRING); - REQFUNC("CopyAmxMemory", g_fn_CopyAmxMemory, PFN_COPY_AMXMEMORY); - REQFUNC("GetAmxAddr", g_fn_GetAmxAddr, PFN_GET_AMXADDR); - - REQFUNC("amx_Exec", g_fn_AmxExec, PFN_AMX_EXEC); - REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV); - REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC); - REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT); - REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE); - - // Natives / Forwards - REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES); - REQFUNC("AddNewNatives", g_fn_AddNewNatives, PFN_ADD_NEW_NATIVES); - REQFUNC("RaiseAmxError", g_fn_RaiseAmxError, PFN_RAISE_AMXERROR); - REQFUNC("RegisterForward", g_fn_RegisterForward, PFN_REGISTER_FORWARD); - REQFUNC("RegisterSPForward", g_fn_RegisterSPForward, PFN_REGISTER_SPFORWARD); - REQFUNC("RegisterSPForwardByName", g_fn_RegisterSPForwardByName, PFN_REGISTER_SPFORWARD_BYNAME); - REQFUNC("UnregisterSPForward", g_fn_UnregisterSPForward, PFN_UNREGISTER_SPFORWARD); - REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD); - REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY); - REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY); - REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A); - REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A); - // Player - REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID); - REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME); - REQFUNC("GetPlayerIP", g_fn_GetPlayerIP, PFN_GET_PLAYER_IP); - REQFUNC("IsPlayerInGame", g_fn_IsPlayerIngame, PFN_IS_PLAYER_INGAME); - REQFUNC("IsPlayerBot", g_fn_IsPlayerBot, PFN_IS_PLAYER_BOT); - REQFUNC("IsPlayerAuthorized", g_fn_IsPlayerAuthorized, PFN_IS_PLAYER_AUTHORIZED); - REQFUNC("GetPlayerTime", g_fn_GetPlayerTime, PFN_GET_PLAYER_TIME); - REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME); - REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON); - REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID); - REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM); - REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS); - REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU); - REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS); - REQFUNC("IsPlayerAlive", g_fn_IsPlayerAlive, PFN_IS_PLAYER_ALIVE); - REQFUNC("GetPlayerFrags", g_fn_GetPlayerFrags, PFN_GET_PLAYER_FRAGS); - REQFUNC("IsPlayerConnecting", g_fn_IsPlayerConnecting, PFN_IS_PLAYER_CONNECTING); - REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); - REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); - REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); - REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); - REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT); - REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH); - REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO); - REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR); - REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC); - REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC); - - //Added in 1.75 - REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY); - REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); - REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); - REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); - REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); - REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER); - - REQFUNC("MessageBlock", g_fn_MessageBlock, PFN_MESSAGE_BLOCK); - -#ifdef MEMORY_TEST - // Memory - REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); - REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR); - REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR); -#endif - - REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL); - REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL); - -#ifdef FN_AMXX_ATTACH - FN_AMXX_ATTACH(); -#endif // FN_AMXX_ATACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_Detach() -{ -#ifdef FN_AMXX_DETACH - FN_AMXX_DETACH(); -#endif // FN_AMXX_DETACH - - return AMXX_OK; -} - -C_DLLEXPORT int AMXX_PluginsLoaded() -{ -#ifdef FN_AMXX_PLUGINSLOADED - FN_AMXX_PLUGINSLOADED(); -#endif // FN_AMXX_PLUGINSLOADED - return AMXX_OK; -} - -C_DLLEXPORT void AMXX_PluginsUnloaded() -{ -#ifdef FN_AMXX_PLUGINSUNLOADED - FN_AMXX_PLUGINSUNLOADED(); -#endif // FN_AMXX_PLUGINSUNLOADED -} - -C_DLLEXPORT void AMXX_PluginsUnloading() -{ -#ifdef FN_AMXX_PLUGINSUNLOADING - FN_AMXX_PLUGINSUNLOADING(); -#endif // FN_AMXX_PLUGINSUNLOADING -} - -// Advanced MF functions -void MF_Log(const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); -} - -void MF_LogError(AMX *amx, int err, const char *fmt, ...) -{ - char msg[3072]; - va_list arglst; - va_start(arglst, fmt); - vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); - va_end(arglst); - - g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); -} - - -#ifdef _DEBUG -// validate macros -// Makes sure compiler reports errors when macros are invalid -void ValidateMacros_DontCallThis_Smiley() -{ - const cell str[] = { 's', 't', 'r', '\0' }; - MF_BuildPathname("str", "str", 0); - MF_BuildPathnameR(NULL, 0, "%d", 0); - MF_FormatAmxString(NULL, 0, 0, NULL); - MF_GetAmxAddr(NULL, 0); - MF_PrintSrvConsole("str", "str", 0); - MF_GetModname(); - MF_GetScriptName(0); - MF_GetScriptAmx(0); - MF_FindScriptByAmx(NULL); - MF_FindScriptByName("str"); - MF_SetAmxString(NULL, 0, "str", 0); - MF_SetAmxStringUTF8Char(NULL, 0, "str", 0, 0); - MF_SetAmxStringUTF8Cell(NULL, 0, str, 0, 0); - MF_GetAmxString(NULL, 0, 0, 0); - MF_GetAmxStringLen(NULL); - MF_CopyAmxMemory(NULL, NULL, 0); - MF_Log("str", "str", 0); - MF_LogError(NULL, 0, NULL); - MF_RaiseAmxError(NULL, 0); - MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0); - MF_ExecuteForward(0, 0, 0); - MF_PrepareCellArray(NULL, 0); - MF_PrepareCharArray(NULL, 0); - MF_PrepareCellArrayA(NULL, 0, true); - MF_PrepareCharArrayA(NULL, 0, true); - MF_IsPlayerValid(0); - MF_GetPlayerName(0); - MF_GetPlayerIP(0); - MF_IsPlayerIngame(0); - MF_IsPlayerBot(0); - MF_IsPlayerAuthorized(0); - MF_GetPlayerTime(0); - MF_GetPlayerPlayTime(0); - MF_GetPlayerCurweapon(0); - MF_GetPlayerTeamID(0); - MF_GetPlayerTeam(0); - MF_GetPlayerDeaths(0); - MF_GetPlayerMenu(0); - MF_GetPlayerKeys(0); - MF_IsPlayerAlive(0); - MF_GetPlayerFrags(0); - MF_IsPlayerConnecting(0); - MF_IsPlayerHLTV(0); - MF_GetPlayerArmor(0); - MF_GetPlayerHealth(0); - MF_AmxExec(0, 0, 0); - MF_AmxExecv(0, 0, 0, 0, 0); - MF_AmxFindPublic(0, 0, 0); - MF_AmxAllot(0, 0, 0, 0); - MF_LoadAmxScript(0, 0, 0, 0, 0); - MF_UnloadAmxScript(0, 0); - MF_RegisterSPForward(0, 0, 0, 0, 0, 0); - MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0); - MF_UnregisterSPForward(0); - MF_GetPlayerFrags(0); - MF_GetPlayerEdict(0); - MF_Format("", 4, "str"); - MF_RegisterFunction(NULL, ""); - MF_RegisterFunctionEx(NULL, ""); - MF_SetPlayerTeamInfo(0, 0, ""); - MF_PlayerPropAddr(0, 0); - MF_RegAuthFunc(NULL); - MF_UnregAuthFunc(NULL); - MF_FindLibrary(NULL, LibType_Class); - MF_AddLibraries(NULL, LibType_Class, NULL); - MF_RemoveLibraries(NULL); - MF_OverrideNatives(NULL, NULL); - MF_MessageBlock(0, 0, NULL); -} -#endif - -#ifdef MEMORY_TEST - -/************* MEMORY *************/ -// undef all defined macros -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -const unsigned int m_alloc_unknown = 0; -const unsigned int m_alloc_new = 1; -const unsigned int m_alloc_new_array = 2; -const unsigned int m_alloc_malloc = 3; -const unsigned int m_alloc_calloc = 4; -const unsigned int m_alloc_realloc = 5; -const unsigned int m_alloc_delete = 6; -const unsigned int m_alloc_delete_array = 7; -const unsigned int m_alloc_free = 8; - -const char *g_Mem_CurrentFilename = "??"; -int g_Mem_CurrentLine = 0; -const char *g_Mem_CurrentFunc = "??"; - -const char *Mem_MakeSourceFile(const char *sourceFile) -{ - static char buffer[512]; - static size_t pos = 0; - if (!pos) - { - // init - buffer[0] = '['; - strcpy(buffer + 1, MODULE_NAME); - pos = strlen(MODULE_NAME) + 1; - buffer[pos++] = ']'; - } - - // convert from absolute path to [modulename]filename - const char *ptr = strrchr(sourceFile, '\\'); - if (ptr) - ptr++; - else - { - ptr = strrchr(sourceFile, '/'); - if (ptr) - ptr++; - else - ptr = sourceFile; - } - strcpy(buffer + pos, ptr); - return buffer; -} - -void Mem_SetOwner(const char *filename, int line, const char *function) -{ - g_Mem_CurrentFilename = filename; - g_Mem_CurrentLine = line; - g_Mem_CurrentFunc = function; -} - -void Mem_ResetGlobals() -{ - Mem_SetOwner("??", 0, "??"); -} - -// raw (re/de)allocators -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize) -{ - if (g_fn_Allocator) - return g_fn_Allocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, allocationType, reportedSize); - else - return malloc(reportedSize); -} - -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress) -{ - if (g_fn_Reallocator) - return g_fn_Reallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, reallocationType, reportedSize, reportedAddress); - else - return realloc(reportedAddress, reportedSize); -} - -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress) -{ - // If you you get user breakpoint here, something failed :) - // - invalid pointer - // - alloc type mismatch ( for example - // char *a = new char[5]; delete char; - // ) - // - The allocation unit is damaged (for example - // char *a = new char[5]; a[6] = 8; - // ) - // - break on dealloc flag set (somehow) - - if (g_fn_Deallocator) - g_fn_Deallocator(Mem_MakeSourceFile(sourceFile), sourceLine, sourceFunc, deallocationType, reportedAddress); - else - free(reportedAddress); -} - -// new and delete operators -void *operator new(size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void *operator new[](size_t reportedSize) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -// Microsoft memory tracking operators -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) -{ - if (reportedSize == 0) - reportedSize = 1; - void *ptr = Mem_Allocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_new_array, reportedSize); - // :TODO: Handler support ? - if (ptr) - return ptr; - - // allocation failed - return NULL; -} - -void operator delete(void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete, reportedAddress); -} - -void operator delete[](void *reportedAddress) -{ - if (!reportedAddress) - return; - - Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); -} - -#else - -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 -void * operator new(size_t size) { - return(calloc(1, size)); -} - -void * operator new[](size_t size) { - return(calloc(1, size)); -} - -void operator delete(void * ptr) { - if(ptr) - free(ptr); -} - -void operator delete[](void * ptr) { - if(ptr) - free(ptr); -} -#endif - -#endif //MEMORY_TEST - -/************* stuff from dlls/util.cpp *************/ -// must come here because cbase.h declares it's own operator new - -#ifdef USE_METAMOD - -// Selected portions of dlls/util.cpp from SDK 2.1. -// Functions copied from there as needed... -// And modified to avoid buffer overflows (argh). - -/*** -* -* Copyright (c) 1999, 2000 Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -/* - -===== util.cpp ======================================================== - - Utility code. Really not optional after all. - -*/ - -#include -#include "sdk_util.h" -#include - -#include // for strncpy(), etc - -#include "osdep.h" // win32 vsnprintf, etc - -char* UTIL_VarArgs( char *format, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start (argptr, format); - vsnprintf (string, sizeof(string), format, argptr); - va_end (argptr); - - return string; -} - - -//========================================================= -// UTIL_LogPrintf - Prints a logged message to console. -// Preceded by LOG: ( timestamp ) < message > -//========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) -{ - va_list argptr; - static char string[1024]; - - va_start ( argptr, fmt ); - vsnprintf ( string, sizeof(string), fmt, argptr ); - va_end ( argptr ); - - // Print to server console - ALERT( at_logged, "%s", string ); -} - - -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, - const char *pMessage) -{ - if ( !pEntity ) - return; - - MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) ); - WRITE_BYTE( TE_TEXTMESSAGE ); - WRITE_BYTE( textparms.channel & 0xFF ); - - WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) ); - WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) ); - WRITE_BYTE( textparms.effect ); - - WRITE_BYTE( textparms.r1 ); - WRITE_BYTE( textparms.g1 ); - WRITE_BYTE( textparms.b1 ); - WRITE_BYTE( textparms.a1 ); - - WRITE_BYTE( textparms.r2 ); - WRITE_BYTE( textparms.g2 ); - WRITE_BYTE( textparms.b2 ); - WRITE_BYTE( textparms.a2 ); - - WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) ); - WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) ); - - if ( textparms.effect == 2 ) - WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) ); - - if ( strlen( pMessage ) < 512 ) - { - WRITE_STRING( pMessage ); - } - else - { - char tmp[512]; - strncpy( tmp, pMessage, 511 ); - tmp[511] = 0; - WRITE_STRING( tmp ); - } - MESSAGE_END(); -} - -short FixedSigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - - if ( output > 32767 ) - output = 32767; - - if ( output < -32768 ) - output = -32768; - - return (short)output; -} - -unsigned short FixedUnsigned16( float value, float scale ) -{ - int output; - - output = (int) (value * scale); - if ( output < 0 ) - output = 0; - if ( output > 0xFFFF ) - output = 0xFFFF; - - return (unsigned short)output; -} -#endif // USE_METAMOD - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} diff --git a/dlls/ts/tsx/sdk/amxxmodule.h b/dlls/ts/tsx/sdk/amxxmodule.h deleted file mode 100755 index 8cb820fa..00000000 --- a/dlls/ts/tsx/sdk/amxxmodule.h +++ /dev/null @@ -1,2500 +0,0 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license -// - -// -// Module SDK -// - -// prevent double include -#ifndef __AMXXMODULE_H__ -#define __AMXXMODULE_H__ - -// config -#include "moduleconfig.h" - -#include // size_t -// metamod include files -#ifdef USE_METAMOD -#include -#include -#include "osdep.h" -#endif // #ifdef USE_METAMOD - -// DLL Export -#undef DLLEXPORT -#if defined(_WIN32) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT __attribute__((visibility("default"))) -#endif - -#if defined(__linux__) && !defined(LINUX) -#define LINUX -#elif defined(__APPLE__) && !defined(OSX) -#define OSX -#endif - -#undef C_DLLEXPORT -#define C_DLLEXPORT extern "C" DLLEXPORT - -// ***** AMXX stuff ***** - -// module interface version was 1 -// 2 - added logtag to struct (amxx1.1-rc1) -// 3 - added new tagAMX structure (amxx1.5) -// 4 - added new 'library' setting for direct loading -#define AMXX_INTERFACE_VERSION 4 - -// amxx module info -struct amxx_module_info_s -{ - const char *name; - const char *author; - const char *version; - int reload; // reload on mapchange when nonzero - const char *logtag; // added in version 2 - const char *library; // added in version 4 - const char *libclass; // added in version 4 -}; - -// return values from functions called by amxx -#define AMXX_OK 0 /* no error */ -#define AMXX_IFVERS 1 /* interface version */ -#define AMXX_PARAM 2 /* Invalid parameter */ -#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */ - -#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */ -#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */ - -// *** Small stuff *** -// The next section is copied from the amx.h file -// Copyright (c) ITB CompuPhase, 1997-2005 - -#if defined HAVE_STDINT_H - #include -#else - #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__ - #if defined HAVE_INTTYPES_H - #include - #else - #include - #endif - #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L - /* The ISO C99 defines the int16_t and int_32t types. If the compiler got - * here, these types are probably undefined. - */ - #if defined __MACH__ - #include - typedef unsigned short int uint16_t; - typedef unsigned long int uint32_t; - #elif defined __FreeBSD__ - #include - #else - typedef short int int16_t; - typedef unsigned short int uint16_t; - #if defined SN_TARGET_PS2 - typedef int int32_t; - typedef unsigned int uint32_t; - #else - typedef long int int32_t; - typedef unsigned long int uint32_t; - #endif - #if defined __WIN32__ || defined _WIN32 || defined WIN32 - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - #define HAVE_I64 - #elif defined __GNUC__ - typedef long long int64_t; - typedef unsigned long long uint64_t; - #define HAVE_I64 - #endif - #endif - #endif - #define HAVE_STDINT_H -#endif -#if defined _LP64 || defined WIN64 || defined _WIN64 - #if !defined __64BIT__ - #define __64BIT__ - #endif -#endif - -/* calling convention for native functions */ -#if !defined AMX_NATIVE_CALL - #define AMX_NATIVE_CALL -#endif -/* calling convention for all interface functions and callback functions */ -#if !defined AMXAPI - #if defined STDECL - #define AMXAPI __stdcall - #elif defined CDECL - #define AMXAPI __cdecl - #else - #define AMXAPI - #endif -#endif -#if !defined AMXEXPORT - #define AMXEXPORT -#endif - -#if !defined PAWN_CELL_SIZE - #define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */ -#endif -#if PAWN_CELL_SIZE==16 - typedef uint16_t ucell; - typedef int16_t cell; -#elif PAWN_CELL_SIZE==32 - typedef uint32_t ucell; - typedef int32_t cell; -#define REAL float -#elif PAWN_CELL_SIZE==64 - typedef uint64_t ucell; - typedef int64_t cell; -#define REAL double -#else - #error Unsupported cell size (PAWN_CELL_SIZE) -#endif - -#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1) -#define UNLIMITED (~1u >> 1) - -struct tagAMX; -typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params); -typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index, - cell *result, cell *params); -typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); -#if !defined _FAR - #define _FAR -#endif - -#if defined _MSC_VER - #pragma warning(disable:4103) /* disable warning message 4103 that complains - * about pragma pack in a header file */ - #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ - - #if _MSC_VER >= 1400 - #if !defined NO_MSVC8_AUTO_COMPAT - - /* Disable deprecation warnings concerning unsafe CRT functions */ - #if !defined _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE - #endif - - /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ - #define access _access - #define cabs _cabs - #define cgets _cgets - #define chdir _chdir - #define chmod _chmod - #define chsize _chsize - #define close _close - #define cprintf _cprintf - #define cputs _cputts - #define creat _creat - #define cscanf _cscanf - #define cwait _cwait - #define dup _dup - #define dup2 _dup2 - #define ecvt _ecvt - #define eof _eof - #define execl _execl - #define execle _execle - #define execlp _execlp - #define execlpe _execlpe - #define execv _execv - #define execve _execv - #define execvp _execvp - #define execvpe _execvpe - #define fcloseall _fcloseall - #define fcvt _fcvt - #define fdopen _fdopen - #define fgetchar _fgetchar - #define filelength _filelength - #define fileno _fileno - #define flushall _flushall - #define fputchar _fputchar - #define gcvt _gcvt - #define getch _getch - #define getche _getche - #define getcwd _getcwd - #define getpid _getpid - #define getw _getw - #define hypot _hypot - #define inp _inp - #define inpw _inpw - #define isascii __isascii - #define isatty _isatty - #define iscsym __iscsym - #define iscsymf __iscsymf - #define itoa _itoa - #define j0 _j0 - #define j1 _j1 - #define jn _jn - #define kbhit _kbhit - #define lfind _lfind - #define locking _locking - #define lsearch _lsearch - #define lseek _lseek - #define ltoa _ltoa - #define memccpy _memccpy - #define memicmp _memicmp - #define mkdir _mkdir - #define mktemp _mktemp - #define open _open - #define outp _outp - #define outpw _outpw - #define putch _putch - #define putenv _putenv - #define putw _putw - #define read _read - #define rmdir _rmdir - #define rmtmp _rmtmp - #define setmode _setmode - #define sopen _sopen - #define spawnl _spawnl - #define spawnle _spawnle - #define spawnlp _spawnlp - #define spawnlpe _spawnlpe - #define spawnv _spawnv - #define spawnve _spawnve - #define spawnvp _spawnvp - #define spawnvpe _spawnvpe - #define strcmpi _strcmpi - #define strdup _strdup - #define stricmp _stricmp - #define strlwr _strlwr - #define strnicmp _strnicmp - #define strnset _strnset - #define strrev _strrev - #define strset _strset - #define strupr _strupr - #define swab _swab - #define tell _tell - #define tempnam _tempnam - #define toascii __toascii - #define tzset _tzset - #define ultoa _ultoa - #define umask _umask - #define ungetch _ungetch - #define unlink _unlink - #define wcsdup _wcsdup - #define wcsicmp _wcsicmp - #define wcsicoll _wcsicoll - #define wcslwr _wcslwr - #define wcsnicmp _wcsnicmp - #define wcsnset _wcsnset - #define wcsrev _wcsrev - #define wcsset _wcsset - #define wcsupr _wcsupr - #define write _write - #define y0 _y0 - #define y1 _y1 - #define yn _yn - - /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant - * functions above are deprecated. */ - #pragma warning (disable:4996) - - #endif - #else - #define vsnprintf _vsnprintf - #endif -#endif - - -/* Some compilers do not support the #pragma align, which should be fine. Some - * compilers give a warning on unknown #pragmas, which is not so fine... - */ -#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN - #define AMX_NO_ALIGN -#endif - -#if defined __GNUC__ - #define PACKED __attribute__((packed)) -#else - #define PACKED -#endif - -#if !defined AMX_NO_ALIGN - #if defined LINUX || defined __FreeBSD__ || defined __APPLE__ - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #elif defined MACOS && defined __MWERKS__ - #pragma options align=mac68k - #else - #pragma pack(push) - #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ - #pragma option -a- /* "pack" pragma for older Borland compilers */ - #endif - #endif -#endif - -typedef struct { - const char _FAR *name PACKED; - AMX_NATIVE func PACKED; -} AMX_NATIVE_INFO; - -#define AMX_USERNUM 4 - -/* The AMX structure is the internal structure for many functions. Not all - * fields are valid at all times; many fields are cached in local variables. - */ -typedef struct tagAMX { - unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */ - unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */ - AMX_CALLBACK callback PACKED; - AMX_DEBUG debug PACKED; /* debug callback */ - /* for external functions a few registers must be accessible from the outside */ - cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */ - cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */ - cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */ - cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */ - cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */ - cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */ - int flags PACKED; /* current status, see amx_Flags() */ - /* user data */ - long usertags[AMX_USERNUM] PACKED; - //okay userdata[3] in AMX Mod X is for the CPlugin * pointer - //we're also gonna set userdata[2] to a special debug structure - void _FAR *userdata[AMX_USERNUM] PACKED; - /* native functions can raise an error */ - int error PACKED; - /* passing parameters requires a "count" field */ - int paramcount; - /* the sleep opcode needs to store the full AMX status */ - cell pri PACKED; - cell alt PACKED; - cell reset_stk PACKED; - cell reset_hea PACKED; - cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */ - /* support variables for the JIT */ - int reloc_size PACKED; /* required temporary buffer for relocations */ - long code_size PACKED; /* estimated memory footprint of the native code */ -} PACKED AMX; - -enum { - AMX_ERR_NONE, - /* reserve the first 15 error codes for exit codes of the abstract machine */ - AMX_ERR_EXIT, /* forced exit */ - AMX_ERR_ASSERT, /* assertion failed */ - AMX_ERR_STACKERR, /* stack/heap collision */ - AMX_ERR_BOUNDS, /* index out of bounds */ - AMX_ERR_MEMACCESS, /* invalid memory access */ - AMX_ERR_INVINSTR, /* invalid instruction */ - AMX_ERR_STACKLOW, /* stack underflow */ - AMX_ERR_HEAPLOW, /* heap underflow */ - AMX_ERR_CALLBACK, /* no callback, or invalid callback */ - AMX_ERR_NATIVE, /* native function failed */ - AMX_ERR_DIVIDE, /* divide by zero */ - AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */ - AMX_ERR_INVSTATE, /* invalid state for this access */ - - AMX_ERR_MEMORY = 16, /* out of memory */ - AMX_ERR_FORMAT, /* invalid file format */ - AMX_ERR_VERSION, /* file is for a newer version of the AMX */ - AMX_ERR_NOTFOUND, /* function not found */ - AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */ - AMX_ERR_DEBUG, /* debugger cannot run */ - AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */ - AMX_ERR_USERDATA, /* unable to set user data field (table full) */ - AMX_ERR_INIT_JIT, /* cannot initialize the JIT */ - AMX_ERR_PARAMS, /* parameter error */ - AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ -}; - -#if !defined AMX_NO_ALIGN - #if defined(__linux__) || defined(__APPLE__) - #pragma pack() /* reset default packing */ - #else - #pragma pack(pop) /* reset previous packing */ - #endif -#endif - - -// ***** declare functions ***** - -#ifdef USE_METAMOD -void UTIL_LogPrintf( const char *fmt, ... ); -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); -short FixedSigned16( float value, float scale ); -unsigned short FixedUnsigned16( float value, float scale ); - -#ifdef FN_META_QUERY -void FN_META_QUERY(void); -#endif // FN_META_QUERY - -#ifdef FN_META_ATTACH -void FN_META_ATTACH(void); -#endif // FN_META_ATTACH - -#ifdef FN_META_DETACH -void FN_META_DETACH(void); -#endif // FN_META_DETACH - - - - - -#ifdef FN_GameDLLInit -void FN_GameDLLInit(void); -#endif // FN_GameDLLInit - -#ifdef FN_DispatchSpawn -int FN_DispatchSpawn(edict_t *pent); -#endif // FN_DispatchSpawn - -#ifdef FN_DispatchThink -void FN_DispatchThink(edict_t *pent); -#endif // FN_DispatchThink - -#ifdef FN_DispatchUse -void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse - -#ifdef FN_DispatchTouch -void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch - -#ifdef FN_DispatchBlocked -void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked - -#ifdef FN_DispatchKeyValue -void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue - -#ifdef FN_DispatchSave -void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave - -#ifdef FN_DispatchRestore -int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore - -#ifdef FN_DispatchObjectCollsionBox -void FN_DispatchObjectCollsionBox(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox - -#ifdef FN_SaveWriteFields -void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields - -#ifdef FN_SaveReadFields -void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields - -#ifdef FN_SaveGlobalState -void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState - -#ifdef FN_RestoreGlobalState -void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState - -#ifdef FN_ResetGlobalState -void FN_ResetGlobalState(void); -#endif // FN_ResetGlobalState - -#ifdef FN_ClientConnect -BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect - -#ifdef FN_ClientDisconnect -void FN_ClientDisconnect(edict_t *pEntity); -#endif // FN_ClientDisconnect - -#ifdef FN_ClientKill -void FN_ClientKill(edict_t *pEntity); -#endif // FN_ClientKill - -#ifdef FN_ClientPutInServer -void FN_ClientPutInServer(edict_t *pEntity); -#endif // FN_ClientPutInServer - -#ifdef FN_ClientCommand -void FN_ClientCommand(edict_t *pEntity); -#endif // FN_ClientCommand - -#ifdef FN_ClientUserInfoChanged -void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged - -#ifdef FN_ServerActivate -void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate - -#ifdef FN_ServerDeactivate -void FN_ServerDeactivate(void); -#endif // FN_ServerDeactivate - -#ifdef FN_PlayerPreThink -void FN_PlayerPreThink(edict_t *pEntity); -#endif // FN_PlayerPreThink - -#ifdef FN_PlayerPostThink -void FN_PlayerPostThink(edict_t *pEntity); -#endif // FN_PlayerPostThink - -#ifdef FN_StartFrame -void FN_StartFrame(void); -#endif // FN_StartFrame - -#ifdef FN_ParmsNewLevel -void FN_ParmsNewLevel(void); -#endif // FN_ParmsNewLevel - -#ifdef FN_ParmsChangeLevel -void FN_ParmsChangeLevel(void); -#endif // FN_ParmsChangeLevel - -#ifdef FN_GetGameDescription -const char *FN_GetGameDescription(void); -#endif // FN_GetGameDescription - -#ifdef FN_PlayerCustomization -void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization - -#ifdef FN_SpectatorConnect -void FN_SpectatorConnect(edict_t *pEntity); -#endif // FN_SpectatorConnect - -#ifdef FN_SpectatorDisconnect -void FN_SpectatorDisconnect(edict_t *pEntity); -#endif // FN_SpectatorDisconnect - -#ifdef FN_SpectatorThink -void FN_SpectatorThink(edict_t *pEntity); -#endif // FN_SpectatorThink - -#ifdef FN_Sys_Error -void FN_Sys_Error(const char *error_string); -#endif // FN_Sys_Error - -#ifdef FN_PM_Move -void FN_PM_Move(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move - -#ifdef FN_PM_Init -void FN_PM_Init(struct playermove_s *ppmove); -#endif // FN_PM_Init - -#ifdef FN_PM_FindTextureType -char FN_PM_FindTextureType(char *name); -#endif // FN_PM_FindTextureType - -#ifdef FN_SetupVisibility -void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility - -#ifdef FN_UpdateClientData -void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData - -#ifdef FN_AddToFullPack -int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack - -#ifdef FN_CreateBaseline -void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline - -#ifdef FN_RegisterEncoders -void FN_RegisterEncoders(void); -#endif // FN_RegisterEncoders - -#ifdef FN_GetWeaponData -int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData - -#ifdef FN_CmdStart -void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart - -#ifdef FN_CmdEnd -void FN_CmdEnd(const edict_t *player); -#endif // FN_CmdEnd - -#ifdef FN_ConnectionlessPacket -int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket - -#ifdef FN_GetHullBounds -int FN_GetHullBounds(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds - -#ifdef FN_CreateInstancedBaselines -void FN_CreateInstancedBaselines(void); -#endif // FN_CreateInstancedBaselines - -#ifdef FN_InconsistentFile -int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile - -#ifdef FN_AllowLagCompensation -int FN_AllowLagCompensation(void); -#endif // FN_AllowLagCompensation - - - - -#ifdef FN_GameDLLInit_Post -void FN_GameDLLInit_Post(void); -#endif // FN_GameDLLInit_Post - -#ifdef FN_DispatchSpawn_Post -int FN_DispatchSpawn_Post(edict_t *pent); -#endif // FN_DispatchSpawn_Post - -#ifdef FN_DispatchThink_Post -void FN_DispatchThink_Post(edict_t *pent); -#endif // FN_DispatchThink_Post - -#ifdef FN_DispatchUse_Post -void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther); -#endif // FN_DispatchUse_Post - -#ifdef FN_DispatchTouch_Post -void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_DispatchTouch_Post - -#ifdef FN_DispatchBlocked_Post -void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther); -#endif // FN_DispatchBlocked_Post - -#ifdef FN_DispatchKeyValue_Post -void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd); -#endif // FN_DispatchKeyValue_Post - -#ifdef FN_DispatchSave_Post -void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData); -#endif // FN_DispatchSave_Post - -#ifdef FN_DispatchRestore_Post -int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity); -#endif // FN_DispatchRestore_Post - -#ifdef FN_DispatchObjectCollsionBox_Post -void FN_DispatchObjectCollsionBox_Post(edict_t *pent); -#endif // FN_DispatchObjectCollsionBox_Post - -#ifdef FN_SaveWriteFields_Post -void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveWriteFields_Post - -#ifdef FN_SaveReadFields_Post -void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); -#endif // FN_SaveReadFields_Post - -#ifdef FN_SaveGlobalState_Post -void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_SaveGlobalState_Post - -#ifdef FN_RestoreGlobalState_Post -void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData); -#endif // FN_RestoreGlobalState_Post - -#ifdef FN_ResetGlobalState_Post -void FN_ResetGlobalState_Post(void); -#endif // FN_ResetGlobalState_Post - -#ifdef FN_ClientConnect_Post -BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]); -#endif // FN_ClientConnect_Post - -#ifdef FN_ClientDisconnect_Post -void FN_ClientDisconnect_Post(edict_t *pEntity); -#endif // FN_ClientDisconnect_Post - -#ifdef FN_ClientKill_Post -void FN_ClientKill_Post(edict_t *pEntity); -#endif // FN_ClientKill_Post - -#ifdef FN_ClientPutInServer_Post -void FN_ClientPutInServer_Post(edict_t *pEntity); -#endif // FN_ClientPutInServer_Post - -#ifdef FN_ClientCommand_Post -void FN_ClientCommand_Post(edict_t *pEntity); -#endif // FN_ClientCommand_Post - -#ifdef FN_ClientUserInfoChanged_Post -void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer); -#endif // FN_ClientUserInfoChanged_Post - -#ifdef FN_ServerActivate_Post -void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); -#endif // FN_ServerActivate_Post - -#ifdef FN_ServerDeactivate_Post -void FN_ServerDeactivate_Post(void); -#endif // FN_ServerDeactivate_Post - -#ifdef FN_PlayerPreThink_Post -void FN_PlayerPreThink_Post(edict_t *pEntity); -#endif // FN_PlayerPreThink_Post - -#ifdef FN_PlayerPostThink_Post -void FN_PlayerPostThink_Post(edict_t *pEntity); -#endif // FN_PlayerPostThink_Post - -#ifdef FN_StartFrame_Post -void FN_StartFrame_Post(void); -#endif // FN_StartFrame_Post - -#ifdef FN_ParmsNewLevel_Post -void FN_ParmsNewLevel_Post(void); -#endif // FN_ParmsNewLevel_Post - -#ifdef FN_ParmsChangeLevel_Post -void FN_ParmsChangeLevel_Post(void); -#endif // FN_ParmsChangeLevel_Post - -#ifdef FN_GetGameDescription_Post -const char *FN_GetGameDescription_Post(void); -#endif // FN_GetGameDescription_Post - -#ifdef FN_PlayerCustomization_Post -void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust); -#endif // FN_PlayerCustomization_Post - -#ifdef FN_SpectatorConnect_Post -void FN_SpectatorConnect_Post(edict_t *pEntity); -#endif // FN_SpectatorConnect_Post - -#ifdef FN_SpectatorDisconnect_Post -void FN_SpectatorDisconnect_Post(edict_t *pEntity); -#endif // FN_SpectatorDisconnect_Post - -#ifdef FN_SpectatorThink_Post -void FN_SpectatorThink_Post(edict_t *pEntity); -#endif // FN_SpectatorThink_Post - -#ifdef FN_Sys_Error_Post -void FN_Sys_Error_Post(const char *error_string); -#endif // FN_Sys_Error_Post - -#ifdef FN_PM_Move_Post -void FN_PM_Move_Post(struct playermove_s *ppmove, int server); -#endif // FN_PM_Move_Post - -#ifdef FN_PM_Init_Post -void FN_PM_Init_Post(struct playermove_s *ppmove); -#endif // FN_PM_Init_Post - -#ifdef FN_PM_FindTextureType_Post -char FN_PM_FindTextureType_Post(char *name); -#endif // FN_PM_FindTextureType_Post - -#ifdef FN_SetupVisibility_Post -void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas); -#endif // FN_SetupVisibility_Post - -#ifdef FN_UpdateClientData_Post -void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd); -#endif // FN_UpdateClientData_Post - -#ifdef FN_AddToFullPack_Post -int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet); -#endif // FN_AddToFullPack_Post - -#ifdef FN_CreateBaseline_Post -void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs); -#endif // FN_CreateBaseline_Post - -#ifdef FN_RegisterEncoders_Post -void FN_RegisterEncoders_Post(void); -#endif // FN_RegisterEncoders_Post - -#ifdef FN_GetWeaponData_Post -int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info); -#endif // FN_GetWeaponData_Post - -#ifdef FN_CmdStart_Post -void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed); -#endif // FN_CmdStart_Post - -#ifdef FN_CmdEnd_Post -void FN_CmdEnd_Post(const edict_t *player); -#endif // FN_CmdEnd_Post - -#ifdef FN_ConnectionlessPacket_Post -int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); -#endif // FN_ConnectionlessPacket_Post - -#ifdef FN_GetHullBounds_Post -int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs); -#endif // FN_GetHullBounds_Post - -#ifdef FN_CreateInstancedBaselines_Post -void FN_CreateInstancedBaselines_Post(void); -#endif // FN_CreateInstancedBaselines_Post - -#ifdef FN_InconsistentFile_Post -int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message); -#endif // FN_InconsistentFile_Post - -#ifdef FN_AllowLagCompensation_Post -int FN_AllowLagCompensation_Post(void); -#endif // FN_AllowLagCompensation_Post - - - -#ifdef FN_PrecacheModel -int FN_PrecacheModel(const char *s); -#endif // FN_PrecacheModel - -#ifdef FN_PrecacheSound -int FN_PrecacheSound(const char *s); -#endif // FN_PrecacheSound - -#ifdef FN_SetModel -void FN_SetModel(edict_t *e, const char *m); -#endif // FN_SetModel - -#ifdef FN_ModelIndex -int FN_ModelIndex(const char *m); -#endif // FN_ModelIndex - -#ifdef FN_ModelFrames -int FN_ModelFrames(int modelIndex); -#endif // FN_ModelFrames - -#ifdef FN_SetSize -void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize - -#ifdef FN_ChangeLevel -void FN_ChangeLevel(const char *s1, const char *s2); -#endif // FN_ChangeLevel - -#ifdef FN_GetSpawnParms -void FN_GetSpawnParms(edict_t *ent); -#endif // FN_GetSpawnParms - -#ifdef FN_SaveSpawnParms -void FN_SaveSpawnParms(edict_t *ent); -#endif // FN_SaveSpawnParms - -#ifdef FN_VecToYaw -float FN_VecToYaw(const float *rgflVector); -#endif // FN_VecToYaw - -#ifdef FN_VecToAngles -void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles - -#ifdef FN_MoveToOrigin -void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin - -#ifdef FN_ChangeYaw -void FN_ChangeYaw(edict_t *ent); -#endif // FN_ChangeYaw - -#ifdef FN_ChangePitch -void FN_ChangePitch(edict_t *ent); -#endif // FN_ChangePitch - -#ifdef FN_FindEntityByString -edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString - -#ifdef FN_GetEntityIllum -int FN_GetEntityIllum(edict_t *pEnt); -#endif // FN_GetEntityIllum - -#ifdef FN_FindEntityInSphere -edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere - -#ifdef FN_FindClientInPVS -edict_t *FN_FindClientInPVS(edict_t *pEdict); -#endif // FN_FindClientInPVS - -#ifdef FN_EntitiesInPVS -edict_t *FN_EntitiesInPVS(edict_t *pplayer); -#endif // FN_EntitiesInPVS - -#ifdef FN_MakeVectors -void FN_MakeVectors(const float *rgflVector); -#endif // FN_MakeVectors - -#ifdef FN_AngleVectors -void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors - -#ifdef FN_CreateEntity -edict_t *FN_CreateEntity(void); -#endif // FN_CreateEntity - -#ifdef FN_RemoveEntity -void FN_RemoveEntity(edict_t *e); -#endif // FN_RemoveEntity - -#ifdef FN_CreateNamedEntity -edict_t *FN_CreateNamedEntity(int className); -#endif // FN_CreateNamedEntity - -#ifdef FN_MakeStatic -void FN_MakeStatic(edict_t *ent); -#endif // FN_MakeStatic - -#ifdef FN_EntIsOnFloor -int FN_EntIsOnFloor(edict_t *ent); -#endif // FN_EntIsOnFloor - -#ifdef FN_DropToFloor -int FN_DropToFloor(edict_t *ent); -#endif // FN_DropToFloor - -#ifdef FN_WalkMove -int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove - -#ifdef FN_SetOrigin -void FN_SetOrigin(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin - -#ifdef FN_EmitSound -void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound - -#ifdef FN_EmitAmbientSound -void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound - -#ifdef FN_TraceLine -void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine - -#ifdef FN_TraceToss -void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss - -#ifdef FN_TraceMonsterHull -int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull - -#ifdef FN_TraceHull -void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull - -#ifdef FN_TraceModel -void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel - -#ifdef FN_TraceTexture -const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture - -#ifdef FN_TraceSphere -void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere - -#ifdef FN_GetAimVector -void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector - -#ifdef FN_ServerCommand -void FN_ServerCommand(char *str); -#endif // FN_ServerCommand - -#ifdef FN_ServerExecute -void FN_ServerExecute(void); -#endif // FN_ServerExecute - -#ifdef FN_engClientCommand -void FN_engClientCommand(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand - -#ifdef FN_ParticleEffect -void FN_ParticleEffect(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect - -#ifdef FN_LightStyle -void FN_LightStyle(int style, const char *val); -#endif // FN_LightStyle - -#ifdef FN_DecalIndex -int FN_DecalIndex(const char *name); -#endif // FN_DecalIndex - -#ifdef FN_PointContents -int FN_PointContents(const float *rgflVector); -#endif // FN_PointContents - -#ifdef FN_MessageBegin -void FN_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin - -#ifdef FN_MessageEnd -void FN_MessageEnd(void); -#endif // FN_MessageEnd - -#ifdef FN_WriteByte -void FN_WriteByte(int iValue); -#endif // FN_WriteByte - -#ifdef FN_WriteChar -void FN_WriteChar(int iValue); -#endif // FN_WriteChar - -#ifdef FN_WriteShort -void FN_WriteShort(int iValue); -#endif // FN_WriteShort - -#ifdef FN_WriteLong -void FN_WriteLong(int iValue); -#endif // FN_WriteLong - -#ifdef FN_WriteAngle -void FN_WriteAngle(float flValue); -#endif // FN_WriteAngle - -#ifdef FN_WriteCoord -void FN_WriteCoord(float flValue); -#endif // FN_WriteCoord - -#ifdef FN_WriteString -void FN_WriteString(const char *sz); -#endif // FN_WriteString - -#ifdef FN_WriteEntity -void FN_WriteEntity(int iValue); -#endif // FN_WriteEntity - -#ifdef FN_CVarRegister -void FN_CVarRegister(cvar_t *pCvar); -#endif // FN_CVarRegister - -#ifdef FN_CVarGetFloat -float FN_CVarGetFloat(const char *szVarName); -#endif // FN_CVarGetFloat - -#ifdef FN_CVarGetString -const char *FN_CVarGetString(const char *szVarName); -#endif // FN_CVarGetString - -#ifdef FN_CVarSetFloat -void FN_CVarSetFloat(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat - -#ifdef FN_CVarSetString -void FN_CVarSetString(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString - -#ifdef FN_AlertMessage -void FN_AlertMessage(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage - -#ifdef FN_EngineFprintf -void FN_EngineFprintf(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf - -#ifdef FN_PvAllocEntPrivateData -void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData - -#ifdef FN_PvEntPrivateData -void *FN_PvEntPrivateData(edict_t *pEdict); -#endif // FN_PvEntPrivateData - -#ifdef FN_FreeEntPrivateData -void FN_FreeEntPrivateData(edict_t *pEdict); -#endif // FN_FreeEntPrivateData - -#ifdef FN_SzFromIndex -const char *FN_SzFromIndex(int iString); -#endif // FN_SzFromIndex - -#ifdef FN_AllocString -int FN_AllocString(const char *szValue); -#endif // FN_AllocString - -#ifdef FN_GetVarsOfEnt -struct entvars_s *FN_GetVarsOfEnt(edict_t *pEdict); -#endif // FN_GetVarsOfEnt - -#ifdef FN_PEntityOfEntOffset -edict_t *FN_PEntityOfEntOffset(int iEntOffset); -#endif // FN_PEntityOfEntOffset - -#ifdef FN_EntOffsetOfPEntity -int FN_EntOffsetOfPEntity(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity - -#ifdef FN_IndexOfEdict -int FN_IndexOfEdict(const edict_t *pEdict); -#endif // FN_IndexOfEdict - -#ifdef FN_PEntityOfEntIndex -edict_t *FN_PEntityOfEntIndex(int iEntIndex); -#endif // FN_PEntityOfEntIndex - -#ifdef FN_FindEntityByVars -edict_t *FN_FindEntityByVars(struct entvars_s *pvars); -#endif // FN_FindEntityByVars - -#ifdef FN_GetModelPtr -void *FN_GetModelPtr(edict_t *pEdict); -#endif // FN_GetModelPtr - -#ifdef FN_RegUserMsg -int FN_RegUserMsg(const char *pszName, int iSize); -#endif // FN_RegUserMsg - -#ifdef FN_AnimationAutomove -void FN_AnimationAutomove(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove - -#ifdef FN_GetBonePosition -void FN_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition - -#ifdef FN_FunctionFromName -uint32 FN_FunctionFromName(const char *pName); -#endif // FN_FunctionFromName - -#ifdef FN_NameForFunction -const char *FN_NameForFunction(uint32); -#endif // FN_NameForFunction - -#ifdef FN_ClientPrintf -void FN_ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf - -#ifdef FN_ServerPrint -void FN_ServerPrint(const char *szMsg); -#endif // FN_ServerPrint - -#ifdef FN_Cmd_Args -const char *FN_Cmd_Args(void); -#endif // FN_Cmd_Args - -#ifdef FN_Cmd_Argv -const char *FN_Cmd_Argv(int argc); -#endif // FN_Cmd_Argv - -#ifdef FN_Cmd_Argc -int FN_Cmd_Argc(void); -#endif // FN_Cmd_Argc - -#ifdef FN_GetAttachment -void FN_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment - -#ifdef FN_CRC32_Init -void FN_CRC32_Init(CRC32_t *pulCRC); -#endif // FN_CRC32_Init - -#ifdef FN_CRC32_ProcessBuffer -void FN_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer - -#ifdef FN_CRC32_ProcessByte -void FN_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte - -#ifdef FN_CRC32_Final -CRC32_t FN_CRC32_Final(CRC32_t pulCRC); -#endif // FN_CRC32_Final - -#ifdef FN_RandomLong -int32 FN_RandomLong(int32 lLow, int32 lHigh); -#endif // FN_RandomLong - -#ifdef FN_RandomFloat -float FN_RandomFloat(float flLow, float flHigh); -#endif // FN_RandomFloat - -#ifdef FN_SetView -void FN_SetView(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView - -#ifdef FN_Time -float FN_Time(void); -#endif // FN_Time - -#ifdef FN_CrosshairAngle -void FN_CrosshairAngle(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle - -#ifdef FN_LoadFileForMe -byte *FN_LoadFileForMe(const char *filename, int *pLength); -#endif // FN_LoadFileForMe - -#ifdef FN_FreeFile -void FN_FreeFile(void *buffer); -#endif // FN_FreeFile - -#ifdef FN_EndSection -void FN_EndSection(const char *pszSectionName); -#endif // FN_EndSection - -#ifdef FN_CompareFileTime -int FN_CompareFileTime(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime - -#ifdef FN_GetGameDir -void FN_GetGameDir(char *szGetGameDir); -#endif // FN_GetGameDir - -#ifdef FN_Cvar_RegisterVariable -void FN_Cvar_RegisterVariable(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable - -#ifdef FN_FadeClientVolume -void FN_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume - -#ifdef FN_SetClientMaxspeed -void FN_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed - -#ifdef FN_CreateFakeClient -edict_t *FN_CreateFakeClient(const char *netname); -#endif // FN_CreateFakeClient - -#ifdef FN_RunPlayerMove -void FN_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove - -#ifdef FN_NumberOfEntities -int FN_NumberOfEntities(void); -#endif // FN_NumberOfEntities - -#ifdef FN_GetInfoKeyBuffer -char *FN_GetInfoKeyBuffer(edict_t *e); -#endif // FN_GetInfoKeyBuffer - -#ifdef FN_InfoKeyValue -char *FN_InfoKeyValue(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue - -#ifdef FN_SetKeyValue -void FN_SetKeyValue(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue - -#ifdef FN_SetClientKeyValue -void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue - -#ifdef FN_IsMapValid -int FN_IsMapValid(const char *filename); -#endif // FN_IsMapValid - -#ifdef FN_StaticDecal -void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal - -#ifdef FN_PrecacheGeneric -int FN_PrecacheGeneric(const char *s); -#endif // FN_PrecacheGeneric - -#ifdef FN_GetPlayerUserId -int FN_GetPlayerUserId(edict_t *e ); -#endif // FN_GetPlayerUserId - -#ifdef FN_BuildSoundMsg -void FN_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg - -#ifdef FN_IsDedicatedServer -int FN_IsDedicatedServer(void); -#endif // FN_IsDedicatedServer - -#ifdef FN_CVarGetPointer -cvar_t *FN_CVarGetPointer(const char *szVarName); -#endif // FN_CVarGetPointer - -#ifdef FN_GetPlayerWONId -unsigned int FN_GetPlayerWONId(edict_t *e); -#endif // FN_GetPlayerWONId - -#ifdef FN_Info_RemoveKey -void FN_Info_RemoveKey( char *s, const char *key); -#endif // FN_Info_RemoveKey - -#ifdef FN_GetPhysicsKeyValue -const char *FN_GetPhysicsKeyValue(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue - -#ifdef FN_SetPhysicsKeyValue -void FN_SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue - -#ifdef FN_GetPhysicsInfoString -const char *FN_GetPhysicsInfoString( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString - -#ifdef FN_PrecacheEvent -unsigned short FN_PrecacheEvent(int type, const char *psz); -#endif // FN_PrecacheEvent - -#ifdef FN_PlaybackEvent -void FN_PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent - -#ifdef FN_SetFatPVS -unsigned char *FN_SetFatPVS(float *org); -#endif // FN_SetFatPVS - -#ifdef FN_SetFatPAS -unsigned char *FN_SetFatPAS(float *org); -#endif // FN_SetFatPAS - -#ifdef FN_CheckVisibility -int FN_CheckVisibility(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility - -#ifdef FN_DeltaSetField -void FN_DeltaSetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField - -#ifdef FN_DeltaUnsetField -void FN_DeltaUnsetField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField - -#ifdef FN_DeltaAddEncoder -void FN_DeltaAddEncoder(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder - -#ifdef FN_GetCurrentPlayer -int FN_GetCurrentPlayer(void); -#endif // FN_GetCurrentPlayer - -#ifdef FN_CanSkipPlayer -int FN_CanSkipPlayer(const edict_t *player); -#endif // FN_CanSkipPlayer - -#ifdef FN_DeltaFindField -int FN_DeltaFindField(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField - -#ifdef FN_DeltaSetFieldByIndex -void FN_DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex - -#ifdef FN_DeltaUnsetFieldByIndex -void FN_DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex - -#ifdef FN_SetGroupMask -void FN_SetGroupMask(int mask, int op); -#endif // FN_SetGroupMask - -#ifdef FN_engCreateInstancedBaseline -int FN_engCreateInstancedBaseline(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline - -#ifdef FN_Cvar_DirectSet -void FN_Cvar_DirectSet(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet - -#ifdef FN_ForceUnmodified -void FN_ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified - -#ifdef FN_GetPlayerStats -void FN_GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats - -#ifdef FN_AddServerCommand -void FN_AddServerCommand(char *cmd_name, void (*function) (void)); -#endif // FN_AddServerCommand - -#ifdef FN_Voice_GetClientListening -qboolean FN_Voice_GetClientListening(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening - -#ifdef FN_Voice_SetClientListening -qboolean FN_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening - -#ifdef FN_GetPlayerAuthId -const char *FN_GetPlayerAuthId(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - - - -#ifdef FN_PrecacheModel_Post -int FN_PrecacheModel_Post(const char *s); -#endif // FN_PrecacheModel_Post - -#ifdef FN_PrecacheSound_Post -int FN_PrecacheSound_Post(const char *s); -#endif // FN_PrecacheSound_Post - -#ifdef FN_SetModel_Post -void FN_SetModel_Post(edict_t *e, const char *m); -#endif // FN_SetModel_Post - -#ifdef FN_ModelIndex_Post -int FN_ModelIndex_Post(const char *m); -#endif // FN_ModelIndex_Post - -#ifdef FN_ModelFrames_Post -int FN_ModelFrames_Post(int modelIndex); -#endif // FN_ModelFrames_Post - -#ifdef FN_SetSize_Post -void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); -#endif // FN_SetSize_Post - -#ifdef FN_ChangeLevel_Post -void FN_ChangeLevel_Post(const char *s1, const char *s2); -#endif // FN_ChangeLevel_Post - -#ifdef FN_GetSpawnParms_Post -void FN_GetSpawnParms_Post(edict_t *ent); -#endif // FN_GetSpawnParms_Post - -#ifdef FN_SaveSpawnParms_Post -void FN_SaveSpawnParms_Post(edict_t *ent); -#endif // FN_SaveSpawnParms_Post - -#ifdef FN_VecToYaw_Post -float FN_VecToYaw_Post(const float *rgflVector); -#endif // FN_VecToYaw_Post - -#ifdef FN_VecToAngles_Post -void FN_VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); -#endif // FN_VecToAngles_Post - -#ifdef FN_MoveToOrigin_Post -void FN_MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); -#endif // FN_MoveToOrigin_Post - -#ifdef FN_ChangeYaw_Post -void FN_ChangeYaw_Post(edict_t *ent); -#endif // FN_ChangeYaw_Post - -#ifdef FN_ChangePitch_Post -void FN_ChangePitch_Post(edict_t *ent); -#endif // FN_ChangePitch_Post - -#ifdef FN_FindEntityByString_Post -edict_t *FN_FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); -#endif // FN_FindEntityByString_Post - -#ifdef FN_GetEntityIllum_Post -int FN_GetEntityIllum_Post(edict_t *pEnt); -#endif // FN_GetEntityIllum_Post - -#ifdef FN_FindEntityInSphere_Post -edict_t *FN_FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); -#endif // FN_FindEntityInSphere_Post - -#ifdef FN_FindClientInPVS_Post -edict_t *FN_FindClientInPVS_Post(edict_t *pEdict); -#endif // FN_FindClientInPVS_Post - -#ifdef FN_EntitiesInPVS_Post -edict_t *FN_EntitiesInPVS_Post(edict_t *pplayer); -#endif // FN_EntitiesInPVS_Post - -#ifdef FN_MakeVectors_Post -void FN_MakeVectors_Post(const float *rgflVector); -#endif // FN_MakeVectors_Post - -#ifdef FN_AngleVectors_Post -void FN_AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); -#endif // FN_AngleVectors_Post - -#ifdef FN_CreateEntity_Post -edict_t *FN_CreateEntity_Post(void); -#endif // FN_CreateEntity_Post - -#ifdef FN_RemoveEntity_Post -void FN_RemoveEntity_Post(edict_t *e); -#endif // FN_RemoveEntity_Post - -#ifdef FN_CreateNamedEntity_Post -edict_t *FN_CreateNamedEntity_Post(int className); -#endif // FN_CreateNamedEntity_Post - -#ifdef FN_MakeStatic_Post -void FN_MakeStatic_Post(edict_t *ent); -#endif // FN_MakeStatic_Post - -#ifdef FN_EntIsOnFloor_Post -int FN_EntIsOnFloor_Post(edict_t *ent); -#endif // FN_EntIsOnFloor_Post - -#ifdef FN_DropToFloor_Post -int FN_DropToFloor_Post(edict_t *ent); -#endif // FN_DropToFloor_Post - -#ifdef FN_WalkMove_Post -int FN_WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); -#endif // FN_WalkMove_Post - -#ifdef FN_SetOrigin_Post -void FN_SetOrigin_Post(edict_t *e, const float *rgflOrigin); -#endif // FN_SetOrigin_Post - -#ifdef FN_EmitSound_Post -void FN_EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); -#endif // FN_EmitSound_Post - -#ifdef FN_EmitAmbientSound_Post -void FN_EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); -#endif // FN_EmitAmbientSound_Post - -#ifdef FN_TraceLine_Post -void FN_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceLine_Post - -#ifdef FN_TraceToss_Post -void FN_TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); -#endif // FN_TraceToss_Post - -#ifdef FN_TraceMonsterHull_Post -int FN_TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceMonsterHull_Post - -#ifdef FN_TraceHull_Post -void FN_TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceHull_Post - -#ifdef FN_TraceModel_Post -void FN_TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -#endif // FN_TraceModel_Post - -#ifdef FN_TraceTexture_Post -const char *FN_TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); -#endif // FN_TraceTexture_Post - -#ifdef FN_TraceSphere_Post -void FN_TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -#endif // FN_TraceSphere_Post - -#ifdef FN_GetAimVector_Post -void FN_GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); -#endif // FN_GetAimVector_Post - -#ifdef FN_ServerCommand_Post -void FN_ServerCommand_Post(char *str); -#endif // FN_ServerCommand_Post - -#ifdef FN_ServerExecute_Post -void FN_ServerExecute_Post(void); -#endif // FN_ServerExecute_Post - -#ifdef FN_engClientCommand_Post -void FN_engClientCommand_Post(edict_t *pEdict, char *szFmt, ...); -#endif // FN_engClientCommand_Post - -#ifdef FN_ParticleEffect_Post -void FN_ParticleEffect_Post(const float *org, const float *dir, float color, float count); -#endif // FN_ParticleEffect_Post - -#ifdef FN_LightStyle_Post -void FN_LightStyle_Post(int style, const char *val); -#endif // FN_LightStyle_Post - -#ifdef FN_DecalIndex_Post -int FN_DecalIndex_Post(const char *name); -#endif // FN_DecalIndex_Post - -#ifdef FN_PointContents_Post -int FN_PointContents_Post(const float *rgflVector); -#endif // FN_PointContents_Post - -#ifdef FN_MessageBegin_Post -void FN_MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_MessageBegin_Post - -#ifdef FN_MessageEnd_Post -void FN_MessageEnd_Post(void); -#endif // FN_MessageEnd_Post - -#ifdef FN_WriteByte_Post -void FN_WriteByte_Post(int iValue); -#endif // FN_WriteByte_Post - -#ifdef FN_WriteChar_Post -void FN_WriteChar_Post(int iValue); -#endif // FN_WriteChar_Post - -#ifdef FN_WriteShort_Post -void FN_WriteShort_Post(int iValue); -#endif // FN_WriteShort_Post - -#ifdef FN_WriteLong_Post -void FN_WriteLong_Post(int iValue); -#endif // FN_WriteLong_Post - -#ifdef FN_WriteAngle_Post -void FN_WriteAngle_Post(float flValue); -#endif // FN_WriteAngle_Post - -#ifdef FN_WriteCoord_Post -void FN_WriteCoord_Post(float flValue); -#endif // FN_WriteCoord_Post - -#ifdef FN_WriteString_Post -void FN_WriteString_Post(const char *sz); -#endif // FN_WriteString_Post - -#ifdef FN_WriteEntity_Post -void FN_WriteEntity_Post(int iValue); -#endif // FN_WriteEntity_Post - -#ifdef FN_CVarRegister_Post -void FN_CVarRegister_Post(cvar_t *pCvar); -#endif // FN_CVarRegister_Post - -#ifdef FN_CVarGetFloat_Post -float FN_CVarGetFloat_Post(const char *szVarName); -#endif // FN_CVarGetFloat_Post - -#ifdef FN_CVarGetString_Post -const char *FN_CVarGetString_Post(const char *szVarName); -#endif // FN_CVarGetString_Post - -#ifdef FN_CVarSetFloat_Post -void FN_CVarSetFloat_Post(const char *szVarName, float flValue); -#endif // FN_CVarSetFloat_Post - -#ifdef FN_CVarSetString_Post -void FN_CVarSetString_Post(const char *szVarName, const char *szValue); -#endif // FN_CVarSetString_Post - -#ifdef FN_AlertMessage_Post -void FN_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); -#endif // FN_AlertMessage_Post - -#ifdef FN_EngineFprintf_Post -void FN_EngineFprintf_Post(void *pfile, char *szFmt, ...); -#endif // FN_EngineFprintf_Post - -#ifdef FN_PvAllocEntPrivateData_Post -void *FN_PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); -#endif // FN_PvAllocEntPrivateData_Post - -#ifdef FN_PvEntPrivateData_Post -void *FN_PvEntPrivateData_Post(edict_t *pEdict); -#endif // FN_PvEntPrivateData_Post - -#ifdef FN_FreeEntPrivateData_Post -void FN_FreeEntPrivateData_Post(edict_t *pEdict); -#endif // FN_FreeEntPrivateData_Post - -#ifdef FN_SzFromIndex_Post -const char *FN_SzFromIndex_Post(int iString); -#endif // FN_SzFromIndex_Post - -#ifdef FN_AllocString_Post -int FN_AllocString_Post(const char *szValue); -#endif // FN_AllocString_Post - -#ifdef FN_GetVarsOfEnt_Post -struct entvars_s *FN_GetVarsOfEnt_Post(edict_t *pEdict); -#endif // FN_GetVarsOfEnt_Post - -#ifdef FN_PEntityOfEntOffset_Post -edict_t *FN_PEntityOfEntOffset_Post(int iEntOffset); -#endif // FN_PEntityOfEntOffset_Post - -#ifdef FN_EntOffsetOfPEntity_Post -int FN_EntOffsetOfPEntity_Post(const edict_t *pEdict); -#endif // FN_EntOffsetOfPEntity_Post - -#ifdef FN_IndexOfEdict_Post -int FN_IndexOfEdict_Post(const edict_t *pEdict); -#endif // FN_IndexOfEdict_Post - -#ifdef FN_PEntityOfEntIndex_Post -edict_t *FN_PEntityOfEntIndex_Post(int iEntIndex); -#endif // FN_PEntityOfEntIndex_Post - -#ifdef FN_FindEntityByVars_Post -edict_t *FN_FindEntityByVars_Post(struct entvars_s *pvars); -#endif // FN_FindEntityByVars_Post - -#ifdef FN_GetModelPtr_Post -void *FN_GetModelPtr_Post(edict_t *pEdict); -#endif // FN_GetModelPtr_Post - -#ifdef FN_RegUserMsg_Post -int FN_RegUserMsg_Post(const char *pszName, int iSize); -#endif // FN_RegUserMsg_Post - -#ifdef FN_AnimationAutomove_Post -void FN_AnimationAutomove_Post(const edict_t *pEdict, float flTime); -#endif // FN_AnimationAutomove_Post - -#ifdef FN_GetBonePosition_Post -void FN_GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles); -#endif // FN_GetBonePosition_Post - -#ifdef FN_FunctionFromName_Post -uint32 FN_FunctionFromName_Post(const char *pName); -#endif // FN_FunctionFromName_Post - -#ifdef FN_NameForFunction_Post -const char *FN_NameForFunction_Post(uint32); -#endif // FN_NameForFunction_Post - -#ifdef FN_ClientPrintf_Post -void FN_ClientPrintf_Post(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); -#endif // FN_ClientPrintf_Post - -#ifdef FN_ServerPrint_Post -void FN_ServerPrint_Post(const char *szMsg); -#endif // FN_ServerPrint_Post - -#ifdef FN_Cmd_Args_Post -const char *FN_Cmd_Args_Post(void); -#endif // FN_Cmd_Args_Post - -#ifdef FN_Cmd_Argv_Post -const char *FN_Cmd_Argv_Post(int argc); -#endif // FN_Cmd_Argv_Post - -#ifdef FN_Cmd_Argc_Post -int FN_Cmd_Argc_Post(void); -#endif // FN_Cmd_Argc_Post - -#ifdef FN_GetAttachment_Post -void FN_GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -#endif // FN_GetAttachment_Post - -#ifdef FN_CRC32_Init_Post -void FN_CRC32_Init_Post(CRC32_t *pulCRC); -#endif // FN_CRC32_Init_Post - -#ifdef FN_CRC32_ProcessBuffer_Post -void FN_CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); -#endif // FN_CRC32_ProcessBuffer_Post - -#ifdef FN_CRC32_ProcessByte_Post -void FN_CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); -#endif // FN_CRC32_ProcessByte_Post - -#ifdef FN_CRC32_Final_Post -CRC32_t FN_CRC32_Final_Post(CRC32_t pulCRC); -#endif // FN_CRC32_Final_Post - -#ifdef FN_RandomLong_Post -int32 FN_RandomLong_Post(int32 lLow, int32 lHigh); -#endif // FN_RandomLong_Post - -#ifdef FN_RandomFloat_Post -float FN_RandomFloat_Post(float flLow, float flHigh); -#endif // FN_RandomFloat_Post - -#ifdef FN_SetView_Post -void FN_SetView_Post(const edict_t *pClient, const edict_t *pViewent); -#endif // FN_SetView_Post - -#ifdef FN_Time_Post -float FN_Time_Post(void); -#endif // FN_Time_Post - -#ifdef FN_CrosshairAngle_Post -void FN_CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); -#endif // FN_CrosshairAngle_Post - -#ifdef FN_LoadFileForMe_Post -byte *FN_LoadFileForMe_Post(const char *filename, int *pLength); -#endif // FN_LoadFileForMe_Post - -#ifdef FN_FreeFile_Post -void FN_FreeFile_Post(void *buffer); -#endif // FN_FreeFile_Post - -#ifdef FN_EndSection_Post -void FN_EndSection_Post(const char *pszSectionName); -#endif // FN_EndSection_Post - -#ifdef FN_CompareFileTime_Post -int FN_CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); -#endif // FN_CompareFileTime_Post - -#ifdef FN_GetGameDir_Post -void FN_GetGameDir_Post(char *szGetGameDir); -#endif // FN_GetGameDir_Post - -#ifdef FN_Cvar_RegisterVariable_Post -void FN_Cvar_RegisterVariable_Post(cvar_t *variable); -#endif // FN_Cvar_RegisterVariable_Post - -#ifdef FN_FadeClientVolume_Post -void FN_FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); -#endif // FN_FadeClientVolume_Post - -#ifdef FN_SetClientMaxspeed_Post -void FN_SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); -#endif // FN_SetClientMaxspeed_Post - -#ifdef FN_CreateFakeClient_Post -edict_t *FN_CreateFakeClient_Post(const char *netname); -#endif // FN_CreateFakeClient_Post - -#ifdef FN_RunPlayerMove_Post -void FN_RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); -#endif // FN_RunPlayerMove_Post - -#ifdef FN_NumberOfEntities_Post -int FN_NumberOfEntities_Post(void); -#endif // FN_NumberOfEntities_Post - -#ifdef FN_GetInfoKeyBuffer_Post -char *FN_GetInfoKeyBuffer_Post(edict_t *e); -#endif // FN_GetInfoKeyBuffer_Post - -#ifdef FN_InfoKeyValue_Post -char *FN_InfoKeyValue_Post(char *infobuffer, const char *key); -#endif // FN_InfoKeyValue_Post - -#ifdef FN_SetKeyValue_Post -void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value); -#endif // FN_SetKeyValue_Post - -#ifdef FN_SetClientKeyValue_Post -void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value); -#endif // FN_SetClientKeyValue_Post - -#ifdef FN_IsMapValid_Post -int FN_IsMapValid_Post(const char *filename); -#endif // FN_IsMapValid_Post - -#ifdef FN_StaticDecal_Post -void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, int modelIndex); -#endif // FN_StaticDecal_Post - -#ifdef FN_PrecacheGeneric_Post -int FN_PrecacheGeneric_Post(const char *s); -#endif // FN_PrecacheGeneric_Post - -#ifdef FN_GetPlayerUserId_Post -int FN_GetPlayerUserId_Post(edict_t *e ); -#endif // FN_GetPlayerUserId_Post - -#ifdef FN_BuildSoundMsg_Post -void FN_BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -#endif // FN_BuildSoundMsg_Post - -#ifdef FN_IsDedicatedServer_Post -int FN_IsDedicatedServer_Post(void); -#endif // FN_IsDedicatedServer_Post - -#ifdef FN_CVarGetPointer_Post -cvar_t *FN_CVarGetPointer_Post(const char *szVarName); -#endif // FN_CVarGetPointer_Post - -#ifdef FN_GetPlayerWONId_Post -unsigned int FN_GetPlayerWONId_Post(edict_t *e); -#endif // FN_GetPlayerWONId_Post - -#ifdef FN_Info_RemoveKey_Post -void FN_Info_RemoveKey_Post( char *s, const char *key); -#endif // FN_Info_RemoveKey_Post - -#ifdef FN_GetPhysicsKeyValue_Post -const char *FN_GetPhysicsKeyValue_Post(const edict_t *pClient, const char *key); -#endif // FN_GetPhysicsKeyValue_Post - -#ifdef FN_SetPhysicsKeyValue_Post -void FN_SetPhysicsKeyValue_Post(const edict_t *pClient, const char *key, const char *value); -#endif // FN_SetPhysicsKeyValue_Post - -#ifdef FN_GetPhysicsInfoString_Post -const char *FN_GetPhysicsInfoString_Post( const edict_t *pClient); -#endif // FN_GetPhysicsInfoString_Post - -#ifdef FN_PrecacheEvent_Post -unsigned short FN_PrecacheEvent_Post(int type, const char *psz); -#endif // FN_PrecacheEvent_Post - -#ifdef FN_PlaybackEvent_Post -void FN_PlaybackEvent_Post(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); -#endif // FN_PlaybackEvent_Post - -#ifdef FN_SetFatPVS_Post -unsigned char *FN_SetFatPVS_Post(float *org); -#endif // FN_SetFatPVS_Post - -#ifdef FN_SetFatPAS_Post -unsigned char *FN_SetFatPAS_Post(float *org); -#endif // FN_SetFatPAS_Post - -#ifdef FN_CheckVisibility_Post -int FN_CheckVisibility_Post(const edict_t *entity, unsigned char *pset); -#endif // FN_CheckVisibility_Post - -#ifdef FN_DeltaSetField_Post -void FN_DeltaSetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaSetField_Post - -#ifdef FN_DeltaUnsetField_Post -void FN_DeltaUnsetField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaUnsetField_Post - -#ifdef FN_DeltaAddEncoder_Post -void FN_DeltaAddEncoder_Post(const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); -#endif // FN_DeltaAddEncoder_Post - -#ifdef FN_GetCurrentPlayer_Post -int FN_GetCurrentPlayer_Post(void); -#endif // FN_GetCurrentPlayer_Post - -#ifdef FN_CanSkipPlayer_Post -int FN_CanSkipPlayer_Post(const edict_t *player); -#endif // FN_CanSkipPlayer_Post - -#ifdef FN_DeltaFindField_Post -int FN_DeltaFindField_Post(struct delta_s *pFields, const char *fieldname); -#endif // FN_DeltaFindField_Post - -#ifdef FN_DeltaSetFieldByIndex_Post -void FN_DeltaSetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaSetFieldByIndex_Post - -#ifdef FN_DeltaUnsetFieldByIndex_Post -void FN_DeltaUnsetFieldByIndex_Post(struct delta_s *pFields, int fieldNumber); -#endif // FN_DeltaUnsetFieldByIndex_Post - -#ifdef FN_SetGroupMask_Post -void FN_SetGroupMask_Post(int mask, int op); -#endif // FN_SetGroupMask_Post - -#ifdef FN_engCreateInstancedBaseline_Post -int FN_engCreateInstancedBaseline_Post(int classname, struct entity_state_s *baseline); -#endif // FN_engCreateInstancedBaseline_Post - -#ifdef FN_Cvar_DirectSet_Post -void FN_Cvar_DirectSet_Post(struct cvar_s *var, const char *value); -#endif // FN_Cvar_DirectSet_Post - -#ifdef FN_ForceUnmodified_Post -void FN_ForceUnmodified_Post(FORCE_TYPE type, float *mins, float *maxs, const char *filename); -#endif // FN_ForceUnmodified_Post - -#ifdef FN_GetPlayerStats_Post -void FN_GetPlayerStats_Post(const edict_t *pClient, int *ping, int *packet_loss); -#endif // FN_GetPlayerStats_Post - -#ifdef FN_AddServerCommand_Post -void FN_AddServerCommand_Post(char *cmd_name, void (*function)(void)); -#endif // FN_AddServerCommand_Post - -#ifdef FN_Voice_GetClientListening_Post -qboolean FN_Voice_GetClientListening_Post(int iReceiver, int iSender); -#endif // FN_Voice_GetClientListening_Post - -#ifdef FN_Voice_SetClientListening_Post -qboolean FN_Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); -#endif // FN_Voice_SetClientListening_Post - -#ifdef FN_GetPlayerAuthId_Post -const char *FN_GetPlayerAuthId_Post(edict_t *e); -#endif // FN_GetPlayerAuthId - - - - -#ifdef FN_OnFreeEntPrivateData -void FN_OnFreeEntPrivateData(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData - -#ifdef FN_GameShutdown -void FN_GameShutdown(void); -#endif // FN_GameShutdown - -#ifdef FN_ShouldCollide -int FN_ShouldCollide(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide - - - - - -#ifdef FN_OnFreeEntPrivateData_Post -void FN_OnFreeEntPrivateData_Post(edict_t *pEnt); -#endif // FN_OnFreeEntPrivateData_Post - -#ifdef FN_GameShutdown_Post -void FN_GameShutdown_Post(void); -#endif // FN_GameShutdown_Post - -#ifdef FN_ShouldCollide_Post -int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther); -#endif // FN_ShouldCollide_Post - -#endif // USE_METAMOD - - -#ifdef FN_AMXX_QUERY -void FN_AMXX_QUERY(void); -#endif // FN_AMXX_QUERY - -#ifdef FN_AMXX_CHECKGAME -int FN_AMXX_CHECKGAME(const char *); -#endif // FN_AMXX_CHECKGAME - -#ifdef FN_AMXX_ATTACH -void FN_AMXX_ATTACH(void); -#endif // FN_AMXX_ATTACH - -#ifdef FN_AMXX_DETACH -void FN_AMXX_DETACH(void); -#endif // FN_AMXX_DETACH - -#ifdef FN_AMXX_PLUGINSLOADED -void FN_AMXX_PLUGINSLOADED(void); -#endif // FN_AMXX_PLUGINSLOADED - -#ifdef FN_AMXX_PLUGINSUNLOADING -void FN_AMXX_PLUGINSUNLOADING(void); -#endif // FN_AMXX_PLUGINSUNLOADING - -#ifdef FN_AMXX_PLUGINSUNLOADED -void FN_AMXX_PLUGINSUNLOADED(void); -#endif // FN_AMXX_PLUGINSUNLOADED - -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - -// ***** Module funcs stuff ***** -enum ForwardExecType -{ - ET_IGNORE = 0, // Ignore return vaue - ET_STOP, // Stop on PLUGIN_HANDLED - ET_STOP2, // Stop on PLUGIN_HANDLED, continue on other values, return biggest return value - ET_CONTINUE, // Continue; return biggest return value -}; - -enum ForwardParam -{ - FP_DONE = -1, // specify this as the last argument - // only tells the function that there are no more arguments - FP_CELL, // normal cell - FP_FLOAT, // float; used as normal cell though - FP_STRING, // string - FP_STRINGEX, // string; will be updated to the last function's value - FP_ARRAY, // array; use the return value of prepareArray. -}; - -enum PlayerProp -{ - Player_Name, //String - Player_Ip, //String - Player_Team, //String - Player_Ingame, //bool - Player_Authorized, //bool - Player_Vgui, //bool - Player_Time, //float - Player_Playtime, //float - Player_MenuExpire, //float - Player_Weapons, //struct{int,int}[32] - Player_CurrentWeapon, //int - Player_TeamID, //int - Player_Deaths, //int - Player_Aiming, //int - Player_Menu, //int - Player_Keys, //int - Player_Flags, //int[32] - Player_Newmenu, //int - Player_NewmenuPage, //int -}; - -enum LibType -{ - LibType_Library, - LibType_Class -}; - -#define MSGBLOCK_SET 0 -#define MSGBLOCK_GET 1 -#define BLOCK_NOT 0 -#define BLOCK_ONCE 1 -#define BLOCK_SET 2 - -typedef void (*AUTHORIZEFUNC)(int player, const char *authstring); - -typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/); -typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); -typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); -typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); -typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...); -typedef const char * (*PFN_GET_MODNAME) (void); -typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); -typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYAMX) (const AMX * /*amx*/); -typedef int (*PFN_FIND_AMXSCRIPT_BYNAME) (const char * /*name*/); -typedef int (*PFN_SET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, const char * /* source */, int /* max */); -typedef int (*PFN_SET_AMXSTRING_UTF8_CHAR) (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen); -typedef int (*PFN_SET_AMXSTRING_UTF8_CELL) (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen); -typedef char * (*PFN_GET_AMXSTRING) (AMX * /*amx*/, cell /*amx_addr*/, int /*bufferId*/, int * /*pLen*/); -typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr); -typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/); -typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/); -typedef void (*PFN_LOG) (const char * /*fmt*/, ...); -typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...); -typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/); -typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/); -typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/); -typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/); -typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/); -typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/); -typedef int (*PFN_IS_PLAYER_INGAME) (int /*id*/); -typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); -typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); -typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); -typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); -typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); -typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); -typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/); -typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); -typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); -typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/); -typedef int (*PFN_GET_PLAYER_KEYS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_ALIVE) (int /*id*/); -typedef int (*PFN_GET_PLAYER_FRAGS) (int /*id*/); -typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/); -typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/); -typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/); -typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/); -#ifdef USE_METAMOD -typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#else -typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/); -#endif -typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/); - -#ifdef MEMORY_TEST -typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/); -typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ ); -typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/, - const unsigned int /*type*/, const void* /*addr*/ ); -#endif -typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); -typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); -typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); -typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/); -typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); -typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); -typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); -typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/); -typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/); -typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/); -typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/); -typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/); -typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/); -typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/); -typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/); -typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */); -typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); -typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); -typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); -typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); -typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); -typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); -typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); -typedef void (*PFN_MESSAGE_BLOCK) (int /* mode */, int /* message */, int * /* opt */); - -extern PFN_ADD_NATIVES g_fn_AddNatives; -extern PFN_ADD_NEW_NATIVES g_fn_AddNewNatives; -extern PFN_BUILD_PATHNAME g_fn_BuildPathname; -extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR; -extern PFN_GET_AMXADDR g_fn_GetAmxAddr; -extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole; -extern PFN_GET_MODNAME g_fn_GetModname; -extern PFN_GET_AMXSCRIPTNAME g_fn_GetAmxScriptName; -extern PFN_GET_AMXSCRIPT g_fn_GetAmxScript; -extern PFN_FIND_AMXSCRIPT_BYAMX g_fn_FindAmxScriptByAmx; -extern PFN_FIND_AMXSCRIPT_BYNAME g_fn_FindAmxScriptByName; -extern PFN_SET_AMXSTRING g_fn_SetAmxString; -extern PFN_SET_AMXSTRING_UTF8_CHAR g_fn_SetAmxStringUTF8Char; -extern PFN_SET_AMXSTRING_UTF8_CELL g_fn_SetAmxStringUTF8Cell; -extern PFN_GET_AMXSTRING g_fn_GetAmxString; -extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen; -extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString; -extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory; -extern PFN_LOG g_fn_Log; -extern PFN_LOG_ERROR g_fn_LogErrorFunc; -extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError; -extern PFN_REGISTER_FORWARD g_fn_RegisterForward; -extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward; -extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray; -extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray; -extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA; -extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA; -extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid; -extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName; -extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP; -extern PFN_IS_PLAYER_INGAME g_fn_IsPlayerIngame; -extern PFN_IS_PLAYER_BOT g_fn_IsPlayerBot; -extern PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized; -extern PFN_GET_PLAYER_TIME g_fn_GetPlayerTime; -extern PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime; -extern PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon; -extern PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID; -extern PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths; -extern PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu; -extern PFN_GET_PLAYER_KEYS g_fn_GetPlayerKeys; -extern PFN_IS_PLAYER_ALIVE g_fn_IsPlayerAlive; -extern PFN_GET_PLAYER_FRAGS g_fn_GetPlayerFrags; -extern PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting; -extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV; -extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor; -extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth; -extern PFN_AMX_EXEC g_fn_AmxExec; -extern PFN_AMX_ALLOT g_fn_AmxAllot; -extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic; -extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript; -extern PFN_UNLOAD_AMXSCRIPT g_fn_UnloadAmxScript; -extern PFN_REAL_TO_CELL g_fn_RealToCell; -extern PFN_CELL_TO_REAL g_fn_CellToReal; -extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward; -extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; -extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; -extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; -extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; -extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; -extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; -extern PFN_FORMAT g_fn_Format; -extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; -extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; -extern PFN_REQ_FNPTR g_fn_RequestFunction; -extern PFN_AMX_PUSH g_fn_AmxPush; -extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo; -extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr; -extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc; -extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc; -extern PFN_FINDLIBRARY g_fn_FindLibrary; -extern PFN_ADDLIBRARIES g_fn_AddLibraries; -extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; -extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; -extern PFN_GETLOCALINFO g_fn_GetLocalInfo; -extern PFN_AMX_REREGISTER g_fn_AmxReRegister; -extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; -extern PFN_MESSAGE_BLOCK g_fn_MessageBlock; - -#ifdef MAY_NEVER_BE_DEFINED -// Function prototypes for intellisense and similar systems -// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED -int MF_AddNatives (const AMX_NATIVE_INFO *list) { } -int MF_AddNewNatives (const AMX_NATIVE_INFO *list) { } -char * MF_BuildPathname (const char * format, ...) { } -char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { } -cell * MF_GetAmxAddr (AMX * amx, cell offset) { } -void MF_PrintSrvConsole (char * format, ...) { } -const char * MF_GetModname (void) { } -const char * MF_GetScriptName (int id) { } -AMX * MF_GetScriptAmx (int id) { } -int MF_FindScriptByAmx (const AMX * amx) { } -int MF_FindScriptByAmx (const char * name) { } -int MF_SetAmxString (AMX * amx, cell amx_addr, const char * source , int max ) { } -int MF_SetAmxStringUTF8Char (AMX *amx, cell amx_addr, const char *source, size_t sourcelen, size_t maxlen) { } -int MF_SetAmxStringUTF8Cell (AMX *amx, cell amx_addr, const cell *source, size_t sourcelen, size_t maxlen) { } -char * MF_GetAmxString (AMX * amx, cell amx_addr, int bufferId, int * pLen) { } -int MF_GetAmxStringLen (const cell *ptr) { } -char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { } -void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { } -void MF_Log (const char * fmt, ...) { } -void MF_LogError (AMX * amx, int err, const char *fmt, ...) { } -int MF_RaiseAmxError (AMX * amx, int error) { } -int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { } -int MF_ExecuteForward (int id, ...) { } -cell MF_PrepareCellArray (cell * ptr, unsigned int size) { } -cell MF_PrepareCharArray (char * ptr, unsigned int size) { } -cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { } -cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { } -int MF_IsPlayerValid (int id) { } -const char * MF_GetPlayerName (int id) { } -const char * MF_GetPlayerIP (int id) { } -int MF_IsPlayerIngame (int id) { } -int MF_IsPlayerBot (int id) { } -int MF_IsPlayerAuthorized (int id) { } -float MF_GetPlayerTime (int id) { } -float MF_GetPlayerPlayTime (int id) { } -int MF_GetPlayerCurweapon (int id) { } -const char * MF_GetPlayerTeam (int id) { } -int MF_GetPlayerTeamID (int id) { } -int MF_GetPlayerDeaths (int id) { } -int MF_GetPlayerMenu (int id) { } -int MF_GetPlayerKeys (int id) { } -int MF_IsPlayerAlive (int id) { } -int MF_GetPlayerFrags (int id) { } -int MF_IsPlayerConnecting (int id) { } -int MF_IsPlayerHLTV (int id) { } -int MF_GetPlayerArmor (int id) { } -int MF_GetPlayerHealth (int id) { } -REAL amx_ctof (cell x) { } -cell amx_ftoc (float x) { } -int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } -int MF_RegisterSPForward (AMX * amx, int func, ...) { } -void MF_UnregisterSPForward (int id) { } -int MF_GetPlayerFlags (int id) { } -edict_t* MF_GetPlayerEdict (int id) { } -const char * MF_Format (const char *fmt, ...) { } -void MF_RegisterFunction (void *pfn, const char *description) { } -void * MF_RequestFunction (const char *description) { } -int MF_AmxPush (AMX *amx, cell *params) { } -int MF_AmxExec (AMX *amx, cell *retval, int idx) { } -int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { } -void * MF_PlayerPropAddr (int id, int prop) { } -void MF_RegAuthFunc (AUTHORIZEFUNC fn) { } -void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } -int MF_FindLibrary (const char *name, LibType type) { } -size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } -size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } -const char * MF_GetLocalInfo (const char *name, const char *def) { } -int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } -void * MF_RegisterFunctionEx (void *pfn, const char *description) { } -void * MF_MessageBlock (int mode, int msg, int *opt) { } -#endif // MAY_NEVER_BE_DEFINED - -#define MF_AddNatives g_fn_AddNatives -#define MF_AddNewNatives g_fn_AddNewNatives -#define MF_BuildPathname g_fn_BuildPathname -#define MF_BuildPathnameR g_fn_BuildPathnameR -#define MF_FormatAmxString g_fn_FormatAmxString -#define MF_GetAmxAddr g_fn_GetAmxAddr -#define MF_PrintSrvConsole g_fn_PrintSrvConsole -#define MF_GetModname g_fn_GetModname -#define MF_GetScriptName g_fn_GetAmxScriptName -#define MF_GetScriptAmx g_fn_GetAmxScript -#define MF_FindScriptByAmx g_fn_FindAmxScriptByAmx -#define MF_FindScriptByName g_fn_FindAmxScriptByName -#define MF_SetAmxString g_fn_SetAmxString -#define MF_SetAmxStringUTF8Char g_fn_SetAmxStringUTF8Char -#define MF_SetAmxStringUTF8Cell g_fn_SetAmxStringUTF8Cell -#define MF_GetAmxString g_fn_GetAmxString -#define MF_GetAmxStringLen g_fn_GetAmxStringLen -#define MF_CopyAmxMemory g_fn_CopyAmxMemory -void MF_Log(const char *fmt, ...); -void MF_LogError(AMX *amx, int err, const char *fmt, ...); -#define MF_RaiseAmxError g_fn_RaiseAmxError -#define MF_RegisterForward g_fn_RegisterForward -#define MF_ExecuteForward g_fn_ExecuteForward -#define MF_PrepareCellArray g_fn_PrepareCellArray -#define MF_PrepareCharArray g_fn_PrepareCharArray -#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA -#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA -#define MF_IsPlayerValid g_fn_IsPlayerValid -#define MF_GetPlayerName g_fn_GetPlayerName -#define MF_GetPlayerIP g_fn_GetPlayerIP -#define MF_IsPlayerIngame g_fn_IsPlayerIngame -#define MF_IsPlayerBot g_fn_IsPlayerBot -#define MF_IsPlayerAuthorized g_fn_IsPlayerAuthorized -#define MF_GetPlayerTime g_fn_GetPlayerTime -#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime -#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon -#define MF_GetPlayerTeam g_fn_GetPlayerTeam -#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID -#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths -#define MF_GetPlayerMenu g_fn_GetPlayerMenu -#define MF_GetPlayerKeys g_fn_GetPlayerKeys -#define MF_IsPlayerAlive g_fn_IsPlayerAlive -#define MF_GetPlayerFrags g_fn_GetPlayerFrags -#define MF_IsPlayerConnecting g_fn_IsPlayerConnecting -#define MF_IsPlayerHLTV g_fn_IsPlayerHLTV -#define MF_GetPlayerArmor g_fn_GetPlayerArmor -#define MF_GetPlayerHealth g_fn_GetPlayerHealth -#define MF_AmxExec g_fn_AmxExec -#define MF_AmxExecv g_fn_AmxExecv -#define MF_AmxFindPublic g_fn_AmxFindPublic -#define MF_AmxAllot g_fn_AmxAllot -#define MF_AmxFindNative g_fn_AmxFindNative -#define MF_LoadAmxScript g_fn_LoadAmxScript -#define MF_UnloadAmxScript g_fn_UnloadAmxScript -#define MF_MergeDefinitionFile g_fn_MergeDefinition_File -#define amx_ctof g_fn_CellToReal -#define amx_ftoc g_fn_RealToCell -#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName -#define MF_RegisterSPForward g_fn_RegisterSPForward -#define MF_UnregisterSPForward g_fn_UnregisterSPForward -#define MF_GetPlayerFlags g_fn_GetPlayerFlags -#define MF_GetPlayerEdict g_fn_GetPlayerEdict -#define MF_Format g_fn_Format -#define MF_RegisterFunction g_fn_RegisterFunction -#define MF_RequestFunction g_fn_RequestFunction -#define MF_AmxPush g_fn_AmxPush -#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo -#define MF_PlayerPropAddr g_fn_PlayerPropAddr -#define MF_RegAuthFunc g_fn_RegAuthFunc -#define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary -#define MF_AddLibraries g_fn_AddLibraries -#define MF_RemoveLibraries g_fn_RemoveLibraries -#define MF_OverrideNatives g_fn_OverrideNatives -#define MF_GetLocalInfo g_fn_GetLocalInfo -#define MF_AmxReRegister g_fn_AmxReRegister -#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx -#define MF_MessageBlock g_fn_MessageBlock - -#ifdef MEMORY_TEST -/*** Memory ***/ -void *operator new(size_t reportedSize); -void *operator new[](size_t reportedSize); -void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine); -void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine); -void operator delete(void *reportedAddress); -void operator delete[](void *reportedAddress); - -// Allocation types -extern const unsigned int m_alloc_unknown; -extern const unsigned int m_alloc_new; -extern const unsigned int m_alloc_new_array; -extern const unsigned int m_alloc_malloc; -extern const unsigned int m_alloc_calloc; -extern const unsigned int m_alloc_realloc; -extern const unsigned int m_alloc_delete; -extern const unsigned int m_alloc_delete_array; -extern const unsigned int m_alloc_free; - -// To be called before new / delete -void Mem_SetOwner(const char *filename, int line, const char *function); -// Actual allocator -void * Mem_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int allocationType, const size_t reportedSize); -void * Mem_Reallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress); -void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, - const unsigned int deallocationType, void *reportedAddress); - -// memory macros -#ifndef __FUNCTION__ -#define __FUNCTION__ "??" -#endif - -// call Mem_SetOwner, followed by the actual new operator -#define new (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new -// call Mem_SetOwner, followed by the actual delete operator -#define delete (Mem_SetOwner(__FILE__,__LINE__,__FUNCTION__),false) ? Mem_SetOwner("",0,"") : delete -#define malloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_malloc,sz) -#define calloc(sz) Mem_Allocator (__FILE__,__LINE__,__FUNCTION__,m_alloc_calloc,sz) -#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) -#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) - -#endif //MEMORY_TEST - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); - -#endif // #ifndef __AMXXMODULE_H__ diff --git a/public/ITextParsers.h b/public/ITextParsers.h index 0f88be9e..2a643d32 100644 --- a/public/ITextParsers.h +++ b/public/ITextParsers.h @@ -36,8 +36,8 @@ * @file ITextParsers.h * @brief Defines various text/file parsing functions, as well as UTF-8 support code. */ -namespace SourceMod -{ +//namespace SourceMod +//{ #define SMINTERFACE_TEXTPARSERS_NAME "ITextParsers" #define SMINTERFACE_TEXTPARSERS_VERSION 4 @@ -450,9 +450,9 @@ namespace SourceMod } return 1; } -} +//} -extern SourceMod::ITextParsers *textparsers; +extern ITextParsers *textparsers; #endif //_INCLUDE_SOURCEMOD_TEXTPARSERS_INTERFACE_H_ diff --git a/amxmodx/sdk/amxxmodule.cpp b/public/sdk/amxxmodule.cpp old mode 100755 new mode 100644 similarity index 100% rename from amxmodx/sdk/amxxmodule.cpp rename to public/sdk/amxxmodule.cpp diff --git a/amxmodx/sdk/amxxmodule.h b/public/sdk/amxxmodule.h old mode 100755 new mode 100644 similarity index 100% rename from amxmodx/sdk/amxxmodule.h rename to public/sdk/amxxmodule.h diff --git a/amxmodx/sdk/howto.txt b/public/sdk/howto.txt old mode 100755 new mode 100644 similarity index 96% rename from amxmodx/sdk/howto.txt rename to public/sdk/howto.txt index 8b76a1fa..6e152bbb --- a/amxmodx/sdk/howto.txt +++ b/public/sdk/howto.txt @@ -2,7 +2,8 @@ * STEP 1 Download the AMXX Sdk, and place all files into your module source dir. Don't edit amxxmodule.h or amxxmodule.cpp - + Rename moduleconfig.in.h to moduleconfig.h + Go through the moduleconfig.h file and do what it says If you want to have natives in your module, uncomment line 30 ( // #define FN_AMXX_ATTACH OnAmxxAttach ) diff --git a/amxmodx/sdk/moduleconfig.h b/public/sdk/moduleconfig.in.h old mode 100755 new mode 100644 similarity index 100% rename from amxmodx/sdk/moduleconfig.h rename to public/sdk/moduleconfig.in.h diff --git a/dlls/mysqlx/sdk/sh_list.h b/public/sh_list.h similarity index 99% rename from dlls/mysqlx/sdk/sh_list.h rename to public/sh_list.h index f7276989..1b22b0ce 100644 --- a/dlls/mysqlx/sdk/sh_list.h +++ b/public/sh_list.h @@ -21,8 +21,8 @@ #include #include -namespace SourceHook -{ +//namespace SourceHook +//{ //This class is from CSDM for AMX Mod X /* @@ -293,6 +293,6 @@ namespace SourceHook return *this; } }; -}; //NAMESPACE +//}; //NAMESPACE #endif //_INCLUDE_CSDM_LIST_H diff --git a/dlls/mysqlx/sdk/sh_stack.h b/public/sh_stack.h old mode 100755 new mode 100644 similarity index 100% rename from dlls/mysqlx/sdk/sh_stack.h rename to public/sh_stack.h diff --git a/dlls/mysqlx/sdk/sh_string.h b/public/sh_string.h old mode 100755 new mode 100644 similarity index 99% rename from dlls/mysqlx/sdk/sh_string.h rename to public/sh_string.h index e1cc54d6..01eef29a --- a/dlls/mysqlx/sdk/sh_string.h +++ b/public/sh_string.h @@ -19,8 +19,8 @@ #include #include -namespace SourceHook -{ +//namespace SourceHook +//{ class String { public: @@ -362,6 +362,6 @@ public: static const int npos = -1; }; -}; //NAMESPACE +//}; //NAMESPACE #endif //_INCLUDE_CSTRING_H diff --git a/public/sm_queue.h b/public/sm_queue.h new file mode 100644 index 00000000..21c3b7eb --- /dev/null +++ b/public/sm_queue.h @@ -0,0 +1,333 @@ +/** + * vim: set ts=4 : + * ============================================================================= + * SourceMod + * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + * + * Version: $Id$ + */ + +#ifndef _INCLUDE_SM_QUEUE_H +#define _INCLUDE_SM_QUEUE_H + +#include +#include +#include + +//using namespace SourceHook; + +/* + A circular, doubly-linked List with one sentinel node + + Empty: + m_Head = sentinel + m_Head->next = m_Head; + m_Head->prev = m_Head; + One element: + m_Head = sentinel + m_Head->next = node1 + m_Head->prev = node1 + node1->next = m_Head + node1->prev = m_Head + Two elements: + m_Head = sentinel + m_Head->next = node1 + m_Head->prev = node2 + node1->next = node2 + node1->prev = m_Head + node2->next = m_Head + node2->prev = node1 +*/ +template +class Queue +{ +public: + class iterator; + friend class iterator; + class QueueNode + { + public: + T obj; + QueueNode *next; + QueueNode *prev; + }; +private: + // Initializes the sentinel node. + QueueNode *_Initialize() + { + QueueNode *n = (QueueNode *)malloc(sizeof(QueueNode)); + n->next = n; + n->prev = n; + return n; + } +public: + Queue() : m_Head(_Initialize()), m_Size(0) + { + } + + Queue(const Queue &src) : m_Head(_Initialize()), m_Size(0) + { + iterator iter; + for (iter=src.begin(); iter!=src.end(); iter++) + { + push_back( (*iter) ); + } + } + + ~Queue() + { + clear(); + + // Don't forget to free the sentinel + if (m_Head) + { + free(m_Head); + m_Head = NULL; + } + + while (!m_FreeNodes.empty()) + { + free(m_FreeNodes.front()); + m_FreeNodes.pop(); + } + } + + void push(const T &obj) + { + QueueNode *node; + + if (m_FreeNodes.empty()) + { + node = (QueueNode *)malloc(sizeof(QueueNode)); + } else { + node = m_FreeNodes.front(); + m_FreeNodes.pop(); + } + + /* Copy the object */ + new (&node->obj) T(obj); + + /* Install into the Queue */ + node->prev = m_Head->prev; + node->next = m_Head; + m_Head->prev->next = node; + m_Head->prev = node; + + m_Size++; + } + + size_t size() const + { + return m_Size; + } + + void clear() + { + QueueNode *node = m_Head->next; + QueueNode *temp; + m_Head->next = m_Head; + m_Head->prev = m_Head; + + // Iterate through the nodes until we find g_Head (the sentinel) again + while (node != m_Head) + { + temp = node->next; + node->obj.~T(); + m_FreeNodes.push(node); + node = temp; + } + m_Size = 0; + } + + bool empty() const + { + return (m_Size == 0); + } + +private: + QueueNode *m_Head; + size_t m_Size; + CStack m_FreeNodes; +public: + class iterator + { + friend class Queue; + public: + iterator() + { + m_This = NULL; + } + iterator(const Queue &src) + { + m_This = src.m_Head; + } + iterator(QueueNode *n) : m_This(n) + { + } + iterator(const iterator &where) + { + m_This = where.m_This; + } + //pre decrement + iterator & operator--() + { + if (m_This) + m_This = m_This->prev; + return *this; + } + //post decrement + iterator operator--(int) + { + iterator old(*this); + if (m_This) + m_This = m_This->prev; + return old; + } + + //pre increment + iterator & operator++() + { + if (m_This) + m_This = m_This->next; + return *this; + } + //post increment + iterator operator++(int) + { + iterator old(*this); + if (m_This) + m_This = m_This->next; + return old; + } + + const T & operator * () const + { + return m_This->obj; + } + T & operator * () + { + return m_This->obj; + } + + T * operator -> () + { + return &(m_This->obj); + } + const T * operator -> () const + { + return &(m_This->obj); + } + + bool operator != (const iterator &where) const + { + return (m_This != where.m_This); + } + bool operator ==(const iterator &where) const + { + return (m_This == where.m_This); + } + private: + QueueNode *m_This; + }; +public: + iterator begin() const + { + return iterator(m_Head->next); + } + + iterator end() const + { + return iterator(m_Head); + } + + iterator erase(iterator &where) + { + QueueNode *pNode = where.m_This; + iterator iter(where); + iter++; + + + // Works for all cases: empty Queue, erasing first element, erasing tail, erasing in the middle... + pNode->prev->next = pNode->next; + pNode->next->prev = pNode->prev; + + pNode->obj.~T(); + m_FreeNodes.push(pNode); + m_Size--; + + return iter; + } +public: + void remove(const T & obj) + { + iterator b; + for (b=begin(); b!=end(); b++) + { + if ( (*b) == obj ) + { + erase( b ); + break; + } + } + } + template + iterator find(const U & equ) const + { + iterator iter; + for (iter=begin(); iter!=end(); iter++) + { + if ( (*iter) == equ ) + { + return iter; + } + } + return end(); + } + Queue & operator =(const Queue &src) + { + clear(); + iterator iter; + for (iter=src.begin(); iter!=src.end(); iter++) + { + push_back( (*iter) ); + } + return *this; + } +public: + T & first() const + { + iterator i = begin(); + + return (*i); + } + + void pop() + { + iterator iter = begin(); + erase(iter); + } +}; + +#endif //_INCLUDE_SM_QUEUE_H diff --git a/public/sm_stringhashmap.h b/public/sm_stringhashmap.h index 39f9c0b0..8b521e13 100644 --- a/public/sm_stringhashmap.h +++ b/public/sm_stringhashmap.h @@ -50,8 +50,8 @@ #include #include -namespace SourceMod -{ +//namespace SourceMod +//{ namespace detail { @@ -236,6 +236,6 @@ private: size_t memory_used_; }; -} +//} #endif // _include_sourcemod_hashtable_h_