Move dlls/ to modules/

This commit is contained in:
xPaw
2015-03-13 15:18:47 +02:00
parent 54c978addb
commit e09f434ed8
365 changed files with 2233 additions and 2233 deletions

22
modules/engine/AMBuilder Normal file
View File

@ -0,0 +1,22 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os.path
binary = AMXX.MetaModule(builder, 'engine')
binary.compiler.defines += [
'HAVE_STDINT_H',
]
binary.sources = [
'../../public/sdk/amxxmodule.cpp',
'amxxapi.cpp',
'engine.cpp',
'entity.cpp',
'globals.cpp',
'forwards.cpp',
]
if builder.target_platform == 'windows':
binary.sources += ['version.rc']
AMXX.modules += [builder.Add(binary)]

124
modules/engine/Makefile Normal file
View File

@ -0,0 +1,124 @@
# (C)2004-2013 AMX Mod X Development Team
# Makefile written by David "BAILOPAN" Anderson
###########################################
### EDIT THESE PATHS FOR YOUR OWN SETUP ###
###########################################
HLSDK = ../../../hlsdk
MM_ROOT = ../../../metamod/metamod
PUBLIC_ROOT = ../../public
#####################################
### EDIT BELOW FOR OTHER PROJECTS ###
#####################################
PROJECT = engine
OBJECTS = amxxmodule.cpp amxxapi.cpp engine.cpp entity.cpp globals.cpp forwards.cpp
##############################################
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
##############################################
C_OPT_FLAGS = -DNDEBUG -O2 -funroll-loops -fomit-frame-pointer -pipe
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc
CPP_OSX = clang
LINK =
INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \
-I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\
-I$(MM_ROOT)
################################################
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
################################################
OS := $(shell uname -s)
ifeq "$(OS)" "Darwin"
CPP = $(CPP_OSX)
LIB_EXT = dylib
LIB_SUFFIX = _amxx
CFLAGS += -DOSX
LINK += -dynamiclib -lstdc++ -mmacosx-version-min=10.5
else
LIB_EXT = so
LIB_SUFFIX = _amxx_i386
CFLAGS += -DLINUX
LINK += -shared
endif
LINK += -m32 -lm -ldl
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32 -DHAVE_STDINT_H -fno-strict-aliasing -m32 -Wall -Werror
CPPFLAGS += -fno-exceptions -fno-rtti
BINARY = $(PROJECT)$(LIB_SUFFIX).$(LIB_EXT)
ifeq "$(DEBUG)" "true"
BIN_DIR = Debug
CFLAGS += $(C_DEBUG_FLAGS)
else
BIN_DIR = Release
CFLAGS += $(C_OPT_FLAGS)
LINK += -s
endif
IS_CLANG := $(shell $(CPP) --version | head -1 | grep clang > /dev/null && echo "1" || echo "0")
ifeq "$(IS_CLANG)" "1"
CPP_MAJOR := $(shell $(CPP) --version | grep clang | sed "s/.*version \([0-9]\)*\.[0-9]*.*/\1/")
CPP_MINOR := $(shell $(CPP) --version | grep clang | sed "s/.*version [0-9]*\.\([0-9]\)*.*/\1/")
else
CPP_MAJOR := $(shell $(CPP) -dumpversion >&1 | cut -b1)
CPP_MINOR := $(shell $(CPP) -dumpversion >&1 | cut -b3)
endif
# Clang || GCC >= 4
ifeq "$(shell expr $(IS_CLANG) \| $(CPP_MAJOR) \>= 4)" "1"
CFLAGS += $(C_GCC4_FLAGS)
CPPFLAGS += $(CPP_GCC4_FLAGS)
endif
# Clang >= 3 || GCC >= 4.7
ifeq "$(shell expr $(IS_CLANG) \& $(CPP_MAJOR) \>= 3 \| $(CPP_MAJOR) \>= 4 \& $(CPP_MINOR) \>= 7)" "1"
CPPFLAGS += -Wno-delete-non-virtual-dtor
endif
# OS is Linux and not using clang
ifeq "$(shell expr $(OS) \= Linux \& $(IS_CLANG) \= 0)" "1"
LINK += -static-libgcc
endif
OBJ_BIN := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
# This will break if we include other Makefiles, but is fine for now. It allows
# us to make a copy of this file that uses altered paths (ie. Makefile.mine)
# or other changes without mucking up the original.
MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
$(BIN_DIR)/%.o: %.cpp
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
all:
mkdir -p $(BIN_DIR)
ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp
$(MAKE) -f $(MAKEFILE_NAME) $(PROJECT)
$(PROJECT): $(OBJ_BIN)
$(CPP) $(INCLUDE) $(OBJ_BIN) $(LINK) -o $(BIN_DIR)/$(BINARY)
debug:
$(MAKE) -f $(MAKEFILE_NAME) all DEBUG=true
default: all
clean:
rm -rf $(BIN_DIR)/*.o
rm -f $(BIN_DIR)/$(BINARY)

257
modules/engine/amxxapi.cpp Normal file
View File

@ -0,0 +1,257 @@
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Engine Module
//
#include "engine.h"
BOOL CheckForPublic(const char *publicname);
edict_t *g_player_edicts[33];
int AmxStringToEngine(AMX *amx, cell param, int &len)
{
char *szString = MF_GetAmxString(amx, param, 0, &len);
return ALLOC_STRING(szString);
}
void ClearHooks()
{
size_t i;
for (i=0; i<Touches.length(); i++)
delete Touches[i];
for (i=0; i<Impulses.length(); i++)
delete Impulses[i];
for (i=0; i<Thinks.length(); i++)
delete Thinks[i];
Touches.clear();
Impulses.clear();
Thinks.clear();
}
void OnAmxxAttach()
{
pfnTouchForward = 0;
pfnThinkForward = 0;
PlayerPreThinkForward = 0;
PlayerPostThinkForward = 0;
ClientKillForward = 0;
ClientImpulseForward = 0;
CmdStartForward = 0;
StartFrameForward = 0;
MF_AddNatives(ent_Natives);
MF_AddNewNatives(ent_NewNatives);
MF_AddNatives(engine_Natives);
MF_AddNewNatives(engine_NewNatives);
MF_AddNatives(global_Natives);
memset(glinfo.szLastLights, 0x0, 128);
memset(glinfo.szRealLights, 0x0, 128);
glinfo.fNextLights = 0;
glinfo.bCheckLights = false;
}
void OnPluginsLoaded()
{
g_CameraCount=0;
pfnThinkForward = MF_RegisterForward("pfn_think", ET_STOP, FP_CELL, FP_DONE); // done
PlayerPreThinkForward = MF_RegisterForward("client_PreThink", ET_STOP, FP_CELL, FP_DONE); // done
PlayerPostThinkForward = MF_RegisterForward("client_PostThink", ET_STOP, FP_CELL, FP_DONE); // done
ClientKillForward = MF_RegisterForward("client_kill", ET_STOP, FP_CELL, FP_DONE); // done
ClientImpulseForward = MF_RegisterForward("client_impulse", ET_STOP, FP_CELL, FP_CELL, FP_DONE); // done
CmdStartForward = MF_RegisterForward("client_cmdStart", ET_STOP, FP_CELL, FP_DONE); // done
StartFrameForward = MF_RegisterForward("server_frame", ET_IGNORE, FP_DONE); // done
DispatchKeyForward = MF_RegisterForward("pfn_keyvalue", ET_STOP, FP_CELL, FP_DONE); // done
PlaybackForward = MF_RegisterForward("pfn_playbackevent", ET_STOP, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); // done
SpawnForward = MF_RegisterForward("pfn_spawn", ET_STOP, FP_CELL, FP_DONE); // done
pfnTouchForward = MF_RegisterForward("pfn_touch", ET_STOP, FP_CELL, FP_CELL, FP_DONE); // done
VexdTouchForward = MF_RegisterForward("vexd_pfntouch", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE); // done
VexdServerForward = MF_RegisterForward("ServerFrame", ET_IGNORE, FP_DONE); // done
// Reset all standard engine callbacks
// These will be reset through native calls, if need be
g_pFunctionTable->pfnAddToFullPack=NULL;
g_pFunctionTable->pfnKeyValue=NULL;
if (CheckForPublic("pfn_keyvalue"))
g_pFunctionTable->pfnKeyValue=KeyValue;
g_pengfuncsTable->pfnPlaybackEvent=NULL; // "pfn_playbackevent"
if (CheckForPublic("pfn_playbackevent"))
g_pengfuncsTable->pfnPlaybackEvent=PlaybackEvent;
g_pFunctionTable->pfnPlayerPreThink=NULL; // "client_PreThink"
if (CheckForPublic("client_PreThink"))
g_pFunctionTable->pfnPlayerPreThink=PlayerPreThink;
g_pFunctionTable_Post->pfnPlayerPostThink=NULL; // "client_PostThink"
if (CheckForPublic("client_PostThink"))
g_pFunctionTable->pfnPlayerPostThink=PlayerPostThink_Post;
g_pFunctionTable->pfnSpawn=NULL; // "pfn_spawn"
//if (CheckForPublic("pfn_spawn")) // JGHG: I commented this if out because we always need the Spawn to precache the rocket mdl used with SetView native
g_pFunctionTable->pfnSpawn=Spawn;
g_pFunctionTable->pfnClientKill=NULL; // "client_kill"
if (CheckForPublic("client_kill"))
g_pFunctionTable->pfnClientKill=ClientKill;
g_pFunctionTable->pfnCmdStart=NULL; // "client_impulse","register_impulse","client_cmdStart"
if (CheckForPublic("client_impulse") || CheckForPublic("client_cmdStart"))
g_pFunctionTable->pfnCmdStart=CmdStart;
g_pFunctionTable->pfnThink=NULL; // "pfn_think", "register_think"
if (CheckForPublic("pfn_think"))
g_pFunctionTable->pfnThink=Think;
g_pFunctionTable->pfnStartFrame=NULL; // "server_frame","ServerFrame"
if (CheckForPublic("server_frame"))
g_pFunctionTable->pfnStartFrame=StartFrame;
if (CheckForPublic("ServerFrame"))
g_pFunctionTable->pfnStartFrame=StartFrame;
g_pFunctionTable->pfnTouch=NULL; // "pfn_touch","vexd_pfntouch"
if (CheckForPublic("pfn_touch"))
g_pFunctionTable->pfnTouch=pfnTouch;
if (CheckForPublic("vexd_pfntouch"))
g_pFunctionTable->pfnTouch=pfnTouch;
}
qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen)
{
if((plinfo[iSender].iSpeakFlags & SPEAK_MUTED) != 0) {
(g_engfuncs.pfnVoice_SetClientListening)(iReceiver, iSender, false);
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
if((plinfo[iSender].iSpeakFlags & SPEAK_ALL) != 0) {
(g_engfuncs.pfnVoice_SetClientListening)(iReceiver, iSender, true);
RETURN_META_VALUE(MRES_SUPERCEDE, true);
}
if((plinfo[iReceiver].iSpeakFlags & SPEAK_LISTENALL) != 0) {
(g_engfuncs.pfnVoice_SetClientListening)(iReceiver, iSender, true);
RETURN_META_VALUE(MRES_SUPERCEDE, true);
}
RETURN_META_VALUE(MRES_IGNORED, bListen);
}
int AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet)
{
if( player && ent == host && plinfo[ENTINDEX(ent)].iViewType != CAMERA_NONE )
{
state->rendermode = kRenderTransTexture;
state->renderamt = 100;
}
RETURN_META_VALUE(MRES_IGNORED, 0);
}
void ClientDisconnect(edict_t *pEntity)
{
int id = ENTINDEX(pEntity);
if (plinfo[ENTINDEX(pEntity)].iViewType != CAMERA_NONE) // Verify that they were originally in a modified view
{
g_CameraCount--;
if (g_CameraCount < 0)
g_CameraCount=0;
if (g_CameraCount==0) // Reset the AddToFullPack pointer if there's no more cameras in use...
g_pFunctionTable->pfnAddToFullPack=NULL;
}
plinfo[id].iSpeakFlags = SPEAK_NORMAL;
plinfo[id].iViewType = CAMERA_NONE;
RETURN_META(MRES_IGNORED);
}
BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128])
{
int id = ENTINDEX(pEntity);
plinfo[id].iSpeakFlags = SPEAK_NORMAL;
plinfo[id].iViewType = CAMERA_NONE;
plinfo[id].pViewEnt = NULL;
RETURN_META_VALUE(MRES_IGNORED, 0);
}
void ServerDeactivate()
{
memset(glinfo.szLastLights, 0x0, 128);
memset(glinfo.szRealLights, 0x0, 128);
glinfo.bCheckLights = false;
glinfo.fNextLights = 0;
// Reset all forwarding function tables (so that forwards won't be called before plugins are initialized)
g_pFunctionTable->pfnAddToFullPack=NULL;
g_pFunctionTable->pfnKeyValue=NULL;
g_pengfuncsTable->pfnPlaybackEvent=NULL; // "pfn_playbackevent"
g_pFunctionTable->pfnPlayerPreThink=NULL; // "client_PreThink"
g_pFunctionTable_Post->pfnPlayerPostThink=NULL; // "client_PostThink"
g_pFunctionTable->pfnSpawn=NULL; // "pfn_spawn"
g_pFunctionTable->pfnClientKill=NULL; // "client_kill"
g_pFunctionTable->pfnCmdStart=NULL; // "client_impulse","register_impulse"
g_pFunctionTable->pfnThink=NULL; // "pfn_think", "register_think"
g_pFunctionTable->pfnStartFrame=NULL; // "server_frame","ServerFrame"
g_pFunctionTable->pfnTouch=NULL; // "pfn_touch","vexd_pfntouch"
g_pFunctionTable_Post->pfnStartFrame = NULL; // "set_lights"
ClearHooks();
RETURN_META(MRES_IGNORED);
}
void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
{
for(int f = 1; f <= gpGlobals->maxClients;f++)
g_player_edicts[f]=pEdictList + f;
RETURN_META(MRES_IGNORED);
}
void LightStyle(int style, const char *val) {
if (!style) {
memset(glinfo.szRealLights, 0x0, 128);
memcpy(glinfo.szRealLights, val, strlen(val));
}
RETURN_META(MRES_IGNORED);
}
BOOL CheckForPublic(const char *publicname)
{
AMX* amx;
char blah[64];
strncpy(blah,publicname,63);
int iFunctionIndex;
int i=0;
// Loop through all running scripts
while((amx=MF_GetScriptAmx(i++))!=NULL)
{
// Scan for public
if (MF_AmxFindPublic(amx, blah, &iFunctionIndex) == AMX_ERR_NONE)
{
// Public was found.
return TRUE;
}
}
return FALSE; // no public found in any loaded script
}

1000
modules/engine/engine.cpp Normal file

File diff suppressed because it is too large Load Diff

234
modules/engine/engine.h Normal file
View File

@ -0,0 +1,234 @@
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Engine Module
//
#ifndef _ENGINE_INCLUDE_H
#define _ENGINE_INCLUDE_H
#include "amxxmodule.h"
#include <extdll.h>
#include <string.h>
#include <meta_api.h>
#include <sdk_util.h>
#include <usercmd.h>
#include "entity.h"
#include "gpglobals.h"
#include "entity_state.h"
#include <am-vector.h>
#include <am-string.h>
extern DLL_FUNCTIONS *g_pFunctionTable;
extern DLL_FUNCTIONS *g_pFunctionTable_Post;
extern enginefuncs_t *g_pengfuncsTable;
extern enginefuncs_t *g_pengfuncsTable_Post;
extern int SpawnForward;
extern int ChangelevelForward;
extern int PlaybackForward;
extern int DispatchKeyForward;
extern int pfnTouchForward;
extern int pfnThinkForward;
extern int PlayerPreThinkForward;
extern int PlayerPostThinkForward;
extern int ClientKillForward;
extern int ClientImpulseForward;
extern int CmdStartForward;
extern int StartFrameForward;
extern int DispatchUseForward;
extern int VexdTouchForward;
extern int VexdServerForward;
#define AMS_OFFSET 0.01
#define GETINFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer)
#define INFO_KEY_BUFFER (*g_engfuncs.pfnGetInfoKeyBuffer)
#define INFO_KEY_VALUE (*g_engfuncs.pfnInfoKeyValue)
#define SPEAK_NORMAL 0
#define SPEAK_MUTED 1
#define SPEAK_ALL 2
#define SPEAK_LISTENALL 4
#define CAMERA_NONE 0
#define CAMERA_3RDPERSON 1
#define CAMERA_UPLEFT 2
#define CAMERA_TOPDOWN 3
enum
{
usercmd_float_start,
usercmd_forwardmove, // Float
usercmd_sidemove, // Float
usercmd_upmove, // Float
usercmd_float_end,
usercmd_int_start,
usercmd_lerp_msec, // short
usercmd_msec, // byte
usercmd_lightlevel, // byte
usercmd_buttons, // unsigned short
usercmd_impulse, // byte
usercmd_weaponselect, // byte
usercmd_impact_index, // in
usercmd_int_end,
usercmd_vec_start,
usercmd_viewangles, // Vector
usercmd_impact_position, // vec
usercmd_vec_end
};
// Used by the traceresult() native.
enum
{
TR_AllSolid, // (int) if true, plane is not valid
TR_StartSolid, // (int) if true, the initial point was in a solid area
TR_InOpen, // (int)
TR_InWater, // (int)
TR_Fraction, // (float) time completed, 1.0 = didn't hit anything
TR_EndPos, // (vector) final position
TR_PlaneDist, // (float)
TR_PlaneNormal, // (vector) surface normal at impact
TR_Hit, // (entity) entity the surface is on
TR_Hitgroup // (int) 0 == generic, non zero is specific body part
};
enum {
Meta_GetUserMsgID, // int ) (plid_t plid, const char *msgname, int *size);
Meta_GetUserMsgName, // const char *) (plid_t plid, int msgid, int *size);
Meta_GetPluginPath, // const char *) (plid_t plid);
Meta_GetGameInfo // const char *) (plid_t plid, ginfo_t tag);
};
//These two structs are relics from VexD
struct PlayerInfo {
int iSpeakFlags;
edict_t *pViewEnt;
int iViewType;
//int iRenderMode;
//float fRenderAmt;
};
struct GlobalInfo {
float fNextLights;
char szLastLights[128];
char szRealLights[128];
bool bCheckLights;
};
class Impulse
{
public:
~Impulse()
{
if (Forward != -1)
MF_UnregisterSPForward(Forward);
}
int Forward;
int Check;
};
class Touch
{
public:
int Forward;
ke::AString Toucher;
ke::AString Touched;
~Touch()
{
if (Forward != -1)
MF_UnregisterSPForward(Forward);
}
};
class EntClass
{
public:
int Forward;
ke::AString Class;
~EntClass()
{
if (Forward != -1)
MF_UnregisterSPForward(Forward);
}
};
int is_ent_valid(int iEnt);
int AmxStringToEngine(AMX *amx, cell param, int &len);
edict_t *UTIL_FindEntityInSphere(edict_t *pStart, const Vector &vecCenter, float flRadius);
extern int g_CameraCount;
extern edict_t *g_player_edicts[33];
inline edict_t* INDEXENT2( int iEdictNum )
{
if (iEdictNum >= 1 && iEdictNum <= gpGlobals->maxClients)
return MF_GetPlayerEdict(iEdictNum);
else
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
}
int Spawn(edict_t *pEntity);
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);
void KeyValue(edict_t *pEntity, KeyValueData *pkvd);
void StartFrame();
void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int random_seed);
void ClientKill(edict_t *pEntity);
void PlayerPreThink(edict_t *pEntity);
void PlayerPostThink_Post(edict_t *pEntity);
void pfnTouch(edict_t *pToucher, edict_t *pTouched);
void Think(edict_t *pent);
void StartFrame_Post();
#define CHECK_ENTITY_SIMPLE(x) \
if (x < 0 || x > gpGlobals->maxEntities) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
return 0; \
} else { \
if (x != 0 && FNullEnt(INDEXENT(x))) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
return 0; \
} \
}
#define CHECK_ENTITY(x) \
if (x < 0 || x > gpGlobals->maxEntities) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
return 0; \
} else { \
if (x <= gpGlobals->maxClients) { \
if (!MF_IsPlayerIngame(x)) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
return 0; \
} \
} else { \
if (x != 0 && FNullEnt(INDEXENT(x))) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
return 0; \
} \
} \
}
extern bool g_inKeyValue;
extern KeyValueData *g_pkvd;
extern bool incmd;
extern struct usercmd_s *g_cmd;
extern struct PlayerInfo plinfo[33];
extern struct GlobalInfo glinfo;
extern AMX_NATIVE_INFO engine_Natives[];
extern AMX_NATIVE_INFO engine_NewNatives[];
extern ke::Vector<Impulse *> Impulses;
extern ke::Vector<EntClass *> Thinks;
extern ke::Vector<Touch *> Touches;
#endif //_ENGINE_INCLUDE_H

1635
modules/engine/entity.cpp Normal file

File diff suppressed because it is too large Load Diff

170
modules/engine/entity.h Normal file
View File

@ -0,0 +1,170 @@
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Engine Module
//
#ifndef _INCLUDE_ENGINE_ENTSTUFF
#define _INCLUDE_ENGINE_ENTSTUFF
#include "engine.h"
enum {
gamestate,
oldbuttons,
groupinfo,
iuser1,
iuser2,
iuser3,
iuser4,
weaponanim,
pushmsec,
bInDuck,
flTimeStepSound,
flSwimTime,
flDuckTime,
iStepLeft,
movetype,
solid,
skin,
body,
effects,
light_level,
sequence,
gaitsequence,
modelindex,
playerclass,
waterlevel,
watertype,
spawnflags,
flags,
colormap,
team,
fixangle,
weapons,
rendermode,
renderfx,
button,
impulse,
deadflag,
};
enum {
impacttime,
starttime,
idealpitch,
pitch_speed,
ideal_yaw,
yaw_speed,
ltime,
nextthink,
gravity,
friction,
frame,
animtime,
framerate,
health,
frags,
takedamage,
max_health,
teleport_time,
armortype,
armorvalue,
dmg_take,
dmg_save,
dmg,
dmgtime,
speed,
air_finished,
pain_finished,
radsuit_finished,
scale,
renderamt,
maxspeed,
fov,
flFallVelocity,
fuser1,
fuser2,
fuser3,
fuser4,
};
enum {
origin,
oldorigin,
velocity,
basevelocity,
clbasevelocity,
movedir,
angles,
avelocity,
punchangle,
v_angle,
endpos,
startpos,
absmin,
absmax,
mins,
maxs,
size,
rendercolor,
view_ofs,
vuser1,
vuser2,
vuser3,
vuser4,
};
enum {
chain,
dmg_inflictor,
enemy,
aiment,
owner,
groundentity,
pContainingEntity,
euser1,
euser2,
euser3,
euser4,
};
enum {
classname,
globalname,
model,
target,
targetname,
netname,
message,
noise,
noise1,
noise2,
noise3,
viewmodel,
weaponmodel,
};
enum {
controller1,
controller2,
controller3,
controller4,
blending1,
blending2,
};
void UTIL_SetSize(edict_t *pev, const Vector &vecMin, const Vector &vecMax);
extern AMX_NATIVE_INFO ent_Natives[];
extern AMX_NATIVE_INFO ent_NewNatives[];
#endif //_INCLUDE_ENGINE_ENTSTUFF

326
modules/engine/forwards.cpp Normal file
View File

@ -0,0 +1,326 @@
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Engine Module
//
#include "engine.h"
bool incmd = false;
int DispatchUseForward = 0;
int SpawnForward = 0;
int PlaybackForward = 0;
int DispatchKeyForward = 0;
int pfnTouchForward = 0;
int pfnThinkForward = 0;
int PlayerPreThinkForward = 0;
int PlayerPostThinkForward = 0;
int ClientKillForward = 0;
int ClientImpulseForward = 0;
int CmdStartForward = 0;
int StartFrameForward = 0;
int VexdTouchForward = 0;
int VexdServerForward = 0;
ke::Vector<Impulse *> Impulses;
ke::Vector<EntClass *> Thinks;
ke::Vector<Touch *> Touches;
KeyValueData *g_pkvd;
bool g_inKeyValue=false;
bool g_precachedStuff = false;
int fstrcmp(const char *s1, const char *s2)
{
int i=0;
int len1 = strlen(s1);
int len2 = strlen(s2);
if (len1 != len2)
return 0;
for (i=0; i<len1; i++)
{
if (s1[i] != s2[i])
return 0;
}
return 1;
}
int Spawn(edict_t *pEntity)
{
if (!g_precachedStuff) {
// Used for SetView, added by JGHG
PRECACHE_MODEL("models/rpgrocket.mdl");
g_precachedStuff = true;
}
if (SpawnForward != -1) {
int retVal = 0;
int id = ENTINDEX(pEntity);
retVal = MF_ExecuteForward(SpawnForward, (cell)id);
if (retVal)
RETURN_META_VALUE(MRES_SUPERCEDE, -1);
}
RETURN_META_VALUE(MRES_IGNORED, 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)
{
if (PlaybackForward != -1) {
edict_t *e = (edict_t *)pInvoker;
int retVal = 0;
static cell cOrigin[3];
static cell cAngles[3];
Vector vOrigin = (Vector)origin;
Vector vAngles = (Vector)angles;
cOrigin[0] = amx_ftoc(vOrigin.x);
cOrigin[1] = amx_ftoc(vOrigin.y);
cOrigin[2] = amx_ftoc(vOrigin.z);
cAngles[0] = amx_ftoc(vAngles.x);
cAngles[1] = amx_ftoc(vAngles.y);
cAngles[2] = amx_ftoc(vAngles.z);
cell CellOrigin = MF_PrepareCellArray(cOrigin, 3);
cell CellAngles = MF_PrepareCellArray(cAngles, 3);
retVal = MF_ExecuteForward(PlaybackForward, (cell)flags, (cell)ENTINDEX(e), (cell)eventindex, delay, CellOrigin, CellAngles, fparam1, fparam2, (cell)iparam1, (cell)iparam2, (cell)bparam1, (cell)bparam2);
if (retVal)
RETURN_META(MRES_SUPERCEDE);
}
RETURN_META(MRES_IGNORED);
}
void KeyValue(edict_t *pEntity, KeyValueData *pkvd)
{
int retVal = 0;
g_inKeyValue=true;
g_pkvd=pkvd;
int index = ENTINDEX(pEntity);
if (DispatchKeyForward != -1) {
retVal = MF_ExecuteForward(DispatchKeyForward, (cell)index);
g_inKeyValue=false;
if (retVal)
RETURN_META(MRES_SUPERCEDE);
}
g_inKeyValue=false;
RETURN_META(MRES_IGNORED);
}
void StartFrame()
{
if (StartFrameForward != -1)
MF_ExecuteForward(StartFrameForward);
else if (VexdServerForward != -1)
MF_ExecuteForward(VexdServerForward);
RETURN_META(MRES_IGNORED);
}
void StartFrame_Post()
{
if (glinfo.bCheckLights)
{
if (glinfo.fNextLights < gpGlobals->time)
{
(g_engfuncs.pfnLightStyle)(0, glinfo.szLastLights);
glinfo.fNextLights = gpGlobals->time + 1;
}
}
RETURN_META(MRES_IGNORED);
}
void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int random_seed)
{
unsigned int i = 0;
int retVal = 0;
edict_t *pEntity = (edict_t *)player;
g_cmd = (struct usercmd_s *)_cmd;
int origImpulse = g_cmd->impulse; // incase a plugin alters it
for (i=0; i<Impulses.length(); i++)
{
if (Impulses[i]->Check == g_cmd->impulse)
{
retVal = MF_ExecuteForward(Impulses[i]->Forward, (cell)ENTINDEX(pEntity), (cell)origImpulse);
// don't return SUPERCEDE in any way here,
// we don't want to break client_impulse forward and access to cmd with [g/s]et_usercmd
if (retVal)
g_cmd->impulse = 0;
}
}
// client_impulse
if (ClientImpulseForward != -1 && origImpulse != 0)
{
retVal = MF_ExecuteForward(ClientImpulseForward, (cell)ENTINDEX(pEntity), (cell)origImpulse);
if (retVal)
g_cmd->impulse = 0;
}
// client_CmdStart
if (CmdStartForward != -1)
{
incmd = true;
retVal = MF_ExecuteForward(CmdStartForward, (cell)ENTINDEX(pEntity));
incmd = false;
if (retVal)
RETURN_META(MRES_SUPERCEDE);
}
RETURN_META(MRES_IGNORED);
}
void ClientKill(edict_t *pEntity)
{
int retVal = 0;
if (ClientKillForward != -1) {
retVal = MF_ExecuteForward(ClientKillForward, (cell)ENTINDEX(pEntity));
if (retVal)
RETURN_META(MRES_SUPERCEDE);
}
RETURN_META(MRES_IGNORED);
}
void PlayerPreThink(edict_t *pEntity)
{
MF_ExecuteForward(PlayerPreThinkForward, (cell)ENTINDEX(pEntity));
RETURN_META(MRES_IGNORED);
}
void PlayerPostThink_Post(edict_t *pEntity)
{
if(plinfo[ENTINDEX(pEntity)].pViewEnt) {
edict_t *pCamEnt = plinfo[ENTINDEX(pEntity)].pViewEnt;
MAKE_VECTORS(pEntity->v.v_angle + pEntity->v.punchangle);
Vector vecSrc = pEntity->v.origin + pEntity->v.view_ofs;
Vector vecAiming = gpGlobals->v_forward;
TraceResult tr;
switch(plinfo[ENTINDEX(pEntity)].iViewType) {
case CAMERA_3RDPERSON:
TRACE_LINE(vecSrc, vecSrc - (vecAiming * 128), ignore_monsters, ENT(pEntity), &tr);
SET_VIEW(pEntity, pCamEnt);
pCamEnt->v.origin = tr.vecEndPos;
pCamEnt->v.angles = pEntity->v.v_angle;
break;
case CAMERA_UPLEFT:
TRACE_LINE(vecSrc, vecSrc - ((vecAiming * 32) - ((gpGlobals->v_right * 15) + (gpGlobals->v_up * 15))), ignore_monsters, ENT(pEntity), &tr);
SET_VIEW(pEntity, pCamEnt);
pCamEnt->v.origin = tr.vecEndPos;
pCamEnt->v.angles = pEntity->v.v_angle;
break;
case CAMERA_TOPDOWN:
TRACE_LINE(vecSrc, vecSrc + Vector(0,0,2048), dont_ignore_monsters, ENT(pEntity), &tr);
SET_VIEW(pEntity, pCamEnt);
pCamEnt->v.origin = tr.vecEndPos;
pCamEnt->v.origin.z -= 40;
pCamEnt->v.angles = Vector(90,pEntity->v.v_angle.y,0);
break;
default:
SET_VIEW(pEntity, pEntity);
REMOVE_ENTITY(plinfo[ENTINDEX(pEntity)].pViewEnt);
plinfo[ENTINDEX(pEntity)].iViewType = CAMERA_NONE;
plinfo[ENTINDEX(pEntity)].pViewEnt = NULL;
break;
}
}
if (PlayerPostThinkForward != -1)
{
if (MF_ExecuteForward(PlayerPostThinkForward, (cell)ENTINDEX(pEntity)))
RETURN_META(MRES_SUPERCEDE);
}
RETURN_META(MRES_IGNORED);
}
void pfnTouch(edict_t *pToucher, edict_t *pTouched)
{
unsigned int i = 0;
int retVal = 0;
const char *ptrClass = STRING(pToucher->v.classname);
const char *ptdClass = STRING(pTouched->v.classname);
int ptrIndex = ENTINDEX(pToucher);
int ptdIndex = ENTINDEX(pTouched);
META_RES res=MRES_IGNORED;
for (i=0; i<Touches.length(); i++)
{
if (Touches[i]->Toucher.length() == 0)
{
if (Touches[i]->Touched.length() == 0)
{
retVal = MF_ExecuteForward(Touches[i]->Forward, (cell)ptrIndex, (cell)ptdIndex);
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
RETURN_META(MRES_SUPERCEDE);
else if (retVal)
res=MRES_SUPERCEDE;
} else if (Touches[i]->Touched.compare(ptdClass)==0) {
retVal = MF_ExecuteForward(Touches[i]->Forward, (cell)ptrIndex, (cell)ptdIndex);
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
RETURN_META(MRES_SUPERCEDE);
else if (retVal)
res=MRES_SUPERCEDE;
}
} else if (Touches[i]->Toucher.compare(ptrClass)==0) {
if (Touches[i]->Touched.length() == 0)
{
retVal = MF_ExecuteForward(Touches[i]->Forward, (cell)ptrIndex, (cell)ptdIndex);
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
RETURN_META(MRES_SUPERCEDE);
else if (retVal)
res=MRES_SUPERCEDE;
} else if (Touches[i]->Touched.compare(ptdClass)==0) {
retVal = MF_ExecuteForward(Touches[i]->Forward, (cell)ptrIndex, (cell)ptdIndex);
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
RETURN_META(MRES_SUPERCEDE);
else if (retVal)
res=MRES_SUPERCEDE;
}
}
}
/* Execute pfnTouch forwards */
if (pfnTouchForward != -1) {
retVal = MF_ExecuteForward(pfnTouchForward, (cell)ptrIndex, (cell)ptdIndex);
if (retVal)
RETURN_META(MRES_SUPERCEDE);
}
if (VexdTouchForward != -1) {
retVal = MF_ExecuteForward(VexdTouchForward, (cell)ptrIndex, (cell)ptdIndex);
if (retVal)
RETURN_META(MRES_SUPERCEDE);
}
RETURN_META(res);
}
void Think(edict_t *pent)
{
unsigned int i = 0;
const char *cls = STRING(pent->v.classname);
META_RES res=MRES_IGNORED;
int retVal=0;
for (i=0; i<Thinks.length(); i++)
{
if (Thinks[i]->Class.compare(cls)==0)
{
retVal=MF_ExecuteForward(Thinks[i]->Forward, (cell)ENTINDEX(pent));
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
RETURN_META(MRES_SUPERCEDE);
else if (retVal)
res=MRES_SUPERCEDE;
}
}
retVal=MF_ExecuteForward(pfnThinkForward, (cell)ENTINDEX(pent));
if (retVal)
res=MRES_SUPERCEDE;
RETURN_META(res);
}

189
modules/engine/globals.cpp Normal file
View File

@ -0,0 +1,189 @@
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Engine Module
//
#include "gpglobals.h"
static cell AMX_NATIVE_CALL get_global_float(AMX *amx, cell *params)
{
REAL returnValue;
switch (params[1]) {
case GL_coop:
returnValue = gpGlobals->coop;
break;
case GL_deathmatch:
returnValue = gpGlobals->deathmatch;
break;
case GL_force_retouch:
returnValue = gpGlobals->force_retouch;
break;
case GL_found_secrets:
returnValue = gpGlobals->found_secrets;
break;
case GL_frametime:
returnValue = gpGlobals->frametime;
break;
case GL_serverflags:
returnValue = gpGlobals->serverflags;
break;
case GL_teamplay:
returnValue = gpGlobals->teamplay;
break;
case GL_time:
returnValue = gpGlobals->time;
break;
case GL_trace_allsolid:
returnValue = gpGlobals->trace_allsolid;
break;
case GL_trace_fraction:
returnValue = gpGlobals->trace_fraction;
break;
case GL_trace_inopen:
returnValue = gpGlobals->trace_inopen;
break;
case GL_trace_inwater:
returnValue = gpGlobals->trace_inwater;
break;
case GL_trace_plane_dist:
returnValue = gpGlobals->trace_plane_dist;
break;
case GL_trace_startsolid:
returnValue = gpGlobals->trace_startsolid;
break;
default:
MF_LogError(amx, AMX_ERR_NATIVE, "Undefined global_float index %d", params[1]);
return 0;
}
return amx_ftoc(returnValue);
}
static cell AMX_NATIVE_CALL get_global_int(AMX *amx, cell *params)
{
int returnValue = 0;
switch (params[1]) {
case GL_cdAudioTrack:
returnValue = gpGlobals->cdAudioTrack;
break;
case GL_maxClients:
returnValue = gpGlobals->maxClients;
break;
case GL_maxEntities:
returnValue = gpGlobals->maxEntities;
break;
case GL_msg_entity:
returnValue = gpGlobals->msg_entity;
break;
case GL_trace_flags:
returnValue = gpGlobals->trace_flags;
break;
case GL_trace_hitgroup:
returnValue = gpGlobals->trace_hitgroup;
break;
default:
MF_LogError(amx, AMX_ERR_NATIVE, "Undefined global_int index %d", params[1]);
return 0;
}
return returnValue;
}
static cell AMX_NATIVE_CALL get_global_string(AMX *amx, cell *params)
{
string_t* returnValue;
switch(params[1]) {
case GL_pStringBase: // const char *, so no string_t
return MF_SetAmxString(amx, params[2], gpGlobals->pStringBase, params[3]);
// The rest are string_t:s...
case GL_mapname:
returnValue = &(gpGlobals->mapname);
break;
case GL_startspot:
returnValue = &(gpGlobals->startspot);
break;
default:
MF_LogError(amx, AMX_ERR_NATIVE, "Undefined global_string index %d", params[1]);
return 0;
}
return MF_SetAmxString(amx, params[2], STRING(*returnValue), params[3]);
}
static cell AMX_NATIVE_CALL get_global_vector(AMX *amx, cell *params) // globals_get_vector(variable, Float:vector[3]); = 2 params
{
cell *cRet = MF_GetAmxAddr(amx, params[2]);
vec3_t fetchedVector;
switch (params[1]) {
case GL_trace_endpos:
fetchedVector = gpGlobals->trace_endpos;
break;
case GL_trace_plane_normal:
fetchedVector = gpGlobals->trace_plane_normal;
break;
case GL_v_forward:
fetchedVector = gpGlobals->v_forward;
break;
case GL_v_right:
fetchedVector = gpGlobals->v_right;
break;
case GL_v_up:
fetchedVector = gpGlobals->v_up;
break;
case GL_vecLandmarkOffset:
fetchedVector = gpGlobals->vecLandmarkOffset;
break;
default:
MF_LogError(amx, AMX_ERR_NATIVE, "Undefined global_vector index %d", params[1]);
return 0;
}
cRet[0] = amx_ftoc(fetchedVector.x);
cRet[1] = amx_ftoc(fetchedVector.y);
cRet[2] = amx_ftoc(fetchedVector.z);
return 1;
}
static cell AMX_NATIVE_CALL get_global_edict(AMX *amx, cell *params) // globals_get_edict(variable); = 1 param
{
edict_t* pReturnEntity;
switch (params[1]) {
case GL_trace_ent:
pReturnEntity = gpGlobals->trace_ent;
break;
default:
MF_LogError(amx, AMX_ERR_NATIVE, "Undefined global_edict index %d", params[1]);
return 0;
}
// Will crash if ENTINDEX() is called on bad pointer?
if(!FNullEnt(pReturnEntity))
return ENTINDEX(pReturnEntity);
return 0;
}
AMX_NATIVE_INFO global_Natives[] = {
{"get_global_float", get_global_float},
{"get_global_int", get_global_int},
{"get_global_string", get_global_string},
{"get_global_edict", get_global_edict},
{"get_global_vector", get_global_vector},
{NULL, NULL},
///////////////////
};

View File

@ -0,0 +1,67 @@
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Engine Module
//
#ifndef _INCLUDE_ENGINE_GLOBAL
#define _INCLUDE_ENGINE_GLOBAL
#include "engine.h"
enum globals {
// Edict
GL_trace_ent = 0,
// Float
GL_coop,
GL_deathmatch,
GL_force_retouch,
GL_found_secrets,
GL_frametime,
GL_serverflags,
GL_teamplay,
GL_time,
GL_trace_allsolid,
GL_trace_fraction,
GL_trace_inopen,
GL_trace_inwater,
GL_trace_plane_dist,
GL_trace_startsolid,
// Int
GL_cdAudioTrack,
GL_maxClients,
GL_maxEntities,
GL_msg_entity,
GL_trace_flags,
GL_trace_hitgroup,
// String
GL_pStringBase,
GL_mapname,
GL_startspot,
// Vector
GL_trace_endpos,
GL_trace_plane_normal,
GL_v_forward,
GL_v_right,
GL_v_up,
GL_vecLandmarkOffset,
// Void (not supported)
GL_pSaveData
};
extern AMX_NATIVE_INFO global_Natives[];
#endif //_INCLUDE_ENGINE_GLOBAL

View File

@ -0,0 +1,506 @@
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Module Config
//
#ifndef __MODULECONFIG_H__
#define __MODULECONFIG_H__
#include <amxmodx_version.h>
// Module info
#define MODULE_NAME "Engine"
#define MODULE_VERSION AMXX_VERSION
#define MODULE_AUTHOR "AMX Mod X Dev Team"
#define MODULE_URL "http://www.amxmodx.org"
#define MODULE_LOGTAG "ENGINE"
#define MODULE_LIBRARY "engine"
#define MODULE_LIBCLASS ""
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
#define MODULE_RELOAD_ON_MAPCHANGE
#ifdef __DATE__
#define MODULE_DATE __DATE__
#else // __DATE__
#define MODULE_DATE "Unknown"
#endif // __DATE__
// metamod plugin?
#define USE_METAMOD
// use memory manager/tester?
// note that if you use this, you cannot construct/allocate
// anything before the module attached (OnAmxxAttach).
// be careful of default constructors using new/malloc!
// #define MEMORY_TEST
// Unless you use STL or exceptions, keep this commented.
// It allows you to compile without libstdc++.so as a dependency
// #define NO_ALLOC_OVERRIDES
// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself
// #define NO_MSVC8_AUTO_COMPAT
/**
* AMXX Init functions
* Also consider using FN_META_*
*/
/** AMXX query */
//#define FN_AMXX_QUERY OnAmxxQuery
/** AMXX attach
* Do native functions init here (MF_AddNatives)
*/
#define FN_AMXX_ATTACH OnAmxxAttach
/** AMXX Detach (unload) */
//#define FN_AMXX_DETACH OnAmxxDetach
/** All plugins loaded
* Do forward functions init here (MF_RegisterForward)
*/
#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
/** All plugins are about to be unloaded */
//#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading
/** All plugins are now unloaded */
//#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded
/**** METAMOD ****/
// If your module doesn't use metamod, you may close the file now :)
#ifdef USE_METAMOD
// ----
// Hook Functions
// Uncomment these to be called
// You can also change the function name
// - Metamod init functions
// Also consider using FN_AMXX_*
// Meta query
//#define FN_META_QUERY OnMetaQuery
// Meta attach
//#define FN_META_ATTACH OnMetaAttach
// Meta dettach
//#define FN_META_DETACH OnMetaDetach
// (wd) are Will Day's notes
// - GetEntityAPI2 functions
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
// #define FN_DispatchSpawn Spawn /* pfnSpawn() */
// #define FN_DispatchThink Think /* pfnThink() */
// #define FN_DispatchUse Use /* pfnUse() */
// #define FN_DispatchTouch pfnTouch /* pfnTouch() */
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
// #define FN_DispatchKeyValue KeyValue /* pfnKeyValue() */
// #define FN_DispatchSave DispatchSave /* pfnSave() */
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
#define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
#define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
// - GetEntityAPI2_Post functions
// #define FN_GameDLLInit_Post GameDLLInit_Post
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
// #define FN_DispatchThink_Post DispatchThink_Post
// #define FN_DispatchUse_Post DispatchUse_Post
// #define FN_DispatchTouch_Post DispatchTouch_Post
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
// #define FN_DispatchSave_Post DispatchSave_Post
// #define FN_DispatchRestore_Post DispatchRestore_Post
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
// #define FN_SaveReadFields_Post SaveReadFields_Post
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
// #define FN_ClientConnect_Post ClientConnect_Post
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
// #define FN_ClientKill_Post ClientKill_Post
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
// #define FN_ClientCommand_Post ClientCommand_Post
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
// #define FN_ServerActivate_Post ServerActivate_Post
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
// #define FN_StartFrame_Post StartFrame_Post
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
// #define FN_GetGameDescription_Post GetGameDescription_Post
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
// #define FN_SpectatorThink_Post SpectatorThink_Post
// #define FN_Sys_Error_Post Sys_Error_Post
// #define FN_PM_Move_Post PM_Move_Post
// #define FN_PM_Init_Post PM_Init_Post
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
// #define FN_SetupVisibility_Post SetupVisibility_Post
// #define FN_UpdateClientData_Post UpdateClientData_Post
#define FN_AddToFullPack_Post AddToFullPack_Post
// #define FN_CreateBaseline_Post CreateBaseline_Post
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
// #define FN_GetWeaponData_Post GetWeaponData_Post
// #define FN_CmdStart_Post CmdStart_Post
// #define FN_CmdEnd_Post CmdEnd_Post
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
// #define FN_GetHullBounds_Post GetHullBounds_Post
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
// #define FN_InconsistentFile_Post InconsistentFile_Post
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
// - GetEngineAPI functions
// #define FN_PrecacheModel PrecacheModel
// #define FN_PrecacheSound PrecacheSound
// #define FN_SetModel SetModel
// #define FN_ModelIndex ModelIndex
// #define FN_ModelFrames ModelFrames
// #define FN_SetSize SetSize
// #define FN_ChangeLevel ChangeLevel
// #define FN_GetSpawnParms GetSpawnParms
// #define FN_SaveSpawnParms SaveSpawnParms
// #define FN_VecToYaw VecToYaw
// #define FN_VecToAngles VecToAngles
// #define FN_MoveToOrigin MoveToOrigin
// #define FN_ChangeYaw ChangeYaw
// #define FN_ChangePitch ChangePitch
// #define FN_FindEntityByString FindEntityByString
// #define FN_GetEntityIllum GetEntityIllum
// #define FN_FindEntityInSphere FindEntityInSphere
// #define FN_FindClientInPVS FindClientInPVS
// #define FN_EntitiesInPVS EntitiesInPVS
// #define FN_MakeVectors MakeVectors
// #define FN_AngleVectors AngleVectors
// #define FN_CreateEntity CreateEntity
// #define FN_RemoveEntity RemoveEntity
// #define FN_CreateNamedEntity CreateNamedEntity
// #define FN_MakeStatic MakeStatic
// #define FN_EntIsOnFloor EntIsOnFloor
// #define FN_DropToFloor DropToFloor
// #define FN_WalkMove WalkMove
// #define FN_SetOrigin SetOrigin
// #define FN_EmitSound EmitSound
// #define FN_EmitAmbientSound EmitAmbientSound
// #define FN_TraceLine TraceLine
// #define FN_TraceToss TraceToss
// #define FN_TraceMonsterHull TraceMonsterHull
// #define FN_TraceHull TraceHull
// #define FN_TraceModel TraceModel
// #define FN_TraceTexture TraceTexture
// #define FN_TraceSphere TraceSphere
// #define FN_GetAimVector GetAimVector
// #define FN_ServerCommand ServerCommand
// #define FN_ServerExecute ServerExecute
// #define FN_engClientCommand engClientCommand
// #define FN_ParticleEffect ParticleEffect
#define FN_LightStyle LightStyle
// #define FN_DecalIndex DecalIndex
// #define FN_PointContents PointContents
// #define FN_MessageBegin MessageBegin
// #define FN_MessageEnd MessageEnd
// #define FN_WriteByte WriteByte
// #define FN_WriteChar WriteChar
// #define FN_WriteShort WriteShort
// #define FN_WriteLong WriteLong
// #define FN_WriteAngle WriteAngle
// #define FN_WriteCoord WriteCoord
// #define FN_WriteString WriteString
// #define FN_WriteEntity WriteEntity
// #define FN_CVarRegister CVarRegister
// #define FN_CVarGetFloat CVarGetFloat
// #define FN_CVarGetString CVarGetString
// #define FN_CVarSetFloat CVarSetFloat
// #define FN_CVarSetString CVarSetString
// #define FN_AlertMessage AlertMessage
// #define FN_EngineFprintf EngineFprintf
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
// #define FN_PvEntPrivateData PvEntPrivateData
// #define FN_FreeEntPrivateData FreeEntPrivateData
// #define FN_SzFromIndex SzFromIndex
// #define FN_AllocString AllocString
// #define FN_GetVarsOfEnt GetVarsOfEnt
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
// #define FN_IndexOfEdict IndexOfEdict
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
// #define FN_FindEntityByVars FindEntityByVars
// #define FN_GetModelPtr GetModelPtr
// #define FN_RegUserMsg RegUserMsg
// #define FN_AnimationAutomove AnimationAutomove
// #define FN_GetBonePosition GetBonePosition
// #define FN_FunctionFromName FunctionFromName
// #define FN_NameForFunction NameForFunction
// #define FN_ClientPrintf ClientPrintf
// #define FN_ServerPrint ServerPrint
// #define FN_Cmd_Args Cmd_Args
// #define FN_Cmd_Argv Cmd_Argv
// #define FN_Cmd_Argc Cmd_Argc
// #define FN_GetAttachment GetAttachment
// #define FN_CRC32_Init CRC32_Init
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
// #define FN_CRC32_Final CRC32_Final
// #define FN_RandomLong RandomLong
// #define FN_RandomFloat RandomFloat
// #define FN_SetView SetView
// #define FN_Time Time
// #define FN_CrosshairAngle CrosshairAngle
// #define FN_LoadFileForMe LoadFileForMe
// #define FN_FreeFile FreeFile
// #define FN_EndSection EndSection
// #define FN_CompareFileTime CompareFileTime
// #define FN_GetGameDir GetGameDir
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
// #define FN_FadeClientVolume FadeClientVolume
// #define FN_SetClientMaxspeed SetClientMaxspeed
// #define FN_CreateFakeClient CreateFakeClient
// #define FN_RunPlayerMove RunPlayerMove
// #define FN_NumberOfEntities NumberOfEntities
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
// #define FN_InfoKeyValue InfoKeyValue
// #define FN_SetKeyValue SetKeyValue
// #define FN_SetClientKeyValue SetClientKeyValue
// #define FN_IsMapValid IsMapValid
// #define FN_StaticDecal StaticDecal
// #define FN_PrecacheGeneric PrecacheGeneric
// #define FN_GetPlayerUserId GetPlayerUserId
// #define FN_BuildSoundMsg BuildSoundMsg
// #define FN_IsDedicatedServer IsDedicatedServer
// #define FN_CVarGetPointer CVarGetPointer
// #define FN_GetPlayerWONId GetPlayerWONId
// #define FN_Info_RemoveKey Info_RemoveKey
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
// #define FN_PrecacheEvent PrecacheEvent
// #define FN_PlaybackEvent PlaybackEvent
// #define FN_SetFatPVS SetFatPVS
// #define FN_SetFatPAS SetFatPAS
// #define FN_CheckVisibility CheckVisibility
// #define FN_DeltaSetField DeltaSetField
// #define FN_DeltaUnsetField DeltaUnsetField
// #define FN_DeltaAddEncoder DeltaAddEncoder
// #define FN_GetCurrentPlayer GetCurrentPlayer
// #define FN_CanSkipPlayer CanSkipPlayer
// #define FN_DeltaFindField DeltaFindField
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
// #define FN_SetGroupMask SetGroupMask
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
// #define FN_Cvar_DirectSet Cvar_DirectSet
// #define FN_ForceUnmodified ForceUnmodified
// #define FN_GetPlayerStats GetPlayerStats
// #define FN_AddServerCommand AddServerCommand
// #define FN_Voice_GetClientListening Voice_GetClientListening
#define FN_Voice_SetClientListening Voice_SetClientListening
// #define FN_GetPlayerAuthId GetPlayerAuthId
// - GetEngineAPI_Post functions
// #define FN_PrecacheModel_Post PrecacheModel_Post
// #define FN_PrecacheSound_Post PrecacheSound_Post
// #define FN_SetModel_Post SetModel_Post
// #define FN_ModelIndex_Post ModelIndex_Post
// #define FN_ModelFrames_Post ModelFrames_Post
// #define FN_SetSize_Post SetSize_Post
// #define FN_ChangeLevel_Post ChangeLevel_Post
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
// #define FN_VecToYaw_Post VecToYaw_Post
// #define FN_VecToAngles_Post VecToAngles_Post
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
// #define FN_ChangeYaw_Post ChangeYaw_Post
// #define FN_ChangePitch_Post ChangePitch_Post
// #define FN_FindEntityByString_Post FindEntityByString_Post
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
// #define FN_MakeVectors_Post MakeVectors_Post
// #define FN_AngleVectors_Post AngleVectors_Post
// #define FN_CreateEntity_Post CreateEntity_Post
// #define FN_RemoveEntity_Post RemoveEntity_Post
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
// #define FN_MakeStatic_Post MakeStatic_Post
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
// #define FN_DropToFloor_Post DropToFloor_Post
// #define FN_WalkMove_Post WalkMove_Post
// #define FN_SetOrigin_Post SetOrigin_Post
// #define FN_EmitSound_Post EmitSound_Post
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
// #define FN_TraceLine_Post TraceLine_Post
// #define FN_TraceToss_Post TraceToss_Post
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
// #define FN_TraceHull_Post TraceHull_Post
// #define FN_TraceModel_Post TraceModel_Post
// #define FN_TraceTexture_Post TraceTexture_Post
// #define FN_TraceSphere_Post TraceSphere_Post
// #define FN_GetAimVector_Post GetAimVector_Post
// #define FN_ServerCommand_Post ServerCommand_Post
// #define FN_ServerExecute_Post ServerExecute_Post
// #define FN_engClientCommand_Post engClientCommand_Post
// #define FN_ParticleEffect_Post ParticleEffect_Post
// #define FN_LightStyle_Post LightStyle_Post
// #define FN_DecalIndex_Post DecalIndex_Post
// #define FN_PointContents_Post PointContents_Post
// #define FN_MessageBegin_Post MessageBegin_Post
// #define FN_MessageEnd_Post MessageEnd_Post
// #define FN_WriteByte_Post WriteByte_Post
// #define FN_WriteChar_Post WriteChar_Post
// #define FN_WriteShort_Post WriteShort_Post
// #define FN_WriteLong_Post WriteLong_Post
// #define FN_WriteAngle_Post WriteAngle_Post
// #define FN_WriteCoord_Post WriteCoord_Post
// #define FN_WriteString_Post WriteString_Post
// #define FN_WriteEntity_Post WriteEntity_Post
// #define FN_CVarRegister_Post CVarRegister_Post
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
// #define FN_CVarGetString_Post CVarGetString_Post
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
// #define FN_CVarSetString_Post CVarSetString_Post
// #define FN_AlertMessage_Post AlertMessage_Post
// #define FN_EngineFprintf_Post EngineFprintf_Post
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
// #define FN_SzFromIndex_Post SzFromIndex_Post
// #define FN_AllocString_Post AllocString_Post
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
// #define FN_GetModelPtr_Post GetModelPtr_Post
// #define FN_RegUserMsg_Post RegUserMsg_Post
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
// #define FN_GetBonePosition_Post GetBonePosition_Post
// #define FN_FunctionFromName_Post FunctionFromName_Post
// #define FN_NameForFunction_Post NameForFunction_Post
// #define FN_ClientPrintf_Post ClientPrintf_Post
// #define FN_ServerPrint_Post ServerPrint_Post
// #define FN_Cmd_Args_Post Cmd_Args_Post
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
// #define FN_GetAttachment_Post GetAttachment_Post
// #define FN_CRC32_Init_Post CRC32_Init_Post
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
// #define FN_CRC32_Final_Post CRC32_Final_Post
// #define FN_RandomLong_Post RandomLong_Post
// #define FN_RandomFloat_Post RandomFloat_Post
// #define FN_SetView_Post SetView_Post
// #define FN_Time_Post Time_Post
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
// #define FN_FreeFile_Post FreeFile_Post
// #define FN_EndSection_Post EndSection_Post
// #define FN_CompareFileTime_Post CompareFileTime_Post
// #define FN_GetGameDir_Post GetGameDir_Post
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
// #define FN_SetKeyValue_Post SetKeyValue_Post
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
// #define FN_IsMapValid_Post IsMapValid_Post
// #define FN_StaticDecal_Post StaticDecal_Post
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
// #define FN_SetFatPVS_Post SetFatPVS_Post
// #define FN_SetFatPAS_Post SetFatPAS_Post
// #define FN_CheckVisibility_Post CheckVisibility_Post
// #define FN_DeltaSetField_Post DeltaSetField_Post
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
// #define FN_DeltaFindField_Post DeltaFindField_Post
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
// #define FN_SetGroupMask_Post SetGroupMask_Post
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
// #define FN_AddServerCommand_Post AddServerCommand_Post
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
// #define FN_GameShutdown GameShutdown
// #define FN_ShouldCollide ShouldCollide
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
// #define FN_GameShutdown_Post GameShutdown_Post
// #define FN_ShouldCollide_Post ShouldCollide_Post
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "engine.vcxproj", "{B3F4467B-6148-4EBF-B897-168D81CF8D9B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B3F4467B-6148-4EBF-B897-168D81CF8D9B}.Debug|Win32.ActiveCfg = Debug|Win32
{B3F4467B-6148-4EBF-B897-168D81CF8D9B}.Debug|Win32.Build.0 = Debug|Win32
{B3F4467B-6148-4EBF-B897-168D81CF8D9B}.Release|Win32.ActiveCfg = Release|Win32
{B3F4467B-6148-4EBF-B897-168D81CF8D9B}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B3F4467B-6148-4EBF-B897-168D81CF8D9B}</ProjectGuid>
<RootNamespace>engine</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_amxx</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)_amxx</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl\include;..\..\third_party;..\..\third_party\hashing;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)engine.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(OutDir)engine.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>LIBCMT;</IgnoreSpecificDefaultLibraries>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl\include;..\..\third_party;..\..\third_party\hashing;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<ImportLibrary>$(OutDir)engine.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\amxxapi.cpp" />
<ClCompile Include="..\engine.cpp" />
<ClCompile Include="..\entity.cpp" />
<ClCompile Include="..\forwards.cpp" />
<ClCompile Include="..\globals.cpp" />
<ClCompile Include="..\..\..\public\sdk\amxxmodule.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\engine.h" />
<ClInclude Include="..\entity.h" />
<ClInclude Include="..\gpglobals.h" />
<ClInclude Include="..\moduleconfig.h" />
<ClInclude Include="..\..\..\public\sdk\amxxmodule.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\plugins\include\engine.inc" />
<None Include="..\..\..\plugins\include\engine_const.inc" />
<None Include="..\..\..\plugins\include\engine_stocks.inc" />
<None Include="..\..\..\plugins\include\hlsdk_const.inc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Module SDK">
<UniqueIdentifier>{fb945ae1-3977-41e3-a51b-04242aff8c78}</UniqueIdentifier>
</Filter>
<Filter Include="Module SDK\SDK Base">
<UniqueIdentifier>{aad49737-4d0e-4276-a471-dc77365bf9e0}</UniqueIdentifier>
</Filter>
<Filter Include="Pawn Includes">
<UniqueIdentifier>{e7f2c5c2-cba9-4712-a576-ceb676c94b36}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\amxxapi.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\engine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\entity.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\forwards.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\globals.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\sdk\amxxmodule.cpp">
<Filter>Module SDK\SDK Base</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\engine.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\entity.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\gpglobals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\moduleconfig.h">
<Filter>Module SDK</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\sdk\amxxmodule.h">
<Filter>Module SDK\SDK Base</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\plugins\include\engine.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\..\plugins\include\engine_const.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\..\plugins\include\engine_stocks.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\..\plugins\include\hlsdk_const.inc">
<Filter>Pawn Includes</Filter>
</None>
</ItemGroup>
</Project>

101
modules/engine/version.rc Normal file
View File

@ -0,0 +1,101 @@
// Microsoft Visual C++ generated resource script.
//
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <winresrc.h>
#include <moduleconfig.h>
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION AMXX_VERSION_FILE
PRODUCTVERSION AMXX_VERSION_FILE
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "Comments", "AMX Mod X"
VALUE "FileDescription", "AMX Mod X"
VALUE "FileVersion", AMXX_VERSION
VALUE "InternalName", MODULE_LIBRARY
VALUE "LegalCopyright", "Copyright (c) AMX Mod X Dev Team"
VALUE "OriginalFilename", MODULE_LIBRARY "_amxx.dll"
VALUE "ProductName", MODULE_NAME
VALUE "ProductVersion", AMXX_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED