* Fixed bots not camping in camp spots. Fixed chatter/radio message cycling. (need feedback). Fixed CTs unable to defuse bomb. Fixed backward jump path generation in waypoint editor. Fixed autoradius in waypoint editor. Fixed autoradius menu non closeable. Fixed bots version display on entering game. Fixed memory leak in DLL-loader. (non metamod). Fixed bots able to see through smoke. Fixed team-detection on non-standard modes. Fixed quota & autovacate management. Fixed bunch of warnings from static analyzers. Greatly imporoved grenade throwing. Grealty reduced bot CPU usage. * Fixed stack-corruption in memory-file reader. Fixed A* pathfinder not working correctly. Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove. Minor tweaks to camping and bot enemy aiming * Make clang happy. * Fixed VIP-dection on some maps. Fixed occupied waypoint checker. Small refactoring of code with clang-format. * Fixed clang compilation * Fixed compilation. * Debugging seek cover task. Some more code cleanup. * Fixed typos. * Fixes to attack movement. Revert Z component updates. * Fixes for aiming at enemy. Fixes for seek cover & enemy hunt tasks. More refactoring. * Making clang happy once again? Tweaked grenade timers. * Revised language comparer hasher * Fixed build. * Fixed build. * Optimized headshot offsets. Optimized aim errors and enemy searches. Get rid of preprocessor macroses. Added back yb_think_fps. Use with caution. * Minor refactoring of code. * Check if tracking entity is still alive. Do not duck in crouch-goal waypoints. Remove ancient hack with failed goals. * Get rid of c++14 stuff. Tweaked isOccupiedPoint. * Changed pickup check radius. * Fix compilation. * Fixed bots ignore breakables. Fixed A* pathfinder. Fixed searching for optimal waypoints. Fixed bot waypoint reachability functions. * Get rid of new/delete calls in pathfinder. Disallow access to yapb waypoint menu on hlds. Minor refactoring. * Updated linux/osx makefile * Spaces -> Tabs in makefile. Made G++ happy. * Updated makefile. * Fixed heap buffer overflow in config loader code. * Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node. Do not traceline for doors on map, that have no doors. Get rid stack-based containers. * Remove win-only debug crap. * Refactored string class. * Fix OSX compiling. * Minor refactoring of corelib to use cpp move-semantic. * Use reference for active grenades searcher. * Use system's atan2f () as it's eror rate is a bit lower. Fixed bots continuously stays in throw smoke task. Fixed bots reaching camp-goal jumping or stays they for some time. Increased radius for searching targets for grenades. Tweaked bot difficulty levels. Improved sniper weapon handling. Trying to stand still while shooting. Increase retreat level only if sniper weapon is low on ammo. Fixed predict path enemy tracking timer is always true. Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends. Fied bots endlessy trying to pickup weapons. Reduce surpise timers when holding sniper weapons. New aim-at-head position calculation. Shoot delay timers are now based on bot's difficulty. Prefer smoke grenades more than flashbangs. Fixed kill-all bot command not killing one random bot for first time use. Do not play with jump velocity, now using the same as in waypoints. Tweaked shift move, so zero move speed not overriden with shift speed. Radius waypoint searcher use waypoint bucket as well. Increase reachability radius for dest waypoint, if it's currenlty owned by other bot. Partially fixed bots choice to use unreachable waypoints. * Makes OSX clang happy? * Support for compiling on llvm-win32, makefile to be done. Increased default reachability time. * Fixed build. * Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles. * Fixed active grenades list not working after changelevel. Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little. * Precache should be done in spawn... * Do not use engfuncs in intresting entities. * Fixed GCC-8.2 warnings. Minor refactoring. * Added some safety checks to intresting entities. Get rid of stdc++ dependency for GCC & ICC under linux. * Remove -g from release make. Cosmetic changes. * Re-enabled debug overlay. * Remove test header... * Some static-analyzer warnings fixed. Support for X64 build for FWGS Xash3D Engine. * Reduced time between selecting grenade and throwing it away. Do not try to kill bots that already dead with kill command. Several fixes from static-analyzers. * Update CI. * Fixed bot's not added after the changelevel on Xash3D engine. * Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime.... * Bots will try to not strafe while in combat if seeing enemy only partially. Do not use "shift" when considering stuck. * Weapon price for Elite is 800$ since CS 1.6... * Fixed bots at difficulty 0 can't shoot enemies. * Cosmetic change. * Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module. Consider freed entities as invalid. * Bigger distance for throwing he grenades. * Faster version of atan2f(). * Removed accidentally left SSE header. * Cosmetic changes to enums. * Tweaked difficulty levels. Bots on Android will have a difficulty level 2 by default. Fixed LTO builds under linux. * Do not consider Android CS as legacy. * Get rid of system's math functions. Just for fun) * Use SSE2 for sincos function. * Fixed failed during load wayponts still allows to add bots, thus causing bot to crash. Added ability to delete waypoint by number using "yb wp delete". Enabled Link Time Optimization for Linux and OSX. * Fixed CI Builds.
371 lines
19 KiB
C
371 lines
19 KiB
C
/***
|
|
*
|
|
* Copyright (c) 1999-2005, Valve Corporation. All rights reserved.
|
|
*
|
|
* This product contains software technology licensed from Id
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
* All Rights Reserved.
|
|
*
|
|
* This source code contains proprietary and confidential information of
|
|
* Valve LLC and its suppliers. Access to this code is restricted to
|
|
* persons who have executed a written SDK license with Valve. Any access,
|
|
* use or distribution of this code by or to any unlicensed person is illegal.
|
|
*
|
|
****/
|
|
#ifndef EIFACE_H
|
|
#define EIFACE_H
|
|
|
|
#define INTERFACE_VERSION 140
|
|
|
|
#include <stdio.h>
|
|
|
|
#define FCVAR_ARCHIVE (1 << 0) // set to cause it to be saved to vars.rc
|
|
#define FCVAR_USERINFO (1 << 1) // changes the client's info string
|
|
#define FCVAR_SERVER (1 << 2) // notifies players when changed
|
|
#define FCVAR_EXTDLL (1 << 3) // defined by external DLL
|
|
#define FCVAR_CLIENTDLL (1 << 4) // defined by the client dll
|
|
#define FCVAR_PROTECTED (1 << 5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
|
|
#define FCVAR_SPONLY (1 << 6) // This cvar cannot be changed by clients connected to a multiplayer server.
|
|
#define FCVAR_PRINTABLEONLY (1 << 7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
|
|
#define FCVAR_UNLOGGED (1 << 8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
|
|
|
|
struct cvar_t {
|
|
char *name;
|
|
char *string;
|
|
int flags;
|
|
float value;
|
|
cvar_t *next;
|
|
};
|
|
|
|
//
|
|
// Defines entity interface between engine and DLLs.
|
|
// This header file included by engine files and DLL files.
|
|
//
|
|
// Before including this header, DLLs must:
|
|
// include progdefs.h
|
|
// This is conveniently done for them in extdll.h
|
|
//
|
|
|
|
#ifdef _WIN32
|
|
#define DLLEXPORT __stdcall
|
|
#else
|
|
#define DLLEXPORT /* */
|
|
#endif
|
|
|
|
typedef enum {
|
|
at_notice,
|
|
at_console, // same as at_notice, but forces a ConPrintf, not a message box
|
|
at_aiconsole, // same as at_console, but only shown if developer level is 2!
|
|
at_warning,
|
|
at_error,
|
|
at_logged // Server print to console ( only in multiplayer games ).
|
|
} ALERT_TYPE;
|
|
|
|
// 4-22-98 JOHN: added for use in pfnClientPrintf
|
|
typedef enum { print_console, print_center, print_chat } PRINT_TYPE;
|
|
|
|
// For integrity checking of content on clients
|
|
typedef enum {
|
|
force_exactfile, // File on client must exactly match server's file
|
|
force_model_samebounds, // For model files only, the geometry must fit in the same bbox
|
|
force_model_specifybounds // For model files only, the geometry must fit in the specified bbox
|
|
} FORCE_TYPE;
|
|
|
|
// Returned by TraceLine
|
|
typedef struct {
|
|
int fAllSolid; // if true, plane is not valid
|
|
int fStartSolid; // if true, the initial point was in a solid area
|
|
int fInOpen;
|
|
int fInWater;
|
|
float flFraction; // time completed, 1.0 = didn't hit anything
|
|
vec3_t vecEndPos; // final position
|
|
float flPlaneDist;
|
|
vec3_t vecPlaneNormal; // surface normal at impact
|
|
edict_t *pHit; // entity the surface is on
|
|
int iHitgroup; // 0 == generic, non zero is specific body part
|
|
} TraceResult;
|
|
|
|
typedef uint32 CRC32_t;
|
|
|
|
// Engine hands this to DLLs for functionality callbacks
|
|
|
|
typedef struct enginefuncs_s {
|
|
int (*pfnPrecacheModel) (char *s);
|
|
int (*pfnPrecacheSound) (char *s);
|
|
void (*pfnSetModel) (edict_t *e, const char *m);
|
|
int (*pfnModelIndex) (const char *m);
|
|
int (*pfnModelFrames) (int modelIndex);
|
|
void (*pfnSetSize) (edict_t *e, const float *rgflMin, const float *rgflMax);
|
|
void (*pfnChangeLevel) (char *s1, char *s2);
|
|
void (*pfnGetSpawnParms) (edict_t *ent);
|
|
void (*pfnSaveSpawnParms) (edict_t *ent);
|
|
float (*pfnVecToYaw) (const float *rgflVector);
|
|
void (*pfnVecToAngles) (const float *rgflVectorIn, float *rgflVectorOut);
|
|
void (*pfnMoveToOrigin) (edict_t *ent, const float *pflGoal, float dist, int iMoveType);
|
|
void (*pfnChangeYaw) (edict_t *ent);
|
|
void (*pfnChangePitch) (edict_t *ent);
|
|
edict_t *(*pfnFindEntityByString) (edict_t *pentEdictStartSearchAfter, const char *pszField, const char *pszValue);
|
|
int (*pfnGetEntityIllum) (edict_t *pEnt);
|
|
edict_t *(*pfnFindEntityInSphere) (edict_t *pentEdictStartSearchAfter, const float *org, float rad);
|
|
edict_t *(*pfnFindClientInPVS) (edict_t *ent);
|
|
edict_t *(*pfnEntitiesInPVS) (edict_t *pplayer);
|
|
void (*pfnMakeVectors) (const float *rgflVector);
|
|
void (*pfnAngleVectors) (const float *rgflVector, float *forward, float *right, float *up);
|
|
edict_t *(*pfnCreateEntity) (void);
|
|
void (*pfnRemoveEntity) (edict_t *e);
|
|
edict_t *(*pfnCreateNamedEntity) (int className);
|
|
void (*pfnMakeStatic) (edict_t *ent);
|
|
int (*pfnEntIsOnFloor) (edict_t *e);
|
|
int (*pfnDropToFloor) (edict_t *e);
|
|
int (*pfnWalkMove) (edict_t *ent, float yaw, float dist, int mode);
|
|
void (*pfnSetOrigin) (edict_t *e, const float *rgflOrigin);
|
|
void (*pfnEmitSound) (edict_t *entity, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch);
|
|
void (*pfnEmitAmbientSound) (edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
|
|
void (*pfnTraceLine) (const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
|
|
void (*pfnTraceToss) (edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);
|
|
int (*pfnTraceMonsterHull) (edict_t *ent, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
|
|
void (*pfnTraceHull) (const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
|
|
void (*pfnTraceModel) (const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr);
|
|
const char *(*pfnTraceTexture) (edict_t *pTextureEntity, const float *v1, const float *v2);
|
|
void (*pfnTraceSphere) (const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);
|
|
void (*pfnGetAimVector) (edict_t *ent, float speed, float *rgflReturn);
|
|
void (*pfnServerCommand) (char *str);
|
|
void (*pfnServerExecute) (void);
|
|
void (*pfnClientCommand) (edict_t *ent, char const *szFmt, ...);
|
|
void (*pfnParticleEffect) (const float *org, const float *dir, float color, float count);
|
|
void (*pfnLightStyle) (int style, char *val);
|
|
int (*pfnDecalIndex) (const char *name);
|
|
int (*pfnPointContents) (const float *rgflVector);
|
|
void (*pfnMessageBegin) (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
|
|
void (*pfnMessageEnd) (void);
|
|
void (*pfnWriteByte) (int value);
|
|
void (*pfnWriteChar) (int value);
|
|
void (*pfnWriteShort) (int value);
|
|
void (*pfnWriteLong) (int value);
|
|
void (*pfnWriteAngle) (float flValue);
|
|
void (*pfnWriteCoord) (float flValue);
|
|
void (*pfnWriteString) (const char *sz);
|
|
void (*pfnWriteEntity) (int value);
|
|
void (*pfnCVarRegister) (cvar_t *pCvar);
|
|
float (*pfnCVarGetFloat) (const char *szVarName);
|
|
const char *(*pfnCVarGetString) (const char *szVarName);
|
|
void (*pfnCVarSetFloat) (const char *szVarName, float flValue);
|
|
void (*pfnCVarSetString) (const char *szVarName, const char *szValue);
|
|
void (*pfnAlertMessage) (ALERT_TYPE atype, char *szFmt, ...);
|
|
void (*pfnEngineFprintf) (void *pfile, char *szFmt, ...);
|
|
void *(*pfnPvAllocEntPrivateData) (edict_t *ent, int32 cb);
|
|
void *(*pfnPvEntPrivateData) (edict_t *ent);
|
|
void (*pfnFreeEntPrivateData) (edict_t *ent);
|
|
const char *(*pfnSzFromIndex) (int stingPtr);
|
|
int (*pfnAllocString) (const char *szValue);
|
|
struct entvars_s *(*pfnGetVarsOfEnt) (edict_t *ent);
|
|
edict_t *(*pfnPEntityOfEntOffset) (int iEntOffset);
|
|
int (*pfnEntOffsetOfPEntity) (const edict_t *ent);
|
|
int (*pfnIndexOfEdict) (const edict_t *ent);
|
|
edict_t *(*pfnPEntityOfEntIndex) (int entIndex);
|
|
edict_t *(*pfnFindEntityByVars) (struct entvars_s *pvars);
|
|
void *(*pfnGetModelPtr) (edict_t *ent);
|
|
int (*pfnRegUserMsg) (const char *pszName, int iSize);
|
|
void (*pfnAnimationAutomove) (const edict_t *ent, float flTime);
|
|
void (*pfnGetBonePosition) (const edict_t *ent, int iBone, float *rgflOrigin, float *rgflAngles);
|
|
uint32 (*pfnFunctionFromName) (const char *pName);
|
|
const char *(*pfnNameForFunction) (uint32 function);
|
|
void (*pfnClientPrintf) (edict_t *ent, PRINT_TYPE ptype, const char *szMsg); // JOHN: engine callbacks so game DLL can print messages to individual clients
|
|
void (*pfnServerPrint) (const char *szMsg);
|
|
const char *(*pfnCmd_Args) (void); // these 3 added
|
|
const char *(*pfnCmd_Argv) (int argc); // so game DLL can easily
|
|
int (*pfnCmd_Argc) (void); // access client 'cmd' strings
|
|
void (*pfnGetAttachment) (const edict_t *ent, int iAttachment, float *rgflOrigin, float *rgflAngles);
|
|
void (*pfnCRC32_Init) (CRC32_t *pulCRC);
|
|
void (*pfnCRC32_ProcessBuffer) (CRC32_t *pulCRC, void *p, int len);
|
|
void (*pfnCRC32_ProcessByte) (CRC32_t *pulCRC, uint8 ch);
|
|
CRC32_t (*pfnCRC32_Final) (CRC32_t pulCRC);
|
|
int32 (*pfnRandomLong) (int32 lLow, int32 lHigh);
|
|
float (*pfnRandomFloat) (float flLow, float flHigh);
|
|
void (*pfnSetView) (const edict_t *client, const edict_t *pViewent);
|
|
float (*pfnTime) (void);
|
|
void (*pfnCrosshairAngle) (const edict_t *client, float pitch, float yaw);
|
|
uint8 *(*pfnLoadFileForMe) (char const *szFilename, int *pLength);
|
|
void (*pfnFreeFile) (void *buffer);
|
|
void (*pfnEndSection) (const char *pszSectionName); // trigger_endsection
|
|
int (*pfnCompareFileTime) (char *filename1, char *filename2, int *compare);
|
|
void (*pfnGetGameDir) (char *szGetGameDir);
|
|
void (*pfnCvar_RegisterVariable) (cvar_t *variable);
|
|
void (*pfnFadeClientVolume) (const edict_t *ent, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds);
|
|
void (*pfnSetClientMaxspeed) (const edict_t *ent, float fNewMaxspeed);
|
|
edict_t *(*pfnCreateFakeClient) (const char *netname); // returns nullptr if fake client can't be created
|
|
void (*pfnRunPlayerMove) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, uint16 buttons, uint8 impulse, uint8 msec);
|
|
int (*pfnNumberOfEntities) (void);
|
|
char *(*pfnGetInfoKeyBuffer) (edict_t *e); // passing in nullptr gets the serverinfo
|
|
char *(*pfnInfoKeyValue) (char *infobuffer, char const *key);
|
|
void (*pfnSetKeyValue) (char *infobuffer, char *key, char *value);
|
|
void (*pfnSetClientKeyValue) (int clientIndex, char *infobuffer, char const *key, char const *value);
|
|
int (*pfnIsMapValid) (char *szFilename);
|
|
void (*pfnStaticDecal) (const float *origin, int decalIndex, int entityIndex, int modelIndex);
|
|
int (*pfnPrecacheGeneric) (char *s);
|
|
int (*pfnGetPlayerUserId) (edict_t *e); // 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
|
|
void (*pfnBuildSoundMsg) (edict_t *entity, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
|
|
int (*pfnIsDedicatedServer) (void); // is this a dedicated server?
|
|
cvar_t *(*pfnCVarGetPointer) (const char *szVarName);
|
|
unsigned int (*pfnGetPlayerWONId) (edict_t *e); // 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
|
|
|
|
void (*pfnInfo_RemoveKey) (char *s, const char *key);
|
|
const char *(*pfnGetPhysicsKeyValue) (const edict_t *client, const char *key);
|
|
void (*pfnSetPhysicsKeyValue) (const edict_t *client, const char *key, const char *value);
|
|
const char *(*pfnGetPhysicsInfoString) (const edict_t *client);
|
|
uint16 (*pfnPrecacheEvent) (int type, const char *psz);
|
|
void (*pfnPlaybackEvent) (int flags, const edict_t *pInvoker, uint16 evIndexOfEntity, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2);
|
|
uint8 *(*pfnSetFatPVS) (float *org);
|
|
uint8 *(*pfnSetFatPAS) (float *org);
|
|
int (*pfnCheckVisibility) (const edict_t *entity, uint8 *pset);
|
|
void (*pfnDeltaSetField) (struct delta_s *pFields, const char *fieldname);
|
|
void (*pfnDeltaUnsetField) (struct delta_s *pFields, const char *fieldname);
|
|
void (*pfnDeltaAddEncoder) (char *name, void (*conditionalencode) (struct delta_s *pFields, const uint8 *from, const uint8 *to));
|
|
int (*pfnGetCurrentPlayer) (void);
|
|
int (*pfnCanSkipPlayer) (const edict_t *player);
|
|
int (*pfnDeltaFindField) (struct delta_s *pFields, const char *fieldname);
|
|
void (*pfnDeltaSetFieldByIndex) (struct delta_s *pFields, int fieldNumber);
|
|
void (*pfnDeltaUnsetFieldByIndex) (struct delta_s *pFields, int fieldNumber);
|
|
void (*pfnSetGroupMask) (int mask, int op);
|
|
int (*pfnCreateInstancedBaseline) (int classname, struct entity_state_s *baseline);
|
|
void (*pfnCvar_DirectSet) (struct cvar_t *var, char *value);
|
|
void (*pfnForceUnmodified) (FORCE_TYPE type, float *mins, float *maxs, const char *szFilename);
|
|
void (*pfnGetPlayerStats) (const edict_t *client, int *ping, int *packet_loss);
|
|
void (*pfnAddServerCommand) (char *cmd_name, void (*function) (void));
|
|
|
|
int (*pfnVoice_GetClientListening) (int iReceiver, int iSender);
|
|
int (*pfnVoice_SetClientListening) (int iReceiver, int iSender, int bListen);
|
|
|
|
const char *(*pfnGetPlayerAuthId) (edict_t *e);
|
|
|
|
struct sequenceEntry_s *(*pfnSequenceGet) (const char *fileName, const char *entryName);
|
|
struct sentenceEntry_s *(*pfnSequencePickSentence) (const char *groupName, int pickMethod, int *picked);
|
|
|
|
int (*pfnGetFileSize) (char *szFilename);
|
|
unsigned int (*pfnGetApproxWavePlayLen) (const char *filepath);
|
|
|
|
int (*pfnIsCareerMatch) (void);
|
|
int (*pfnGetLocalizedStringLength) (const char *label);
|
|
void (*pfnRegisterTutorMessageShown) (int mid);
|
|
int (*pfnGetTimesTutorMessageShown) (int mid);
|
|
void (*pfnProcessTutorMessageDecayBuffer) (int *buffer, int bufferLength);
|
|
void (*pfnConstructTutorMessageDecayBuffer) (int *buffer, int bufferLength);
|
|
void (*pfnResetTutorMessageDecayData) (void);
|
|
|
|
void (*pfnQueryClientCVarValue) (const edict_t *player, const char *cvarName);
|
|
void (*pfnQueryClientCVarValue2) (const edict_t *player, const char *cvarName, int requestID);
|
|
int (*pfnCheckParm) (const char *pchCmdLineToken, char **ppnext);
|
|
|
|
} enginefuncs_t;
|
|
|
|
// Passed to pfnKeyValue
|
|
typedef struct KeyValueData_s {
|
|
char *szClassName; // in: entity classname
|
|
char const *szKeyName; // in: name of key
|
|
char *szValue; // in: value of key
|
|
int32 fHandled; // out: DLL sets to true if key-value pair was understood
|
|
} KeyValueData;
|
|
|
|
typedef struct customization_s customization_t;
|
|
|
|
typedef struct {
|
|
// Initialize/shutdown the game (one-time call after loading of game .dll )
|
|
void (*pfnGameInit) (void);
|
|
int (*pfnSpawn) (edict_t *pent);
|
|
void (*pfnThink) (edict_t *pent);
|
|
void (*pfnUse) (edict_t *pentUsed, edict_t *pentOther);
|
|
void (*pfnTouch) (edict_t *pentTouched, edict_t *pentOther);
|
|
void (*pfnBlocked) (edict_t *pentBlocked, edict_t *pentOther);
|
|
void (*pfnKeyValue) (edict_t *pentKeyvalue, KeyValueData *pkvd);
|
|
void (*pfnSave) (edict_t *pent, struct SAVERESTOREDATA *pSaveData);
|
|
int (*pfnRestore) (edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity);
|
|
void (*pfnSetAbsBox) (edict_t *pent);
|
|
|
|
void (*pfnSaveWriteFields) (SAVERESTOREDATA *, const char *, void *, struct TYPEDESCRIPTION *, int);
|
|
void (*pfnSaveReadFields) (SAVERESTOREDATA *, const char *, void *, TYPEDESCRIPTION *, int);
|
|
|
|
void (*pfnSaveGlobalState) (SAVERESTOREDATA *);
|
|
void (*pfnRestoreGlobalState) (SAVERESTOREDATA *);
|
|
void (*pfnResetGlobalState) (void);
|
|
|
|
int (*pfnClientConnect) (edict_t *ent, const char *pszName, const char *pszAddress, char szRejectReason[128]);
|
|
|
|
void (*pfnClientDisconnect) (edict_t *ent);
|
|
void (*pfnClientKill) (edict_t *ent);
|
|
void (*pfnClientPutInServer) (edict_t *ent);
|
|
void (*pfnClientCommand) (edict_t *ent);
|
|
void (*pfnClientUserInfoChanged) (edict_t *ent, char *infobuffer);
|
|
|
|
void (*pfnServerActivate) (edict_t *edictList, int edictCount, int clientMax);
|
|
void (*pfnServerDeactivate) (void);
|
|
|
|
void (*pfnPlayerPreThink) (edict_t *ent);
|
|
void (*pfnPlayerPostThink) (edict_t *ent);
|
|
|
|
void (*pfnStartFrame) (void);
|
|
void (*pfnParmsNewLevel) (void);
|
|
void (*pfnParmsChangeLevel) (void);
|
|
|
|
// Returns string describing current .dll. E.g., TeamFotrress 2, Half-Life
|
|
const char *(*pfnGetGameDescription) (void);
|
|
|
|
// Notify dll about a player customization.
|
|
void (*pfnPlayerCustomization) (edict_t *ent, struct customization_s *pCustom);
|
|
|
|
// Spectator funcs
|
|
void (*pfnSpectatorConnect) (edict_t *ent);
|
|
void (*pfnSpectatorDisconnect) (edict_t *ent);
|
|
void (*pfnSpectatorThink) (edict_t *ent);
|
|
|
|
// Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint.
|
|
void (*pfnSys_Error) (const char *error_string);
|
|
|
|
void (*pfnPM_Move) (struct playermove_s *ppmove, int server);
|
|
void (*pfnPM_Init) (struct playermove_s *ppmove);
|
|
char (*pfnPM_FindTextureType) (char *name);
|
|
void (*pfnSetupVisibility) (struct edict_s *pViewEntity, struct edict_s *client, uint8 **pvs, uint8 **pas);
|
|
void (*pfnUpdateClientData) (const struct edict_s *ent, int sendweapons, struct clientdata_s *cd);
|
|
int (*pfnAddToFullPack) (struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, uint8 *pSet);
|
|
void (*pfnCreateBaseline) (int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, float *player_mins, float *player_maxs);
|
|
void (*pfnRegisterEncoders) (void);
|
|
int (*pfnGetWeaponData) (struct edict_s *player, struct weapon_data_s *info);
|
|
|
|
void (*pfnCmdStart) (const edict_t *player, const struct c *cmd, unsigned int random_seed);
|
|
void (*pfnCmdEnd) (const edict_t *player);
|
|
|
|
// Return 1 if the packet is valid. Set response_buffer_size if you want to send a response packet. Incoming, it holds the max
|
|
// size of the response_buffer, so you must zero it out if you choose not to respond.
|
|
int (*pfnConnectionlessPacket) (const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size);
|
|
|
|
// Enumerates player hulls. Returns 0 if the hull number doesn't exist, 1 otherwise
|
|
int (*pfnGetHullBounds) (int hullnumber, float *mins, float *maxs);
|
|
|
|
// Create baselines for certain "unplaced" items.
|
|
void (*pfnCreateInstancedBaselines) (void);
|
|
|
|
// One of the pfnForceUnmodified files failed the consistency check for the specified player
|
|
// Return 0 to allow the client to continue, 1 to force immediate disconnection ( with an optional disconnect message of up to 256 characters )
|
|
int (*pfnInconsistentFile) (const struct edict_s *player, const char *szFilename, char *disconnect_message);
|
|
|
|
// The game .dll should return 1 if lag compensation should be allowed ( could also just set
|
|
// the sv_unlag cvar.
|
|
// Most games right now should return 0, until client-side weapon prediction code is written
|
|
// and tested for them.
|
|
int (*pfnAllowLagCompensation) (void);
|
|
} gamefuncs_t;
|
|
|
|
// Current version.
|
|
#define NEWGAMEDLLFUNCS_VERSION 1
|
|
|
|
typedef struct {
|
|
// Called right before the object's memory is freed.
|
|
// Calls its destructor.
|
|
void (*pfnOnFreeEntPrivateData) (edict_t *pEnt);
|
|
void (*pfnGameShutdown) (void);
|
|
int (*pfnShouldCollide) (edict_t *pentTouched, edict_t *pentOther);
|
|
|
|
void (*pfnCvarValue) (const edict_t *pEnt, const char *value);
|
|
void (*pfnCvarValue2) (const edict_t *pEnt, int requestID, const char *cvarName, const char *value);
|
|
} newgamefuncs_t;
|
|
|
|
#endif /* EIFACE_H */
|