darope@0: // vi: set ts=4 sw=4 : darope@0: // vim: set tw=75 : darope@0: darope@0: // dll_plugin.cpp - implementation of plugin's HL 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: darope@0: #include darope@0: #include darope@0: darope@0: #include "wdmisc.h" darope@0: #include "dll_plugin.h" darope@0: #include "log_plugin.h" darope@0: darope@0: void wd_ServerDeactivate( void ) { darope@0: bounce_check(); darope@0: RETURN_META(MRES_HANDLED); darope@0: } darope@0: darope@0: static DLL_FUNCTIONS gFunctionTable = darope@0: { darope@0: NULL, //! pfnGameInit() darope@0: NULL, //! pfnSpawn() darope@0: NULL, //! pfnThink() darope@0: NULL, //! pfnUse() darope@0: NULL, //! pfnTouch() darope@0: NULL, //! pfnBlocked() darope@0: NULL, //! pfnKeyValue() darope@0: NULL, //! pfnSave() darope@0: NULL, //! pfnRestore() darope@0: NULL, //! pfnSetAbsBox() darope@0: darope@0: NULL, //! pfnSaveWriteFields() darope@0: NULL, //! pfnSaveReadFields() darope@0: darope@0: NULL, //! pfnSaveGlobalState() darope@0: NULL, //! pfnRestoreGlobalState() darope@0: NULL, //! pfnResetGlobalState() darope@0: darope@0: NULL, //! pfnClientConnect() darope@0: NULL, //! pfnClientDisconnect() darope@0: NULL, //! pfnClientKill() darope@0: NULL, //! pfnClientPutInServer() darope@0: NULL, //! pfnClientCommand() darope@0: NULL, //! pfnClientUserInfoChanged() darope@0: NULL, //! pfnServerActivate() darope@0: wd_ServerDeactivate, //! pfnServerDeactivate() darope@0: darope@0: NULL, //! pfnPlayerPreThink() darope@0: NULL, //! pfnPlayerPostThink() darope@0: darope@0: NULL, //! pfnStartFrame() darope@0: NULL, //! pfnParmsNewLevel() darope@0: NULL, //! pfnParmsChangeLevel() darope@0: darope@0: NULL, //! pfnGetGameDescription() darope@0: NULL, //! pfnPlayerCustomization() darope@0: darope@0: NULL, //! pfnSpectatorConnect() darope@0: NULL, //! pfnSpectatorDisconnect() darope@0: NULL, //! pfnSpectatorThink() darope@0: darope@0: NULL, //! pfnSys_Error() darope@0: darope@0: NULL, //! pfnPM_Move() darope@0: NULL, //! pfnPM_Init() darope@0: NULL, //! pfnPM_FindTextureType() darope@0: darope@0: NULL, //! pfnSetupVisibility() darope@0: NULL, //! pfnUpdateClientData() darope@0: NULL, //! pfnAddToFullPack() darope@0: NULL, //! pfnCreateBaseline() darope@0: NULL, //! pfnRegisterEncoders() darope@0: NULL, //! pfnGetWeaponData() darope@0: NULL, //! pfnCmdStart() darope@0: NULL, //! pfnCmdEnd() darope@0: NULL, //! pfnConnectionlessPacket() darope@0: NULL, //! pfnGetHullBounds() darope@0: NULL, //! pfnCreateInstancedBaselines() darope@0: NULL, //! pfnInconsistentFile() darope@0: NULL, //! pfnAllowLagCompensation() darope@0: }; 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, "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: }