stub_plugin/dllapi.cpp
changeset 0 d15304fcb7a7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/stub_plugin/dllapi.cpp	Tue Apr 06 07:36:14 2004 +0000
     1.3 @@ -0,0 +1,119 @@
     1.4 +// vi: set ts=4 sw=4 :
     1.5 +// vim: set tw=75 :
     1.6 +
     1.7 +/*
     1.8 + * Copyright (c) 2001-2003 Will Day <[email protected]>
     1.9 + *
    1.10 + *    This file is part of Metamod.
    1.11 + *
    1.12 + *    Metamod is free software; you can redistribute it and/or modify it
    1.13 + *    under the terms of the GNU General Public License as published by the
    1.14 + *    Free Software Foundation; either version 2 of the License, or (at
    1.15 + *    your option) any later version.
    1.16 + *
    1.17 + *    Metamod is distributed in the hope that it will be useful, but
    1.18 + *    WITHOUT ANY WARRANTY; without even the implied warranty of
    1.19 + *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.20 + *    General Public License for more details.
    1.21 + *
    1.22 + *    You should have received a copy of the GNU General Public License
    1.23 + *    along with Metamod; if not, write to the Free Software Foundation,
    1.24 + *    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.25 + *
    1.26 + *    In addition, as a special exception, the author gives permission to
    1.27 + *    link the code of this program with the Half-Life Game Engine ("HL
    1.28 + *    Engine") and Modified Game Libraries ("MODs") developed by Valve,
    1.29 + *    L.L.C ("Valve").  You must obey the GNU General Public License in all
    1.30 + *    respects for all of the code used other than the HL Engine and MODs
    1.31 + *    from Valve.  If you modify this file, you may extend this exception
    1.32 + *    to your version of the file, but you are not obligated to do so.  If
    1.33 + *    you do not wish to do so, delete this exception statement from your
    1.34 + *    version.
    1.35 + *
    1.36 + */
    1.37 +
    1.38 +#include <extdll.h>
    1.39 +
    1.40 +#include <dllapi.h>
    1.41 +#include <meta_api.h>
    1.42 +
    1.43 +static DLL_FUNCTIONS gFunctionTable = 
    1.44 +{
    1.45 +	NULL,					// pfnGameInit
    1.46 +	NULL,					// pfnSpawn
    1.47 +	NULL,					// pfnThink
    1.48 +	NULL,					// pfnUse
    1.49 +	NULL,					// pfnTouch
    1.50 +	NULL,					// pfnBlocked
    1.51 +	NULL,					// pfnKeyValue
    1.52 +	NULL,					// pfnSave
    1.53 +	NULL,					// pfnRestore
    1.54 +	NULL,					// pfnSetAbsBox
    1.55 +
    1.56 +	NULL,					// pfnSaveWriteFields
    1.57 +	NULL,					// pfnSaveReadFields
    1.58 +
    1.59 +	NULL,					// pfnSaveGlobalState
    1.60 +	NULL,					// pfnRestoreGlobalState
    1.61 +	NULL,					// pfnResetGlobalState
    1.62 +
    1.63 +	NULL,					// pfnClientConnect
    1.64 +	NULL,					// pfnClientDisconnect
    1.65 +	NULL,					// pfnClientKill
    1.66 +	NULL,					// pfnClientPutInServer
    1.67 +	NULL,					// pfnClientCommand
    1.68 +	NULL,					// pfnClientUserInfoChanged
    1.69 +	NULL,					// pfnServerActivate
    1.70 +	NULL,					// pfnServerDeactivate
    1.71 +
    1.72 +	NULL,					// pfnPlayerPreThink
    1.73 +	NULL,					// pfnPlayerPostThink
    1.74 +
    1.75 +	NULL,					// pfnStartFrame
    1.76 +	NULL,					// pfnParmsNewLevel
    1.77 +	NULL,					// pfnParmsChangeLevel
    1.78 +
    1.79 +	NULL,					// pfnGetGameDescription
    1.80 +	NULL,					// pfnPlayerCustomization
    1.81 +
    1.82 +	NULL,					// pfnSpectatorConnect
    1.83 +	NULL,					// pfnSpectatorDisconnect
    1.84 +	NULL,					// pfnSpectatorThink
    1.85 +	
    1.86 +	NULL,					// pfnSys_Error
    1.87 +
    1.88 +	NULL,					// pfnPM_Move
    1.89 +	NULL,					// pfnPM_Init
    1.90 +	NULL,					// pfnPM_FindTextureType
    1.91 +	
    1.92 +	NULL,					// pfnSetupVisibility
    1.93 +	NULL,					// pfnUpdateClientData
    1.94 +	NULL,					// pfnAddToFullPack
    1.95 +	NULL,					// pfnCreateBaseline
    1.96 +	NULL,					// pfnRegisterEncoders
    1.97 +	NULL,					// pfnGetWeaponData
    1.98 +	NULL,					// pfnCmdStart
    1.99 +	NULL,					// pfnCmdEnd
   1.100 +	NULL,					// pfnConnectionlessPacket
   1.101 +	NULL,					// pfnGetHullBounds
   1.102 +	NULL,					// pfnCreateInstancedBaselines
   1.103 +	NULL,					// pfnInconsistentFile
   1.104 +	NULL,					// pfnAllowLagCompensation
   1.105 +};
   1.106 +
   1.107 +C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, 
   1.108 +		int *interfaceVersion)
   1.109 +{
   1.110 +	if(!pFunctionTable) {
   1.111 +		UTIL_LogPrintf("GetEntityAPI2 called with null pFunctionTable");
   1.112 +		return(FALSE);
   1.113 +	}
   1.114 +	else if(*interfaceVersion != INTERFACE_VERSION) {
   1.115 +		UTIL_LogPrintf("GetEntityAPI2 version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
   1.116 +		//! Tell metamod what version we had, so it can figure out who is out of date.
   1.117 +		*interfaceVersion = INTERFACE_VERSION;
   1.118 +		return(FALSE);
   1.119 +	}
   1.120 +	memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));
   1.121 +	return(TRUE);
   1.122 +}