darope@0: // vi: set ts=4 sw=4 : darope@0: // vim: set tw=75 : darope@0: darope@0: // dllapi.cpp - implementation of Half-Life DLL routines darope@0: darope@0: /* darope@0: * Copyright (c) 2001-2003 Will Day darope@0: * darope@0: * This file is part of Metamod. darope@0: * darope@0: * Metamod is free software; you can redistribute it and/or modify it darope@0: * under the terms of the GNU General Public License as published by the darope@0: * Free Software Foundation; either version 2 of the License, or (at darope@0: * your option) any later version. darope@0: * darope@0: * Metamod is distributed in the hope that it will be useful, but darope@0: * WITHOUT ANY WARRANTY; without even the implied warranty of darope@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU darope@0: * General Public License for more details. darope@0: * darope@0: * You should have received a copy of the GNU General Public License darope@0: * along with Metamod; if not, write to the Free Software Foundation, darope@0: * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA darope@0: * darope@0: * In addition, as a special exception, the author gives permission to darope@0: * link the code of this program with the Half-Life Game Engine ("HL darope@0: * Engine") and Modified Game Libraries ("MODs") developed by Valve, darope@0: * L.L.C ("Valve"). You must obey the GNU General Public License in all darope@0: * respects for all of the code used other than the HL Engine and MODs darope@0: * from Valve. If you modify this file, you may extend this exception darope@0: * to your version of the file, but you are not obligated to do so. If darope@0: * you do not wish to do so, delete this exception statement from your darope@0: * version. darope@0: * darope@0: */ darope@0: darope@0: #include darope@0: #include darope@0: #include darope@0: #include darope@0: darope@0: #include darope@0: #include darope@0: #include darope@0: darope@0: #include "trace_api.h" darope@0: #include "log_plugin.h" darope@0: darope@0: // from SDK dlls/game.cpp: darope@0: void GameDLLInit( void ) { darope@0: DLL_TRACE(pfnGameInit, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: // from SDK dlls/cbase.cpp: darope@0: int DispatchSpawn( edict_t *pent ) { darope@0: edict_t *ed=pent; darope@0: DLL_TRACE(pfnSpawn, P_PRE, ("classname=%s", darope@0: ed ? STRING(ed->v.classname) : "nil")); darope@0: // 0==Success, -1==Failure ? darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void DispatchThink( edict_t *pent ) { darope@0: DLL_TRACE(pfnThink, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void DispatchUse( edict_t *pentUsed, edict_t *pentOther ) { darope@0: DLL_TRACE(pfnUse, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void DispatchTouch( edict_t *pentTouched, edict_t *pentOther ) { darope@0: DLL_TRACE(pfnTouch, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void DispatchBlocked( edict_t *pentBlocked, edict_t *pentOther ) { darope@0: DLL_TRACE(pfnBlocked, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd ) { darope@0: DLL_TRACE(pfnKeyValue, P_PRE, ("classname=%s keyname=%s value=%s", P_PRE, darope@0: pkvd->szClassName, pkvd->szKeyName, pkvd->szValue)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData ) { darope@0: DLL_TRACE(pfnSave, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity ) { darope@0: DLL_TRACE(pfnRestore, P_PRE, ("")); darope@0: // 0==Success, -1==Failure ? darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void DispatchObjectCollsionBox( edict_t *pent ) { darope@0: edict_t *ed=pent; darope@0: DLL_TRACE(pfnSetAbsBox, P_PRE, ("classname=%s netname=%s", darope@0: ed ? STRING(ed->v.classname) : "nil", darope@0: ed ? STRING(ed->v.netname) : "nil")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void SaveWriteFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) { darope@0: DLL_TRACE(pfnSaveWriteFields, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void SaveReadFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) { darope@0: DLL_TRACE(pfnSaveReadFields, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: // from SDK dlls/world.cpp: darope@0: void SaveGlobalState( SAVERESTOREDATA *pSaveData ) { darope@0: DLL_TRACE(pfnSaveGlobalState, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void RestoreGlobalState( SAVERESTOREDATA *pSaveData ) { darope@0: DLL_TRACE(pfnRestoreGlobalState, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ResetGlobalState( void ) { darope@0: DLL_TRACE(pfnResetGlobalState, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: //! from SDK dlls/client.cpp: darope@0: BOOL ClientConnect( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ) { darope@0: DLL_TRACE(pfnClientConnect, P_PRE, ("name=%s, addr=%s", pszName, pszAddress)); darope@0: RETURN_META_VALUE(MRES_IGNORED, FALSE); darope@0: } darope@0: void ClientDisconnect( edict_t *pEntity ) { darope@0: // DLL_TRACE(pfnClientDisconnect, P_PRE, ("name=%s", ENTITY_KEYVALUE(pEntity, "name"))); darope@0: DLL_TRACE(pfnClientDisconnect, P_PRE, ("name=%s", STRING(pEntity->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ClientKill( edict_t *pEntity ) { darope@0: DLL_TRACE(pfnClientKill, P_PRE, ("name=%s", STRING(pEntity->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ClientPutInServer( edict_t *pEntity ) { darope@0: CBaseEntity *pPlayer=NULL; darope@0: pPlayer=(CBasePlayer*)GET_PRIVATE(pEntity); darope@0: DLL_TRACE(pfnClientPutInServer, P_PRE, ("name=%s", STRING(pEntity->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ClientCommand( edict_t *pEntity ) { darope@0: DLL_TRACE(pfnClientCommand, P_PRE, ("name=%s, cmd='%s %s'", STRING(pEntity->v.netname), CMD_ARGV(0), darope@0: CMD_ARGC() >= 1 ? CMD_ARGS() : "")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer ) { darope@0: DLL_TRACE(pfnClientUserInfoChanged, P_PRE, ("name=%s", STRING(pEntity->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ) { darope@0: DLL_TRACE(pfnServerActivate, P_PRE, ("count=%d, max=%d", edictCount, clientMax)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ServerDeactivate( void ) { darope@0: DLL_TRACE(pfnServerDeactivate, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void PlayerPreThink( edict_t *pEntity ) { darope@0: DLL_TRACE(pfnPlayerPreThink, P_PRE, ("name=%s", STRING(pEntity->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void PlayerPostThink( edict_t *pEntity ) { darope@0: DLL_TRACE(pfnPlayerPostThink, P_PRE, ("name=%s", STRING(pEntity->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void StartFrame( void ) { darope@0: DLL_TRACE(pfnStartFrame, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ParmsNewLevel( void ) { darope@0: DLL_TRACE(pfnParmsNewLevel, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ParmsChangeLevel( void ) { darope@0: DLL_TRACE(pfnParmsChangeLevel, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: const char *GetGameDescription( void ) { darope@0: DLL_TRACE(pfnGetGameDescription, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, ""); darope@0: } darope@0: void PlayerCustomization( edict_t *pEntity, customization_t *pCust ) { darope@0: DLL_TRACE(pfnPlayerCustomization, P_PRE, ("name=%s", STRING(pEntity->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void SpectatorConnect( edict_t *pEntity ) { darope@0: DLL_TRACE(pfnSpectatorConnect, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void SpectatorDisconnect( edict_t *pEntity ) { darope@0: DLL_TRACE(pfnSpectatorDisconnect, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void SpectatorThink( edict_t *pEntity ) { darope@0: DLL_TRACE(pfnSpectatorThink, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void Sys_Error( const char *error_string ) { darope@0: DLL_TRACE(pfnSys_Error, P_PRE, ("string=%s", error_string)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: // from SDK pm_shared/pm_shared.c: darope@0: void PM_Move ( struct playermove_s *ppmove, int server ) { darope@0: DLL_TRACE(pfnPM_Move, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void PM_Init( struct playermove_s *ppmove ) { darope@0: DLL_TRACE(pfnPM_Init, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: char PM_FindTextureType( char *name ) { darope@0: DLL_TRACE(pfnPM_FindTextureType, P_PRE, ("name=%s", name)); darope@0: RETURN_META_VALUE(MRES_IGNORED, '\0'); darope@0: } darope@0: darope@0: // from SDK dlls/client.cpp: darope@0: void SetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) { darope@0: DLL_TRACE(pfnSetupVisibility, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void UpdateClientData ( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd ) { darope@0: DLL_TRACE(pfnUpdateClientData, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet ) { darope@0: DLL_TRACE(pfnAddToFullPack, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void CreateBaseline( int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs ) { darope@0: DLL_TRACE(pfnCreateBaseline, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void RegisterEncoders( void ) { darope@0: DLL_TRACE(pfnRegisterEncoders, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) { darope@0: DLL_TRACE(pfnGetWeaponData, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 1); darope@0: } darope@0: void CmdStart( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed ) { darope@0: DLL_TRACE(pfnCmdStart, P_PRE, ("name=%s, rand=%d", STRING(player->v.netname), random_seed)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void CmdEnd ( const edict_t *player ) { darope@0: DLL_TRACE(pfnCmdEnd, P_PRE, ("name=%s", STRING(player->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ) { darope@0: DLL_TRACE(pfnConnectionlessPacket, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int GetHullBounds( int hullnumber, float *mins, float *maxs ) { darope@0: DLL_TRACE(pfnGetHullBounds, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void CreateInstancedBaselines ( void ) { darope@0: DLL_TRACE(pfnCreateInstancedBaselines, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int InconsistentFile( const edict_t *player, const char *filename, char *disconnect_message ) { darope@0: DLL_TRACE(pfnInconsistentFile, P_PRE, ("name=%s, file=%s", STRING(player->v.netname), filename)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int AllowLagCompensation( void ) { darope@0: DLL_TRACE(pfnAllowLagCompensation, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 1); darope@0: } darope@0: darope@0: darope@0: // from SDK ? darope@0: void OnFreeEntPrivateData(edict_t *pEnt) { darope@0: NEWDLL_TRACE(pfnOnFreeEntPrivateData, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void GameShutdown(void) { darope@0: NEWDLL_TRACE(pfnGameShutdown, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int ShouldCollide(edict_t *pentTouched, edict_t *pentOther) { darope@0: NEWDLL_TRACE(pfnShouldCollide, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 1); darope@0: } darope@249: darope@249: // Added 2005-08-11 (no SDK update) darope@248: void CvarValue(const edict_t *pEdict, const char *szValue) { darope@248: NEWDLL_TRACE(pfnCvarValue, P_PRE, ("player=%s, value=%s", STRING(pEdict->v.netname), szValue?szValue:"nil")); darope@248: RETURN_META(MRES_IGNORED); darope@248: } darope@0: darope@249: // Added 2005-11-22 (no SDK update) darope@249: void CvarValue2(const edict_t *pEdict, int requestID, const char *cvarName, const char *value) { darope@249: NEWDLL_TRACE(pfnCvarValue2, P_PRE, ("player=%s, requestID=%d, cvar=%s, value=%s", darope@249: STRING(pEdict->v.netname), requestID, cvarName?cvarName:"nil", value?value:"nil")); darope@249: RETURN_META(MRES_IGNORED); darope@249: } darope@249: darope@0: darope@0: // from SDK dlls/cbase.cpp: darope@0: // (wd) indicates my comments on the functions darope@0: static DLL_FUNCTIONS gFunctionTable = darope@0: { darope@0: GameDLLInit, //! pfnGameInit() Initialize the game (one-time call after loading of game .dll) darope@0: DispatchSpawn, //! pfnSpawn() darope@0: DispatchThink, //! pfnThink() darope@0: DispatchUse, //! pfnUse() darope@0: DispatchTouch, //! pfnTouch() darope@0: DispatchBlocked, //! pfnBlocked() darope@0: DispatchKeyValue, //! pfnKeyValue() darope@0: DispatchSave, //! pfnSave() darope@0: DispatchRestore, //! pfnRestore() darope@0: DispatchObjectCollsionBox, //! pfnSetAbsBox() darope@0: darope@0: SaveWriteFields, //! pfnSaveWriteFields() darope@0: SaveReadFields, //! pfnSaveReadFields() darope@0: darope@0: SaveGlobalState, //! pfnSaveGlobalState() darope@0: RestoreGlobalState, //! pfnRestoreGlobalState() darope@0: ResetGlobalState, //! pfnResetGlobalState() darope@0: darope@0: ClientConnect, //! pfnClientConnect() (wd) Client has connected darope@0: ClientDisconnect, //! pfnClientDisconnect() (wd) Player has left the game darope@0: ClientKill, //! pfnClientKill() (wd) Player has typed "kill" darope@0: ClientPutInServer, //! pfnClientPutInServer() (wd) Client is entering the game darope@0: ClientCommand, //! pfnClientCommand() (wd) Player has sent a command (typed, or from a bind) darope@0: ClientUserInfoChanged, //! pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure darope@0: ServerActivate, //! pfnServerActivate() (wd) Server is starting a new map darope@0: ServerDeactivate, //! pfnServerDeactivate() (wd) Server is leaving the map (shutdown, or changelevel); SDK2 darope@0: darope@0: PlayerPreThink, //! pfnPlayerPreThink() darope@0: PlayerPostThink, //! pfnPlayerPostThink() darope@0: darope@0: StartFrame, //! pfnStartFrame() darope@0: ParmsNewLevel, //! pfnParmsNewLevel() darope@0: ParmsChangeLevel, //! pfnParmsChangeLevel() darope@0: darope@0: GetGameDescription, //! pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2", "Half-Life" darope@0: PlayerCustomization, //! pfnPlayerCustomization() Notifies .dll of new customization for player. darope@0: darope@0: SpectatorConnect, //! pfnSpectatorConnect() Called when spectator joins server darope@0: SpectatorDisconnect, //! pfnSpectatorDisconnect() Called when spectator leaves the server darope@0: SpectatorThink, //! pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) darope@0: darope@0: Sys_Error, //! pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 darope@0: darope@0: PM_Move, //! pfnPM_Move() (wd) SDK2 darope@0: PM_Init, //! pfnPM_Init() Server version of player movement initialization; (wd) SDK2 darope@0: PM_FindTextureType, //! pfnPM_FindTextureType() (wd) SDK2 darope@0: darope@0: SetupVisibility, //! pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 darope@0: UpdateClientData, //! pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 darope@0: AddToFullPack, //! pfnAddToFullPack() (wd) SDK2 darope@0: CreateBaseline, //! pfnCreateBaseline() Tweak entity baseline for network encoding, allows setup of player baselines, too.; (wd) SDK2 darope@0: RegisterEncoders, //! pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 darope@0: GetWeaponData, //! pfnGetWeaponData() (wd) SDK2 darope@0: CmdStart, //! pfnCmdStart() (wd) SDK2 darope@0: CmdEnd, //! pfnCmdEnd() (wd) SDK2 darope@0: ConnectionlessPacket, //! pfnConnectionlessPacket() (wd) SDK2 darope@0: GetHullBounds, //! pfnGetHullBounds() (wd) SDK2 darope@0: CreateInstancedBaselines, //! pfnCreateInstancedBaselines() (wd) SDK2 darope@0: InconsistentFile, //! pfnInconsistentFile() (wd) SDK2 darope@0: AllowLagCompensation, //! pfnAllowLagCompensation() (wd) SDK2 darope@0: }; darope@0: darope@0: // It's not clear what the difference is between GetAPI and GetAPI2; they darope@0: // both appear to return the exact same function table. darope@0: // darope@0: // Only one of them appears to be ever called, though. If the DLL provides darope@0: // GetAPI2, the engine/hlds will call that, and will not call GetAPI. If darope@0: // the engine couldn't find GetAPI2 in the DLL, it appears to fall back to darope@0: // GetAPI. darope@0: // darope@0: // So, GetAPI2 appears to replace GetAPI, and appears to have been added darope@0: // with SDK 2.0. My best guess is that, with the new SDK, interface darope@0: // version checking became important, and without the int ptr used in darope@0: // GetAPI2, the engine can't find out the version of the DLL via GetAPI. darope@0: // darope@0: // It's unclear whether a DLL coded under SDK2 needs to provide the older darope@0: // GetAPI or not.. darope@0: darope@0: C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, darope@0: int *interfaceVersion ) darope@0: { darope@0: LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion); darope@0: if(!pFunctionTable) { darope@0: LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable"); darope@0: return(FALSE); darope@0: } darope@0: else if(*interfaceVersion != INTERFACE_VERSION) { darope@0: LOG_ERROR(PLID, darope@0: "GetEntityAPI2 version mismatch; requested=%d ours=%d", darope@0: *interfaceVersion, INTERFACE_VERSION); darope@0: //! Tell engine what version we had, so it can figure out who is darope@0: //! out of date. darope@0: *interfaceVersion = INTERFACE_VERSION; darope@0: return(FALSE); darope@0: } darope@0: memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS)); darope@0: return(TRUE); darope@0: } darope@0: darope@0: darope@0: // I could find _no_ documentation or examples for the intended use of darope@0: // NEW_DLL_FUNCTIONS. I wouldn't have even _known_ about the darope@0: // GetNewDLLFunctions() function except for the reference in Adminmod.. It darope@0: // appears to be new with SDK 2.0. darope@0: // darope@0: // Obviously, it seems to provide additional functions to the engine, but darope@0: // it's unclear why a new table and interface were added, rather than darope@0: // appending new functions to the GetAPI table/interface. darope@0: // darope@0: // Interestingly, it appears to be called by the engine _before_ GetAPI. darope@0: darope@0: static NEW_DLL_FUNCTIONS gNewFunctionTable = darope@0: { darope@0: OnFreeEntPrivateData, //! pfnOnFreeEntPrivateData() Called right before the object's memory is freed. Calls its destructor. darope@0: GameShutdown, //! pfnGameShutdown() darope@0: ShouldCollide, //! pfnShouldCollide() darope@249: // Added 2005-08-11 (no SDK update) darope@248: CvarValue, //! pfnCvarValue() darope@249: // Added 2005-11-22 (no SDK update) darope@249: CvarValue2, //! pfnCvarValue2() darope@0: }; darope@0: darope@0: C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, darope@0: int *interfaceVersion) darope@0: { darope@0: LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d", darope@0: *interfaceVersion); darope@0: if(!pNewFunctionTable) { darope@0: LOG_ERROR(PLID, darope@0: "GetNewDLLFunctions called with null pNewFunctionTable"); darope@0: return(FALSE); darope@0: } darope@0: else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) { darope@0: LOG_ERROR(PLID, darope@0: "GetNewDLLFunctions version mismatch; requested=%d ours=%d", darope@0: *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION); darope@0: //! Tell engine what version we had, so it can figure out who is darope@0: //! out of date. darope@0: *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION; darope@0: return(FALSE); darope@0: } darope@0: memcpy(pNewFunctionTable, &gNewFunctionTable, sizeof(NEW_DLL_FUNCTIONS)); darope@0: return TRUE; darope@0: }