trace_plugin/engine_api.cpp
author darope
Sat May 29 23:14:59 2004 +0000 (2004-05-29)
branchB-work
changeset 47 3bf8ea9ab02d
parent 0 d15304fcb7a7
child 161 01c698fef99a
permissions -rw-r--r--
Updated to use new engine interface. Old interface is available via
HLSDK_3_2_OLD_EIFACE macro.
darope@0
     1
// vi: set ts=4 sw=4 :
darope@0
     2
// vim: set tw=75 :
darope@0
     3
darope@0
     4
// engine_api.cpp - implementation of Half-Life engine functions
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 <stdio.h>
darope@0
    38
#include <stdarg.h>
darope@0
    39
darope@0
    40
#include <extdll.h>
darope@0
    41
darope@0
    42
#include "engine_api.h"
darope@0
    43
#include "meta_api.h"
darope@0
    44
#include "trace_api.h"
darope@0
    45
#include "support_meta.h"		// MAX_STRBUF_LEN
darope@0
    46
#include "log_plugin.h"
darope@0
    47
darope@0
    48
int PrecacheModel(char *s) {
darope@0
    49
	ENGINE_TRACE(pfnPrecacheModel, P_PRE, ("model=%s", s));
darope@0
    50
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
    51
}
darope@0
    52
int PrecacheSound(char *s) {
darope@0
    53
	ENGINE_TRACE(pfnPrecacheSound, P_PRE, ("sound=%s", s));
darope@0
    54
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
    55
}
darope@0
    56
void SetModel(edict_t *e, const char *m) {
darope@0
    57
	edict_t *ed = e;
darope@0
    58
	ENGINE_TRACE(pfnSetModel, P_PRE, ("classname=%s netname=%s model=%s", 
darope@0
    59
				ed ? STRING(ed->v.classname) : "nil",
darope@0
    60
				ed ? STRING(ed->v.netname) : "nil",
darope@0
    61
				m));
darope@0
    62
	RETURN_META(MRES_IGNORED);
darope@0
    63
}
darope@0
    64
int ModelIndex(const char *m) {
darope@0
    65
	ENGINE_TRACE(pfnModelIndex, P_PRE, ("model=%s", m));
darope@0
    66
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
    67
}
darope@0
    68
int ModelFrames(int modelIndex) {
darope@0
    69
	ENGINE_TRACE(pfnModelFrames, P_PRE, ("index=%d", modelIndex));
darope@0
    70
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
    71
}
darope@0
    72
darope@0
    73
void SetSize(edict_t *e, const float *rgflMin, const float *rgflMax) {
darope@0
    74
	ENGINE_TRACE(pfnSetSize, P_PRE, (""));
darope@0
    75
	RETURN_META(MRES_IGNORED);
darope@0
    76
}
darope@0
    77
void ChangeLevel(char *s1, char *s2) {
darope@0
    78
	ENGINE_TRACE(pfnChangeLevel, P_PRE, ("s1=%s, s2=%s", s1, s2));
darope@0
    79
	RETURN_META(MRES_IGNORED);
darope@0
    80
}
darope@0
    81
void GetSpawnParms(edict_t *ent) {
darope@0
    82
	ENGINE_TRACE(pfnGetSpawnParms, P_PRE, (""));
darope@0
    83
	RETURN_META(MRES_IGNORED);
darope@0
    84
}
darope@0
    85
void SaveSpawnParms(edict_t *ent) {
darope@0
    86
	ENGINE_TRACE(pfnSaveSpawnParms, P_PRE, (""));
darope@0
    87
	RETURN_META(MRES_IGNORED);
darope@0
    88
}
darope@0
    89
darope@0
    90
float VecToYaw(const float *rgflVector) {
darope@0
    91
	ENGINE_TRACE(pfnVecToYaw, P_PRE, (""));
darope@0
    92
	RETURN_META_VALUE(MRES_IGNORED, 0.0);
darope@0
    93
}
darope@0
    94
void VecToAngles(const float *rgflVectorIn, float *rgflVectorOut) {
darope@0
    95
	ENGINE_TRACE(pfnVecToAngles, P_PRE, (""));
darope@0
    96
	RETURN_META(MRES_IGNORED);
darope@0
    97
}
darope@0
    98
void MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType) {
darope@0
    99
	ENGINE_TRACE(pfnMoveToOrigin, P_PRE, (""));
darope@0
   100
	RETURN_META(MRES_IGNORED);
darope@0
   101
}
darope@0
   102
void ChangeYaw(edict_t *ent) {
darope@0
   103
	ENGINE_TRACE(pfnChangeYaw, P_PRE, (""));
darope@0
   104
	RETURN_META(MRES_IGNORED);
darope@0
   105
}
darope@0
   106
void ChangePitch(edict_t *ent) {
darope@0
   107
	ENGINE_TRACE(pfnChangePitch, P_PRE, (""));
darope@0
   108
	RETURN_META(MRES_IGNORED);
darope@0
   109
}
darope@0
   110
darope@0
   111
edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue) {
darope@0
   112
	edict_t *ed=pEdictStartSearchAfter;
darope@0
   113
	ENGINE_TRACE(pfnFindEntityByString, P_PRE, ("start=%s field=%s value=%s", 
darope@0
   114
				ed ? STRING(ed->v.classname) : "nil", pszField, pszValue));
darope@0
   115
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   116
}
darope@0
   117
int GetEntityIllum(edict_t *pEnt) {
darope@0
   118
	ENGINE_TRACE(pfnGetEntityIllum, P_PRE, (""));
darope@0
   119
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   120
}
darope@0
   121
edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad) {
darope@0
   122
	ENGINE_TRACE(pfnFindEntityInSphere, P_PRE, (""));
darope@0
   123
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   124
}
darope@0
   125
edict_t *FindClientInPVS(edict_t *pEdict) {
darope@0
   126
	ENGINE_TRACE(pfnFindClientInPVS, P_PRE, (""));
darope@0
   127
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   128
}
darope@0
   129
edict_t *EntitiesInPVS(edict_t *pplayer) {
darope@0
   130
	ENGINE_TRACE(pfnEntitiesInPVS, P_PRE, (""));
darope@0
   131
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   132
}
darope@0
   133
darope@0
   134
void MakeVectors(const float *rgflVector) {
darope@0
   135
	ENGINE_TRACE(pfnMakeVectors, P_PRE, (""));
darope@0
   136
	RETURN_META(MRES_IGNORED);
darope@0
   137
}
darope@0
   138
void AngleVectors(const float *rgflVector, float *forward, float *right, float *up) {
darope@0
   139
	ENGINE_TRACE(pfnAngleVectors, P_PRE, (""));
darope@0
   140
	RETURN_META(MRES_IGNORED);
darope@0
   141
}
darope@0
   142
darope@0
   143
edict_t *CreateEntity(void) {
darope@0
   144
	ENGINE_TRACE(pfnCreateEntity, P_PRE, (""));
darope@0
   145
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   146
}
darope@0
   147
void RemoveEntity(edict_t *e) {
darope@0
   148
	ENGINE_TRACE(pfnRemoveEntity, P_PRE, ("name=%s", STRING(e->v.classname)));
darope@0
   149
	RETURN_META(MRES_IGNORED);
darope@0
   150
}
darope@0
   151
edict_t *CreateNamedEntity(int className) {
darope@0
   152
	ENGINE_TRACE(pfnCreateNamedEntity, P_PRE, ("name=%s", STRING(className)));
darope@0
   153
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   154
}
darope@0
   155
darope@0
   156
void MakeStatic(edict_t *ent) {
darope@0
   157
	ENGINE_TRACE(pfnMakeStatic, P_PRE, (""));
darope@0
   158
	RETURN_META(MRES_IGNORED);
darope@0
   159
}
darope@0
   160
int EntIsOnFloor(edict_t *e) {
darope@0
   161
	ENGINE_TRACE(pfnEntIsOnFloor, P_PRE, (""));
darope@0
   162
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   163
}
darope@0
   164
int DropToFloor(edict_t *e) {
darope@0
   165
	ENGINE_TRACE(pfnDropToFloor, P_PRE, (""));
darope@0
   166
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   167
}
darope@0
   168
darope@0
   169
int WalkMove(edict_t *ent, float yaw, float dist, int iMode) {
darope@0
   170
	ENGINE_TRACE(pfnWalkMove, P_PRE, (""));
darope@0
   171
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   172
}
darope@0
   173
void SetOrigin(edict_t *e, const float *rgflOrigin) {
darope@0
   174
	edict_t *ed = e;
darope@0
   175
	ENGINE_TRACE(pfnSetOrigin, P_PRE, ("classname=%s netname=%s",
darope@0
   176
				ed ? STRING(ed->v.classname) : "nil",
darope@0
   177
				ed ? STRING(ed->v.netname) : "nil"));
darope@0
   178
	RETURN_META(MRES_IGNORED);
darope@0
   179
}
darope@0
   180
darope@0
   181
void EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) {
darope@0
   182
	ENGINE_TRACE(pfnEmitSound, P_PRE, ("sample=%s", sample));
darope@0
   183
	RETURN_META(MRES_IGNORED);
darope@0
   184
}
darope@0
   185
void EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch) {
darope@0
   186
	ENGINE_TRACE(pfnEmitAmbientSound, P_PRE, ("sample=%s", samp));
darope@0
   187
	RETURN_META(MRES_IGNORED);
darope@0
   188
}
darope@0
   189
darope@0
   190
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
darope@0
   191
	ENGINE_TRACE(pfnTraceLine, P_PRE, (""));
darope@0
   192
	RETURN_META(MRES_IGNORED);
darope@0
   193
}
darope@0
   194
void TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr) {
darope@0
   195
	ENGINE_TRACE(pfnTraceToss, P_PRE, (""));
darope@0
   196
	RETURN_META(MRES_IGNORED);
darope@0
   197
}
darope@0
   198
int TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
darope@0
   199
	ENGINE_TRACE(pfnTraceMonsterHull, P_PRE, (""));
darope@0
   200
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   201
}
darope@0
   202
void TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr) {
darope@0
   203
	ENGINE_TRACE(pfnTraceHull, P_PRE, (""));
darope@0
   204
	RETURN_META(MRES_IGNORED);
darope@0
   205
}
darope@0
   206
void TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr) {
darope@0
   207
	ENGINE_TRACE(pfnTraceModel, P_PRE, (""));
darope@0
   208
	RETURN_META(MRES_IGNORED);
darope@0
   209
}
darope@0
   210
const char *TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ) {
darope@0
   211
	ENGINE_TRACE(pfnTraceTexture, P_PRE, (""));
darope@0
   212
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   213
}
darope@0
   214
void TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr) {
darope@0
   215
	ENGINE_TRACE(pfnTraceSphere, P_PRE, (""));
darope@0
   216
	RETURN_META(MRES_IGNORED);
darope@0
   217
}
darope@0
   218
void GetAimVector(edict_t *ent, float speed, float *rgflReturn) {
darope@0
   219
	ENGINE_TRACE(pfnGetAimVector, P_PRE, (""));
darope@0
   220
	RETURN_META(MRES_IGNORED);
darope@0
   221
}
darope@0
   222
darope@0
   223
void ServerCommand(char *str) {
darope@0
   224
	ENGINE_TRACE(pfnServerCommand, P_PRE, ("cmd=%s", str));
darope@0
   225
	RETURN_META(MRES_IGNORED);
darope@0
   226
}
darope@0
   227
void ServerExecute(void) {
darope@0
   228
	ENGINE_TRACE(pfnServerExecute, P_PRE, (""));
darope@0
   229
	RETURN_META(MRES_IGNORED);
darope@0
   230
}
darope@0
   231
void engClientCommand(edict_t *pEdict, char *szFmt, ...) {
darope@0
   232
	va_list ap;
darope@0
   233
	char buf[1024];
darope@0
   234
	char *cp;
darope@0
   235
	va_start(ap, szFmt);
darope@0
   236
	vsnprintf(buf, sizeof(buf), szFmt, ap);
darope@0
   237
	va_end(ap);
darope@0
   238
	cp=buf+strlen(buf)-1;
darope@0
   239
	if(*cp=='\n') *cp='\0';
darope@0
   240
	ENGINE_TRACE(pfnClientCommand, P_PRE, ("cmd='%s'", buf));
darope@0
   241
	RETURN_META(MRES_IGNORED);
darope@0
   242
}
darope@0
   243
darope@0
   244
void ParticleEffect(const float *org, const float *dir, float color, float count) {
darope@0
   245
	ENGINE_TRACE(pfnParticleEffect, P_PRE, (""));
darope@0
   246
	RETURN_META(MRES_IGNORED);
darope@0
   247
}
darope@0
   248
void LightStyle(int style, char *val) {
darope@0
   249
	ENGINE_TRACE(pfnLightStyle, P_PRE, (""));
darope@0
   250
	RETURN_META(MRES_IGNORED);
darope@0
   251
}
darope@0
   252
int DecalIndex(const char *name) {
darope@0
   253
	ENGINE_TRACE(pfnDecalIndex, P_PRE, (""));
darope@0
   254
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   255
}
darope@0
   256
int PointContents(const float *rgflVector) {
darope@0
   257
	ENGINE_TRACE(pfnPointContents, P_PRE, (""));
darope@0
   258
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   259
}
darope@0
   260
darope@0
   261
void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) {
darope@0
   262
	const char *name, *dest;
darope@0
   263
	name=GET_USER_MSG_NAME(PLID, msg_type, NULL);
darope@0
   264
	if(!name) name="unknown";
darope@0
   265
	dest=msg_dest_types[msg_dest];
darope@0
   266
	if(!dest) dest="unknown";
darope@0
   267
	ENGINE_TRACE(pfnMessageBegin, P_PRE, ("type=%s(%d), dest=%s(%d), classname=%s netname=%s", name, msg_type, dest, msg_dest,
darope@0
   268
				ed ? STRING(ed->v.classname) : "nil",
darope@0
   269
				ed ? STRING(ed->v.netname) : "nil"));
darope@0
   270
	RETURN_META(MRES_IGNORED);
darope@0
   271
}
darope@0
   272
void MessageEnd(void) {
darope@0
   273
	ENGINE_TRACE(pfnMessageEnd, P_PRE, (""));
darope@0
   274
	RETURN_META(MRES_IGNORED);
darope@0
   275
}
darope@0
   276
darope@0
   277
void WriteByte(int iValue) {
darope@0
   278
	ENGINE_TRACE(pfnWriteByte, P_PRE, (""));
darope@0
   279
	RETURN_META(MRES_IGNORED);
darope@0
   280
}
darope@0
   281
void WriteChar(int iValue) {
darope@0
   282
	ENGINE_TRACE(pfnWriteChar, P_PRE, (""));
darope@0
   283
	RETURN_META(MRES_IGNORED);
darope@0
   284
}
darope@0
   285
void WriteShort(int iValue) {
darope@0
   286
	ENGINE_TRACE(pfnWriteShort, P_PRE, (""));
darope@0
   287
	RETURN_META(MRES_IGNORED);
darope@0
   288
}
darope@0
   289
void WriteLong(int iValue) {
darope@0
   290
	ENGINE_TRACE(pfnWriteLong, P_PRE, (""));
darope@0
   291
	RETURN_META(MRES_IGNORED);
darope@0
   292
}
darope@0
   293
void WriteAngle(float flValue) {
darope@0
   294
	ENGINE_TRACE(pfnWriteAngle, P_PRE, (""));
darope@0
   295
	RETURN_META(MRES_IGNORED);
darope@0
   296
}
darope@0
   297
void WriteCoord(float flValue) {
darope@0
   298
	ENGINE_TRACE(pfnWriteCoord, P_PRE, (""));
darope@0
   299
	RETURN_META(MRES_IGNORED);
darope@0
   300
}
darope@0
   301
void WriteString(const char *sz) {
darope@0
   302
	ENGINE_TRACE(pfnWriteString, P_PRE, ("string=%s", sz));
darope@0
   303
	RETURN_META(MRES_IGNORED);
darope@0
   304
}
darope@0
   305
void WriteEntity(int iValue) {
darope@0
   306
	ENGINE_TRACE(pfnWriteEntity, P_PRE, (""));
darope@0
   307
	RETURN_META(MRES_IGNORED);
darope@0
   308
}
darope@0
   309
darope@0
   310
void CVarRegister(cvar_t *pCvar) {
darope@0
   311
	ENGINE_TRACE(pfnCVarRegister, P_PRE, ("cvar=%s", pCvar->name));
darope@0
   312
	RETURN_META(MRES_IGNORED);
darope@0
   313
}
darope@0
   314
float CVarGetFloat(const char *szVarName) {
darope@0
   315
	// more trace output in Post
darope@0
   316
	ENGINE_TRACE(pfnCVarGetFloat, P_PRE, ("cvar=%s", szVarName));
darope@0
   317
	RETURN_META_VALUE(MRES_IGNORED, 0.0);
darope@0
   318
}
darope@0
   319
const char *CVarGetString(const char *szVarName) {
darope@0
   320
	// more trace output in Post
darope@0
   321
	ENGINE_TRACE(pfnCVarGetString, P_PRE, ("cvar=%s", szVarName));
darope@0
   322
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   323
}
darope@0
   324
void CVarSetFloat(const char *szVarName, float flValue) {
darope@0
   325
	ENGINE_TRACE(pfnCVarSetFloat, P_PRE, ("cvar=%s, val=%f", szVarName, flValue));
darope@0
   326
	RETURN_META(MRES_IGNORED);
darope@0
   327
}
darope@0
   328
void CVarSetString(const char *szVarName, const char *szValue) {
darope@0
   329
	ENGINE_TRACE(pfnCVarSetString, P_PRE, ("cvar=%s, val=%s", szVarName, szValue));
darope@0
   330
	RETURN_META(MRES_IGNORED);
darope@0
   331
}
darope@0
   332
darope@0
   333
void AlertMessage(ALERT_TYPE atype, char *szFmt, ...) {
darope@0
   334
	char *astr;
darope@0
   335
	va_list ap;
darope@0
   336
	char buf[MAX_STRBUF_LEN];
darope@0
   337
	switch(atype) {
darope@0
   338
		case at_notice:
darope@0
   339
			astr="at_notice";
darope@0
   340
			break;
darope@0
   341
		case at_console:
darope@0
   342
			astr="at_console";
darope@0
   343
			break;
darope@0
   344
		case at_aiconsole:
darope@0
   345
			astr="at_aiconsole";
darope@0
   346
			break;
darope@0
   347
		case at_warning:
darope@0
   348
			astr="at_warning";
darope@0
   349
			break;
darope@0
   350
		case at_error:
darope@0
   351
			astr="at_error";
darope@0
   352
			break;
darope@0
   353
		case at_logged:
darope@0
   354
			astr="at_logged";
darope@0
   355
			break;
darope@0
   356
		default:
darope@0
   357
			astr="unknown";
darope@0
   358
			break;
darope@0
   359
	}
darope@0
   360
	va_start(ap, szFmt);
darope@0
   361
	vsnprintf(buf, sizeof(buf), szFmt, ap);
darope@0
   362
	va_end(ap);
darope@0
   363
	ENGINE_TRACE(pfnAlertMessage, P_PRE, ("atype=%s(%d) msg=%s", astr, 
darope@0
   364
				atype, buf));
darope@0
   365
	RETURN_META(MRES_IGNORED);
darope@0
   366
}
darope@47
   367
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   368
void EngineFprintf(FILE *pfile, char *szFmt, ...) {
darope@47
   369
#else
darope@47
   370
void EngineFprintf(void *pfile, char *szFmt, ...) {
darope@47
   371
#endif
darope@0
   372
	va_list ap;
darope@0
   373
	char buf[1024];
darope@0
   374
	va_start(ap, szFmt);
darope@0
   375
	vsnprintf(buf, sizeof(buf), szFmt, ap);
darope@0
   376
	va_end(ap);
darope@0
   377
	ENGINE_TRACE(pfnEngineFprintf, P_PRE, ("line=%s", buf));
darope@0
   378
	RETURN_META(MRES_IGNORED);
darope@0
   379
}
darope@0
   380
darope@47
   381
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   382
void *PvAllocEntPrivateData(edict_t *pEdict, long cb) {
darope@47
   383
#else
darope@47
   384
void *PvAllocEntPrivateData(edict_t *pEdict, int32 cb) {
darope@47
   385
#endif
darope@0
   386
	ENGINE_TRACE(pfnPvAllocEntPrivateData, P_PRE, (""));
darope@0
   387
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   388
}
darope@0
   389
void *PvEntPrivateData(edict_t *pEdict) {
darope@0
   390
	ENGINE_TRACE(pfnPvEntPrivateData, P_PRE, (""));
darope@0
   391
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   392
}
darope@0
   393
void FreeEntPrivateData(edict_t *pEdict) {
darope@0
   394
	ENGINE_TRACE(pfnFreeEntPrivateData, P_PRE, (""));
darope@0
   395
	RETURN_META(MRES_IGNORED);
darope@0
   396
}
darope@0
   397
darope@0
   398
const char *SzFromIndex(int iString) {
darope@0
   399
	ENGINE_TRACE(pfnSzFromIndex, P_PRE, (""));
darope@0
   400
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   401
}
darope@0
   402
int AllocString(const char *szValue) {
darope@0
   403
	// more trace output in Post
darope@0
   404
	ENGINE_TRACE(pfnAllocString, P_PRE, ("str=%s", szValue));
darope@0
   405
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   406
}
darope@0
   407
darope@0
   408
struct entvars_s *GetVarsOfEnt(edict_t *pEdict) {
darope@0
   409
	ENGINE_TRACE(pfnGetVarsOfEnt, P_PRE, (""));
darope@0
   410
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   411
}
darope@0
   412
edict_t *PEntityOfEntOffset(int iEntOffset) {
darope@0
   413
	ENGINE_TRACE(pfnPEntityOfEntOffset, P_PRE, (""));
darope@0
   414
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   415
}
darope@0
   416
int EntOffsetOfPEntity(const edict_t *pEdict) {
darope@0
   417
	const edict_t *ed=pEdict;
darope@0
   418
	ENGINE_TRACE(pfnEntOffsetOfPEntity, P_PRE, ("classname=%s netname=%s",
darope@0
   419
				ed ? STRING(ed->v.classname) : "nil",
darope@0
   420
				ed ? STRING(ed->v.netname) : "nil"));
darope@0
   421
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   422
}
darope@0
   423
int IndexOfEdict(const edict_t *pEdict) {
darope@0
   424
	ENGINE_TRACE(pfnIndexOfEdict, P_PRE, (""));
darope@0
   425
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   426
}
darope@0
   427
edict_t *PEntityOfEntIndex(int iEntIndex) {
darope@0
   428
	ENGINE_TRACE(pfnPEntityOfEntIndex, P_PRE, ("index=%d", iEntIndex));
darope@0
   429
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   430
}
darope@0
   431
edict_t *FindEntityByVars(struct entvars_s *pvars) {
darope@0
   432
	ENGINE_TRACE(pfnFindEntityByVars, P_PRE, (""));
darope@0
   433
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   434
}
darope@0
   435
void *GetModelPtr(edict_t *pEdict) {
darope@0
   436
	ENGINE_TRACE(pfnGetModelPtr, P_PRE, (""));
darope@0
   437
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   438
}
darope@0
   439
darope@0
   440
int RegUserMsg(const char *pszName, int iSize) {
darope@0
   441
	// more trace output in Post
darope@0
   442
	ENGINE_TRACE(pfnRegUserMsg, P_PRE, ("msg=%s size=%d", pszName, iSize));
darope@0
   443
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   444
}
darope@0
   445
darope@0
   446
void AnimationAutomove(const edict_t *pEdict, float flTime) {
darope@0
   447
	ENGINE_TRACE(pfnAnimationAutomove, P_PRE, (""));
darope@0
   448
	RETURN_META(MRES_IGNORED);
darope@0
   449
}
darope@0
   450
void GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles ) {
darope@0
   451
	ENGINE_TRACE(pfnGetBonePosition, P_PRE, (""));
darope@0
   452
	RETURN_META(MRES_IGNORED);
darope@0
   453
}
darope@0
   454
darope@47
   455
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   456
unsigned long FunctionFromName( const char *pName ) {
darope@47
   457
#else
darope@47
   458
uint32 FunctionFromName( const char *pName ) {
darope@47
   459
#endif
darope@0
   460
	ENGINE_TRACE(pfnFunctionFromName, P_PRE, ("name=%s", pName));
darope@0
   461
	RETURN_META_VALUE(MRES_IGNORED, 0UL);
darope@0
   462
}
darope@47
   463
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   464
const char *NameForFunction( unsigned long function ) {
darope@47
   465
#else
darope@47
   466
const char *NameForFunction( uint32 function ) {
darope@47
   467
#endif
darope@0
   468
	ENGINE_TRACE(pfnNameForFunction, P_PRE, (""));
darope@0
   469
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   470
}
darope@0
   471
darope@0
   472
//! JOHN: engine callbacks so game DLL can print messages to individual clients
darope@0
   473
void ClientPrintf( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ) {
darope@0
   474
	ENGINE_TRACE(pfnClientPrintf, P_PRE, ("msg=%s", szMsg));
darope@0
   475
	RETURN_META(MRES_IGNORED);
darope@0
   476
}
darope@0
   477
void ServerPrint( const char *szMsg ) {
darope@0
   478
	ENGINE_TRACE(pfnServerPrint, P_PRE, ("msg=%s", szMsg));
darope@0
   479
	RETURN_META(MRES_IGNORED);
darope@0
   480
}
darope@0
   481
darope@0
   482
//! these 3 added so game DLL can easily access client 'cmd' strings
darope@0
   483
const char *Cmd_Args( void ) {
darope@0
   484
	// trace output in Post
darope@0
   485
	ENGINE_TRACE(pfnCmd_Args, P_PRE, (""));
darope@0
   486
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   487
}
darope@0
   488
const char *Cmd_Argv( int argc ) {
darope@0
   489
	// more trace output in Post
darope@0
   490
	ENGINE_TRACE(pfnCmd_Argv, P_PRE, ("argc=%d", argc));
darope@0
   491
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   492
}
darope@0
   493
int Cmd_Argc( void ) {
darope@0
   494
	// trace output in Post
darope@0
   495
	ENGINE_TRACE(pfnCmd_Argc, P_PRE, (""));
darope@0
   496
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   497
}
darope@0
   498
darope@0
   499
void GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ) {
darope@0
   500
	ENGINE_TRACE(pfnGetAttachment, P_PRE, (""));
darope@0
   501
	RETURN_META(MRES_IGNORED);
darope@0
   502
}
darope@0
   503
darope@0
   504
void CRC32_Init(CRC32_t *pulCRC) {
darope@0
   505
	ENGINE_TRACE(pfnCRC32_Init, P_PRE, (""));
darope@0
   506
	RETURN_META(MRES_IGNORED);
darope@0
   507
}
darope@0
   508
void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len) {
darope@0
   509
	ENGINE_TRACE(pfnCRC32_ProcessBuffer, P_PRE, (""));
darope@0
   510
	RETURN_META(MRES_IGNORED);
darope@0
   511
}
darope@0
   512
void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch) {
darope@0
   513
	ENGINE_TRACE(pfnCRC32_ProcessByte, P_PRE, (""));
darope@0
   514
	RETURN_META(MRES_IGNORED);
darope@0
   515
}
darope@0
   516
CRC32_t CRC32_Final(CRC32_t pulCRC) {
darope@0
   517
	ENGINE_TRACE(pfnCRC32_Final, P_PRE, (""));
darope@0
   518
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   519
}
darope@0
   520
darope@47
   521
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   522
long RandomLong(long lLow, long lHigh) {
darope@47
   523
#else
darope@47
   524
int32 RandomLong(int32 lLow, int32 lHigh) {
darope@47
   525
#endif
darope@0
   526
	// more output in Post
darope@0
   527
	ENGINE_TRACE(pfnRandomLong, P_PRE, ("low=%ld, high=%ld", lLow, lHigh));
darope@0
   528
	RETURN_META_VALUE(MRES_IGNORED, 0L);
darope@0
   529
}
darope@0
   530
float RandomFloat(float flLow, float flHigh) {
darope@0
   531
	// more output in Post
darope@0
   532
	ENGINE_TRACE(pfnRandomFloat, P_PRE, ("low=%f, high=%f", flLow, flHigh));
darope@0
   533
	RETURN_META_VALUE(MRES_IGNORED, 0.0);
darope@0
   534
}
darope@0
   535
darope@0
   536
void SetView(const edict_t *pClient, const edict_t *pViewent ) {
darope@0
   537
	ENGINE_TRACE(pfnSetView, P_PRE, (""));
darope@0
   538
	RETURN_META(MRES_IGNORED);
darope@0
   539
}
darope@0
   540
float Time( void ) {
darope@0
   541
	// trace output in Post
darope@0
   542
	ENGINE_TRACE(pfnTime, P_PRE, (""));
darope@0
   543
	RETURN_META_VALUE(MRES_IGNORED, 0.0);
darope@0
   544
}
darope@0
   545
void CrosshairAngle(const edict_t *pClient, float pitch, float yaw) {
darope@0
   546
	ENGINE_TRACE(pfnCrosshairAngle, P_PRE, (""));
darope@0
   547
	RETURN_META(MRES_IGNORED);
darope@0
   548
}
darope@0
   549
darope@0
   550
byte *LoadFileForMe(char *filename, int *pLength) {
darope@0
   551
	ENGINE_TRACE(pfnLoadFileForMe, P_PRE, ("file=%s", filename));
darope@0
   552
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   553
}
darope@0
   554
void FreeFile(void *buffer) {
darope@0
   555
	ENGINE_TRACE(pfnFreeFile, P_PRE, (""));
darope@0
   556
	RETURN_META(MRES_IGNORED);
darope@0
   557
}
darope@0
   558
darope@0
   559
//! trigger_endsection
darope@0
   560
void EndSection(const char *pszSectionName) {
darope@0
   561
	ENGINE_TRACE(pfnEndSection, P_PRE, ("section=%s", pszSectionName));
darope@0
   562
	RETURN_META(MRES_IGNORED);
darope@0
   563
}
darope@0
   564
int CompareFileTime(char *filename1, char *filename2, int *iCompare) {
darope@0
   565
	ENGINE_TRACE(pfnCompareFileTime, P_PRE, ("file1=%s, file2=%s", filename1, filename2));
darope@0
   566
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   567
}
darope@0
   568
void GetGameDir(char *szGetGameDir) {
darope@0
   569
	// trace output in Post
darope@0
   570
	ENGINE_TRACE(pfnGetGameDir, P_PRE, (""));
darope@0
   571
	RETURN_META(MRES_IGNORED);
darope@0
   572
}
darope@0
   573
void Cvar_RegisterVariable(cvar_t *variable) {
darope@0
   574
	ENGINE_TRACE(pfnCvar_RegisterVariable, P_PRE, ("cvar=%s", variable->name));
darope@0
   575
	RETURN_META(MRES_IGNORED);
darope@0
   576
}
darope@0
   577
void FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds) {
darope@0
   578
	ENGINE_TRACE(pfnFadeClientVolume, P_PRE, (""));
darope@0
   579
	RETURN_META(MRES_IGNORED);
darope@0
   580
}
darope@0
   581
void SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed) {
darope@0
   582
	ENGINE_TRACE(pfnSetClientMaxspeed, P_PRE, (""));
darope@0
   583
	RETURN_META(MRES_IGNORED);
darope@0
   584
}
darope@0
   585
//! returns NULL if fake client can't be created
darope@0
   586
edict_t * CreateFakeClient(const char *netname) {
darope@0
   587
	ENGINE_TRACE(pfnCreateFakeClient, P_PRE, ("name=%s", netname));
darope@0
   588
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   589
}
darope@0
   590
void RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ) {
darope@0
   591
	ENGINE_TRACE(pfnRunPlayerMove, P_PRE, (""));
darope@0
   592
	RETURN_META(MRES_IGNORED);
darope@0
   593
}
darope@0
   594
int NumberOfEntities(void) {
darope@0
   595
	// trace output in Post
darope@0
   596
	ENGINE_TRACE(pfnNumberOfEntities, P_PRE, (""));
darope@0
   597
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   598
}
darope@0
   599
darope@0
   600
//! passing in NULL gets the serverinfo
darope@0
   601
char *GetInfoKeyBuffer(edict_t *e) {
darope@0
   602
	ENGINE_TRACE(pfnGetInfoKeyBuffer, P_PRE, (""));
darope@0
   603
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   604
}
darope@0
   605
char *InfoKeyValue(char *infobuffer, char *key) {
darope@0
   606
	ENGINE_TRACE(pfnInfoKeyValue, P_PRE, ("key=%s", key));
darope@0
   607
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   608
}
darope@0
   609
void SetKeyValue(char *infobuffer, char *key, char *value) {
darope@0
   610
	ENGINE_TRACE(pfnSetKeyValue, P_PRE, ("key=%s, value=%s", key, value));
darope@0
   611
	RETURN_META(MRES_IGNORED);
darope@0
   612
}
darope@0
   613
void SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value) {
darope@0
   614
	ENGINE_TRACE(pfnSetClientKeyValue, P_PRE, ("index=%d, key=%s, value=%s", clientIndex, key, value));
darope@0
   615
	RETURN_META(MRES_IGNORED);
darope@0
   616
}
darope@0
   617
darope@0
   618
int IsMapValid(char *filename) {
darope@0
   619
	// more trace output in Post
darope@0
   620
	ENGINE_TRACE(pfnIsMapValid, P_PRE, ("filename=%s", filename));
darope@0
   621
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   622
}
darope@0
   623
void StaticDecal( const float *origin, int decalIndex, int entityIndex, int modelIndex ) {
darope@0
   624
	ENGINE_TRACE(pfnStaticDecal, P_PRE, (""));
darope@0
   625
	RETURN_META(MRES_IGNORED);
darope@0
   626
}
darope@0
   627
int PrecacheGeneric(char *s) {
darope@0
   628
	ENGINE_TRACE(pfnPrecacheGeneric, P_PRE, ("name=%s", s));
darope@0
   629
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   630
}
darope@0
   631
//! returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
darope@0
   632
int GetPlayerUserId(edict_t *e ) {
darope@0
   633
	// more trace output in Post
darope@0
   634
	edict_t *ed = e;
darope@0
   635
	ENGINE_TRACE(pfnGetPlayerUserId, P_PRE, ("netname=%s",
darope@0
   636
				ed ? STRING(ed->v.netname) : "nil"));
darope@0
   637
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   638
}
darope@0
   639
void BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) 
darope@0
   640
{
darope@0
   641
	ENGINE_TRACE(pfnBuildSoundMsg, P_PRE, ("sample=%s", sample));
darope@0
   642
	RETURN_META(MRES_IGNORED);
darope@0
   643
}
darope@0
   644
//! is this a dedicated server?
darope@0
   645
int IsDedicatedServer(void) {
darope@0
   646
	ENGINE_TRACE(pfnIsDedicatedServer, P_PRE, (""));
darope@0
   647
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   648
}
darope@0
   649
cvar_t *CVarGetPointer(const char *szVarName) {
darope@0
   650
	ENGINE_TRACE(pfnCVarGetPointer, P_PRE, ("cvar=%s", szVarName));
darope@0
   651
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   652
}
darope@0
   653
//! returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
darope@0
   654
unsigned int GetPlayerWONId(edict_t *e) {
darope@0
   655
	// more output in Post
darope@0
   656
	edict_t *ed = e;
darope@0
   657
	ENGINE_TRACE(pfnGetPlayerWONId, P_PRE, ("netname=%s",
darope@0
   658
				ed ? STRING(ed->v.netname) : "nil"));
darope@0
   659
	RETURN_META_VALUE(MRES_IGNORED, 0U);
darope@0
   660
}
darope@0
   661
darope@0
   662
//! YWB 8/1/99 TFF Physics additions
darope@0
   663
void Info_RemoveKey( char *s, const char *key ) {
darope@0
   664
	ENGINE_TRACE(pfnInfo_RemoveKey, P_PRE, ("key=%s", key));
darope@0
   665
	RETURN_META(MRES_IGNORED);
darope@0
   666
}
darope@0
   667
const char *GetPhysicsKeyValue( const edict_t *pClient, const char *key ) {
darope@0
   668
	ENGINE_TRACE(pfnGetPhysicsKeyValue, P_PRE, ("key=%s", key));
darope@0
   669
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   670
}
darope@0
   671
void SetPhysicsKeyValue( const edict_t *pClient, const char *key, const char *value ) {
darope@0
   672
	ENGINE_TRACE(pfnSetPhysicsKeyValue, P_PRE, ("key=%s, value=%s", key, value));
darope@0
   673
	RETURN_META(MRES_IGNORED);
darope@0
   674
}
darope@0
   675
const char *GetPhysicsInfoString( const edict_t *pClient ) {
darope@0
   676
	ENGINE_TRACE(pfnGetPhysicsInfoString, P_PRE, (""));
darope@0
   677
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   678
}
darope@0
   679
unsigned short PrecacheEvent( int type, const char *psz ) {
darope@0
   680
	ENGINE_TRACE(pfnPrecacheEvent, P_PRE, ("event=%s", psz));
darope@0
   681
	RETURN_META_VALUE(MRES_IGNORED, 0U);
darope@0
   682
}
darope@0
   683
void PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ) 
darope@0
   684
{
darope@0
   685
	ENGINE_TRACE(pfnPlaybackEvent, P_PRE, (""));
darope@0
   686
	RETURN_META(MRES_IGNORED);
darope@0
   687
}
darope@0
   688
darope@0
   689
unsigned char *SetFatPVS( float *org ) {
darope@0
   690
	ENGINE_TRACE(pfnSetFatPVS, P_PRE, (""));
darope@0
   691
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   692
}
darope@0
   693
unsigned char *SetFatPAS( float *org ) {
darope@0
   694
	ENGINE_TRACE(pfnSetFatPAS, P_PRE, (""));
darope@0
   695
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   696
}
darope@0
   697
darope@0
   698
int CheckVisibility( const edict_t *entity, unsigned char *pset ) {
darope@0
   699
	ENGINE_TRACE(pfnCheckVisibility, P_PRE, (""));
darope@0
   700
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   701
}
darope@0
   702
darope@0
   703
void DeltaSetField( struct delta_s *pFields, const char *fieldname ) {
darope@0
   704
	ENGINE_TRACE(pfnDeltaSetField, P_PRE, ("field=%s", fieldname));
darope@0
   705
	RETURN_META(MRES_IGNORED);
darope@0
   706
}
darope@0
   707
void DeltaUnsetField( struct delta_s *pFields, const char *fieldname ) {
darope@0
   708
	ENGINE_TRACE(pfnDeltaUnsetField, P_PRE, ("field=%s", fieldname));
darope@0
   709
	RETURN_META(MRES_IGNORED);
darope@0
   710
}
darope@0
   711
void DeltaAddEncoder( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ) {
darope@0
   712
	ENGINE_TRACE(pfnDeltaAddEncoder, P_PRE, (""));
darope@0
   713
	RETURN_META(MRES_IGNORED);
darope@0
   714
}
darope@0
   715
int GetCurrentPlayer( void ) {
darope@0
   716
	// trace output in Post
darope@0
   717
	ENGINE_TRACE(pfnGetCurrentPlayer, P_PRE, (""));
darope@0
   718
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   719
}
darope@0
   720
int CanSkipPlayer( const edict_t *player ) {
darope@0
   721
	ENGINE_TRACE(pfnCanSkipPlayer, P_PRE, (""));
darope@0
   722
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   723
}
darope@0
   724
int DeltaFindField( struct delta_s *pFields, const char *fieldname ) {
darope@0
   725
	ENGINE_TRACE(pfnDeltaFindField, P_PRE, (""));
darope@0
   726
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   727
}
darope@0
   728
void DeltaSetFieldByIndex( struct delta_s *pFields, int fieldNumber ) {
darope@0
   729
	ENGINE_TRACE(pfnDeltaSetFieldByIndex, P_PRE, (""));
darope@0
   730
	RETURN_META(MRES_IGNORED);
darope@0
   731
}
darope@0
   732
void DeltaUnsetFieldByIndex( struct delta_s *pFields, int fieldNumber ) {
darope@0
   733
	ENGINE_TRACE(pfnDeltaUnsetFieldByIndex, P_PRE, (""));
darope@0
   734
	RETURN_META(MRES_IGNORED);
darope@0
   735
}
darope@0
   736
darope@0
   737
void SetGroupMask( int mask, int op ) {
darope@0
   738
	ENGINE_TRACE(pfnSetGroupMask, P_PRE, (""));
darope@0
   739
	RETURN_META(MRES_IGNORED);
darope@0
   740
}
darope@0
   741
darope@0
   742
int engCreateInstancedBaseline( int classname, struct entity_state_s *baseline ) {
darope@0
   743
	ENGINE_TRACE(pfnCreateInstancedBaseline, P_PRE, (""));
darope@0
   744
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   745
}
darope@0
   746
void Cvar_DirectSet( struct cvar_s *var, char *value ) {
darope@0
   747
	ENGINE_TRACE(pfnCvar_DirectSet, P_PRE, ("cvar=%s", var->name));
darope@0
   748
	RETURN_META(MRES_IGNORED);
darope@0
   749
}
darope@0
   750
darope@0
   751
//! Forces the client and server to be running with the same version of the specified file
darope@0
   752
//!( e.g., a player model ).
darope@0
   753
//! Calling this has no effect in single player
darope@0
   754
void ForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char *filename ) {
darope@0
   755
	ENGINE_TRACE(pfnForceUnmodified, P_PRE, ("file=%s", filename));
darope@0
   756
	RETURN_META(MRES_IGNORED);
darope@0
   757
}
darope@0
   758
darope@0
   759
void GetPlayerStats( const edict_t *pClient, int *ping, int *packet_loss ) {
darope@0
   760
	ENGINE_TRACE(pfnGetPlayerStats, P_PRE, ("name=%s", STRING(pClient->v.netname)));
darope@0
   761
	RETURN_META(MRES_IGNORED);
darope@0
   762
}
darope@0
   763
darope@0
   764
void AddServerCommand( char *cmd_name, void (*function) (void) ) {
darope@0
   765
	ENGINE_TRACE(pfnAddServerCommand, P_PRE, ("cmd=%s", cmd_name));
darope@0
   766
	RETURN_META(MRES_IGNORED);
darope@0
   767
}
darope@0
   768
darope@0
   769
// Added in SDK 2.2:
darope@0
   770
darope@0
   771
//! For voice communications, set which clients hear eachother.
darope@0
   772
//! NOTE: these functions take player entity indices (starting at 1).
darope@0
   773
qboolean Voice_GetClientListening(int iReceiver, int iSender) {
darope@0
   774
	ENGINE_TRACE(pfnVoice_GetClientListening, P_PRE, (""));
darope@0
   775
	RETURN_META_VALUE(MRES_IGNORED, false);
darope@0
   776
}
darope@0
   777
qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen) {
darope@0
   778
	ENGINE_TRACE(pfnVoice_SetClientListening, P_PRE, (""));
darope@0
   779
	RETURN_META_VALUE(MRES_IGNORED, false);
darope@0
   780
}
darope@0
   781
darope@0
   782
// Added for HL 1109 (no SDK update):
darope@0
   783
darope@0
   784
const char *GetPlayerAuthId(edict_t *e) {
darope@0
   785
	// trace output in Post
darope@0
   786
	ENGINE_TRACE(pfnGetPlayerAuthId, P_PRE, (""));
darope@0
   787
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   788
}
darope@0
   789
darope@0
   790
// Added 2003/11/10 (no SDK update):
darope@0
   791
darope@47
   792
sequenceEntry_s*SequenceGet(const char* fileName, const char* entryName) {
darope@0
   793
	ENGINE_TRACE(pfnSequenceGet, P_PRE, (""));
darope@0
   794
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   795
}
darope@0
   796
darope@47
   797
sentenceEntry_s *SequencePickSentence(const char* groupName, int pickMethod, int *picked) {
darope@0
   798
	ENGINE_TRACE(pfnSequencePickSentence, P_PRE, (""));
darope@0
   799
	RETURN_META_VALUE(MRES_IGNORED, NULL);
darope@0
   800
}
darope@0
   801
darope@0
   802
int GetFileSize(char *filename) {
darope@0
   803
	ENGINE_TRACE(pfnGetFileSize, P_PRE, (""));
darope@0
   804
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   805
}
darope@0
   806
darope@0
   807
unsigned int GetApproxWavePlayLen(const char *filepath) {
darope@0
   808
	ENGINE_TRACE(pfnGetApproxWavePlayLen, P_PRE, (""));
darope@0
   809
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   810
}
darope@0
   811
darope@0
   812
int IsCareerMatch(void) {
darope@0
   813
	ENGINE_TRACE(pfnIsCareerMatch, P_PRE, (""));
darope@0
   814
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   815
}
darope@0
   816
darope@0
   817
int GetLocalizedStringLength(const char *label) {
darope@0
   818
	ENGINE_TRACE(pfnGetLocalizedStringLength, P_PRE, (""));
darope@0
   819
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   820
}
darope@0
   821
darope@0
   822
void RegisterTutorMessageShown(int mid) {
darope@0
   823
	ENGINE_TRACE(pfnRegisterTutorMessageShown, P_PRE, (""));
darope@0
   824
	RETURN_META(MRES_IGNORED);
darope@0
   825
}
darope@0
   826
darope@0
   827
int GetTimesTutorMessageShown(int mid) {
darope@0
   828
	ENGINE_TRACE(pfnGetTimesTutorMessageShown, P_PRE, (""));
darope@0
   829
	RETURN_META_VALUE(MRES_IGNORED, 0);
darope@0
   830
}
darope@0
   831
darope@0
   832
void ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength) {
darope@0
   833
	ENGINE_TRACE(pfnProcessTutorMessageDecayBuffer, P_PRE, (""));
darope@0
   834
	RETURN_META(MRES_IGNORED);
darope@0
   835
}
darope@0
   836
darope@0
   837
void ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength) {
darope@0
   838
	ENGINE_TRACE(pfnConstructTutorMessageDecayBuffer, P_PRE, (""));
darope@0
   839
	RETURN_META(MRES_IGNORED);
darope@0
   840
}
darope@0
   841
darope@0
   842
void ResetTutorMessageDecayData(void) {
darope@0
   843
	ENGINE_TRACE(pfnResetTutorMessageDecayData, P_PRE, (""));
darope@0
   844
	RETURN_META(MRES_IGNORED);
darope@0
   845
}
darope@0
   846
darope@0
   847
enginefuncs_t meta_engfuncs = {
darope@0
   848
	PrecacheModel,			// pfnPrecacheModel()
darope@0
   849
	PrecacheSound,			// pfnPrecacheSound()
darope@0
   850
	SetModel,				// pfnSetModel()
darope@0
   851
	ModelIndex,				// pfnModelIndex()
darope@0
   852
	ModelFrames,			// pfnModelFrames()
darope@0
   853
darope@0
   854
	SetSize,				// pfnSetSize()
darope@0
   855
	ChangeLevel,			// pfnChangeLevel()
darope@0
   856
	GetSpawnParms,			// pfnGetSpawnParms()
darope@0
   857
	SaveSpawnParms,			// pfnSaveSpawnParms()
darope@0
   858
darope@0
   859
	VecToYaw,				// pfnVecToYaw()
darope@0
   860
	VecToAngles,			// pfnVecToAngles()
darope@0
   861
	MoveToOrigin,			// pfnMoveToOrigin()
darope@0
   862
	ChangeYaw,				// pfnChangeYaw()
darope@0
   863
	ChangePitch,			// pfnChangePitch()
darope@0
   864
darope@0
   865
	FindEntityByString,		// pfnFindEntityByString()
darope@0
   866
	GetEntityIllum,			// pfnGetEntityIllum()
darope@0
   867
	FindEntityInSphere,		// pfnFindEntityInSphere()
darope@0
   868
	FindClientInPVS,		// pfnFindClientInPVS()
darope@0
   869
	EntitiesInPVS,			// pfnEntitiesInPVS()
darope@0
   870
darope@0
   871
	MakeVectors,			// pfnMakeVectors()
darope@0
   872
	AngleVectors,			// pfnAngleVectors()
darope@0
   873
darope@0
   874
	CreateEntity,			// pfnCreateEntity()
darope@0
   875
	RemoveEntity,			// pfnRemoveEntity()
darope@0
   876
	CreateNamedEntity,		// pfnCreateNamedEntity()
darope@0
   877
darope@0
   878
	MakeStatic,				// pfnMakeStatic()
darope@0
   879
	EntIsOnFloor,			// pfnEntIsOnFloor()
darope@0
   880
	DropToFloor,			// pfnDropToFloor()
darope@0
   881
darope@0
   882
	WalkMove,				// pfnWalkMove()
darope@0
   883
	SetOrigin,				// pfnSetOrigin()
darope@0
   884
darope@0
   885
	EmitSound,				// pfnEmitSound()
darope@0
   886
	EmitAmbientSound,		// pfnEmitAmbientSound()
darope@0
   887
darope@0
   888
	TraceLine,				// pfnTraceLine()
darope@0
   889
	TraceToss,				// pfnTraceToss()
darope@0
   890
	TraceMonsterHull,		// pfnTraceMonsterHull()
darope@0
   891
	TraceHull,				// pfnTraceHull()
darope@0
   892
	TraceModel,				// pfnTraceModel()
darope@0
   893
	TraceTexture,			// pfnTraceTexture()
darope@0
   894
	TraceSphere,			// pfnTraceSphere()
darope@0
   895
	GetAimVector,			// pfnGetAimVector()
darope@0
   896
darope@0
   897
	ServerCommand,			// pfnServerCommand()
darope@0
   898
	ServerExecute,			// pfnServerExecute()
darope@0
   899
	engClientCommand,		// pfnClientCommand()	// d'oh, ClientCommand in dllapi too
darope@0
   900
darope@0
   901
	ParticleEffect,			// pfnParticleEffect()
darope@0
   902
	LightStyle,				// pfnLightStyle()
darope@0
   903
	DecalIndex,				// pfnDecalIndex()
darope@0
   904
	PointContents,			// pfnPointContents()
darope@0
   905
darope@0
   906
	MessageBegin,			// pfnMessageBegin()
darope@0
   907
	MessageEnd,				// pfnMessageEnd()
darope@0
   908
darope@0
   909
	WriteByte,				// pfnWriteByte()
darope@0
   910
	WriteChar,				// pfnWriteChar()
darope@0
   911
	WriteShort,				// pfnWriteShort()
darope@0
   912
	WriteLong,				// pfnWriteLong()
darope@0
   913
	WriteAngle,				// pfnWriteAngle()
darope@0
   914
	WriteCoord,				// pfnWriteCoord()
darope@0
   915
	WriteString,			// pfnWriteString()
darope@0
   916
	WriteEntity,			// pfnWriteEntity()
darope@0
   917
darope@0
   918
	CVarRegister,			// pfnCVarRegister()
darope@0
   919
	CVarGetFloat,			// pfnCVarGetFloat()
darope@0
   920
	CVarGetString,			// pfnCVarGetString()
darope@0
   921
	CVarSetFloat,			// pfnCVarSetFloat()
darope@0
   922
	CVarSetString,			// pfnCVarSetString()
darope@0
   923
darope@0
   924
	AlertMessage,			// pfnAlertMessage()
darope@0
   925
	EngineFprintf,			// pfnEngineFprintf()
darope@0
   926
darope@0
   927
	PvAllocEntPrivateData,	// pfnPvAllocEntPrivateData()
darope@0
   928
	PvEntPrivateData,		// pfnPvEntPrivateData()
darope@0
   929
	FreeEntPrivateData,		// pfnFreeEntPrivateData()
darope@0
   930
darope@0
   931
	SzFromIndex,			// pfnSzFromIndex()
darope@0
   932
	AllocString,			// pfnAllocString()
darope@0
   933
darope@0
   934
	GetVarsOfEnt, 			// pfnGetVarsOfEnt()
darope@0
   935
	PEntityOfEntOffset,		// pfnPEntityOfEntOffset()
darope@0
   936
	EntOffsetOfPEntity,		// pfnEntOffsetOfPEntity()
darope@0
   937
	IndexOfEdict,			// pfnIndexOfEdict()
darope@0
   938
	PEntityOfEntIndex,		// pfnPEntityOfEntIndex()
darope@0
   939
	FindEntityByVars,		// pfnFindEntityByVars()
darope@0
   940
	GetModelPtr,			// pfnGetModelPtr()
darope@0
   941
darope@0
   942
	RegUserMsg,				// pfnRegUserMsg()
darope@0
   943
darope@0
   944
	AnimationAutomove,		// pfnAnimationAutomove()
darope@0
   945
	GetBonePosition,		// pfnGetBonePosition()
darope@0
   946
darope@0
   947
	FunctionFromName,		// pfnFunctionFromName()
darope@0
   948
	NameForFunction,		// pfnNameForFunction()
darope@0
   949
darope@0
   950
	ClientPrintf,			// pfnClientPrintf()			//! JOHN: engine callbacks so game DLL can print messages to individual clients
darope@0
   951
	ServerPrint,			// pfnServerPrint()
darope@0
   952
darope@0
   953
	Cmd_Args,				// pfnCmd_Args()				//! these 3 added 
darope@0
   954
	Cmd_Argv,				// pfnCmd_Argv()				//! so game DLL can easily 
darope@0
   955
	Cmd_Argc,				// pfnCmd_Argc()				//! access client 'cmd' strings
darope@0
   956
darope@0
   957
	GetAttachment,			// pfnGetAttachment()
darope@0
   958
darope@0
   959
	CRC32_Init,				// pfnCRC32_Init()
darope@0
   960
	CRC32_ProcessBuffer,	// pfnCRC32_ProcessBuffer()
darope@0
   961
	CRC32_ProcessByte,		// pfnCRC32_ProcessByte()
darope@0
   962
	CRC32_Final,			// pfnCRC32_Final()
darope@0
   963
darope@0
   964
	RandomLong,				// pfnRandomLong()
darope@0
   965
	RandomFloat,			// pfnRandomFloat()
darope@0
   966
darope@0
   967
	SetView,				// pfnSetView()
darope@0
   968
	Time,					// pfnTime()
darope@0
   969
	CrosshairAngle,			// pfnCrosshairAngle()
darope@0
   970
darope@0
   971
	LoadFileForMe,			// pfnLoadFileForMe()
darope@0
   972
	FreeFile,				// pfnFreeFile()
darope@0
   973
darope@0
   974
	EndSection,				// pfnEndSection()				//! trigger_endsection
darope@0
   975
	CompareFileTime,		// pfnCompareFileTime()
darope@0
   976
	GetGameDir,				// pfnGetGameDir()
darope@0
   977
	Cvar_RegisterVariable,	// pfnCvar_RegisterVariable()
darope@0
   978
	FadeClientVolume,		// pfnFadeClientVolume()
darope@0
   979
	SetClientMaxspeed,		// pfnSetClientMaxspeed()
darope@0
   980
	CreateFakeClient,		// pfnCreateFakeClient() 		//! returns NULL if fake client can't be created
darope@0
   981
	RunPlayerMove,			// pfnRunPlayerMove()
darope@0
   982
	NumberOfEntities,		// pfnNumberOfEntities()
darope@0
   983
darope@0
   984
	GetInfoKeyBuffer,		// pfnGetInfoKeyBuffer()		//! passing in NULL gets the serverinfo
darope@0
   985
	InfoKeyValue,			// pfnInfoKeyValue()
darope@0
   986
	SetKeyValue,			// pfnSetKeyValue()
darope@0
   987
	SetClientKeyValue,		// pfnSetClientKeyValue()
darope@0
   988
darope@0
   989
	IsMapValid,				// pfnIsMapValid()
darope@0
   990
	StaticDecal,			// pfnStaticDecal()
darope@0
   991
	PrecacheGeneric,		// pfnPrecacheGeneric()
darope@0
   992
	GetPlayerUserId, 		// pfnGetPlayerUserId()			//! returns the server assigned userid for this player.
darope@0
   993
	BuildSoundMsg,			// pfnBuildSoundMsg()
darope@0
   994
	IsDedicatedServer,		// pfnIsDedicatedServer()		//! is this a dedicated server?
darope@0
   995
	CVarGetPointer,			// pfnCVarGetPointer()
darope@0
   996
	GetPlayerWONId,			// pfnGetPlayerWONId()			//! returns the server assigned WONid for this player.
darope@0
   997
darope@0
   998
	//! YWB 8/1/99 TFF Physics additions
darope@0
   999
	Info_RemoveKey,			// pfnInfo_RemoveKey()
darope@0
  1000
	GetPhysicsKeyValue,		// pfnGetPhysicsKeyValue()
darope@0
  1001
	SetPhysicsKeyValue,		// pfnSetPhysicsKeyValue()
darope@0
  1002
	GetPhysicsInfoString,	// pfnGetPhysicsInfoString()
darope@0
  1003
	PrecacheEvent,			// pfnPrecacheEvent()
darope@0
  1004
	PlaybackEvent,			// pfnPlaybackEvent()
darope@0
  1005
darope@0
  1006
	SetFatPVS,				// pfnSetFatPVS()
darope@0
  1007
	SetFatPAS,				// pfnSetFatPAS()
darope@0
  1008
darope@0
  1009
	CheckVisibility,		// pfnCheckVisibility()
darope@0
  1010
darope@0
  1011
	DeltaSetField,			// pfnDeltaSetField()
darope@0
  1012
	DeltaUnsetField,		// pfnDeltaUnsetField()
darope@0
  1013
	DeltaAddEncoder,		// pfnDeltaAddEncoder()
darope@0
  1014
	GetCurrentPlayer,		// pfnGetCurrentPlayer()
darope@0
  1015
	CanSkipPlayer,			// pfnCanSkipPlayer()
darope@0
  1016
	DeltaFindField,			// pfnDeltaFindField()
darope@0
  1017
	DeltaSetFieldByIndex,	// pfnDeltaSetFieldByIndex()
darope@0
  1018
	DeltaUnsetFieldByIndex,	// pfnDeltaUnsetFieldByIndex()
darope@0
  1019
darope@0
  1020
	SetGroupMask,			// pfnSetGroupMask()
darope@0
  1021
darope@0
  1022
	engCreateInstancedBaseline, // pfnCreateInstancedBaseline()		// d'oh, CreateInstancedBaseline in dllapi too
darope@0
  1023
	Cvar_DirectSet,			// pfnCvar_DirectSet()
darope@0
  1024
darope@0
  1025
	ForceUnmodified,		// pfnForceUnmodified()
darope@0
  1026
darope@0
  1027
	GetPlayerStats,			// pfnGetPlayerStats()
darope@0
  1028
darope@0
  1029
	AddServerCommand,		// pfnAddServerCommand()
darope@0
  1030
darope@0
  1031
	// Added in SDK 2.2:
darope@0
  1032
	Voice_GetClientListening,	// pfnVoice_GetClientListening()
darope@0
  1033
	Voice_SetClientListening,	// pfnVoice_SetClientListening()
darope@0
  1034
darope@0
  1035
	// Added for HL 1109 (no SDK update):
darope@0
  1036
	GetPlayerAuthId,		// pfnGetPlayerAuthId()
darope@0
  1037
darope@0
  1038
	// Added 2003/11/10 (no SDK update):
darope@0
  1039
	SequenceGet,					// pfnSequenceGet()
darope@0
  1040
	SequencePickSentence,			// pfnSequencePickSentence()
darope@0
  1041
	GetFileSize,					// pfnGetFileSize()
darope@0
  1042
	GetApproxWavePlayLen,			// pfnGetApproxWavePlayLen()
darope@0
  1043
	IsCareerMatch,					// pfnIsCareerMatch()
darope@0
  1044
	GetLocalizedStringLength,		// pfnGetLocalizedStringLength()
darope@0
  1045
	RegisterTutorMessageShown,		// pfnRegisterTutorMessageShown()
darope@0
  1046
	GetTimesTutorMessageShown,		// pfnGetTimesTutorMessageShown()
darope@0
  1047
	ProcessTutorMessageDecayBuffer,	// pfnProcessTutorMessageDecayBuffer()
darope@0
  1048
	ConstructTutorMessageDecayBuffer,	// pfnConstructTutorMessageDecayBuffer()
darope@0
  1049
	ResetTutorMessageDecayData,		// pfnResetTutorMessageDecayData()
darope@0
  1050
};
darope@0
  1051
darope@0
  1052
C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, 
darope@0
  1053
		int *interfaceVersion) 
darope@0
  1054
{
darope@0
  1055
	LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", 
darope@0
  1056
			*interfaceVersion);
darope@0
  1057
	if(!pengfuncsFromEngine) {
darope@0
  1058
		LOG_ERROR(PLID, 
darope@0
  1059
				"GetEngineFunctions called with null pengfuncsFromEngine");
darope@0
  1060
		return(FALSE);
darope@0
  1061
	}
darope@0
  1062
	else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) {
darope@0
  1063
		LOG_ERROR(PLID, 
darope@0
  1064
				"GetEngineFunctions version mismatch; requested=%d ours=%d", 
darope@0
  1065
				*interfaceVersion, ENGINE_INTERFACE_VERSION);
darope@0
  1066
		// Tell metamod what version we had, so it can figure out who is 
darope@0
  1067
		// out of date.
darope@0
  1068
		*interfaceVersion = ENGINE_INTERFACE_VERSION;
darope@0
  1069
		return(FALSE);
darope@0
  1070
	}
darope@0
  1071
	memcpy(pengfuncsFromEngine, &meta_engfuncs, sizeof(enginefuncs_t));
darope@0
  1072
	return TRUE;
darope@0
  1073
}