darope@0: // vi: set ts=4 sw=4 : darope@0: // vim: set tw=75 : darope@0: darope@0: // engine_api.cpp - implementation of Half-Life engine functions 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: darope@0: #include "engine_api.h" darope@0: #include "meta_api.h" darope@0: #include "trace_api.h" darope@0: #include "support_meta.h" // MAX_STRBUF_LEN darope@0: #include "log_plugin.h" darope@0: darope@0: int PrecacheModel(char *s) { darope@0: ENGINE_TRACE(pfnPrecacheModel, P_PRE, ("model=%s", s)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int PrecacheSound(char *s) { darope@0: ENGINE_TRACE(pfnPrecacheSound, P_PRE, ("sound=%s", s)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void SetModel(edict_t *e, const char *m) { darope@0: edict_t *ed = e; darope@0: ENGINE_TRACE(pfnSetModel, P_PRE, ("classname=%s netname=%s model=%s", darope@0: ed ? STRING(ed->v.classname) : "nil", darope@0: ed ? STRING(ed->v.netname) : "nil", darope@0: m)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int ModelIndex(const char *m) { darope@0: ENGINE_TRACE(pfnModelIndex, P_PRE, ("model=%s", m)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int ModelFrames(int modelIndex) { darope@0: ENGINE_TRACE(pfnModelFrames, P_PRE, ("index=%d", modelIndex)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: void SetSize(edict_t *e, const float *rgflMin, const float *rgflMax) { darope@0: ENGINE_TRACE(pfnSetSize, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ChangeLevel(char *s1, char *s2) { darope@0: ENGINE_TRACE(pfnChangeLevel, P_PRE, ("s1=%s, s2=%s", s1, s2)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void GetSpawnParms(edict_t *ent) { darope@0: ENGINE_TRACE(pfnGetSpawnParms, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void SaveSpawnParms(edict_t *ent) { darope@0: ENGINE_TRACE(pfnSaveSpawnParms, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: float VecToYaw(const float *rgflVector) { darope@0: ENGINE_TRACE(pfnVecToYaw, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0.0); darope@0: } darope@0: void VecToAngles(const float *rgflVectorIn, float *rgflVectorOut) { darope@0: ENGINE_TRACE(pfnVecToAngles, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType) { darope@0: ENGINE_TRACE(pfnMoveToOrigin, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ChangeYaw(edict_t *ent) { darope@0: ENGINE_TRACE(pfnChangeYaw, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ChangePitch(edict_t *ent) { darope@0: ENGINE_TRACE(pfnChangePitch, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue) { darope@0: edict_t *ed=pEdictStartSearchAfter; darope@0: ENGINE_TRACE(pfnFindEntityByString, P_PRE, ("start=%s field=%s value=%s", darope@0: ed ? STRING(ed->v.classname) : "nil", pszField, pszValue)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: int GetEntityIllum(edict_t *pEnt) { darope@0: ENGINE_TRACE(pfnGetEntityIllum, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad) { darope@0: ENGINE_TRACE(pfnFindEntityInSphere, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: edict_t *FindClientInPVS(edict_t *pEdict) { darope@0: ENGINE_TRACE(pfnFindClientInPVS, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: edict_t *EntitiesInPVS(edict_t *pplayer) { darope@0: ENGINE_TRACE(pfnEntitiesInPVS, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: darope@0: void MakeVectors(const float *rgflVector) { darope@0: ENGINE_TRACE(pfnMakeVectors, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void AngleVectors(const float *rgflVector, float *forward, float *right, float *up) { darope@0: ENGINE_TRACE(pfnAngleVectors, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: edict_t *CreateEntity(void) { darope@0: ENGINE_TRACE(pfnCreateEntity, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void RemoveEntity(edict_t *e) { darope@0: ENGINE_TRACE(pfnRemoveEntity, P_PRE, ("name=%s", STRING(e->v.classname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: edict_t *CreateNamedEntity(int className) { darope@0: ENGINE_TRACE(pfnCreateNamedEntity, P_PRE, ("name=%s", STRING(className))); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: darope@0: void MakeStatic(edict_t *ent) { darope@0: ENGINE_TRACE(pfnMakeStatic, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int EntIsOnFloor(edict_t *e) { darope@0: ENGINE_TRACE(pfnEntIsOnFloor, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int DropToFloor(edict_t *e) { darope@0: ENGINE_TRACE(pfnDropToFloor, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: int WalkMove(edict_t *ent, float yaw, float dist, int iMode) { darope@0: ENGINE_TRACE(pfnWalkMove, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void SetOrigin(edict_t *e, const float *rgflOrigin) { darope@0: edict_t *ed = e; darope@0: ENGINE_TRACE(pfnSetOrigin, 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: darope@0: void EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) { darope@0: ENGINE_TRACE(pfnEmitSound, P_PRE, ("sample=%s", sample)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch) { darope@0: ENGINE_TRACE(pfnEmitAmbientSound, P_PRE, ("sample=%s", samp)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) { darope@0: ENGINE_TRACE(pfnTraceLine, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr) { darope@0: ENGINE_TRACE(pfnTraceToss, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) { darope@0: ENGINE_TRACE(pfnTraceMonsterHull, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr) { darope@0: ENGINE_TRACE(pfnTraceHull, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr) { darope@0: ENGINE_TRACE(pfnTraceModel, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: const char *TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ) { darope@0: ENGINE_TRACE(pfnTraceTexture, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr) { darope@0: ENGINE_TRACE(pfnTraceSphere, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void GetAimVector(edict_t *ent, float speed, float *rgflReturn) { darope@0: ENGINE_TRACE(pfnGetAimVector, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void ServerCommand(char *str) { darope@0: ENGINE_TRACE(pfnServerCommand, P_PRE, ("cmd=%s", str)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ServerExecute(void) { darope@0: ENGINE_TRACE(pfnServerExecute, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void engClientCommand(edict_t *pEdict, char *szFmt, ...) { darope@0: va_list ap; darope@0: char buf[1024]; darope@0: char *cp; darope@0: va_start(ap, szFmt); darope@0: vsnprintf(buf, sizeof(buf), szFmt, ap); darope@0: va_end(ap); darope@0: cp=buf+strlen(buf)-1; darope@0: if(*cp=='\n') *cp='\0'; darope@0: ENGINE_TRACE(pfnClientCommand, P_PRE, ("cmd='%s'", buf)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void ParticleEffect(const float *org, const float *dir, float color, float count) { darope@0: ENGINE_TRACE(pfnParticleEffect, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void LightStyle(int style, char *val) { darope@0: ENGINE_TRACE(pfnLightStyle, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int DecalIndex(const char *name) { darope@0: ENGINE_TRACE(pfnDecalIndex, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int PointContents(const float *rgflVector) { darope@0: ENGINE_TRACE(pfnPointContents, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) { darope@0: const char *name, *dest; darope@0: name=GET_USER_MSG_NAME(PLID, msg_type, NULL); darope@0: if(!name) name="unknown"; darope@0: dest=msg_dest_types[msg_dest]; darope@0: if(!dest) dest="unknown"; darope@0: ENGINE_TRACE(pfnMessageBegin, P_PRE, ("type=%s(%d), dest=%s(%d), classname=%s netname=%s", name, msg_type, dest, msg_dest, 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 MessageEnd(void) { darope@0: ENGINE_TRACE(pfnMessageEnd, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void WriteByte(int iValue) { darope@0: ENGINE_TRACE(pfnWriteByte, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void WriteChar(int iValue) { darope@0: ENGINE_TRACE(pfnWriteChar, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void WriteShort(int iValue) { darope@0: ENGINE_TRACE(pfnWriteShort, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void WriteLong(int iValue) { darope@0: ENGINE_TRACE(pfnWriteLong, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void WriteAngle(float flValue) { darope@0: ENGINE_TRACE(pfnWriteAngle, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void WriteCoord(float flValue) { darope@0: ENGINE_TRACE(pfnWriteCoord, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void WriteString(const char *sz) { darope@0: ENGINE_TRACE(pfnWriteString, P_PRE, ("string=%s", sz)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void WriteEntity(int iValue) { darope@0: ENGINE_TRACE(pfnWriteEntity, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void CVarRegister(cvar_t *pCvar) { darope@0: ENGINE_TRACE(pfnCVarRegister, P_PRE, ("cvar=%s", pCvar->name)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: float CVarGetFloat(const char *szVarName) { darope@0: // more trace output in Post darope@0: ENGINE_TRACE(pfnCVarGetFloat, P_PRE, ("cvar=%s", szVarName)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0.0); darope@0: } darope@0: const char *CVarGetString(const char *szVarName) { darope@0: // more trace output in Post darope@0: ENGINE_TRACE(pfnCVarGetString, P_PRE, ("cvar=%s", szVarName)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void CVarSetFloat(const char *szVarName, float flValue) { darope@0: ENGINE_TRACE(pfnCVarSetFloat, P_PRE, ("cvar=%s, val=%f", szVarName, flValue)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void CVarSetString(const char *szVarName, const char *szValue) { darope@0: ENGINE_TRACE(pfnCVarSetString, P_PRE, ("cvar=%s, val=%s", szVarName, szValue)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void AlertMessage(ALERT_TYPE atype, char *szFmt, ...) { darope@0: char *astr; darope@0: va_list ap; darope@0: char buf[MAX_STRBUF_LEN]; darope@0: switch(atype) { darope@0: case at_notice: darope@0: astr="at_notice"; darope@0: break; darope@0: case at_console: darope@0: astr="at_console"; darope@0: break; darope@0: case at_aiconsole: darope@0: astr="at_aiconsole"; darope@0: break; darope@0: case at_warning: darope@0: astr="at_warning"; darope@0: break; darope@0: case at_error: darope@0: astr="at_error"; darope@0: break; darope@0: case at_logged: darope@0: astr="at_logged"; darope@0: break; darope@0: default: darope@0: astr="unknown"; darope@0: break; darope@0: } darope@0: va_start(ap, szFmt); darope@0: vsnprintf(buf, sizeof(buf), szFmt, ap); darope@0: va_end(ap); darope@0: ENGINE_TRACE(pfnAlertMessage, P_PRE, ("atype=%s(%d) msg=%s", astr, darope@0: atype, buf)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: void EngineFprintf(FILE *pfile, char *szFmt, ...) { darope@47: #else darope@47: void EngineFprintf(void *pfile, char *szFmt, ...) { darope@47: #endif darope@0: va_list ap; darope@0: char buf[1024]; darope@0: va_start(ap, szFmt); darope@0: vsnprintf(buf, sizeof(buf), szFmt, ap); darope@0: va_end(ap); darope@0: ENGINE_TRACE(pfnEngineFprintf, P_PRE, ("line=%s", buf)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: void *PvAllocEntPrivateData(edict_t *pEdict, long cb) { darope@47: #else darope@47: void *PvAllocEntPrivateData(edict_t *pEdict, int32 cb) { darope@47: #endif darope@0: ENGINE_TRACE(pfnPvAllocEntPrivateData, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void *PvEntPrivateData(edict_t *pEdict) { darope@0: ENGINE_TRACE(pfnPvEntPrivateData, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void FreeEntPrivateData(edict_t *pEdict) { darope@0: ENGINE_TRACE(pfnFreeEntPrivateData, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: const char *SzFromIndex(int iString) { darope@0: ENGINE_TRACE(pfnSzFromIndex, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: int AllocString(const char *szValue) { darope@0: // more trace output in Post darope@0: ENGINE_TRACE(pfnAllocString, P_PRE, ("str=%s", szValue)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: struct entvars_s *GetVarsOfEnt(edict_t *pEdict) { darope@0: ENGINE_TRACE(pfnGetVarsOfEnt, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: edict_t *PEntityOfEntOffset(int iEntOffset) { darope@0: ENGINE_TRACE(pfnPEntityOfEntOffset, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: int EntOffsetOfPEntity(const edict_t *pEdict) { darope@0: const edict_t *ed=pEdict; darope@0: ENGINE_TRACE(pfnEntOffsetOfPEntity, 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_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int IndexOfEdict(const edict_t *pEdict) { darope@0: ENGINE_TRACE(pfnIndexOfEdict, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: edict_t *PEntityOfEntIndex(int iEntIndex) { darope@0: ENGINE_TRACE(pfnPEntityOfEntIndex, P_PRE, ("index=%d", iEntIndex)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: edict_t *FindEntityByVars(struct entvars_s *pvars) { darope@0: ENGINE_TRACE(pfnFindEntityByVars, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void *GetModelPtr(edict_t *pEdict) { darope@0: ENGINE_TRACE(pfnGetModelPtr, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: darope@0: int RegUserMsg(const char *pszName, int iSize) { darope@0: // more trace output in Post darope@0: ENGINE_TRACE(pfnRegUserMsg, P_PRE, ("msg=%s size=%d", pszName, iSize)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: void AnimationAutomove(const edict_t *pEdict, float flTime) { darope@0: ENGINE_TRACE(pfnAnimationAutomove, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles ) { darope@0: ENGINE_TRACE(pfnGetBonePosition, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: unsigned long FunctionFromName( const char *pName ) { darope@47: #else darope@47: uint32 FunctionFromName( const char *pName ) { darope@47: #endif darope@0: ENGINE_TRACE(pfnFunctionFromName, P_PRE, ("name=%s", pName)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0UL); darope@0: } darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: const char *NameForFunction( unsigned long function ) { darope@47: #else darope@47: const char *NameForFunction( uint32 function ) { darope@47: #endif darope@0: ENGINE_TRACE(pfnNameForFunction, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: darope@0: //! JOHN: engine callbacks so game DLL can print messages to individual clients darope@0: void ClientPrintf( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ) { darope@0: ENGINE_TRACE(pfnClientPrintf, P_PRE, ("msg=%s", szMsg)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void ServerPrint( const char *szMsg ) { darope@0: ENGINE_TRACE(pfnServerPrint, P_PRE, ("msg=%s", szMsg)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: //! these 3 added so game DLL can easily access client 'cmd' strings darope@0: const char *Cmd_Args( void ) { darope@0: // trace output in Post darope@0: ENGINE_TRACE(pfnCmd_Args, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: const char *Cmd_Argv( int argc ) { darope@0: // more trace output in Post darope@0: ENGINE_TRACE(pfnCmd_Argv, P_PRE, ("argc=%d", argc)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: int Cmd_Argc( void ) { darope@0: // trace output in Post darope@0: ENGINE_TRACE(pfnCmd_Argc, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: void GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ) { darope@0: ENGINE_TRACE(pfnGetAttachment, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void CRC32_Init(CRC32_t *pulCRC) { darope@0: ENGINE_TRACE(pfnCRC32_Init, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len) { darope@0: ENGINE_TRACE(pfnCRC32_ProcessBuffer, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch) { darope@0: ENGINE_TRACE(pfnCRC32_ProcessByte, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: CRC32_t CRC32_Final(CRC32_t pulCRC) { darope@0: ENGINE_TRACE(pfnCRC32_Final, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: long RandomLong(long lLow, long lHigh) { darope@47: #else darope@47: int32 RandomLong(int32 lLow, int32 lHigh) { darope@47: #endif darope@0: // more output in Post darope@0: ENGINE_TRACE(pfnRandomLong, P_PRE, ("low=%ld, high=%ld", lLow, lHigh)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0L); darope@0: } darope@0: float RandomFloat(float flLow, float flHigh) { darope@0: // more output in Post darope@0: ENGINE_TRACE(pfnRandomFloat, P_PRE, ("low=%f, high=%f", flLow, flHigh)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0.0); darope@0: } darope@0: darope@0: void SetView(const edict_t *pClient, const edict_t *pViewent ) { darope@0: ENGINE_TRACE(pfnSetView, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: float Time( void ) { darope@0: // trace output in Post darope@0: ENGINE_TRACE(pfnTime, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0.0); darope@0: } darope@0: void CrosshairAngle(const edict_t *pClient, float pitch, float yaw) { darope@0: ENGINE_TRACE(pfnCrosshairAngle, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: byte *LoadFileForMe(char *filename, int *pLength) { darope@0: ENGINE_TRACE(pfnLoadFileForMe, P_PRE, ("file=%s", filename)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void FreeFile(void *buffer) { darope@0: ENGINE_TRACE(pfnFreeFile, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: //! trigger_endsection darope@0: void EndSection(const char *pszSectionName) { darope@0: ENGINE_TRACE(pfnEndSection, P_PRE, ("section=%s", pszSectionName)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int CompareFileTime(char *filename1, char *filename2, int *iCompare) { darope@0: ENGINE_TRACE(pfnCompareFileTime, P_PRE, ("file1=%s, file2=%s", filename1, filename2)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void GetGameDir(char *szGetGameDir) { darope@0: // trace output in Post darope@0: ENGINE_TRACE(pfnGetGameDir, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void Cvar_RegisterVariable(cvar_t *variable) { darope@0: ENGINE_TRACE(pfnCvar_RegisterVariable, P_PRE, ("cvar=%s", variable->name)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds) { darope@0: ENGINE_TRACE(pfnFadeClientVolume, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed) { darope@0: ENGINE_TRACE(pfnSetClientMaxspeed, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: //! returns NULL if fake client can't be created darope@0: edict_t * CreateFakeClient(const char *netname) { darope@0: ENGINE_TRACE(pfnCreateFakeClient, P_PRE, ("name=%s", netname)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ) { darope@0: ENGINE_TRACE(pfnRunPlayerMove, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int NumberOfEntities(void) { darope@0: // trace output in Post darope@0: ENGINE_TRACE(pfnNumberOfEntities, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: //! passing in NULL gets the serverinfo darope@0: char *GetInfoKeyBuffer(edict_t *e) { darope@0: ENGINE_TRACE(pfnGetInfoKeyBuffer, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: char *InfoKeyValue(char *infobuffer, char *key) { darope@0: ENGINE_TRACE(pfnInfoKeyValue, P_PRE, ("key=%s", key)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void SetKeyValue(char *infobuffer, char *key, char *value) { darope@0: ENGINE_TRACE(pfnSetKeyValue, P_PRE, ("key=%s, value=%s", key, value)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value) { darope@0: ENGINE_TRACE(pfnSetClientKeyValue, P_PRE, ("index=%d, key=%s, value=%s", clientIndex, key, value)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: int IsMapValid(char *filename) { darope@0: // more trace output in Post darope@0: ENGINE_TRACE(pfnIsMapValid, P_PRE, ("filename=%s", filename)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void StaticDecal( const float *origin, int decalIndex, int entityIndex, int modelIndex ) { darope@0: ENGINE_TRACE(pfnStaticDecal, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int PrecacheGeneric(char *s) { darope@0: ENGINE_TRACE(pfnPrecacheGeneric, P_PRE, ("name=%s", s)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: //! 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: int GetPlayerUserId(edict_t *e ) { darope@0: // more trace output in Post darope@0: edict_t *ed = e; darope@0: ENGINE_TRACE(pfnGetPlayerUserId, P_PRE, ("netname=%s", darope@0: ed ? STRING(ed->v.netname) : "nil")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: 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: { darope@0: ENGINE_TRACE(pfnBuildSoundMsg, P_PRE, ("sample=%s", sample)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: //! is this a dedicated server? darope@0: int IsDedicatedServer(void) { darope@0: ENGINE_TRACE(pfnIsDedicatedServer, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: cvar_t *CVarGetPointer(const char *szVarName) { darope@0: ENGINE_TRACE(pfnCVarGetPointer, P_PRE, ("cvar=%s", szVarName)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: //! 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: unsigned int GetPlayerWONId(edict_t *e) { darope@0: // more output in Post darope@0: edict_t *ed = e; darope@0: ENGINE_TRACE(pfnGetPlayerWONId, P_PRE, ("netname=%s", darope@0: ed ? STRING(ed->v.netname) : "nil")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0U); darope@0: } darope@0: darope@0: //! YWB 8/1/99 TFF Physics additions darope@0: void Info_RemoveKey( char *s, const char *key ) { darope@0: ENGINE_TRACE(pfnInfo_RemoveKey, P_PRE, ("key=%s", key)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: const char *GetPhysicsKeyValue( const edict_t *pClient, const char *key ) { darope@0: ENGINE_TRACE(pfnGetPhysicsKeyValue, P_PRE, ("key=%s", key)); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: void SetPhysicsKeyValue( const edict_t *pClient, const char *key, const char *value ) { darope@0: ENGINE_TRACE(pfnSetPhysicsKeyValue, P_PRE, ("key=%s, value=%s", key, value)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: const char *GetPhysicsInfoString( const edict_t *pClient ) { darope@0: ENGINE_TRACE(pfnGetPhysicsInfoString, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: unsigned short PrecacheEvent( int type, const char *psz ) { darope@0: ENGINE_TRACE(pfnPrecacheEvent, P_PRE, ("event=%s", psz)); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0U); darope@0: } darope@0: 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: { darope@0: ENGINE_TRACE(pfnPlaybackEvent, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: unsigned char *SetFatPVS( float *org ) { darope@0: ENGINE_TRACE(pfnSetFatPVS, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: unsigned char *SetFatPAS( float *org ) { darope@0: ENGINE_TRACE(pfnSetFatPAS, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: darope@0: int CheckVisibility( const edict_t *entity, unsigned char *pset ) { darope@0: ENGINE_TRACE(pfnCheckVisibility, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: void DeltaSetField( struct delta_s *pFields, const char *fieldname ) { darope@0: ENGINE_TRACE(pfnDeltaSetField, P_PRE, ("field=%s", fieldname)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void DeltaUnsetField( struct delta_s *pFields, const char *fieldname ) { darope@0: ENGINE_TRACE(pfnDeltaUnsetField, P_PRE, ("field=%s", fieldname)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void DeltaAddEncoder( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ) { darope@0: ENGINE_TRACE(pfnDeltaAddEncoder, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: int GetCurrentPlayer( void ) { darope@0: // trace output in Post darope@0: ENGINE_TRACE(pfnGetCurrentPlayer, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int CanSkipPlayer( const edict_t *player ) { darope@0: ENGINE_TRACE(pfnCanSkipPlayer, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: int DeltaFindField( struct delta_s *pFields, const char *fieldname ) { darope@0: ENGINE_TRACE(pfnDeltaFindField, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void DeltaSetFieldByIndex( struct delta_s *pFields, int fieldNumber ) { darope@0: ENGINE_TRACE(pfnDeltaSetFieldByIndex, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: void DeltaUnsetFieldByIndex( struct delta_s *pFields, int fieldNumber ) { darope@0: ENGINE_TRACE(pfnDeltaUnsetFieldByIndex, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void SetGroupMask( int mask, int op ) { darope@0: ENGINE_TRACE(pfnSetGroupMask, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: int engCreateInstancedBaseline( int classname, struct entity_state_s *baseline ) { darope@0: ENGINE_TRACE(pfnCreateInstancedBaseline, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: void Cvar_DirectSet( struct cvar_s *var, char *value ) { darope@0: ENGINE_TRACE(pfnCvar_DirectSet, P_PRE, ("cvar=%s", var->name)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: //! Forces the client and server to be running with the same version of the specified file darope@0: //!( e.g., a player model ). darope@0: //! Calling this has no effect in single player darope@0: void ForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char *filename ) { darope@0: ENGINE_TRACE(pfnForceUnmodified, P_PRE, ("file=%s", filename)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void GetPlayerStats( const edict_t *pClient, int *ping, int *packet_loss ) { darope@0: ENGINE_TRACE(pfnGetPlayerStats, P_PRE, ("name=%s", STRING(pClient->v.netname))); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void AddServerCommand( char *cmd_name, void (*function) (void) ) { darope@0: ENGINE_TRACE(pfnAddServerCommand, P_PRE, ("cmd=%s", cmd_name)); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: // Added in SDK 2.2: darope@0: darope@0: //! For voice communications, set which clients hear eachother. darope@0: //! NOTE: these functions take player entity indices (starting at 1). darope@0: qboolean Voice_GetClientListening(int iReceiver, int iSender) { darope@0: ENGINE_TRACE(pfnVoice_GetClientListening, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, false); darope@0: } darope@0: qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen) { darope@0: ENGINE_TRACE(pfnVoice_SetClientListening, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, false); darope@0: } darope@0: darope@0: // Added for HL 1109 (no SDK update): darope@0: darope@0: const char *GetPlayerAuthId(edict_t *e) { darope@0: // trace output in Post darope@0: ENGINE_TRACE(pfnGetPlayerAuthId, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: darope@0: // Added 2003/11/10 (no SDK update): darope@0: darope@47: sequenceEntry_s*SequenceGet(const char* fileName, const char* entryName) { darope@0: ENGINE_TRACE(pfnSequenceGet, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: darope@47: sentenceEntry_s *SequencePickSentence(const char* groupName, int pickMethod, int *picked) { darope@0: ENGINE_TRACE(pfnSequencePickSentence, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, NULL); darope@0: } darope@0: darope@0: int GetFileSize(char *filename) { darope@0: ENGINE_TRACE(pfnGetFileSize, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: unsigned int GetApproxWavePlayLen(const char *filepath) { darope@0: ENGINE_TRACE(pfnGetApproxWavePlayLen, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: int IsCareerMatch(void) { darope@0: ENGINE_TRACE(pfnIsCareerMatch, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: int GetLocalizedStringLength(const char *label) { darope@0: ENGINE_TRACE(pfnGetLocalizedStringLength, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: void RegisterTutorMessageShown(int mid) { darope@0: ENGINE_TRACE(pfnRegisterTutorMessageShown, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: int GetTimesTutorMessageShown(int mid) { darope@0: ENGINE_TRACE(pfnGetTimesTutorMessageShown, P_PRE, ("")); darope@0: RETURN_META_VALUE(MRES_IGNORED, 0); darope@0: } darope@0: darope@0: void ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength) { darope@0: ENGINE_TRACE(pfnProcessTutorMessageDecayBuffer, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength) { darope@0: ENGINE_TRACE(pfnConstructTutorMessageDecayBuffer, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: darope@0: void ResetTutorMessageDecayData(void) { darope@0: ENGINE_TRACE(pfnResetTutorMessageDecayData, P_PRE, ("")); darope@0: RETURN_META(MRES_IGNORED); darope@0: } darope@0: bailopan@161: void QueryClientCvarValue(const edict_t *pEdict, const char *cvarName) bailopan@161: { bailopan@161: ENGINE_TRACE(pfnQueryClientCvarValue, P_PRE, ("queried=%s",cvarName?cvarName:"nil")); bailopan@161: RETURN_META(MRES_IGNORED); bailopan@161: } bailopan@161: darope@0: enginefuncs_t meta_engfuncs = { darope@0: PrecacheModel, // pfnPrecacheModel() darope@0: PrecacheSound, // pfnPrecacheSound() darope@0: SetModel, // pfnSetModel() darope@0: ModelIndex, // pfnModelIndex() darope@0: ModelFrames, // pfnModelFrames() darope@0: darope@0: SetSize, // pfnSetSize() darope@0: ChangeLevel, // pfnChangeLevel() darope@0: GetSpawnParms, // pfnGetSpawnParms() darope@0: SaveSpawnParms, // pfnSaveSpawnParms() darope@0: darope@0: VecToYaw, // pfnVecToYaw() darope@0: VecToAngles, // pfnVecToAngles() darope@0: MoveToOrigin, // pfnMoveToOrigin() darope@0: ChangeYaw, // pfnChangeYaw() darope@0: ChangePitch, // pfnChangePitch() darope@0: darope@0: FindEntityByString, // pfnFindEntityByString() darope@0: GetEntityIllum, // pfnGetEntityIllum() darope@0: FindEntityInSphere, // pfnFindEntityInSphere() darope@0: FindClientInPVS, // pfnFindClientInPVS() darope@0: EntitiesInPVS, // pfnEntitiesInPVS() darope@0: darope@0: MakeVectors, // pfnMakeVectors() darope@0: AngleVectors, // pfnAngleVectors() darope@0: darope@0: CreateEntity, // pfnCreateEntity() darope@0: RemoveEntity, // pfnRemoveEntity() darope@0: CreateNamedEntity, // pfnCreateNamedEntity() darope@0: darope@0: MakeStatic, // pfnMakeStatic() darope@0: EntIsOnFloor, // pfnEntIsOnFloor() darope@0: DropToFloor, // pfnDropToFloor() darope@0: darope@0: WalkMove, // pfnWalkMove() darope@0: SetOrigin, // pfnSetOrigin() darope@0: darope@0: EmitSound, // pfnEmitSound() darope@0: EmitAmbientSound, // pfnEmitAmbientSound() darope@0: darope@0: TraceLine, // pfnTraceLine() darope@0: TraceToss, // pfnTraceToss() darope@0: TraceMonsterHull, // pfnTraceMonsterHull() darope@0: TraceHull, // pfnTraceHull() darope@0: TraceModel, // pfnTraceModel() darope@0: TraceTexture, // pfnTraceTexture() darope@0: TraceSphere, // pfnTraceSphere() darope@0: GetAimVector, // pfnGetAimVector() darope@0: darope@0: ServerCommand, // pfnServerCommand() darope@0: ServerExecute, // pfnServerExecute() darope@0: engClientCommand, // pfnClientCommand() // d'oh, ClientCommand in dllapi too darope@0: darope@0: ParticleEffect, // pfnParticleEffect() darope@0: LightStyle, // pfnLightStyle() darope@0: DecalIndex, // pfnDecalIndex() darope@0: PointContents, // pfnPointContents() darope@0: darope@0: MessageBegin, // pfnMessageBegin() darope@0: MessageEnd, // pfnMessageEnd() darope@0: darope@0: WriteByte, // pfnWriteByte() darope@0: WriteChar, // pfnWriteChar() darope@0: WriteShort, // pfnWriteShort() darope@0: WriteLong, // pfnWriteLong() darope@0: WriteAngle, // pfnWriteAngle() darope@0: WriteCoord, // pfnWriteCoord() darope@0: WriteString, // pfnWriteString() darope@0: WriteEntity, // pfnWriteEntity() darope@0: darope@0: CVarRegister, // pfnCVarRegister() darope@0: CVarGetFloat, // pfnCVarGetFloat() darope@0: CVarGetString, // pfnCVarGetString() darope@0: CVarSetFloat, // pfnCVarSetFloat() darope@0: CVarSetString, // pfnCVarSetString() darope@0: darope@0: AlertMessage, // pfnAlertMessage() darope@0: EngineFprintf, // pfnEngineFprintf() darope@0: darope@0: PvAllocEntPrivateData, // pfnPvAllocEntPrivateData() darope@0: PvEntPrivateData, // pfnPvEntPrivateData() darope@0: FreeEntPrivateData, // pfnFreeEntPrivateData() darope@0: darope@0: SzFromIndex, // pfnSzFromIndex() darope@0: AllocString, // pfnAllocString() darope@0: darope@0: GetVarsOfEnt, // pfnGetVarsOfEnt() darope@0: PEntityOfEntOffset, // pfnPEntityOfEntOffset() darope@0: EntOffsetOfPEntity, // pfnEntOffsetOfPEntity() darope@0: IndexOfEdict, // pfnIndexOfEdict() darope@0: PEntityOfEntIndex, // pfnPEntityOfEntIndex() darope@0: FindEntityByVars, // pfnFindEntityByVars() darope@0: GetModelPtr, // pfnGetModelPtr() darope@0: darope@0: RegUserMsg, // pfnRegUserMsg() darope@0: darope@0: AnimationAutomove, // pfnAnimationAutomove() darope@0: GetBonePosition, // pfnGetBonePosition() darope@0: darope@0: FunctionFromName, // pfnFunctionFromName() darope@0: NameForFunction, // pfnNameForFunction() darope@0: darope@0: ClientPrintf, // pfnClientPrintf() //! JOHN: engine callbacks so game DLL can print messages to individual clients darope@0: ServerPrint, // pfnServerPrint() darope@0: darope@0: Cmd_Args, // pfnCmd_Args() //! these 3 added darope@0: Cmd_Argv, // pfnCmd_Argv() //! so game DLL can easily darope@0: Cmd_Argc, // pfnCmd_Argc() //! access client 'cmd' strings darope@0: darope@0: GetAttachment, // pfnGetAttachment() darope@0: darope@0: CRC32_Init, // pfnCRC32_Init() darope@0: CRC32_ProcessBuffer, // pfnCRC32_ProcessBuffer() darope@0: CRC32_ProcessByte, // pfnCRC32_ProcessByte() darope@0: CRC32_Final, // pfnCRC32_Final() darope@0: darope@0: RandomLong, // pfnRandomLong() darope@0: RandomFloat, // pfnRandomFloat() darope@0: darope@0: SetView, // pfnSetView() darope@0: Time, // pfnTime() darope@0: CrosshairAngle, // pfnCrosshairAngle() darope@0: darope@0: LoadFileForMe, // pfnLoadFileForMe() darope@0: FreeFile, // pfnFreeFile() darope@0: darope@0: EndSection, // pfnEndSection() //! trigger_endsection darope@0: CompareFileTime, // pfnCompareFileTime() darope@0: GetGameDir, // pfnGetGameDir() darope@0: Cvar_RegisterVariable, // pfnCvar_RegisterVariable() darope@0: FadeClientVolume, // pfnFadeClientVolume() darope@0: SetClientMaxspeed, // pfnSetClientMaxspeed() darope@0: CreateFakeClient, // pfnCreateFakeClient() //! returns NULL if fake client can't be created darope@0: RunPlayerMove, // pfnRunPlayerMove() darope@0: NumberOfEntities, // pfnNumberOfEntities() darope@0: darope@0: GetInfoKeyBuffer, // pfnGetInfoKeyBuffer() //! passing in NULL gets the serverinfo darope@0: InfoKeyValue, // pfnInfoKeyValue() darope@0: SetKeyValue, // pfnSetKeyValue() darope@0: SetClientKeyValue, // pfnSetClientKeyValue() darope@0: darope@0: IsMapValid, // pfnIsMapValid() darope@0: StaticDecal, // pfnStaticDecal() darope@0: PrecacheGeneric, // pfnPrecacheGeneric() darope@0: GetPlayerUserId, // pfnGetPlayerUserId() //! returns the server assigned userid for this player. darope@0: BuildSoundMsg, // pfnBuildSoundMsg() darope@0: IsDedicatedServer, // pfnIsDedicatedServer() //! is this a dedicated server? darope@0: CVarGetPointer, // pfnCVarGetPointer() darope@0: GetPlayerWONId, // pfnGetPlayerWONId() //! returns the server assigned WONid for this player. darope@0: darope@0: //! YWB 8/1/99 TFF Physics additions darope@0: Info_RemoveKey, // pfnInfo_RemoveKey() darope@0: GetPhysicsKeyValue, // pfnGetPhysicsKeyValue() darope@0: SetPhysicsKeyValue, // pfnSetPhysicsKeyValue() darope@0: GetPhysicsInfoString, // pfnGetPhysicsInfoString() darope@0: PrecacheEvent, // pfnPrecacheEvent() darope@0: PlaybackEvent, // pfnPlaybackEvent() darope@0: darope@0: SetFatPVS, // pfnSetFatPVS() darope@0: SetFatPAS, // pfnSetFatPAS() darope@0: darope@0: CheckVisibility, // pfnCheckVisibility() darope@0: darope@0: DeltaSetField, // pfnDeltaSetField() darope@0: DeltaUnsetField, // pfnDeltaUnsetField() darope@0: DeltaAddEncoder, // pfnDeltaAddEncoder() darope@0: GetCurrentPlayer, // pfnGetCurrentPlayer() darope@0: CanSkipPlayer, // pfnCanSkipPlayer() darope@0: DeltaFindField, // pfnDeltaFindField() darope@0: DeltaSetFieldByIndex, // pfnDeltaSetFieldByIndex() darope@0: DeltaUnsetFieldByIndex, // pfnDeltaUnsetFieldByIndex() darope@0: darope@0: SetGroupMask, // pfnSetGroupMask() darope@0: darope@0: engCreateInstancedBaseline, // pfnCreateInstancedBaseline() // d'oh, CreateInstancedBaseline in dllapi too darope@0: Cvar_DirectSet, // pfnCvar_DirectSet() darope@0: darope@0: ForceUnmodified, // pfnForceUnmodified() darope@0: darope@0: GetPlayerStats, // pfnGetPlayerStats() darope@0: darope@0: AddServerCommand, // pfnAddServerCommand() darope@0: darope@0: // Added in SDK 2.2: darope@0: Voice_GetClientListening, // pfnVoice_GetClientListening() darope@0: Voice_SetClientListening, // pfnVoice_SetClientListening() darope@0: darope@0: // Added for HL 1109 (no SDK update): darope@0: GetPlayerAuthId, // pfnGetPlayerAuthId() darope@0: darope@0: // Added 2003/11/10 (no SDK update): darope@0: SequenceGet, // pfnSequenceGet() darope@0: SequencePickSentence, // pfnSequencePickSentence() darope@0: GetFileSize, // pfnGetFileSize() darope@0: GetApproxWavePlayLen, // pfnGetApproxWavePlayLen() darope@0: IsCareerMatch, // pfnIsCareerMatch() darope@0: GetLocalizedStringLength, // pfnGetLocalizedStringLength() darope@0: RegisterTutorMessageShown, // pfnRegisterTutorMessageShown() darope@0: GetTimesTutorMessageShown, // pfnGetTimesTutorMessageShown() darope@0: ProcessTutorMessageDecayBuffer, // pfnProcessTutorMessageDecayBuffer() darope@0: ConstructTutorMessageDecayBuffer, // pfnConstructTutorMessageDecayBuffer() darope@0: ResetTutorMessageDecayData, // pfnResetTutorMessageDecayData() bailopan@161: QueryClientCvarValue, // pfnQueryClientCvarValue() darope@0: }; darope@0: darope@0: C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, darope@0: int *interfaceVersion) darope@0: { darope@0: LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d", darope@0: *interfaceVersion); darope@0: if(!pengfuncsFromEngine) { darope@0: LOG_ERROR(PLID, darope@0: "GetEngineFunctions called with null pengfuncsFromEngine"); darope@0: return(FALSE); darope@0: } darope@0: else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) { darope@0: LOG_ERROR(PLID, darope@0: "GetEngineFunctions version mismatch; requested=%d ours=%d", darope@0: *interfaceVersion, ENGINE_INTERFACE_VERSION); darope@0: // Tell metamod what version we had, so it can figure out who is darope@0: // out of date. darope@0: *interfaceVersion = ENGINE_INTERFACE_VERSION; darope@0: return(FALSE); darope@0: } darope@0: memcpy(pengfuncsFromEngine, &meta_engfuncs, sizeof(enginefuncs_t)); darope@0: return TRUE; darope@0: }