trace_plugin/dllapi_post.cpp
author Scott Ehlert <ds@alliedmods.net>
Thu Sep 26 17:00:32 2013 -0500 (2013-09-26)
changeset 284 ca90ccdb8d49
parent 265 9e61d0d70e9a
permissions -rw-r--r--
Fixed makefile error when issuing 'make clean' or 'make distclean'.
darope@0
     1
// vi: set ts=4 sw=4 :
darope@0
     2
// vim: set tw=75 :
darope@0
     3
darope@0
     4
// dllapi_post.cpp - implementation of "post" versions of Half-Life DLL routines
darope@0
     5
darope@0
     6
/*
darope@0
     7
 * Copyright (c) 2001-2003 Will Day <[email protected]>
darope@0
     8
 *
darope@0
     9
 *    This file is part of Metamod.
darope@0
    10
 *
darope@0
    11
 *    Metamod is free software; you can redistribute it and/or modify it
darope@0
    12
 *    under the terms of the GNU General Public License as published by the
darope@0
    13
 *    Free Software Foundation; either version 2 of the License, or (at
darope@0
    14
 *    your option) any later version.
darope@0
    15
 *
darope@0
    16
 *    Metamod is distributed in the hope that it will be useful, but
darope@0
    17
 *    WITHOUT ANY WARRANTY; without even the implied warranty of
darope@0
    18
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
darope@0
    19
 *    General Public License for more details.
darope@0
    20
 *
darope@0
    21
 *    You should have received a copy of the GNU General Public License
darope@0
    22
 *    along with Metamod; if not, write to the Free Software Foundation,
darope@0
    23
 *    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
darope@0
    24
 *
darope@0
    25
 *    In addition, as a special exception, the author gives permission to
darope@0
    26
 *    link the code of this program with the Half-Life Game Engine ("HL
darope@0
    27
 *    Engine") and Modified Game Libraries ("MODs") developed by Valve,
darope@0
    28
 *    L.L.C ("Valve").  You must obey the GNU General Public License in all
darope@0
    29
 *    respects for all of the code used other than the HL Engine and MODs
darope@0
    30
 *    from Valve.  If you modify this file, you may extend this exception
darope@0
    31
 *    to your version of the file, but you are not obligated to do so.  If
darope@0
    32
 *    you do not wish to do so, delete this exception statement from your
darope@0
    33
 *    version.
darope@0
    34
 *
darope@0
    35
 */
darope@0
    36
darope@0
    37
#include <extdll.h>
darope@0
    38
darope@0
    39
#include <meta_api.h>
darope@0
    40
darope@0
    41
#include "dllapi_post.h"
darope@0
    42
#include "trace_api.h"
darope@0
    43
#include "log_plugin.h"
darope@0
    44
darope@0
    45
// from SDK dlls/game.cpp:
darope@0
    46
void GameDLLInit_Post( void ) {
darope@0
    47
	DLL_TRACE(pfnGameInit, P_POST, (""));
darope@0
    48
	RETURN_META(MRES_IGNORED);
darope@0
    49
}
darope@0
    50
darope@0
    51
// from SDK dlls/cbase.cpp:
darope@0
    52
int DispatchSpawn_Post( edict_t *pent ) {
darope@0
    53
	edict_t *ed=pent;
darope@0
    54
	DLL_TRACE(pfnSpawn, P_POST, ("classname=%s, returning %d", 
darope@0
    55
				ed ? STRING(ed->v.classname) : "nil",
darope@0
    56
				META_RESULT_ORIG_RET(int)));
darope@0
    57
	// 0==Success, -1==Failure ?
darope@0
    58
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
    59
}
darope@0
    60
void DispatchThink_Post( edict_t *pent ) {
darope@0
    61
	DLL_TRACE(pfnThink, P_POST, (""));
darope@0
    62
	RETURN_META(MRES_IGNORED);
darope@0
    63
}
darope@0
    64
void DispatchUse_Post( edict_t *pentUsed, edict_t *pentOther ) {
darope@0
    65
	DLL_TRACE(pfnUse, P_POST, (""));
darope@0
    66
	RETURN_META(MRES_IGNORED);
darope@0
    67
}
darope@0
    68
void DispatchTouch_Post( edict_t *pentTouched, edict_t *pentOther ) {
darope@0
    69
	DLL_TRACE(pfnTouch, P_POST, (""));
darope@0
    70
	RETURN_META(MRES_IGNORED);
darope@0
    71
}
darope@0
    72
void DispatchBlocked_Post( edict_t *pentBlocked, edict_t *pentOther ) {
darope@0
    73
	DLL_TRACE(pfnBlocked, P_POST, (""));
darope@0
    74
	RETURN_META(MRES_IGNORED);
darope@0
    75
}
darope@0
    76
void DispatchKeyValue_Post( edict_t *pentKeyvalue, KeyValueData *pkvd ) {
darope@0
    77
	DLL_TRACE(pfnKeyValue, P_POST, ("classname=%s keyname=%s value=%s",
darope@0
    78
			pkvd->szClassName, pkvd->szKeyName, pkvd->szValue));
darope@0
    79
	RETURN_META(MRES_IGNORED);
darope@0
    80
}
darope@0
    81
void DispatchSave_Post( edict_t *pent, SAVERESTOREDATA *pSaveData ) {
darope@0
    82
	DLL_TRACE(pfnSave, P_POST, (""));
darope@0
    83
	RETURN_META(MRES_IGNORED);
darope@0
    84
}
darope@0
    85
int DispatchRestore_Post( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity ) {
darope@0
    86
	DLL_TRACE(pfnRestore, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
darope@0
    87
	// 0==Success, -1==Failure ?
darope@0
    88
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
    89
}
darope@0
    90
void DispatchObjectCollsionBox_Post( edict_t *pent ) {
darope@0
    91
	DLL_TRACE(pfnSetAbsBox, P_POST, (""));
darope@0
    92
	RETURN_META(MRES_IGNORED);
darope@0
    93
}
darope@0
    94
void SaveWriteFields_Post( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) {
darope@0
    95
	DLL_TRACE(pfnSaveWriteFields, P_POST, (""));
darope@0
    96
	RETURN_META(MRES_IGNORED);
darope@0
    97
}
darope@0
    98
void SaveReadFields_Post( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) {
darope@0
    99
	DLL_TRACE(pfnSaveReadFields, P_POST, (""));
darope@0
   100
	RETURN_META(MRES_IGNORED);
darope@0
   101
}
darope@0
   102
darope@0
   103
// from SDK dlls/world.cpp:
darope@0
   104
void SaveGlobalState_Post( SAVERESTOREDATA *pSaveData ) {
darope@0
   105
	DLL_TRACE(pfnSaveGlobalState, P_POST, (""));
darope@0
   106
	RETURN_META(MRES_IGNORED);
darope@0
   107
}
darope@0
   108
void RestoreGlobalState_Post( SAVERESTOREDATA *pSaveData ) {
darope@0
   109
	DLL_TRACE(pfnRestoreGlobalState, P_POST, (""));
darope@0
   110
	RETURN_META(MRES_IGNORED);
darope@0
   111
}
darope@0
   112
void ResetGlobalState_Post( void ) {
darope@0
   113
	DLL_TRACE(pfnResetGlobalState, P_POST, (""));
darope@0
   114
	RETURN_META(MRES_IGNORED);
darope@0
   115
}
darope@0
   116
darope@0
   117
//! from SDK dlls/client.cpp:
darope@0
   118
BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]  ) {
darope@0
   119
	BOOL ret=META_RESULT_ORIG_RET(BOOL);
darope@0
   120
	if(ret) DLL_TRACE(pfnClientConnect, P_POST, ("returning %d", ret));
darope@0
   121
	else DLL_TRACE(pfnClientConnect, P_POST, ("returning %d, reason=%s", ret, szRejectReason));
darope@0
   122
	RETURN_META_VALUE(MRES_IGNORED, TRUE);
darope@0
   123
}
darope@0
   124
void ClientDisconnect_Post( edict_t *pEntity ) {
darope@0
   125
	DLL_TRACE(pfnClientDisconnect, P_POST, (""));
darope@0
   126
	RETURN_META(MRES_IGNORED);
darope@0
   127
}
darope@0
   128
void ClientKill_Post( edict_t *pEntity ) {
darope@0
   129
	DLL_TRACE(pfnClientKill, P_POST, (""));
darope@0
   130
	RETURN_META(MRES_IGNORED);
darope@0
   131
}
darope@0
   132
void ClientPutInServer_Post( edict_t *pEntity ) {
darope@0
   133
	DLL_TRACE(pfnClientPutInServer, P_POST, (""));
darope@0
   134
	RETURN_META(MRES_IGNORED);
darope@0
   135
}
darope@0
   136
void ClientCommand_Post( edict_t *pEntity ) {
darope@0
   137
	DLL_TRACE(pfnClientCommand, P_POST, (""));
darope@0
   138
	RETURN_META(MRES_IGNORED);
darope@0
   139
}
darope@0
   140
void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) {
darope@0
   141
	DLL_TRACE(pfnClientUserInfoChanged, P_POST, (""));
darope@0
   142
	RETURN_META(MRES_IGNORED);
darope@0
   143
}
darope@0
   144
void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ) {
darope@0
   145
	DLL_TRACE(pfnServerActivate, P_POST, (""));
darope@0
   146
	RETURN_META(MRES_IGNORED);
darope@0
   147
}
darope@0
   148
void ServerDeactivate_Post( void ) {
darope@0
   149
	DLL_TRACE(pfnServerDeactivate, P_POST, (""));
darope@0
   150
	RETURN_META(MRES_IGNORED);
darope@0
   151
}
darope@0
   152
void PlayerPreThink_Post( edict_t *pEntity ) {
darope@0
   153
	DLL_TRACE(pfnPlayerPreThink, P_POST, (""));
darope@0
   154
	RETURN_META(MRES_IGNORED);
darope@0
   155
}
darope@0
   156
void PlayerPostThink_Post( edict_t *pEntity ) {
darope@0
   157
	DLL_TRACE(pfnPlayerPostThink, P_POST, (""));
darope@0
   158
	RETURN_META(MRES_IGNORED);
darope@0
   159
}
darope@0
   160
void StartFrame_Post( void ) {
darope@0
   161
	DLL_TRACE(pfnStartFrame, P_POST, (""));
darope@0
   162
	RETURN_META(MRES_IGNORED);
darope@0
   163
}
darope@0
   164
void ParmsNewLevel_Post( void ) {
darope@0
   165
	DLL_TRACE(pfnParmsNewLevel, P_POST, (""));
darope@0
   166
	RETURN_META(MRES_IGNORED);
darope@0
   167
}
darope@0
   168
void ParmsChangeLevel_Post( void ) {
darope@0
   169
	DLL_TRACE(pfnParmsChangeLevel, P_POST, (""));
darope@0
   170
	RETURN_META(MRES_IGNORED);
darope@0
   171
}
darope@0
   172
const char *GetGameDescription_Post( void ) {
darope@0
   173
	DLL_TRACE(pfnGetGameDescription, P_POST, ("returning %s", META_RESULT_ORIG_RET(char *)));
darope@0
   174
	RETURN_META_VALUE(MRES_IGNORED, "");
darope@0
   175
}
darope@0
   176
void PlayerCustomization_Post( edict_t *pEntity, customization_t *pCust ) {
darope@0
   177
	DLL_TRACE(pfnPlayerCustomization, P_POST, (""));
darope@0
   178
	RETURN_META(MRES_IGNORED);
darope@0
   179
}
darope@0
   180
void SpectatorConnect_Post( edict_t *pEntity ) {
darope@0
   181
	DLL_TRACE(pfnSpectatorConnect, P_POST, (""));
darope@0
   182
	RETURN_META(MRES_IGNORED);
darope@0
   183
}
darope@0
   184
void SpectatorDisconnect_Post( edict_t *pEntity ) {
darope@0
   185
	DLL_TRACE(pfnSpectatorDisconnect, P_POST, (""));
darope@0
   186
	RETURN_META(MRES_IGNORED);
darope@0
   187
}
darope@0
   188
void SpectatorThink_Post( edict_t *pEntity ) {
darope@0
   189
	DLL_TRACE(pfnSpectatorThink, P_POST, (""));
darope@0
   190
	RETURN_META(MRES_IGNORED);
darope@0
   191
}
darope@0
   192
void Sys_Error_Post( const char *error_string ) {
darope@0
   193
	DLL_TRACE(pfnSys_Error, P_POST, (""));
darope@0
   194
	RETURN_META(MRES_IGNORED);
darope@0
   195
}
darope@0
   196
darope@0
   197
// from SDK pm_shared/pm_shared.c:
darope@0
   198
void PM_Move_Post( struct playermove_s *ppmove, int server ) {
darope@0
   199
	DLL_TRACE(pfnPM_Move, P_POST, (""));
darope@0
   200
	RETURN_META(MRES_IGNORED);
darope@0
   201
}
darope@0
   202
void PM_Init_Post( struct playermove_s *ppmove ) {
darope@0
   203
	DLL_TRACE(pfnPM_Init, P_POST, (""));
darope@0
   204
	RETURN_META(MRES_IGNORED);
darope@0
   205
}
ds@265
   206
char PM_FindTextureType_Post( const char *name ) {
darope@0
   207
	DLL_TRACE(pfnPM_FindTextureType, P_POST, (""));
darope@0
   208
	RETURN_META_VALUE(MRES_IGNORED, '\0');
darope@0
   209
}
darope@0
   210
darope@0
   211
// from SDK dlls/client.cpp:
darope@0
   212
void SetupVisibility_Post( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) {
darope@0
   213
	DLL_TRACE(pfnSetupVisibility, P_POST, (""));
darope@0
   214
	RETURN_META(MRES_IGNORED);
darope@0
   215
}
darope@0
   216
void UpdateClientData_Post ( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd ) {
darope@0
   217
	DLL_TRACE(pfnUpdateClientData, P_POST, (""));
darope@0
   218
	RETURN_META(MRES_IGNORED);
darope@0
   219
}
darope@0
   220
int AddToFullPack_Post( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet ) {
darope@0
   221
	DLL_TRACE(pfnAddToFullPack, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
darope@0
   222
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   223
}
darope@0
   224
void 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 ) {
darope@0
   225
	DLL_TRACE(pfnCreateBaseline, P_POST, (""));
darope@0
   226
	RETURN_META(MRES_IGNORED);
darope@0
   227
}
darope@0
   228
void RegisterEncoders_Post( void ) {
darope@0
   229
	DLL_TRACE(pfnRegisterEncoders, P_POST, (""));
darope@0
   230
	RETURN_META(MRES_IGNORED);
darope@0
   231
}
darope@0
   232
int GetWeaponData_Post( struct edict_s *player, struct weapon_data_s *info ) {
darope@0
   233
	DLL_TRACE(pfnGetWeaponData, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
darope@0
   234
	RETURN_META_VALUE(MRES_IGNORED, 1);
darope@0
   235
}
darope@0
   236
void CmdStart_Post( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed ) {
darope@0
   237
	DLL_TRACE(pfnCmdStart, P_POST, (""));
darope@0
   238
	RETURN_META(MRES_IGNORED);
darope@0
   239
}
darope@0
   240
void CmdEnd_Post ( const edict_t *player ) {
darope@0
   241
	DLL_TRACE(pfnCmdEnd, P_POST, (""));
darope@0
   242
	RETURN_META(MRES_IGNORED);
darope@0
   243
}
darope@0
   244
int ConnectionlessPacket_Post( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ) {
darope@0
   245
	DLL_TRACE(pfnConnectionlessPacket, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
darope@0
   246
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   247
}
darope@0
   248
int GetHullBounds_Post( int hullnumber, float *mins, float *maxs ) {
darope@0
   249
	DLL_TRACE(pfnGetHullBounds, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
darope@0
   250
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   251
}
darope@0
   252
void CreateInstancedBaselines_Post ( void ) {
darope@0
   253
	DLL_TRACE(pfnCreateInstancedBaselines, P_POST, (""));
darope@0
   254
	RETURN_META(MRES_IGNORED);
darope@0
   255
}
darope@0
   256
int InconsistentFile_Post( const edict_t *player, const char *filename, char *disconnect_message ) {
darope@0
   257
	DLL_TRACE(pfnInconsistentFile, P_POST, ("returning %d, message=%s", META_RESULT_ORIG_RET(int), disconnect_message));
darope@0
   258
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   259
}
darope@0
   260
int AllowLagCompensation_Post( void ) {
darope@0
   261
	DLL_TRACE(pfnAllowLagCompensation, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
darope@0
   262
	RETURN_META_VALUE(MRES_IGNORED, 1);
darope@0
   263
}
darope@0
   264
darope@0
   265
darope@0
   266
// from SDK ?
darope@0
   267
void OnFreeEntPrivateData_Post(edict_t *pEnt) {
darope@0
   268
	NEWDLL_TRACE(pfnOnFreeEntPrivateData, P_POST, (""));
darope@0
   269
	RETURN_META(MRES_IGNORED);
darope@0
   270
}
darope@0
   271
void GameShutdown_Post(void) {
darope@0
   272
	NEWDLL_TRACE(pfnGameShutdown, P_POST, (""));
darope@0
   273
	RETURN_META(MRES_IGNORED);
darope@0
   274
}
darope@0
   275
int ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther) {
darope@0
   276
	NEWDLL_TRACE(pfnShouldCollide, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
darope@0
   277
	RETURN_META_VALUE(MRES_IGNORED, 1);
darope@0
   278
}
darope@0
   279
darope@249
   280
// Added 2005-08-11 (no SDK update)
darope@248
   281
void CvarValue_Post(const edict_t *pEdict, const char *szValue)
darope@248
   282
{
darope@248
   283
	NEWDLL_TRACE(pfnCvarValue, P_POST, (""));
darope@248
   284
	RETURN_META(MRES_IGNORED);
darope@248
   285
}
darope@248
   286
darope@249
   287
// Added 2005-11-22 (no SDK update)
darope@249
   288
void CvarValue2_Post(const edict_t *pEdict, int requestID, const char *cvarName, const char *value) {
darope@249
   289
	NEWDLL_TRACE(pfnCvarValue2, P_POST, ("player=%s, requestID=%d, cvar=%s, value=%s", 
darope@249
   290
										STRING(pEdict->v.netname), requestID, cvarName?cvarName:"nil", value?value:"nil"));
darope@249
   291
	RETURN_META(MRES_IGNORED);
darope@249
   292
}
darope@249
   293
darope@0
   294
darope@0
   295
// from SDK dlls/cbase.cpp:
darope@0
   296
// (wd) indicates my comments on the functions
darope@0
   297
static DLL_FUNCTIONS gFunctionTable_Post = 
darope@0
   298
{
darope@0
   299
	GameDLLInit_Post,				//! pfnGameInit()				Initialize the game (one-time call after loading of game .dll)
darope@0
   300
	DispatchSpawn_Post,				//! pfnSpawn()
darope@0
   301
	DispatchThink_Post,				//! pfnThink()
darope@0
   302
	DispatchUse_Post,				//! pfnUse()
darope@0
   303
	DispatchTouch_Post,				//! pfnTouch()
darope@0
   304
	DispatchBlocked_Post,			//! pfnBlocked()
darope@0
   305
	DispatchKeyValue_Post,			//! pfnKeyValue()
darope@0
   306
	DispatchSave_Post,				//! pfnSave()
darope@0
   307
	DispatchRestore_Post,			//! pfnRestore()
darope@0
   308
	DispatchObjectCollsionBox_Post,	//! pfnSetAbsBox()
darope@0
   309
darope@0
   310
	SaveWriteFields_Post,			//! pfnSaveWriteFields()
darope@0
   311
	SaveReadFields_Post,			//! pfnSaveReadFields()
darope@0
   312
darope@0
   313
	SaveGlobalState_Post,			//! pfnSaveGlobalState()
darope@0
   314
	RestoreGlobalState_Post,		//! pfnRestoreGlobalState()
darope@0
   315
	ResetGlobalState_Post,			//! pfnResetGlobalState()
darope@0
   316
darope@0
   317
	ClientConnect_Post,				//! pfnClientConnect()			(wd) Client has connected
darope@0
   318
	ClientDisconnect_Post,			//! pfnClientDisconnect()		(wd) Player has left the game
darope@0
   319
	ClientKill_Post,				//! pfnClientKill()				(wd) Player has typed "kill"
darope@0
   320
	ClientPutInServer_Post,			//! pfnClientPutInServer()		(wd) Client is entering the game
darope@0
   321
	ClientCommand_Post,				//! pfnClientCommand()			(wd) Player has sent a command (typed, or from a bind)
darope@0
   322
	ClientUserInfoChanged_Post,		//! pfnClientUserInfoChanged()	(wd) Client has updated their setinfo structure
darope@0
   323
	ServerActivate_Post,			//! pfnServerActivate()			(wd) Server is starting a new map
darope@0
   324
	ServerDeactivate_Post,			//! pfnServerDeactivate()		(wd) Server is leaving the map (shutdown, or changelevel); SDK2
darope@0
   325
darope@0
   326
	PlayerPreThink_Post,			//! pfnPlayerPreThink()
darope@0
   327
	PlayerPostThink_Post,			//! pfnPlayerPostThink()
darope@0
   328
darope@0
   329
	StartFrame_Post,				//! pfnStartFrame()
darope@0
   330
	ParmsNewLevel_Post,				//! pfnParmsNewLevel()
darope@0
   331
	ParmsChangeLevel_Post,			//! pfnParmsChangeLevel()
darope@0
   332
darope@0
   333
	GetGameDescription_Post,		//! pfnGetGameDescription()		Returns string describing current .dll.  E.g. "TeamFotrress 2", "Half-Life"
darope@0
   334
	PlayerCustomization_Post,		//! pfnPlayerCustomization()	Notifies .dll of new customization for player.
darope@0
   335
darope@0
   336
	SpectatorConnect_Post,			//! pfnSpectatorConnect()		Called when spectator joins server
darope@0
   337
	SpectatorDisconnect_Post,		//! pfnSpectatorDisconnect()	Called when spectator leaves the server
darope@0
   338
	SpectatorThink_Post,			//! pfnSpectatorThink()			Called when spectator sends a command packet (usercmd_t)
darope@0
   339
	
darope@0
   340
	Sys_Error_Post,					//! pfnSys_Error()				Notify game .dll that engine is going to shut down.  Allows mod authors to set a breakpoint.  SDK2
darope@0
   341
darope@0
   342
	PM_Move_Post,					//! pfnPM_Move()				(wd) SDK2
darope@0
   343
	PM_Init_Post,					//! pfnPM_Init()				Server version of player movement initialization; (wd) SDK2
darope@0
   344
	PM_FindTextureType_Post,		//! pfnPM_FindTextureType()		(wd) SDK2
darope@0
   345
	
darope@0
   346
	SetupVisibility_Post,			//! pfnSetupVisibility()		Set up PVS and PAS for networking for this client; (wd) SDK2
darope@0
   347
	UpdateClientData_Post,			//! pfnUpdateClientData()		Set up data sent only to specific client; (wd) SDK2
darope@0
   348
	AddToFullPack_Post,				//! pfnAddToFullPack()			(wd) SDK2
darope@0
   349
	CreateBaseline_Post,			//! pfnCreateBaseline()			Tweak entity baseline for network encoding, allows setup of player baselines, too.; (wd) SDK2
darope@0
   350
	RegisterEncoders_Post,			//! pfnRegisterEncoders()		Callbacks for network encoding; (wd) SDK2
darope@0
   351
	GetWeaponData_Post,				//! pfnGetWeaponData()			(wd) SDK2
darope@0
   352
	CmdStart_Post,					//! pfnCmdStart()				(wd) SDK2
darope@0
   353
	CmdEnd_Post,					//! pfnCmdEnd()					(wd) SDK2
darope@0
   354
	ConnectionlessPacket_Post,		//! pfnConnectionlessPacket()	(wd) SDK2
darope@0
   355
	GetHullBounds_Post,				//! pfnGetHullBounds()			(wd) SDK2
darope@0
   356
	CreateInstancedBaselines_Post,	//! pfnCreateInstancedBaselines()	(wd) SDK2
darope@0
   357
	InconsistentFile_Post,			//! pfnInconsistentFile()		(wd) SDK2
darope@0
   358
	AllowLagCompensation_Post,		//! pfnAllowLagCompensation()	(wd) SDK2
darope@0
   359
};
darope@0
   360
darope@0
   361
C_DLLEXPORT int GetEntityAPI_Post( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion )
darope@0
   362
{
darope@0
   363
	LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion);
darope@0
   364
	if(!pFunctionTable) {
darope@0
   365
		LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable");
darope@0
   366
		return(FALSE);
darope@0
   367
	}
darope@0
   368
	else if(interfaceVersion != INTERFACE_VERSION) {
darope@0
   369
		LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION);
darope@0
   370
		return(FALSE);
darope@0
   371
	}
darope@0
   372
	memcpy(pFunctionTable, &gFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
darope@0
   373
	return(TRUE);
darope@0
   374
}
darope@0
   375
darope@0
   376
C_DLLEXPORT int GetEntityAPI2_Post( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion )
darope@0
   377
{
darope@0
   378
	LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion);
darope@0
   379
	if(!pFunctionTable) {
darope@0
   380
		LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable");
darope@0
   381
		return(FALSE);
darope@0
   382
	}
darope@0
   383
	else if(*interfaceVersion != INTERFACE_VERSION) {
darope@0
   384
		LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
darope@0
   385
		//! Tell engine what version we had, so it can figure out who is out of date.
darope@0
   386
		*interfaceVersion = INTERFACE_VERSION;
darope@0
   387
		return(FALSE);
darope@0
   388
	}
darope@0
   389
	memcpy( pFunctionTable, &gFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
darope@0
   390
	return(TRUE);
darope@0
   391
}
darope@0
   392
darope@0
   393
darope@0
   394
static NEW_DLL_FUNCTIONS gNewFunctionTable_Post = 
darope@0
   395
{
darope@0
   396
	OnFreeEntPrivateData_Post,		//! pfnOnFreeEntPrivateData()	Called right before the object's memory is freed.  Calls its destructor.
darope@0
   397
	GameShutdown_Post,				//! pfnGameShutdown()
darope@0
   398
	ShouldCollide_Post,				//! pfnShouldCollide()
darope@248
   399
	CvarValue_Post,					//! pfnCvarValue()
darope@249
   400
	CvarValue2_Post,				//! pfnCvarValue2()
darope@0
   401
};
darope@0
   402
darope@0
   403
C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ) 
darope@0
   404
{
darope@0
   405
	LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion);
darope@0
   406
	if(!pNewFunctionTable) {
darope@0
   407
		LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable");
darope@0
   408
		return(FALSE);
darope@0
   409
	}
darope@0
   410
	else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) {
darope@0
   411
		LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION);
darope@0
   412
		//! Tell engine what version we had, so it can figure out who is out of date.
darope@0
   413
		*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
darope@0
   414
		return(FALSE);
darope@0
   415
	}
darope@0
   416
	memcpy(pNewFunctionTable, &gNewFunctionTable_Post, sizeof(NEW_DLL_FUNCTIONS));
darope@0
   417
	return TRUE;
darope@0
   418
}