#include "precompiled.h" DLL_FUNCTIONS *g_pFunctionTable; extern void ServerDeactivate_Post(); extern void ClientPutInServer_Post(edict_t *pEntity); extern void StartFrame(); static DLL_FUNCTIONS gFunctionTable = { NULL, // pfnGameInit NULL, // pfnSpawn NULL, // pfnThink NULL, // pfnUse NULL, // pfnTouch NULL, // pfnBlocked NULL, // pfnKeyValue NULL, // pfnSave NULL, // pfnRestore NULL, // pfnSetAbsBox NULL, // pfnSaveWriteFields NULL, // pfnSaveReadFields NULL, // pfnSaveGlobalState NULL, // pfnRestoreGlobalState NULL, // pfnResetGlobalState NULL, // pfnClientConnect NULL, // pfnClientDisconnect NULL, // pfnClientKill NULL, // pfnClientPutInServer NULL, // pfnClientCommand NULL, // pfnClientUserInfoChanged NULL, // pfnServerActivate NULL, // pfnServerDeactivate NULL, // pfnPlayerPreThink NULL, // pfnPlayerPostThink NULL, // pfnStartFrame NULL, // pfnParmsNewLevel NULL, // pfnParmsChangeLevel NULL, // pfnGetGameDescription NULL, // pfnPlayerCustomization NULL, // pfnSpectatorConnect NULL, // pfnSpectatorDisconnect NULL, // pfnSpectatorThink NULL, // pfnSys_Error NULL, // pfnPM_Move NULL, // pfnPM_Init NULL, // pfnPM_FindTextureType NULL, // pfnSetupVisibility NULL, // pfnUpdateClientData NULL, // pfnAddToFullPack NULL, // pfnCreateBaseline NULL, // pfnRegisterEncoders NULL, // pfnGetWeaponData NULL, // pfnCmdStart NULL, // pfnCmdEnd NULL, // pfnConnectionlessPacket NULL, // pfnGetHullBounds NULL, // pfnCreateInstancedBaselines NULL, // pfnInconsistentFile NULL, // pfnAllowLagCompensation }; static DLL_FUNCTIONS gFunctionTable_Post = { NULL, // pfnGameInit NULL, // pfnSpawn NULL, // pfnThink NULL, // pfnUse NULL, // pfnTouch NULL, // pfnBlocked NULL, // pfnKeyValue NULL, // pfnSave NULL, // pfnRestore NULL, // pfnSetAbsBox NULL, // pfnSaveWriteFields NULL, // pfnSaveReadFields NULL, // pfnSaveGlobalState NULL, // pfnRestoreGlobalState NULL, // pfnResetGlobalState NULL, // pfnClientConnect NULL, // pfnClientDisconnect NULL, // pfnClientKill &ClientPutInServer_Post, // pfnClientPutInServer NULL, // pfnClientCommand NULL, // pfnClientUserInfoChanged NULL, // pfnServerActivate &ServerDeactivate_Post, // pfnServerDeactivate NULL, // pfnPlayerPreThink NULL, // pfnPlayerPostThink NULL, // pfnStartFrame NULL, // pfnParmsNewLevel NULL, // pfnParmsChangeLevel NULL, // pfnGetGameDescription NULL, // pfnPlayerCustomization NULL, // pfnSpectatorConnect NULL, // pfnSpectatorDisconnect NULL, // pfnSpectatorThink NULL, // pfnSys_Error NULL, // pfnPM_Move NULL, // pfnPM_Init NULL, // pfnPM_FindTextureType NULL, // pfnSetupVisibility NULL, // pfnUpdateClientData NULL, // pfnAddToFullPack NULL, // pfnCreateBaseline NULL, // pfnRegisterEncoders NULL, // pfnGetWeaponData NULL, // pfnCmdStart NULL, // pfnCmdEnd NULL, // pfnConnectionlessPacket NULL, // pfnGetHullBounds NULL, // pfnCreateInstancedBaselines NULL, // pfnInconsistentFile NULL, // pfnAllowLagCompensation }; C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) { if (!pFunctionTable) { ALERT(at_logged, __FUNCTION__ " called with null pFunctionTable"); return FALSE; } else if (*interfaceVersion != INTERFACE_VERSION) { ALERT(at_logged, __FUNCTION__ " version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); //! Tell metamod what version we had, so it can figure out who is out of date. *interfaceVersion = INTERFACE_VERSION; return FALSE; } memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS)); g_pFunctionTable = pFunctionTable; return TRUE; } C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) { if (!pFunctionTable) { ALERT(at_logged, __FUNCTION__ " called with null pFunctionTable"); return FALSE; } else if (*interfaceVersion != INTERFACE_VERSION) { ALERT(at_logged, __FUNCTION__ " version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); //! Tell metamod what version we had, so it can figure out who is out of date. *interfaceVersion = INTERFACE_VERSION; return FALSE; } memcpy(pFunctionTable, &gFunctionTable_Post, sizeof(DLL_FUNCTIONS)); g_pFunctionTable = pFunctionTable; return TRUE; }