├── .gitignore ├── extension ├── Makefile ├── README.md ├── extension.cpp ├── extension.h ├── msvc10 │ ├── sdk.vcxproj │ ├── sdk.vcxproj.filters │ └── sendproxy.sln └── sdk │ ├── smsdk_config.h │ ├── smsdk_ext.cpp │ └── smsdk_ext.h └── sourcemod ├── gamedata └── sendproxy.txt └── scripting └── include └── sendproxy.inc /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | # User files 16 | *.suo 17 | *.user 18 | 19 | Debug*/ 20 | Release*/ -------------------------------------------------------------------------------- /extension/Makefile: -------------------------------------------------------------------------------- 1 | # (C)2004-2010 SourceMod Development Team 2 | # Makefile written by David "BAILOPAN" Anderson 3 | 4 | ########################################### 5 | ### EDIT THESE PATHS FOR YOUR OWN SETUP ### 6 | ########################################### 7 | 8 | SMSDK = ../.. 9 | HL2SDK_ORIG = ../../../hl2sdk 10 | HL2SDK_OB = ../../../hl2sdk-ob 11 | HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve 12 | HL2SDK_L4D = ../../../hl2sdk-l4d 13 | HL2SDK_L4D2 = ../../../hl2sdk-l4d2 14 | MMSOURCE18 = ../../../mmsource-1.8 15 | 16 | ##################################### 17 | ### EDIT BELOW FOR OTHER PROJECTS ### 18 | ##################################### 19 | 20 | PROJECT = sendproxy 21 | 22 | #Uncomment for Metamod: Source enabled extension 23 | USEMETA = true 24 | 25 | OBJECTS = sdk/smsdk_ext.cpp extension.cpp gamedataupdater.cpp 26 | 27 | ############################################## 28 | ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ### 29 | ############################################## 30 | 31 | C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing 32 | C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3 33 | C_GCC4_FLAGS = -fvisibility=hidden 34 | CPP_GCC4_FLAGS = -fvisibility-inlines-hidden 35 | CPP = gcc 36 | 37 | ########################## 38 | ### SDK CONFIGURATIONS ### 39 | ########################## 40 | 41 | override ENGSET = false 42 | 43 | # Check for valid list of engines 44 | ifneq (,$(filter original orangebox orangeboxvalve left4dead left4dead2,$(ENGINE))) 45 | override ENGSET = true 46 | endif 47 | 48 | ifeq "$(ENGINE)" "original" 49 | HL2SDK = $(HL2SDK_ORIG) 50 | CFLAGS += -DSOURCE_ENGINE=1 51 | endif 52 | ifeq "$(ENGINE)" "orangebox" 53 | HL2SDK = $(HL2SDK_OB) 54 | CFLAGS += -DSOURCE_ENGINE=3 55 | endif 56 | ifeq "$(ENGINE)" "orangeboxvalve" 57 | HL2SDK = $(HL2SDK_OB_VALVE) 58 | CFLAGS += -DSOURCE_ENGINE=4 59 | endif 60 | ifeq "$(ENGINE)" "left4dead" 61 | HL2SDK = $(HL2SDK_L4D) 62 | CFLAGS += -DSOURCE_ENGINE=5 63 | endif 64 | ifeq "$(ENGINE)" "left4dead2" 65 | HL2SDK = $(HL2SDK_L4D2) 66 | CFLAGS += -DSOURCE_ENGINE=6 67 | endif 68 | 69 | HL2PUB = $(HL2SDK)/public 70 | 71 | ifeq "$(ENGINE)" "original" 72 | INCLUDE += -I$(HL2SDK)/public/dlls 73 | METAMOD = $(MMSOURCE18)/core-legacy 74 | else 75 | INCLUDE += -I$(HL2SDK)/public/game/server 76 | METAMOD = $(MMSOURCE18)/core 77 | endif 78 | 79 | OS := $(shell uname -s) 80 | 81 | ifeq "$(OS)" "Darwin" 82 | LIB_EXT = dylib 83 | HL2LIB = $(HL2SDK)/lib/mac 84 | else 85 | LIB_EXT = so 86 | ifeq "$(ENGINE)" "original" 87 | HL2LIB = $(HL2SDK)/linux_sdk 88 | else 89 | HL2LIB = $(HL2SDK)/lib/linux 90 | endif 91 | endif 92 | 93 | # if ENGINE is original or OB 94 | ifneq (,$(filter original orangebox,$(ENGINE))) 95 | LIB_SUFFIX = _i486.$(LIB_EXT) 96 | else 97 | LIB_PREFIX = lib 98 | LIB_SUFFIX = _srv.$(LIB_EXT) 99 | endif 100 | 101 | INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn 102 | 103 | ifeq "$(USEMETA)" "true" 104 | LINK_HL2 = $(HL2LIB)/tier1_i486.a $(LIB_PREFIX)vstdlib$(LIB_SUFFIX) $(LIB_PREFIX)tier0$(LIB_SUFFIX) 105 | 106 | LINK += $(LINK_HL2) 107 | 108 | INCLUDE += -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) \ 109 | -I$(METAMOD)/sourcehook 110 | CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 \ 111 | -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6 -DSE_ALIENSWARM=7 112 | endif 113 | 114 | LINK += -m32 -lm -ldl 115 | 116 | CFLAGS += -DPOSIX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ 117 | -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \ 118 | -Wno-switch -Wno-unused -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32 119 | CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti 120 | 121 | ################################################ 122 | ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ### 123 | ################################################ 124 | 125 | BINARY = $(PROJECT).ext.$(LIB_EXT) 126 | 127 | ifeq "$(DEBUG)" "true" 128 | BIN_DIR = Debug 129 | CFLAGS += $(C_DEBUG_FLAGS) 130 | else 131 | BIN_DIR = Release 132 | CFLAGS += $(C_OPT_FLAGS) 133 | endif 134 | 135 | ifeq "$(USEMETA)" "true" 136 | BIN_DIR := $(BIN_DIR).$(ENGINE) 137 | endif 138 | 139 | ifeq "$(OS)" "Darwin" 140 | LIB_EXT = dylib 141 | CFLAGS += -isysroot /Developer/SDKs/MacOSX10.5.sdk 142 | LINK += -dynamiclib -lstdc++ -mmacosx-version-min=10.5 143 | else 144 | LIB_EXT = so 145 | CFLAGS += -D_LINUX 146 | LINK += -shared 147 | endif 148 | 149 | GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) 150 | ifeq "$(GCC_VERSION)" "4" 151 | CFLAGS += $(C_GCC4_FLAGS) 152 | CPPFLAGS += $(CPP_GCC4_FLAGS) 153 | endif 154 | 155 | OBJ_BIN := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o) 156 | 157 | $(BIN_DIR)/%.o: %.cpp 158 | $(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< 159 | 160 | all: check 161 | mkdir -p $(BIN_DIR)/sdk 162 | if [ "$(USEMETA)" = "true" ]; then \ 163 | ln -sf $(HL2LIB)/$(LIB_PREFIX)vstdlib$(LIB_SUFFIX); \ 164 | ln -sf $(HL2LIB)/$(LIB_PREFIX)tier0$(LIB_SUFFIX); \ 165 | fi 166 | $(MAKE) -f Makefile extension 167 | 168 | check: 169 | if [ "$(USEMETA)" = "true" ] && [ "$(ENGSET)" = "false" ]; then \ 170 | echo "You must supply one of the following values for ENGINE:"; \ 171 | echo "left4dead2, left4dead, orangeboxvalve, orangebox, or original"; \ 172 | exit 1; \ 173 | fi 174 | 175 | extension: check $(OBJ_BIN) 176 | $(CPP) $(INCLUDE) $(OBJ_BIN) $(LINK) -o $(BIN_DIR)/$(BINARY) 177 | 178 | debug: 179 | $(MAKE) -f Makefile all DEBUG=true 180 | 181 | default: all 182 | 183 | clean: check 184 | rm -rf $(BIN_DIR)/*.o 185 | rm -rf $(BIN_DIR)/sdk/*.o 186 | rm -rf $(BIN_DIR)/$(BINARY) 187 | 188 | -------------------------------------------------------------------------------- /extension/README.md: -------------------------------------------------------------------------------- 1 | sourcemod-sendproxy-manager 2 | =========================== 3 | 4 | Fork of Afronanny's SendProxy Manager extension 5 | -------------------------------------------------------------------------------- /extension/extension.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SendVar Proxy Manager 5 | * Copyright (C) 2011 Afronanny. All rights reserved. 6 | * ============================================================================= 7 | * 8 | * This program is free software; you can redistribute it and/or modify it under 9 | * the terms of the GNU General Public License, version 3.0, as published by the 10 | * Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 | * details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with 18 | * this program. If not, see . 19 | * 20 | * As a special exception, AlliedModders LLC gives you permission to link the 21 | * code of this program (as well as its derivative works) to "Half-Life 2," the 22 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 23 | * by the Valve Corporation. You must obey the GNU General Public License in 24 | * all respects for all other code used. Additionally, AlliedModders LLC grants 25 | * this exception to all derivative works. AlliedModders LLC defines further 26 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 27 | * or . 28 | * 29 | * Version: $Id$ 30 | */ 31 | #ifdef _WIN32 32 | #undef GetProp 33 | #endif 34 | #include "extension.h" 35 | 36 | 37 | /** 38 | * @file extension.cpp 39 | * @brief Implement extension code here. 40 | */ 41 | 42 | SH_DECL_MANUALHOOK0_void(UpdateOnRemove, 0, 0, 0); 43 | SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, false, edict_t*); 44 | SH_DECL_HOOK1_void(IServerGameDLL, GameFrame, SH_NOATTRIB, false, bool); 45 | 46 | SendProxyManager g_SendProxyManager; /**< Global singleton for extension's main interface */ 47 | SMEXT_LINK(&g_SendProxyManager); 48 | 49 | CThreadFastMutex g_WorkMutex; 50 | 51 | CUtlVector g_Hooks; 52 | CUtlVector g_ChangeHooks; 53 | 54 | IServerGameEnts *gameents = NULL; 55 | IServerGameClients *gameclients = NULL; 56 | IGameConfig *g_pGameConf = NULL; 57 | 58 | static cell_t Native_Hook(IPluginContext* pContext, const cell_t* params); 59 | static cell_t Native_Unhook(IPluginContext* pContext, const cell_t* params); 60 | static cell_t Native_IsHooked(IPluginContext* pContext, const cell_t* params); 61 | static cell_t Native_HookArrayProp(IPluginContext* pContext, const cell_t* params); 62 | static cell_t Native_UnhookArrayProp(IPluginContext* pContext, const cell_t* params); 63 | static cell_t Native_HookPropChange(IPluginContext* pContext, const cell_t* params); 64 | static cell_t Native_UnhookPropChange(IPluginContext* pContext, const cell_t* params); 65 | 66 | const sp_nativeinfo_t g_MyNatives[] = { 67 | {"SendProxy_Hook", Native_Hook}, 68 | {"SendProxy_HookArrayProp", Native_HookArrayProp}, 69 | {"SendProxy_UnhookArrayProp", Native_UnhookArrayProp}, 70 | {"SendProxy_Unhook", Native_Unhook}, 71 | {"SendProxy_IsHooked", Native_IsHooked}, 72 | {"SendProxy_HookPropChange", Native_HookPropChange}, 73 | {"SendProxy_UnhookPropChange", Native_UnhookPropChange}, 74 | {NULL, NULL}, 75 | }; 76 | 77 | 78 | void Hook_UpdateOnRemove() 79 | { 80 | CBaseEntity *pEnt = META_IFACEPTR(CBaseEntity); 81 | int idx = gamehelpers->EntityToBCompatRef(pEnt); 82 | for (int i = 0; i < g_Hooks.Count(); i++) 83 | { 84 | if (g_Hooks[i].objectID == idx) 85 | { 86 | g_SendProxyManager.UnhookProxy(i); 87 | } 88 | } 89 | 90 | for (int i = 0; i < g_ChangeHooks.Count(); i++) 91 | { 92 | if (g_ChangeHooks[i].objectID == idx) 93 | g_ChangeHooks.Remove(i--); 94 | } 95 | SH_REMOVE_MANUALHOOK(UpdateOnRemove, pEnt, SH_STATIC(Hook_UpdateOnRemove), false); 96 | RETURN_META(MRES_IGNORED); 97 | } 98 | 99 | void Hook_ClientDisconnect(edict_t* pEnt) 100 | { 101 | for (int i = 0; i < g_Hooks.Count(); i++) 102 | { 103 | if (g_Hooks[i].objectID == engine->IndexOfEdict(pEnt)) 104 | g_SendProxyManager.UnhookProxy(i); 105 | } 106 | 107 | for (int i = 0; i < g_ChangeHooks.Count(); i++) 108 | { 109 | if (g_ChangeHooks[i].objectID == engine->IndexOfEdict(pEnt)) 110 | g_ChangeHooks.Remove(i--); 111 | } 112 | RETURN_META(MRES_IGNORED); 113 | } 114 | 115 | void Hook_GameFrame(bool simulating) 116 | { 117 | if (simulating) 118 | { 119 | for (int i = 0; i < g_ChangeHooks.Count(); i++) 120 | { 121 | switch(g_ChangeHooks[i].PropType) 122 | { 123 | case Prop_Int: 124 | { 125 | edict_t* pEnt = engine->PEntityOfEntIndex(g_ChangeHooks[i].objectID); 126 | CBaseEntity* pEntity = gameents->EdictToBaseEntity(pEnt); 127 | int iCurrent = *(int*)((unsigned char*)pEntity + g_ChangeHooks[i].Offset); 128 | if (iCurrent != g_ChangeHooks[i].iLastValue) 129 | { 130 | g_ChangeHooks[i].pCallback->PushCell(g_ChangeHooks[i].objectID); 131 | g_ChangeHooks[i].pCallback->PushString(g_ChangeHooks[i].pVar->GetName()); 132 | char oldValue[64]; 133 | snprintf(oldValue, 64, "%d", g_ChangeHooks[i].iLastValue); 134 | char newValue[64]; 135 | snprintf(newValue, 64, "%d", iCurrent); 136 | g_ChangeHooks[i].pCallback->PushString(oldValue); 137 | g_ChangeHooks[i].pCallback->PushString(newValue); 138 | g_ChangeHooks[i].pCallback->Execute(0); 139 | g_ChangeHooks[i].iLastValue = iCurrent; 140 | } 141 | break; 142 | } 143 | case Prop_Float: 144 | { 145 | edict_t* pEnt = engine->PEntityOfEntIndex(g_ChangeHooks[i].objectID); 146 | CBaseEntity* pEntity = gameents->EdictToBaseEntity(pEnt); 147 | float flCurrent = *(float*)((unsigned char*)pEntity + g_ChangeHooks[i].Offset); 148 | if (flCurrent != g_ChangeHooks[i].flLastValue) 149 | { 150 | g_ChangeHooks[i].pCallback->PushCell(g_ChangeHooks[i].objectID); 151 | g_ChangeHooks[i].pCallback->PushString(g_ChangeHooks[i].pVar->GetName()); 152 | char oldValue[64]; 153 | snprintf(oldValue, 64, "%f", g_ChangeHooks[i].flLastValue); 154 | char newValue[64]; 155 | snprintf(newValue, 64, "%f", flCurrent); 156 | g_ChangeHooks[i].pCallback->PushString(oldValue); 157 | g_ChangeHooks[i].pCallback->PushString(newValue); 158 | g_ChangeHooks[i].pCallback->Execute(0); 159 | g_ChangeHooks[i].flLastValue = flCurrent; 160 | } 161 | break; 162 | } 163 | case Prop_String: 164 | { 165 | edict_t* pEnt = engine->PEntityOfEntIndex(g_ChangeHooks[i].objectID); 166 | CBaseEntity* pEntity = gameents->EdictToBaseEntity(pEnt); 167 | const char* szCurrent = (const char*)((unsigned char*)pEntity + g_ChangeHooks[i].Offset); 168 | if (strcmp(szCurrent, g_ChangeHooks[i].szLastValue.c_str()) != 0) 169 | { 170 | g_ChangeHooks[i].pCallback->PushCell(g_ChangeHooks[i].objectID); 171 | g_ChangeHooks[i].pCallback->PushString(g_ChangeHooks[i].pVar->GetName()); 172 | g_ChangeHooks[i].pCallback->PushString(g_ChangeHooks[i].szLastValue.c_str()); 173 | g_ChangeHooks[i].pCallback->PushString(szCurrent); 174 | g_ChangeHooks[i].pCallback->Execute(0); 175 | g_ChangeHooks[i].szLastValue.clear(); 176 | g_ChangeHooks[i].szLastValue.append(szCurrent); 177 | } 178 | break; 179 | } 180 | default: 181 | { 182 | //earlier typechecks failed 183 | } 184 | } 185 | } 186 | } 187 | RETURN_META(MRES_IGNORED); 188 | } 189 | bool SendProxyManager::SDK_OnLoad(char *error, size_t maxlength, bool late) 190 | { 191 | char conf_error[255]; 192 | if (!gameconfs->LoadGameConfigFile("sendproxy", &g_pGameConf, conf_error, sizeof(conf_error))) 193 | { 194 | if (conf_error[0]) 195 | snprintf(error, maxlength, "Could not read config file sendproxy.txt: %s", conf_error); 196 | return false; 197 | } 198 | 199 | int offset = 0; 200 | g_pGameConf->GetOffset("UpdateOnRemove", &offset); 201 | if (offset > 0) 202 | { 203 | SH_MANUALHOOK_RECONFIGURE(UpdateOnRemove, offset, 0, 0); 204 | } else { 205 | snprintf(error, maxlength, "Could not get offset for UpdateOnRemove"); 206 | return false; 207 | } 208 | 209 | sharesys->RegisterLibrary(myself, "sendproxy"); 210 | plsys->AddPluginsListener(&g_SendProxyManager); 211 | 212 | return true; 213 | } 214 | 215 | 216 | void SendProxyManager::SDK_OnAllLoaded() 217 | { 218 | sharesys->AddNatives(myself, g_MyNatives); 219 | } 220 | 221 | void SendProxyManager::SDK_OnUnload() 222 | { 223 | for (int i = 0; i < g_Hooks.Count(); i++) 224 | { 225 | g_Hooks[i].pVar->SetProxyFn(g_Hooks[i].pRealProxy); 226 | CBaseEntity *pbe = gameents->EdictToBaseEntity(g_Hooks[i].pEnt); 227 | if (pbe) 228 | SH_REMOVE_MANUALHOOK(UpdateOnRemove, pbe, SH_STATIC(Hook_UpdateOnRemove), false); 229 | } 230 | SH_REMOVE_HOOK(IServerGameClients, ClientDisconnect, gameclients, SH_STATIC(Hook_ClientDisconnect), false); 231 | SH_REMOVE_HOOK(IServerGameDLL, GameFrame, gamedll, SH_STATIC(Hook_GameFrame), false); 232 | 233 | plsys->RemovePluginsListener(&g_SendProxyManager); 234 | } 235 | 236 | bool SendProxyManager::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late) 237 | { 238 | GET_V_IFACE_ANY(GetServerFactory, gameents, IServerGameEnts, INTERFACEVERSION_SERVERGAMEENTS); 239 | GET_V_IFACE_ANY(GetServerFactory, gameclients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS); 240 | GET_V_IFACE_ANY(GetEngineFactory, g_pCVar, ICvar, CVAR_INTERFACE_VERSION); 241 | SH_ADD_HOOK(IServerGameDLL, GameFrame, gamedll, SH_STATIC(Hook_GameFrame), false); 242 | SH_ADD_HOOK(IServerGameClients, ClientDisconnect, gameclients, SH_STATIC(Hook_ClientDisconnect), false); 243 | return true; 244 | } 245 | 246 | void SendProxyManager::OnPluginUnloaded(IPlugin *plugin) 247 | { 248 | IPluginContext *pCtx = plugin->GetBaseContext(); 249 | for (int i = 0; i < g_Hooks.Count(); i++) 250 | { 251 | if (g_Hooks[i].pCallback->GetParentContext() == pCtx) 252 | { 253 | UnhookProxy(i); 254 | i--; 255 | } 256 | } 257 | } 258 | 259 | 260 | bool SendProxyManager::AddHookToList(SendPropHook hook) 261 | { 262 | //Need to make sure this prop isn't already hooked for this entity 263 | for (int i = 0; i < g_Hooks.Count(); i++) 264 | { 265 | if (g_Hooks[i].pVar == hook.pVar && g_Hooks[i].objectID == hook.objectID) 266 | return false; 267 | } 268 | CBaseEntity *pbe = gameents->EdictToBaseEntity(hook.pEnt); 269 | SH_ADD_MANUALHOOK(UpdateOnRemove, pbe, SH_STATIC(Hook_UpdateOnRemove), false); 270 | g_Hooks.AddToTail(hook); 271 | return true; 272 | } 273 | 274 | bool SendProxyManager::HookProxy(SendProp* pProp, int objectID, IPluginFunction *pCallback) 275 | { 276 | edict_t* pEdict = engine->PEntityOfEntIndex(objectID); 277 | if (!pEdict || pEdict->IsFree()) 278 | return false; 279 | 280 | SendPropHook hook; 281 | hook.objectID = objectID; 282 | hook.pCallback = pCallback; 283 | hook.PropType = Prop_Int; 284 | hook.pEnt = pEdict; 285 | hook.pVar = pProp; 286 | hook.pRealProxy = pProp->GetProxyFn(); 287 | if (AddHookToList(hook)) 288 | pProp->SetProxyFn(GlobalProxy); 289 | else 290 | return false; 291 | 292 | return true; 293 | 294 | } 295 | 296 | void SendProxyManager::UnhookProxy(int i) 297 | { 298 | //if there are other hooks for this prop, don't change the proxy, just remove it from our list 299 | for (int j = 0; j < g_Hooks.Count(); j++) 300 | { 301 | if (g_Hooks[j].pVar == g_Hooks[i].pVar && i != j) 302 | { 303 | g_Hooks.Remove(i); 304 | return; 305 | } 306 | } 307 | g_Hooks[i].pVar->SetProxyFn(g_Hooks[i].pRealProxy); 308 | g_Hooks.Remove(i); 309 | } 310 | 311 | bool CallInt(SendPropHook hook, int *ret) 312 | { 313 | AUTO_LOCK_FM(g_WorkMutex); 314 | 315 | IPluginFunction *callback = hook.pCallback; 316 | CBaseEntity *pbe = gameents->EdictToBaseEntity(hook.pEnt); 317 | cell_t value = *ret; 318 | cell_t result = Pl_Continue; 319 | callback->PushCell(hook.objectID); 320 | callback->PushString(hook.pVar->GetName()); 321 | callback->PushCellByRef(&value); 322 | callback->PushCell(hook.Element); 323 | callback->Execute(&result); 324 | if (result == Pl_Changed) 325 | { 326 | *ret = value; 327 | return true; 328 | } 329 | return false; 330 | } 331 | 332 | bool CallFloat(SendPropHook hook, float *ret) 333 | { 334 | AUTO_LOCK_FM(g_WorkMutex); 335 | 336 | IPluginFunction *callback = hook.pCallback; 337 | CBaseEntity *pbe = gameents->EdictToBaseEntity(hook.pEnt); 338 | float value = *ret; 339 | cell_t result = Pl_Continue; 340 | callback->PushCell(hook.objectID); 341 | callback->PushString(hook.pVar->GetName()); 342 | callback->PushFloatByRef(&value); 343 | callback->PushCell(hook.Element); 344 | callback->Execute(&result); 345 | if (result == Pl_Changed) 346 | { 347 | *ret = value; 348 | return true; 349 | } 350 | return false; 351 | } 352 | 353 | bool CallString(SendPropHook hook, char **ret) 354 | { 355 | AUTO_LOCK_FM(g_WorkMutex); 356 | 357 | IPluginFunction *callback = hook.pCallback; 358 | char value[4096]; 359 | const char *src; 360 | CBaseEntity *pbe = gameents->EdictToBaseEntity(hook.pEnt); 361 | src = (char *)((unsigned char*)pbe + hook.Offset); 362 | strncpy(value, src, sizeof(value)); 363 | cell_t result = Pl_Continue; 364 | callback->PushCell(hook.objectID); 365 | callback->PushString(hook.pVar->GetName()); 366 | callback->PushStringEx(value, 4096, SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK); 367 | callback->PushCell(hook.Element); 368 | callback->Execute(&result); 369 | if (result == Pl_Changed) 370 | { 371 | *ret = value; 372 | return true; 373 | } 374 | return false; 375 | } 376 | 377 | bool CallVector(SendPropHook hook, Vector &vec) 378 | { 379 | AUTO_LOCK_FM(g_WorkMutex); 380 | 381 | IPluginFunction *callback = hook.pCallback; 382 | 383 | cell_t vector[3]; 384 | vector[0] = sp_ftoc(vec.x); 385 | vector[1] = sp_ftoc(vec.y); 386 | vector[2] = sp_ftoc(vec.z); 387 | 388 | cell_t result = Pl_Continue; 389 | callback->PushCell(hook.objectID); 390 | callback->PushString(hook.pVar->GetName()); 391 | callback->PushArray(vector, 3, SM_PARAM_COPYBACK); 392 | callback->PushCell(hook.Element); 393 | callback->Execute(&result); 394 | if (result == Pl_Changed) 395 | { 396 | vec.x = sp_ctof(vector[0]); 397 | vec.y = sp_ctof(vector[1]); 398 | vec.z = sp_ctof(vector[2]); 399 | return true; 400 | } 401 | return false; 402 | } 403 | 404 | void GlobalProxy(const SendProp *pProp, const void *pStructBase, const void* pData, DVariant *pOut, int iElement, int objectID) 405 | { 406 | edict_t* pEnt = engine->PEntityOfEntIndex(objectID); 407 | for (int i = 0; i < g_Hooks.Count(); i++) 408 | { 409 | if (g_Hooks[i].objectID == objectID && g_Hooks[i].pVar == pProp && pEnt == g_Hooks[i].pEnt) 410 | { 411 | switch (g_Hooks[i].PropType) 412 | { 413 | case Prop_Int: 414 | { 415 | int result = *(int *)pData; 416 | 417 | if (CallInt(g_Hooks[i], &result)) 418 | { 419 | long data = result; 420 | 421 | g_Hooks[i].pRealProxy(pProp, pStructBase, &data, pOut, iElement, objectID); 422 | return; 423 | } else { 424 | g_Hooks[i].pRealProxy(pProp, pStructBase, pData, pOut, iElement, objectID); 425 | return; 426 | } 427 | } 428 | case Prop_Float: 429 | { 430 | float result = *(float *)pData; 431 | 432 | if (CallFloat(g_Hooks[i], &result)) 433 | { 434 | g_Hooks[i].pRealProxy(pProp, pStructBase, &result, pOut, iElement, objectID); 435 | return; 436 | } else { 437 | g_Hooks[i].pRealProxy(pProp, pStructBase, pData, pOut, iElement, objectID); 438 | return; 439 | } 440 | } 441 | case Prop_String: 442 | { 443 | char* result = (char *)pData; 444 | 445 | if (CallString(g_Hooks[i], &result)) 446 | { 447 | g_Hooks[i].pRealProxy(pProp, pStructBase, &result, pOut, iElement, objectID); 448 | return; 449 | } else { 450 | g_Hooks[i].pRealProxy(pProp, pStructBase, pData, pOut, iElement, objectID); 451 | return; 452 | } 453 | } 454 | case Prop_Vector: 455 | { 456 | Vector result = *(Vector *)pData; 457 | 458 | if (CallVector(g_Hooks[i], result)) 459 | { 460 | g_Hooks[i].pRealProxy(pProp, pStructBase, &result, pOut, iElement, objectID); 461 | return; 462 | } else { 463 | g_Hooks[i].pRealProxy(pProp, pStructBase, pData, pOut, iElement, objectID); 464 | return; 465 | } 466 | } 467 | default: printf("wat do?\n"); 468 | } 469 | } 470 | } 471 | //perhaps we aren't hooked, but we can still find the real proxy for this prop 472 | for (int i = 0; i < g_Hooks.Count(); i++) 473 | { 474 | if (g_Hooks[i].pVar == pProp) 475 | { 476 | g_Hooks[i].pRealProxy(pProp, pStructBase, pData, pOut, iElement, objectID); 477 | return; 478 | } 479 | } 480 | g_pSM->LogError(myself, "CRITICAL: Proxy for unmanaged entity %d called for prop %s", objectID, pProp->GetName()); 481 | 482 | } 483 | 484 | //PropChanged(entity, const String:propname[], const String:oldValue[], const String:newValue[]) 485 | //SendProxy_HookPropChange(entity, const String:name[], PropChanged:callback) 486 | 487 | static cell_t Native_UnhookPropChange(IPluginContext* pContext, const cell_t* params) 488 | { 489 | if (params[1] < 0 || params[1] >= 2048) 490 | { 491 | return pContext->ThrowNativeError("Invalid Edict Index %d", params[1]); 492 | } 493 | int entity = params[1]; 494 | char* name; 495 | edict_t* pEnt = engine->PEntityOfEntIndex(entity); 496 | pContext->LocalToString(params[2], &name); 497 | IPluginFunction *callback = pContext->GetFunctionById(params[3]); 498 | sm_sendprop_info_t info; 499 | ServerClass *sc = pEnt->GetNetworkable()->GetServerClass(); 500 | gamehelpers->FindSendPropInfo(sc->GetName(), name, &info); 501 | 502 | for (int i = 0; i < g_ChangeHooks.Count(); i++) 503 | { 504 | if (g_ChangeHooks[i].pCallback == callback && g_ChangeHooks[i].objectID == entity && g_ChangeHooks[i].pVar == info.prop) 505 | g_ChangeHooks.Remove(i--); 506 | } 507 | return 1; 508 | } 509 | 510 | static cell_t Native_HookPropChange(IPluginContext* pContext, const cell_t* params) 511 | { 512 | if (params[1] < 0 || params[1] >= 2048) 513 | { 514 | return pContext->ThrowNativeError("Invalid Edict Index %d", params[1]); 515 | } 516 | int entity = params[1]; 517 | char* name; 518 | edict_t* pEnt = engine->PEntityOfEntIndex(entity); 519 | pContext->LocalToString(params[2], &name); 520 | IPluginFunction *callback = pContext->GetFunctionById(params[3]); 521 | SendProp *pProp = NULL; 522 | PropChangeHook hook; 523 | sm_sendprop_info_t info; 524 | ServerClass *sc = pEnt->GetNetworkable()->GetServerClass(); 525 | gamehelpers->FindSendPropInfo(sc->GetName(), name, &info); 526 | 527 | pProp = info.prop; 528 | int offset = info.actual_offset; 529 | SendPropType type = pProp->GetType(); 530 | CBaseEntity* pEntity = gameents->EdictToBaseEntity(pEnt); 531 | 532 | switch (type) 533 | { 534 | case DPT_Int: hook.PropType = Prop_Int; hook.iLastValue = *(int*)((unsigned char*)pEntity + offset); break; 535 | case DPT_Float: hook.PropType = Prop_Float; hook.flLastValue = *(float*)((unsigned char*)pEntity + offset); break; 536 | case DPT_String: hook.PropType = Prop_String; hook.szLastValue = *(const char*)((unsigned char*)pEntity + offset); break; 537 | default: return pContext->ThrowNativeError("Prop type %d is not yet supported", type); 538 | } 539 | 540 | hook.objectID = entity; 541 | hook.Offset = offset; 542 | hook.pVar = pProp; 543 | hook.pCallback = callback; 544 | 545 | g_ChangeHooks.AddToTail(hook); 546 | return 1; 547 | } 548 | 549 | static cell_t Native_Hook(IPluginContext* pContext, const cell_t* params) 550 | { 551 | if (params[1] < 0 || params[1] >= 2048) 552 | { 553 | return pContext->ThrowNativeError("Invalid Edict Index %d", params[1]); 554 | } 555 | int entity = params[1]; 556 | char* name; 557 | pContext->LocalToString(params[2], &name); 558 | edict_t* pEnt = engine->PEntityOfEntIndex(entity); 559 | int propType = params[3]; 560 | IPluginFunction *callback = pContext->GetFunctionById(params[4]); 561 | SendProp *pProp = NULL; 562 | ServerClass *sc = pEnt->GetNetworkable()->GetServerClass(); 563 | sm_sendprop_info_t info; 564 | 565 | if (!sc) 566 | { 567 | pContext->ThrowNativeError("Cannot find ServerClass for entity %d", params[1]); 568 | return 0; 569 | } 570 | 571 | gamehelpers->FindSendPropInfo(sc->GetName(), name, &info); 572 | pProp = info.prop; 573 | if (!pProp) 574 | { 575 | pContext->ThrowNativeError("Could not find prop %s", name); 576 | return 0; 577 | } 578 | switch (propType) 579 | { 580 | case Prop_Int: 581 | { 582 | if (pProp->GetType() != DPT_Int) 583 | return pContext->ThrowNativeError("Prop %s is not an int!", pProp->GetName()); 584 | break; 585 | } 586 | case Prop_Float: 587 | { 588 | if (pProp->GetType() != DPT_Float) 589 | return pContext->ThrowNativeError("Prop %s is not a float!", pProp->GetName()); 590 | break; 591 | } 592 | case Prop_String: 593 | { 594 | if (pProp->GetType() != DPT_String) 595 | return pContext->ThrowNativeError("Prop %s is not a string!", pProp->GetName()); 596 | break; 597 | } 598 | case Prop_Vector: 599 | { 600 | if (pProp->GetType() != DPT_Vector) 601 | return pContext->ThrowNativeError("Prop %s is not a vector!", pProp->GetName()); 602 | break; 603 | } 604 | default: return pContext->ThrowNativeError("Unsupported prop type %d", propType); 605 | } 606 | 607 | 608 | SendPropHook hook; 609 | hook.objectID = entity; 610 | hook.pCallback = callback; 611 | hook.pEnt = pEnt; 612 | for (int i = 0; i < g_Hooks.Count(); i++) 613 | { 614 | if (g_Hooks[i].pVar == pProp) 615 | { 616 | hook.pRealProxy = g_Hooks[i].pRealProxy; 617 | goto after; 618 | } 619 | } 620 | hook.pRealProxy = pProp->GetProxyFn(); 621 | after: 622 | hook.PropType = propType; 623 | hook.pVar = pProp; 624 | hook.Offset = info.actual_offset; 625 | 626 | //if this prop has been hooked already, don't set the proxy again 627 | for (int i = 0; i < g_Hooks.Count(); i++) 628 | { 629 | if (g_Hooks[i].pVar == pProp) 630 | { 631 | hook.pRealProxy = g_Hooks[i].pRealProxy; 632 | g_SendProxyManager.AddHookToList(hook); 633 | return 1; 634 | } 635 | } 636 | g_SendProxyManager.AddHookToList(hook); 637 | pProp->SetProxyFn(GlobalProxy); 638 | return 1; 639 | } 640 | 641 | 642 | //native SendProxy_HookArrayProp(entity, const String:name[], element, SendPropType:type, SendProxyCallback:callback); 643 | 644 | static cell_t Native_HookArrayProp(IPluginContext* pContext, const cell_t* params) 645 | { 646 | if (params[1] < 0 || params[1] >= 2048) 647 | { 648 | return pContext->ThrowNativeError("Invalid Edict Index %d", params[1]); 649 | } 650 | int entity = params[1]; 651 | char *propName; 652 | pContext->LocalToString(params[2], &propName); 653 | int element = params[3]; 654 | int propType = params[4]; 655 | IPluginFunction *callback = pContext->GetFunctionById(params[5]); 656 | 657 | edict_t* pEnt = engine->PEntityOfEntIndex(entity); 658 | ServerClass *sc = pEnt->GetNetworkable()->GetServerClass(); 659 | sm_sendprop_info_t info; 660 | gamehelpers->FindSendPropInfo(sc->GetName(), propName, &info); 661 | if (!info.prop) 662 | { 663 | return pContext->ThrowNativeError("Could not find prop %s", propName); 664 | } 665 | SendTable *st = info.prop->GetDataTable(); 666 | if (!st) 667 | { 668 | return pContext->ThrowNativeError("Prop %s does not contain any elements", propName); 669 | } 670 | 671 | SendProp *pProp = st->GetProp(element); 672 | if (!pProp) 673 | { 674 | return pContext->ThrowNativeError("Could not find element %d in %s", element, info.prop->GetName()); 675 | } 676 | 677 | SendPropHook hook; 678 | hook.objectID = entity; 679 | hook.pCallback = callback; 680 | hook.pEnt = pEnt; 681 | hook.Element = element; 682 | for (int i = 0; i < g_Hooks.Count(); i++) 683 | { 684 | if (g_Hooks[i].pVar == pProp) 685 | { 686 | hook.pRealProxy = g_Hooks[i].pRealProxy; 687 | goto after1; 688 | } 689 | } 690 | hook.pRealProxy = pProp->GetProxyFn(); 691 | after1: 692 | hook.PropType = propType; 693 | hook.pVar = pProp; 694 | 695 | for (int i = 0; i < g_Hooks.Count(); i++) 696 | { 697 | if (g_Hooks[i].pVar == pProp) 698 | { 699 | hook.pRealProxy = g_Hooks[i].pRealProxy; 700 | g_SendProxyManager.AddHookToList(hook); 701 | return 1; 702 | } 703 | } 704 | g_SendProxyManager.AddHookToList(hook); 705 | pProp->SetProxyFn(GlobalProxy); 706 | return 1; 707 | } 708 | 709 | //native SendProxy_UnhookArrayProp(entity, const String:name[], element, SendPropType:type, SendProxyCallback:callback); 710 | 711 | static cell_t Native_UnhookArrayProp(IPluginContext* pContext, const cell_t* params) 712 | { 713 | if (params[1] < 0 || params[1] >= 2048) 714 | { 715 | return pContext->ThrowNativeError("Invalid Edict Index %d", params[1]); 716 | } 717 | int entity = params[1]; 718 | char *propName; 719 | pContext->LocalToString(params[2], &propName); 720 | int element = params[3]; 721 | int propType = params[4]; 722 | IPluginFunction *callback = pContext->GetFunctionById(params[5]); 723 | for (int i = 0; i < g_Hooks.Count(); i++) 724 | { 725 | if (g_Hooks[i].Element == element && g_Hooks[i].PropType == propType && g_Hooks[i].pCallback == callback && !strcmp(g_Hooks[i].pVar->GetName(), propName) && g_Hooks[i].objectID == entity) 726 | { 727 | g_SendProxyManager.UnhookProxy(i); 728 | } 729 | } 730 | return 0; 731 | } 732 | 733 | static cell_t Native_Unhook(IPluginContext* pContext, const cell_t* params) 734 | { 735 | char *propName; 736 | pContext->LocalToString(params[2], &propName); 737 | IPluginFunction *pFunction = pContext->GetFunctionById(params[3]); 738 | for (int i = 0; i < g_Hooks.Count(); i++) 739 | { 740 | if (params[1] == g_Hooks[i].objectID && strcmp(g_Hooks[i].pVar->GetName(), propName) == 0 && pFunction == g_Hooks[i].pCallback) 741 | { 742 | g_SendProxyManager.UnhookProxy(i); 743 | return 1; 744 | } 745 | } 746 | return 0; 747 | } 748 | 749 | static cell_t Native_IsHooked(IPluginContext* pContext, const cell_t* params) 750 | { 751 | int objectID = params[1]; 752 | char *propName; 753 | pContext->LocalToString(params[2], &propName); 754 | 755 | for (int i = 0; i < g_Hooks.Count(); i++) 756 | { 757 | if (g_Hooks[i].objectID == objectID && strcmp(propName, g_Hooks[i].pVar->GetName()) == 0) 758 | return 1; 759 | } 760 | return 0; 761 | } -------------------------------------------------------------------------------- /extension/extension.h: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SendVar Proxy Manager 5 | * Copyright (C) 2011 Afronanny. All rights reserved. 6 | * ============================================================================= 7 | * 8 | * This program is free software; you can redistribute it and/or modify it under 9 | * the terms of the GNU General Public License, version 3.0, as published by the 10 | * Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 | * details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with 18 | * this program. If not, see . 19 | * 20 | * As a special exception, AlliedModders LLC gives you permission to link the 21 | * code of this program (as well as its derivative works) to "Half-Life 2," the 22 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 23 | * by the Valve Corporation. You must obey the GNU General Public License in 24 | * all respects for all other code used. Additionally, AlliedModders LLC grants 25 | * this exception to all derivative works. AlliedModders LLC defines further 26 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 27 | * or . 28 | * 29 | * Version: $Id$ 30 | */ 31 | 32 | #ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ 33 | #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ 34 | 35 | /** 36 | * @file extension.h 37 | * @brief Sample extension code header. 38 | */ 39 | 40 | #include "smsdk_ext.h" 41 | #include "dt_send.h" 42 | #include "server_class.h" 43 | #include "convar.h" 44 | #include 45 | 46 | enum { 47 | Prop_Int = 0, 48 | Prop_Float = 1, 49 | Prop_String = 2, 50 | Prop_Array = 3, 51 | Prop_Vector = 4, 52 | Prop_Max 53 | }; 54 | 55 | class SendPropHook 56 | { 57 | public: 58 | IPluginFunction* pCallback; 59 | SendProp* pVar; 60 | edict_t* pEnt; 61 | SendVarProxyFn pRealProxy; 62 | int objectID; 63 | int PropType; 64 | int Offset; 65 | int Element; 66 | }; 67 | 68 | class PropChangeHook 69 | { 70 | public: 71 | IPluginFunction* pCallback; 72 | int iLastValue; 73 | float flLastValue; 74 | std::string szLastValue; 75 | SendProp* pVar; 76 | int PropType; 77 | unsigned int Offset; 78 | int objectID; 79 | }; 80 | 81 | void GlobalProxy(const SendProp *pProp, const void *pStructBase, const void* pData, DVariant *pOut, int iElement, int objectID); 82 | /** 83 | * @brief Sample implementation of the SDK Extension. 84 | * Note: Uncomment one of the pre-defined virtual functions in order to use it. 85 | */ 86 | class SendProxyManager : public SDKExtension, public IPluginsListener 87 | { 88 | public: 89 | virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late); 90 | virtual void SDK_OnUnload(); 91 | virtual void SDK_OnAllLoaded(); 92 | 93 | 94 | //virtual void SDK_OnPauseChange(bool paused); 95 | 96 | //virtual bool QueryRunning(char *error, size_t maxlength); 97 | void OnPluginUnloaded(IPlugin *plugin); 98 | //Returns true upon success 99 | //Returns false if hook exists for that object and prop 100 | //Returns false if the prop does not exist or the edict does not exist/is free 101 | bool AddHookToList(SendPropHook hook); 102 | bool HookProxy(SendProp* pProp, int objectID, IPluginFunction *pCallback); 103 | 104 | void UnhookProxy(int i); 105 | 106 | public: 107 | #if defined SMEXT_CONF_METAMOD 108 | virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late); 109 | //virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength); 110 | //virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength); 111 | #endif 112 | }; 113 | 114 | #endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ 115 | -------------------------------------------------------------------------------- /extension/msvc10/sdk.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug - Alien Swarm 6 | Win32 7 | 8 | 9 | Debug - Dark Messiah 10 | Win32 11 | 12 | 13 | Debug - Episode 1 14 | Win32 15 | 16 | 17 | Debug - Left 4 Dead 2 18 | Win32 19 | 20 | 21 | Debug - Left 4 Dead 22 | Win32 23 | 24 | 25 | Debug - Old Metamod 26 | Win32 27 | 28 | 29 | Debug - Orange Box Valve 30 | Win32 31 | 32 | 33 | Debug - Orange Box 34 | Win32 35 | 36 | 37 | Debug 38 | Win32 39 | 40 | 41 | Release - Alien Swarm 42 | Win32 43 | 44 | 45 | Release - Dark Messiah 46 | Win32 47 | 48 | 49 | Release - Episode 1 50 | Win32 51 | 52 | 53 | Release - Left 4 Dead 2 54 | Win32 55 | 56 | 57 | Release - Left 4 Dead 58 | Win32 59 | 60 | 61 | Release - Old Metamod 62 | Win32 63 | 64 | 65 | Release - Orange Box Valve 66 | Win32 67 | 68 | 69 | Release - Orange Box 70 | Win32 71 | 72 | 73 | Release 74 | Win32 75 | 76 | 77 | 78 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206} 79 | sdk 80 | Win32Proj 81 | sendproxy 82 | 83 | 84 | 85 | DynamicLibrary 86 | MultiByte 87 | true 88 | v120 89 | 90 | 91 | DynamicLibrary 92 | MultiByte 93 | v120 94 | 95 | 96 | DynamicLibrary 97 | MultiByte 98 | true 99 | v120 100 | 101 | 102 | DynamicLibrary 103 | MultiByte 104 | true 105 | v120 106 | 107 | 108 | DynamicLibrary 109 | MultiByte 110 | v120 111 | 112 | 113 | DynamicLibrary 114 | MultiByte 115 | v120 116 | 117 | 118 | DynamicLibrary 119 | MultiByte 120 | true 121 | v120 122 | 123 | 124 | DynamicLibrary 125 | MultiByte 126 | v120 127 | 128 | 129 | DynamicLibrary 130 | MultiByte 131 | true 132 | v120 133 | 134 | 135 | DynamicLibrary 136 | MultiByte 137 | v120 138 | 139 | 140 | DynamicLibrary 141 | MultiByte 142 | true 143 | v120 144 | 145 | 146 | DynamicLibrary 147 | MultiByte 148 | v120 149 | 150 | 151 | DynamicLibrary 152 | MultiByte 153 | true 154 | v120 155 | 156 | 157 | DynamicLibrary 158 | MultiByte 159 | v120 160 | 161 | 162 | DynamicLibrary 163 | MultiByte 164 | true 165 | v120 166 | 167 | 168 | DynamicLibrary 169 | MultiByte 170 | v120 171 | 172 | 173 | DynamicLibrary 174 | MultiByte 175 | true 176 | v120 177 | 178 | 179 | DynamicLibrary 180 | MultiByte 181 | v120 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | <_ProjectFileVersion>10.0.30319.1 243 | true 244 | false 245 | true 246 | false 247 | true 248 | false 249 | true 250 | false 251 | true 252 | false 253 | true 254 | false 255 | true 256 | true 257 | false 258 | false 259 | true 260 | false 261 | AllRules.ruleset 262 | 263 | 264 | AllRules.ruleset 265 | 266 | 267 | AllRules.ruleset 268 | AllRules.ruleset 269 | 270 | 271 | 272 | 273 | AllRules.ruleset 274 | 275 | 276 | AllRules.ruleset 277 | 278 | 279 | AllRules.ruleset 280 | 281 | 282 | AllRules.ruleset 283 | 284 | 285 | AllRules.ruleset 286 | 287 | 288 | AllRules.ruleset 289 | 290 | 291 | AllRules.ruleset 292 | 293 | 294 | AllRules.ruleset 295 | AllRules.ruleset 296 | 297 | 298 | 299 | 300 | AllRules.ruleset 301 | 302 | 303 | AllRules.ruleset 304 | 305 | 306 | AllRules.ruleset 307 | 308 | 309 | AllRules.ruleset 310 | 311 | 312 | AllRules.ruleset 313 | 314 | 315 | sample.ext.2.darkm 316 | sample.ext.2.ep1 317 | sample.ext.2.l4d2 318 | sample.ext.2.swarm 319 | sample.ext.2.l4d 320 | sample.ext.1.ep1 321 | sendproxy.ext 322 | sample.ext.2.ep2 323 | sample.ext 324 | sample.ext.2.darkm 325 | sample.ext.2.ep1 326 | sample.ext.2.l4d2 327 | sample.ext.2.swarm 328 | sample.ext.2.l4d 329 | sample.ext.1.ep1 330 | sendproxy.ext 331 | sample.ext.2.ep2 332 | sample.ext 333 | 334 | 335 | 336 | Disabled 337 | ..;..\sdk;..\..;..\..\sourcepawn;%(AdditionalIncludeDirectories) 338 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;%(PreprocessorDefinitions) 339 | true 340 | EnableFastChecks 341 | MultiThreadedDebug 342 | NotSet 343 | false 344 | 345 | 346 | Level3 347 | EditAndContinue 348 | 349 | 350 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 351 | true 352 | Windows 353 | false 354 | 355 | 356 | MachineX86 357 | 358 | 359 | 360 | 361 | Speed 362 | ..;..\sdk;..\..;..\..\sourcepawn;%(AdditionalIncludeDirectories) 363 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;%(PreprocessorDefinitions) 364 | MultiThreaded 365 | NotSet 366 | false 367 | 368 | 369 | Level3 370 | ProgramDatabase 371 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 372 | 373 | 374 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 375 | true 376 | Windows 377 | true 378 | true 379 | false 380 | 381 | 382 | MachineX86 383 | 384 | 385 | 386 | 387 | /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 388 | Disabled 389 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDK)\public;$(HL2SDK)\public\dlls;$(HL2SDK)\public\engine;$(HL2SDK)\public\tier0;$(HL2SDK)\public\tier1;$(MMSOURCE18)\core-legacy;$(MMSOURCE18)\core-legacy\sourcehook;%(AdditionalIncludeDirectories) 390 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=1;%(PreprocessorDefinitions) 391 | true 392 | EnableFastChecks 393 | MultiThreadedDebug 394 | NotSet 395 | false 396 | 397 | 398 | Level3 399 | EditAndContinue 400 | 401 | 402 | $(HL2SDK)\lib\public\tier0.lib;$(HL2SDK)\lib\public\tier1.lib;$(HL2SDK)\lib\public\vstdlib.lib;%(AdditionalDependencies) 403 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 404 | true 405 | Windows 406 | false 407 | 408 | 409 | MachineX86 410 | 411 | 412 | 413 | 414 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 415 | Speed 416 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDK)\public;$(HL2SDK)\public\dlls;$(HL2SDK)\public\engine;$(HL2SDK)\public\tier0;$(HL2SDK)\public\tier1;$(MMSOURCE18)\core-legacy;$(MMSOURCE18)\core-legacy\sourcehook;%(AdditionalIncludeDirectories) 417 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=1;%(PreprocessorDefinitions) 418 | MultiThreaded 419 | NotSet 420 | false 421 | 422 | 423 | Level3 424 | ProgramDatabase 425 | 426 | 427 | $(HL2SDK)\lib\public\tier0.lib;$(HL2SDK)\lib\public\tier1.lib;$(HL2SDK)\lib\public\vstdlib.lib;%(AdditionalDependencies) 428 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 429 | true 430 | Windows 431 | true 432 | true 433 | false 434 | 435 | 436 | MachineX86 437 | 438 | 439 | 440 | 441 | /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 442 | Disabled 443 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDK-DARKM)\public;$(HL2SDK-DARKM)\public\dlls;$(HL2SDK-DARKM)\public\engine;$(HL2SDK-DARKM)\public\tier0;$(HL2SDK-DARKM)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 444 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=2;%(PreprocessorDefinitions) 445 | true 446 | EnableFastChecks 447 | MultiThreadedDebug 448 | NotSet 449 | false 450 | 451 | 452 | Level3 453 | EditAndContinue 454 | 455 | 456 | $(HL2SDK-DARKM)\lib\public\tier0.lib;$(HL2SDK-DARKM)\lib\public\tier1.lib;$(HL2SDK-DARKM)\lib\public\vstdlib.lib;%(AdditionalDependencies) 457 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 458 | true 459 | Windows 460 | false 461 | 462 | 463 | MachineX86 464 | 465 | 466 | 467 | 468 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 469 | Speed 470 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDK-DARKM)\public;$(HL2SDK-DARKM)\public\dlls;$(HL2SDK-DARKM)\public\engine;$(HL2SDK-DARKM)\public\tier0;$(HL2SDK-DARKM)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 471 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=2;%(PreprocessorDefinitions) 472 | MultiThreaded 473 | NotSet 474 | false 475 | 476 | 477 | Level3 478 | ProgramDatabase 479 | 480 | 481 | $(HL2SDK-DARKM)\lib\public\tier0.lib;$(HL2SDK-DARKM)\lib\public\tier1.lib;$(HL2SDK-DARKM)\lib\public\vstdlib.lib;%(AdditionalDependencies) 482 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 483 | true 484 | Windows 485 | true 486 | true 487 | false 488 | 489 | 490 | MachineX86 491 | 492 | 493 | 494 | 495 | /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 496 | Disabled 497 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDKOB)\public;$(HL2SDKOB)\public\engine;$(HL2SDKOB)\public\game\server;$(HL2SDKOB)\public\tier0;$(HL2SDKOB)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 498 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=3;%(PreprocessorDefinitions) 499 | true 500 | EnableFastChecks 501 | MultiThreadedDebug 502 | NotSet 503 | false 504 | 505 | 506 | Level3 507 | EditAndContinue 508 | 509 | 510 | $(HL2SDKOB)\lib\public\tier0.lib;$(HL2SDKOB)\lib\public\tier1.lib;$(HL2SDKOB)\lib\public\vstdlib.lib;%(AdditionalDependencies) 511 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 512 | true 513 | Windows 514 | false 515 | 516 | 517 | MachineX86 518 | 519 | 520 | 521 | 522 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 523 | Speed 524 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDKOB)\public;$(HL2SDKOB)\public\engine;$(HL2SDKOB)\public\game\server;$(HL2SDKOB)\public\tier0;$(HL2SDKOB)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 525 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=3;%(PreprocessorDefinitions) 526 | MultiThreaded 527 | NotSet 528 | false 529 | 530 | 531 | Level3 532 | ProgramDatabase 533 | 534 | 535 | $(HL2SDKOB)\lib\public\tier0.lib;$(HL2SDKOB)\lib\public\tier1.lib;$(HL2SDKOB)\lib\public\vstdlib.lib;%(AdditionalDependencies) 536 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 537 | true 538 | Windows 539 | true 540 | true 541 | false 542 | 543 | 544 | MachineX86 545 | 546 | 547 | 548 | 549 | /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 550 | Disabled 551 | ..;..\sdk;$(SOURCEMOD15)\public\;$(SOURCEMOD15)\public\sourcepawn\;$(HL2SDKOBVALVE)\public;$(HL2SDKOBVALVE)\public\engine;$(HL2SDKOBVALVE)\public\game\server;$(HL2SDKOBVALVE)\public\tier0;$(HL2SDKOBVALVE)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 552 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=4;%(PreprocessorDefinitions) 553 | true 554 | EnableFastChecks 555 | MultiThreadedDebug 556 | NotSet 557 | false 558 | 559 | 560 | Level3 561 | EditAndContinue 562 | 563 | 564 | $(HL2SDKOBVALVE)\lib\public\tier0.lib;$(HL2SDKOBVALVE)\lib\public\tier1.lib;$(HL2SDKOBVALVE)\lib\public\vstdlib.lib;%(AdditionalDependencies) 565 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 566 | true 567 | Windows 568 | false 569 | 570 | 571 | MachineX86 572 | 573 | 574 | 575 | 576 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 577 | Speed 578 | ..;..\sdk;$(SOURCEMOD_DEV)\public\;$(SOURCEMOD_DEV)\public\sourcepawn\;$(SOURCEMOD_DEV)\sourcepawn\include\;$(HL2SDKTF2)\public;$(HL2SDKTF2)\public\engine;$(HL2SDKTF2)\public\game\server;$(HL2SDKTF2)\public\tier0;$(HL2SDKTF2)\public\tier1;$(MMSOURCE_DEV)\core;$(MMSOURCE_DEV)\core\sourcehook;%(AdditionalIncludeDirectories) 579 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=4;%(PreprocessorDefinitions) 580 | MultiThreaded 581 | NotSet 582 | false 583 | 584 | 585 | Level3 586 | ProgramDatabase 587 | 588 | 589 | $(HL2SDKTF2)\lib\public\tier0.lib;$(HL2SDKTF2)\lib\public\tier1.lib;$(HL2SDKTF2)\lib\public\vstdlib.lib;%(AdditionalDependencies) 590 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 591 | true 592 | Windows 593 | true 594 | true 595 | false 596 | 597 | 598 | MachineX86 599 | 600 | 601 | 602 | 603 | /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 604 | Disabled 605 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDKL4D)\public;$(HL2SDKL4D)\public\engine;$(HL2SDKL4D)\public\game\server;$(HL2SDKL4D)\public\tier0;$(HL2SDKL4D)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 606 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=5;%(PreprocessorDefinitions) 607 | true 608 | EnableFastChecks 609 | MultiThreadedDebug 610 | NotSet 611 | false 612 | 613 | 614 | Level3 615 | EditAndContinue 616 | 617 | 618 | $(HL2SDKL4D)\lib\public\tier0.lib;$(HL2SDKL4D)\lib\public\tier1.lib;$(HL2SDKL4D)\lib\public\vstdlib.lib;%(AdditionalDependencies) 619 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 620 | true 621 | Windows 622 | false 623 | 624 | 625 | MachineX86 626 | 627 | 628 | 629 | 630 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 631 | Speed 632 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDKL4D)\public;$(HL2SDKL4D)\public\engine;$(HL2SDKL4D)\public\game\server;$(HL2SDKL4D)\public\tier0;$(HL2SDKL4D)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 633 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=5;%(PreprocessorDefinitions) 634 | MultiThreaded 635 | NotSet 636 | false 637 | 638 | 639 | Level3 640 | ProgramDatabase 641 | 642 | 643 | $(HL2SDKL4D)\lib\public\tier0.lib;$(HL2SDKL4D)\lib\public\tier1.lib;$(HL2SDKL4D)\lib\public\vstdlib.lib;%(AdditionalDependencies) 644 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 645 | true 646 | Windows 647 | true 648 | true 649 | false 650 | 651 | 652 | MachineX86 653 | 654 | 655 | 656 | 657 | /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 658 | Disabled 659 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDKL4D2)\public;$(HL2SDKL4D2)\public\engine;$(HL2SDKL4D2)\public\game\server;$(HL2SDKL4D2)\public\tier0;$(HL2SDKL4D2)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 660 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=6;%(PreprocessorDefinitions) 661 | true 662 | EnableFastChecks 663 | MultiThreadedDebug 664 | NotSet 665 | false 666 | 667 | 668 | Level3 669 | EditAndContinue 670 | 671 | 672 | $(HL2SDKL4D2)\lib\public\tier0.lib;$(HL2SDKL4D2)\lib\public\tier1.lib;$(HL2SDKL4D2)\lib\public\vstdlib.lib;%(AdditionalDependencies) 673 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 674 | true 675 | Windows 676 | false 677 | 678 | 679 | MachineX86 680 | 681 | 682 | 683 | 684 | /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 685 | Disabled 686 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDK-SWARM)\public;$(HL2SDK-SWARM)\public\engine;$(HL2SDK-SWARM)\public\game\server;$(HL2SDK-SWARM)\public\tier0;$(HL2SDK-SWARM)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 687 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;COMPILER_MSVC;COMPILER_MSVC32;SOURCE_ENGINE=7;%(PreprocessorDefinitions) 688 | true 689 | EnableFastChecks 690 | MultiThreadedDebug 691 | NotSet 692 | false 693 | 694 | 695 | Level3 696 | EditAndContinue 697 | 698 | 699 | $(HL2SDK-SWARM)\lib\public\interfaces.lib;$(HL2SDK-SWARM)\lib\public\tier0.lib;$(HL2SDK-SWARM)\lib\public\tier1.lib;$(HL2SDK-SWARM)\lib\public\vstdlib.lib;%(AdditionalDependencies) 700 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 701 | true 702 | Windows 703 | false 704 | 705 | 706 | MachineX86 707 | 708 | 709 | 710 | 711 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 712 | Speed 713 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDKL4D2)\public;$(HL2SDKL4D2)\public\engine;$(HL2SDKL4D2)\public\game\server;$(HL2SDKL4D2)\public\tier0;$(HL2SDKL4D2)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 714 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=6;%(PreprocessorDefinitions) 715 | MultiThreaded 716 | NotSet 717 | false 718 | 719 | 720 | Level3 721 | ProgramDatabase 722 | 723 | 724 | $(HL2SDKL4D2)\lib\public\tier0.lib;$(HL2SDKL4D2)\lib\public\tier1.lib;$(HL2SDKL4D2)\lib\public\vstdlib.lib;%(AdditionalDependencies) 725 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 726 | true 727 | Windows 728 | true 729 | true 730 | false 731 | 732 | 733 | MachineX86 734 | 735 | 736 | 737 | 738 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 739 | Speed 740 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDK-SWARM)\public;$(HL2SDK-SWARM)\public\engine;$(HL2SDK-SWARM)\public\game\server;$(HL2SDK-SWARM)\public\tier0;$(HL2SDK-SWARM)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 741 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;COMPILER_MSVC;COMPILER_MSVC32;SOURCE_ENGINE=7;%(PreprocessorDefinitions) 742 | MultiThreaded 743 | NotSet 744 | false 745 | 746 | 747 | Level3 748 | ProgramDatabase 749 | 750 | 751 | $(HL2SDK-SWARM)\lib\public\interfaces.lib;$(HL2SDK-SWARM)\lib\public\tier0.lib;$(HL2SDK-SWARM)\lib\public\tier1.lib;$(HL2SDK-SWARM)\lib\public\vstdlib.lib;%(AdditionalDependencies) 752 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 753 | true 754 | Windows 755 | true 756 | true 757 | false 758 | 759 | 760 | MachineX86 761 | 762 | 763 | 764 | 765 | /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 766 | Disabled 767 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDK)\public;$(HL2SDK)\public\dlls;$(HL2SDK)\public\engine;$(HL2SDK)\public\tier0;$(HL2SDK)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 768 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=2;%(PreprocessorDefinitions) 769 | true 770 | EnableFastChecks 771 | MultiThreadedDebug 772 | NotSet 773 | false 774 | 775 | 776 | Level3 777 | EditAndContinue 778 | 779 | 780 | $(HL2SDK)\lib\public\tier0.lib;$(HL2SDK)\lib\public\tier1.lib;$(HL2SDK)\lib\public\vstdlib.lib;%(AdditionalDependencies) 781 | LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries) 782 | true 783 | Windows 784 | false 785 | 786 | 787 | MachineX86 788 | 789 | 790 | 791 | 792 | /MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6 /D SE_ALIENSWARM=7 793 | Speed 794 | ..;..\sdk;..\..;..\..\sourcepawn;$(HL2SDK)\public;$(HL2SDK)\public\dlls;$(HL2SDK)\public\engine;$(HL2SDK)\public\tier0;$(HL2SDK)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories) 795 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=2;%(PreprocessorDefinitions) 796 | MultiThreaded 797 | NotSet 798 | false 799 | 800 | 801 | Level3 802 | ProgramDatabase 803 | 804 | 805 | $(HL2SDK)\lib\public\tier0.lib;$(HL2SDK)\lib\public\tier1.lib;$(HL2SDK)\lib\public\vstdlib.lib;%(AdditionalDependencies) 806 | LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries) 807 | true 808 | Windows 809 | true 810 | true 811 | false 812 | 813 | 814 | MachineX86 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | -------------------------------------------------------------------------------- /extension/msvc10/sdk.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | {31958233-BB2D-4e41-A8F9-CE8A4684F436} 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | SourceMod SDK 26 | 27 | 28 | 29 | 30 | Header Files 31 | 32 | 33 | SourceMod SDK 34 | 35 | 36 | SourceMod SDK 37 | 38 | 39 | -------------------------------------------------------------------------------- /extension/msvc10/sendproxy.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdk", "sdk.vcxproj", "{B3E797CF-4E77-4C9D-B8A8-7589B6902206}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug - Alien Swarm|Win32 = Debug - Alien Swarm|Win32 9 | Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 10 | Debug - Episode 1|Win32 = Debug - Episode 1|Win32 11 | Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32 12 | Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 13 | Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32 14 | Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 15 | Debug - Orange Box|Win32 = Debug - Orange Box|Win32 16 | Debug|Win32 = Debug|Win32 17 | Release - Alien Swarm|Win32 = Release - Alien Swarm|Win32 18 | Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 19 | Release - Episode 1|Win32 = Release - Episode 1|Win32 20 | Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32 21 | Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 22 | Release - Old Metamod|Win32 = Release - Old Metamod|Win32 23 | Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 24 | Release - Orange Box|Win32 = Release - Orange Box|Win32 25 | Release|Win32 = Release|Win32 26 | EndGlobalSection 27 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 28 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Alien Swarm|Win32.ActiveCfg = Debug - Alien Swarm|Win32 29 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Alien Swarm|Win32.Build.0 = Debug - Alien Swarm|Win32 30 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32 31 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 32 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32 33 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32 34 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32 35 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32 36 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 37 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 38 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32 39 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Old Metamod|Win32.Build.0 = Debug - Old Metamod|Win32 40 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box Valve|Win32.ActiveCfg = Debug - Orange Box Valve|Win32 41 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box Valve|Win32.Build.0 = Debug - Orange Box Valve|Win32 42 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32 43 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32 44 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug|Win32.ActiveCfg = Debug|Win32 45 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug|Win32.Build.0 = Debug|Win32 46 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Alien Swarm|Win32.ActiveCfg = Release - Alien Swarm|Win32 47 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Alien Swarm|Win32.Build.0 = Release - Alien Swarm|Win32 48 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32 49 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 50 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32 51 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32 52 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32 53 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32 54 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 55 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 56 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32 57 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Old Metamod|Win32.Build.0 = Release - Old Metamod|Win32 58 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box Valve|Win32.ActiveCfg = Release - Orange Box Valve|Win32 59 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box Valve|Win32.Build.0 = Release - Orange Box Valve|Win32 60 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32 61 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32 62 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release|Win32.ActiveCfg = Release|Win32 63 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release|Win32.Build.0 = Release|Win32 64 | EndGlobalSection 65 | GlobalSection(SolutionProperties) = preSolution 66 | HideSolutionNode = FALSE 67 | EndGlobalSection 68 | EndGlobal 69 | -------------------------------------------------------------------------------- /extension/sdk/smsdk_config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SourceMod Sample Extension 5 | * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. 6 | * ============================================================================= 7 | * 8 | * This program is free software; you can redistribute it and/or modify it under 9 | * the terms of the GNU General Public License, version 3.0, as published by the 10 | * Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 | * details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with 18 | * this program. If not, see . 19 | * 20 | * As a special exception, AlliedModders LLC gives you permission to link the 21 | * code of this program (as well as its derivative works) to "Half-Life 2," the 22 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 23 | * by the Valve Corporation. You must obey the GNU General Public License in 24 | * all respects for all other code used. Additionally, AlliedModders LLC grants 25 | * this exception to all derivative works. AlliedModders LLC defines further 26 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 27 | * or . 28 | * 29 | * Version: $Id$ 30 | */ 31 | 32 | #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ 33 | #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ 34 | 35 | /** 36 | * @file smsdk_config.h 37 | * @brief Contains macros for configuring basic extension information. 38 | */ 39 | 40 | /* Basic information exposed publicly */ 41 | #define SMEXT_CONF_NAME "SendProxy Manager" 42 | #define SMEXT_CONF_DESCRIPTION "Change stuff without actually changing stuff!" 43 | #define SMEXT_CONF_VERSION "1.1.5" 44 | #define SMEXT_CONF_AUTHOR "Afronanny" 45 | #define SMEXT_CONF_URL "http://www.afronanny.org/" 46 | #define SMEXT_CONF_LOGTAG "SENDPROXY" 47 | #define SMEXT_CONF_LICENSE "GPL" 48 | #define SMEXT_CONF_DATESTRING __DATE__ 49 | 50 | /** 51 | * @brief Exposes plugin's main interface. 52 | */ 53 | #define SMEXT_LINK(name) SDKExtension *g_pExtensionIface = name; 54 | 55 | /** 56 | * @brief Sets whether or not this plugin required Metamod. 57 | * NOTE: Uncomment to enable, comment to disable. 58 | */ 59 | #define SMEXT_CONF_METAMOD 60 | 61 | /** Enable interfaces you want to use here by uncommenting lines */ 62 | #define SMEXT_ENABLE_FORWARDSYS 63 | //#define SMEXT_ENABLE_HANDLESYS 64 | //#define SMEXT_ENABLE_PLAYERHELPERS 65 | //#define SMEXT_ENABLE_DBMANAGER 66 | #define SMEXT_ENABLE_GAMECONF 67 | //#define SMEXT_ENABLE_MEMUTILS 68 | #define SMEXT_ENABLE_GAMEHELPERS 69 | //#define SMEXT_ENABLE_TIMERSYS 70 | //#define SMEXT_ENABLE_THREADER 71 | //#define SMEXT_ENABLE_LIBSYS 72 | //#define SMEXT_ENABLE_MENUS 73 | //#define SMEXT_ENABLE_ADTFACTORY 74 | #define SMEXT_ENABLE_PLUGINSYS 75 | //#define SMEXT_ENABLE_ADMINSYS 76 | //#define SMEXT_ENABLE_TEXTPARSERS 77 | //#define SMEXT_ENABLE_USERMSGS 78 | //#define SMEXT_ENABLE_TRANSLATOR 79 | //#define SMEXT_ENABLE_NINVOKE 80 | 81 | #endif // _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ 82 | -------------------------------------------------------------------------------- /extension/sdk/smsdk_ext.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SourceMod Base Extension Code 5 | * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. 6 | * ============================================================================= 7 | * 8 | * This program is free software; you can redistribute it and/or modify it under 9 | * the terms of the GNU General Public License, version 3.0, as published by the 10 | * Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 | * details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with 18 | * this program. If not, see . 19 | * 20 | * As a special exception, AlliedModders LLC gives you permission to link the 21 | * code of this program (as well as its derivative works) to "Half-Life 2," the 22 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 23 | * by the Valve Corporation. You must obey the GNU General Public License in 24 | * all respects for all other code used. Additionally, AlliedModders LLC grants 25 | * this exception to all derivative works. AlliedModders LLC defines further 26 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 27 | * or . 28 | * 29 | * Version: $Id$ 30 | */ 31 | 32 | #include 33 | #include 34 | #include "smsdk_ext.h" 35 | 36 | /** 37 | * @file smsdk_ext.cpp 38 | * @brief Contains wrappers for making Extensions easier to write. 39 | */ 40 | 41 | IExtension *myself = NULL; /**< Ourself */ 42 | IShareSys *g_pShareSys = NULL; /**< Share system */ 43 | IShareSys *sharesys = NULL; /**< Share system */ 44 | ISourceMod *g_pSM = NULL; /**< SourceMod helpers */ 45 | ISourceMod *smutils = NULL; /**< SourceMod helpers */ 46 | 47 | #if defined SMEXT_ENABLE_FORWARDSYS 48 | IForwardManager *g_pForwards = NULL; /**< Forward system */ 49 | IForwardManager *forwards = NULL; /**< Forward system */ 50 | #endif 51 | #if defined SMEXT_ENABLE_HANDLESYS 52 | IHandleSys *g_pHandleSys = NULL; /**< Handle system */ 53 | IHandleSys *handlesys = NULL; /**< Handle system */ 54 | #endif 55 | #if defined SMEXT_ENABLE_PLAYERHELPERS 56 | IPlayerManager *playerhelpers = NULL; /**< Player helpers */ 57 | #endif //SMEXT_ENABLE_PLAYERHELPERS 58 | #if defined SMEXT_ENABLE_DBMANAGER 59 | IDBManager *dbi = NULL; /**< DB Manager */ 60 | #endif //SMEXT_ENABLE_DBMANAGER 61 | #if defined SMEXT_ENABLE_GAMECONF 62 | IGameConfigManager *gameconfs = NULL; /**< Game config manager */ 63 | #endif //SMEXT_ENABLE_DBMANAGER 64 | #if defined SMEXT_ENABLE_MEMUTILS 65 | IMemoryUtils *memutils = NULL; 66 | #endif //SMEXT_ENABLE_DBMANAGER 67 | #if defined SMEXT_ENABLE_GAMEHELPERS 68 | IGameHelpers *gamehelpers = NULL; 69 | #endif 70 | #if defined SMEXT_ENABLE_TIMERSYS 71 | ITimerSystem *timersys = NULL; 72 | #endif 73 | #if defined SMEXT_ENABLE_ADTFACTORY 74 | IADTFactory *adtfactory = NULL; 75 | #endif 76 | #if defined SMEXT_ENABLE_THREADER 77 | IThreader *threader = NULL; 78 | #endif 79 | #if defined SMEXT_ENABLE_LIBSYS 80 | ILibrarySys *libsys = NULL; 81 | #endif 82 | #if defined SMEXT_ENABLE_PLUGINSYS 83 | SourceMod::IPluginManager *plsys; 84 | #endif 85 | #if defined SMEXT_ENABLE_MENUS 86 | IMenuManager *menus = NULL; 87 | #endif 88 | #if defined SMEXT_ENABLE_ADMINSYS 89 | IAdminSystem *adminsys = NULL; 90 | #endif 91 | #if defined SMEXT_ENABLE_TEXTPARSERS 92 | ITextParsers *textparsers = NULL; 93 | #endif 94 | #if defined SMEXT_ENABLE_USERMSGS 95 | IUserMessages *usermsgs = NULL; 96 | #endif 97 | #if defined SMEXT_ENABLE_TRANSLATOR 98 | ITranslator *translator = NULL; 99 | #endif 100 | #if defined SMEXT_ENABLE_NINVOKE 101 | INativeInterface *ninvoke = NULL; 102 | #endif 103 | 104 | /** Exports the main interface */ 105 | PLATFORM_EXTERN_C IExtensionInterface *GetSMExtAPI() 106 | { 107 | return g_pExtensionIface; 108 | } 109 | 110 | SDKExtension::SDKExtension() 111 | { 112 | #if defined SMEXT_CONF_METAMOD 113 | m_SourceMMLoaded = false; 114 | m_WeAreUnloaded = false; 115 | m_WeGotPauseChange = false; 116 | #endif 117 | } 118 | 119 | bool SDKExtension::OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late) 120 | { 121 | g_pShareSys = sharesys = sys; 122 | myself = me; 123 | 124 | #if defined SMEXT_CONF_METAMOD 125 | m_WeAreUnloaded = true; 126 | 127 | if (!m_SourceMMLoaded) 128 | { 129 | if (error) 130 | { 131 | snprintf(error, maxlength, "Metamod attach failed"); 132 | } 133 | return false; 134 | } 135 | #endif 136 | SM_GET_IFACE(SOURCEMOD, g_pSM); 137 | smutils = g_pSM; 138 | #if defined SMEXT_ENABLE_HANDLESYS 139 | SM_GET_IFACE(HANDLESYSTEM, g_pHandleSys); 140 | handlesys = g_pHandleSys; 141 | #endif 142 | #if defined SMEXT_ENABLE_FORWARDSYS 143 | SM_GET_IFACE(FORWARDMANAGER, g_pForwards); 144 | forwards = g_pForwards; 145 | #endif 146 | #if defined SMEXT_ENABLE_PLAYERHELPERS 147 | SM_GET_IFACE(PLAYERMANAGER, playerhelpers); 148 | #endif 149 | #if defined SMEXT_ENABLE_DBMANAGER 150 | SM_GET_IFACE(DBI, dbi); 151 | #endif 152 | #if defined SMEXT_ENABLE_GAMECONF 153 | SM_GET_IFACE(GAMECONFIG, gameconfs); 154 | #endif 155 | #if defined SMEXT_ENABLE_MEMUTILS 156 | SM_GET_IFACE(MEMORYUTILS, memutils); 157 | #endif 158 | #if defined SMEXT_ENABLE_GAMEHELPERS 159 | SM_GET_IFACE(GAMEHELPERS, gamehelpers); 160 | #endif 161 | #if defined SMEXT_ENABLE_TIMERSYS 162 | SM_GET_IFACE(TIMERSYS, timersys); 163 | #endif 164 | #if defined SMEXT_ENABLE_ADTFACTORY 165 | SM_GET_IFACE(ADTFACTORY, adtfactory); 166 | #endif 167 | #if defined SMEXT_ENABLE_THREADER 168 | SM_GET_IFACE(THREADER, threader); 169 | #endif 170 | #if defined SMEXT_ENABLE_LIBSYS 171 | SM_GET_IFACE(LIBRARYSYS, libsys); 172 | #endif 173 | #if defined SMEXT_ENABLE_PLUGINSYS 174 | SM_GET_IFACE(PLUGINSYSTEM, plsys); 175 | #endif 176 | #if defined SMEXT_ENABLE_MENUS 177 | SM_GET_IFACE(MENUMANAGER, menus); 178 | #endif 179 | #if defined SMEXT_ENABLE_ADMINSYS 180 | SM_GET_IFACE(ADMINSYS, adminsys); 181 | #endif 182 | #if defined SMEXT_ENABLE_TEXTPARSERS 183 | SM_GET_IFACE(TEXTPARSERS, textparsers); 184 | #endif 185 | #if defined SMEXT_ENABLE_USERMSGS 186 | SM_GET_IFACE(USERMSGS, usermsgs); 187 | #endif 188 | #if defined SMEXT_ENABLE_TRANSLATOR 189 | SM_GET_IFACE(TRANSLATOR, translator); 190 | #endif 191 | 192 | if (SDK_OnLoad(error, maxlength, late)) 193 | { 194 | #if defined SMEXT_CONF_METAMOD 195 | m_WeAreUnloaded = true; 196 | #endif 197 | return true; 198 | } 199 | 200 | return false; 201 | } 202 | 203 | bool SDKExtension::IsMetamodExtension() 204 | { 205 | #if defined SMEXT_CONF_METAMOD 206 | return true; 207 | #else 208 | return false; 209 | #endif 210 | } 211 | 212 | void SDKExtension::OnExtensionPauseChange(bool state) 213 | { 214 | #if defined SMEXT_CONF_METAMOD 215 | m_WeGotPauseChange = true; 216 | #endif 217 | SDK_OnPauseChange(state); 218 | } 219 | 220 | void SDKExtension::OnExtensionsAllLoaded() 221 | { 222 | SDK_OnAllLoaded(); 223 | } 224 | 225 | void SDKExtension::OnExtensionUnload() 226 | { 227 | #if defined SMEXT_CONF_METAMOD 228 | m_WeAreUnloaded = true; 229 | #endif 230 | SDK_OnUnload(); 231 | } 232 | 233 | const char *SDKExtension::GetExtensionAuthor() 234 | { 235 | return SMEXT_CONF_AUTHOR; 236 | } 237 | 238 | const char *SDKExtension::GetExtensionDateString() 239 | { 240 | return SMEXT_CONF_DATESTRING; 241 | } 242 | 243 | const char *SDKExtension::GetExtensionDescription() 244 | { 245 | return SMEXT_CONF_DESCRIPTION; 246 | } 247 | 248 | const char *SDKExtension::GetExtensionVerString() 249 | { 250 | return SMEXT_CONF_VERSION; 251 | } 252 | 253 | const char *SDKExtension::GetExtensionName() 254 | { 255 | return SMEXT_CONF_NAME; 256 | } 257 | 258 | const char *SDKExtension::GetExtensionTag() 259 | { 260 | return SMEXT_CONF_LOGTAG; 261 | } 262 | 263 | const char *SDKExtension::GetExtensionURL() 264 | { 265 | return SMEXT_CONF_URL; 266 | } 267 | 268 | bool SDKExtension::SDK_OnLoad(char *error, size_t maxlength, bool late) 269 | { 270 | return true; 271 | } 272 | 273 | void SDKExtension::SDK_OnUnload() 274 | { 275 | } 276 | 277 | void SDKExtension::SDK_OnPauseChange(bool paused) 278 | { 279 | } 280 | 281 | void SDKExtension::SDK_OnAllLoaded() 282 | { 283 | } 284 | 285 | #if defined SMEXT_CONF_METAMOD 286 | 287 | PluginId g_PLID = 0; /**< Metamod plugin ID */ 288 | ISmmPlugin *g_PLAPI = NULL; /**< Metamod plugin API */ 289 | SourceHook::ISourceHook *g_SHPtr = NULL; /**< SourceHook pointer */ 290 | ISmmAPI *g_SMAPI = NULL; /**< SourceMM API pointer */ 291 | 292 | IVEngineServer *engine = NULL; /**< IVEngineServer pointer */ 293 | IServerGameDLL *gamedll = NULL; /**< IServerGameDLL pointer */ 294 | 295 | /** Exposes the extension to Metamod */ 296 | SMM_API void *PL_EXPOSURE(const char *name, int *code) 297 | { 298 | #if defined METAMOD_PLAPI_VERSION 299 | if (name && !strcmp(name, METAMOD_PLAPI_NAME)) 300 | #else 301 | if (name && !strcmp(name, PLAPI_NAME)) 302 | #endif 303 | { 304 | if (code) 305 | { 306 | *code = IFACE_OK; 307 | } 308 | return static_cast(g_pExtensionIface); 309 | } 310 | 311 | if (code) 312 | { 313 | *code = IFACE_FAILED; 314 | } 315 | 316 | return NULL; 317 | } 318 | 319 | bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late) 320 | { 321 | PLUGIN_SAVEVARS(); 322 | 323 | #if !defined METAMOD_PLAPI_VERSION 324 | GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); 325 | GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); 326 | #else 327 | GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); 328 | GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); 329 | #endif 330 | 331 | m_SourceMMLoaded = true; 332 | 333 | return SDK_OnMetamodLoad(ismm, error, maxlen, late); 334 | } 335 | 336 | bool SDKExtension::Unload(char *error, size_t maxlen) 337 | { 338 | if (!m_WeAreUnloaded) 339 | { 340 | if (error) 341 | { 342 | snprintf(error, maxlen, "This extension must be unloaded by SourceMod."); 343 | } 344 | return false; 345 | } 346 | 347 | return SDK_OnMetamodUnload(error, maxlen); 348 | } 349 | 350 | bool SDKExtension::Pause(char *error, size_t maxlen) 351 | { 352 | if (!m_WeGotPauseChange) 353 | { 354 | if (error) 355 | { 356 | snprintf(error, maxlen, "This extension must be paused by SourceMod."); 357 | } 358 | return false; 359 | } 360 | 361 | m_WeGotPauseChange = false; 362 | 363 | return SDK_OnMetamodPauseChange(true, error, maxlen); 364 | } 365 | 366 | bool SDKExtension::Unpause(char *error, size_t maxlen) 367 | { 368 | if (!m_WeGotPauseChange) 369 | { 370 | if (error) 371 | { 372 | snprintf(error, maxlen, "This extension must be unpaused by SourceMod."); 373 | } 374 | return false; 375 | } 376 | 377 | m_WeGotPauseChange = false; 378 | 379 | return SDK_OnMetamodPauseChange(false, error, maxlen); 380 | } 381 | 382 | const char *SDKExtension::GetAuthor() 383 | { 384 | return GetExtensionAuthor(); 385 | } 386 | 387 | const char *SDKExtension::GetDate() 388 | { 389 | return GetExtensionDateString(); 390 | } 391 | 392 | const char *SDKExtension::GetDescription() 393 | { 394 | return GetExtensionDescription(); 395 | } 396 | 397 | const char *SDKExtension::GetLicense() 398 | { 399 | return SMEXT_CONF_LICENSE; 400 | } 401 | 402 | const char *SDKExtension::GetLogTag() 403 | { 404 | return GetExtensionTag(); 405 | } 406 | 407 | const char *SDKExtension::GetName() 408 | { 409 | return GetExtensionName(); 410 | } 411 | 412 | const char *SDKExtension::GetURL() 413 | { 414 | return GetExtensionURL(); 415 | } 416 | 417 | const char *SDKExtension::GetVersion() 418 | { 419 | return GetExtensionVerString(); 420 | } 421 | 422 | bool SDKExtension::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late) 423 | { 424 | return true; 425 | } 426 | 427 | bool SDKExtension::SDK_OnMetamodUnload(char *error, size_t maxlength) 428 | { 429 | return true; 430 | } 431 | 432 | bool SDKExtension::SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength) 433 | { 434 | return true; 435 | } 436 | 437 | #endif 438 | 439 | /* Overload a few things to prevent libstdc++ linking */ 440 | #if defined __linux__ || defined __APPLE__ 441 | extern "C" void __cxa_pure_virtual(void) 442 | { 443 | } 444 | 445 | void *operator new(size_t size) 446 | { 447 | return malloc(size); 448 | } 449 | 450 | void *operator new[](size_t size) 451 | { 452 | return malloc(size); 453 | } 454 | 455 | void operator delete(void *ptr) 456 | { 457 | free(ptr); 458 | } 459 | 460 | void operator delete[](void * ptr) 461 | { 462 | free(ptr); 463 | } 464 | #endif 465 | 466 | -------------------------------------------------------------------------------- /extension/sdk/smsdk_ext.h: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SourceMod Base Extension Code 5 | * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. 6 | * ============================================================================= 7 | * 8 | * This program is free software; you can redistribute it and/or modify it under 9 | * the terms of the GNU General Public License, version 3.0, as published by the 10 | * Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 | * details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with 18 | * this program. If not, see . 19 | * 20 | * As a special exception, AlliedModders LLC gives you permission to link the 21 | * code of this program (as well as its derivative works) to "Half-Life 2," the 22 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 23 | * by the Valve Corporation. You must obey the GNU General Public License in 24 | * all respects for all other code used. Additionally, AlliedModders LLC grants 25 | * this exception to all derivative works. AlliedModders LLC defines further 26 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 27 | * or . 28 | * 29 | * Version: $Id$ 30 | */ 31 | 32 | #ifndef _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_ 33 | #define _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_ 34 | 35 | /** 36 | * @file smsdk_ext.h 37 | * @brief Contains wrappers for making Extensions easier to write. 38 | */ 39 | 40 | #include "smsdk_config.h" 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #if defined SMEXT_ENABLE_FORWARDSYS 47 | #include 48 | #endif //SMEXT_ENABLE_FORWARDSYS 49 | #if defined SMEXT_ENABLE_PLAYERHELPERS 50 | #include 51 | #endif //SMEXT_ENABLE_PlAYERHELPERS 52 | #if defined SMEXT_ENABLE_DBMANAGER 53 | #include 54 | #endif //SMEXT_ENABLE_DBMANAGER 55 | #if defined SMEXT_ENABLE_GAMECONF 56 | #include 57 | #endif 58 | #if defined SMEXT_ENABLE_MEMUTILS 59 | #include 60 | #endif 61 | #if defined SMEXT_ENABLE_GAMEHELPERS 62 | #include 63 | #endif 64 | #if defined SMEXT_ENABLE_TIMERSYS 65 | #include 66 | #endif 67 | #if defined SMEXT_ENABLE_ADTFACTORY 68 | #include 69 | #endif 70 | #if defined SMEXT_ENABLE_THREADER 71 | #include 72 | #endif 73 | #if defined SMEXT_ENABLE_LIBSYS 74 | #include 75 | #endif 76 | #if defined SMEXT_ENABLE_PLUGINSYS 77 | #include 78 | #endif 79 | #if defined SMEXT_ENABLE_MENUS 80 | #include 81 | #endif 82 | #if defined SMEXT_ENABLE_ADMINSYS 83 | #include 84 | #endif 85 | #if defined SMEXT_ENABLE_TEXTPARSERS 86 | #include 87 | #endif 88 | #if defined SMEXT_ENABLE_USERMSGS 89 | #include 90 | #endif 91 | #if defined SMEXT_ENABLE_TRANSLATOR 92 | #include 93 | #endif 94 | #if defined SMEXT_ENABLE_NINVOKE 95 | #include 96 | #endif 97 | 98 | #if defined SMEXT_CONF_METAMOD 99 | #include 100 | #include 101 | #endif 102 | 103 | using namespace SourceMod; 104 | using namespace SourcePawn; 105 | 106 | class SDKExtension : 107 | #if defined SMEXT_CONF_METAMOD 108 | public ISmmPlugin, 109 | #endif 110 | public IExtensionInterface 111 | { 112 | public: 113 | /** Constructor */ 114 | SDKExtension(); 115 | public: 116 | /** 117 | * @brief This is called after the initial loading sequence has been processed. 118 | * 119 | * @param error Error message buffer. 120 | * @param maxlength Size of error message buffer. 121 | * @param late Whether or not the module was loaded after map load. 122 | * @return True to succeed loading, false to fail. 123 | */ 124 | virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late); 125 | 126 | /** 127 | * @brief This is called right before the extension is unloaded. 128 | */ 129 | virtual void SDK_OnUnload(); 130 | 131 | /** 132 | * @brief This is called once all known extensions have been loaded. 133 | */ 134 | virtual void SDK_OnAllLoaded(); 135 | 136 | /** 137 | * @brief Called when the pause state is changed. 138 | */ 139 | virtual void SDK_OnPauseChange(bool paused); 140 | 141 | #if defined SMEXT_CONF_METAMOD 142 | /** 143 | * @brief Called when Metamod is attached, before the extension version is called. 144 | * 145 | * @param error Error buffer. 146 | * @param maxlength Maximum size of error buffer. 147 | * @param late Whether or not Metamod considers this a late load. 148 | * @return True to succeed, false to fail. 149 | */ 150 | virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late); 151 | 152 | /** 153 | * @brief Called when Metamod is detaching, after the extension version is called. 154 | * NOTE: By default this is blocked unless sent from SourceMod. 155 | * 156 | * @param error Error buffer. 157 | * @param maxlength Maximum size of error buffer. 158 | * @return True to succeed, false to fail. 159 | */ 160 | virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength); 161 | 162 | /** 163 | * @brief Called when Metamod's pause state is changing. 164 | * NOTE: By default this is blocked unless sent from SourceMod. 165 | * 166 | * @param paused Pause state being set. 167 | * @param error Error buffer. 168 | * @param maxlength Maximum size of error buffer. 169 | * @return True to succeed, false to fail. 170 | */ 171 | virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength); 172 | #endif 173 | 174 | public: //IExtensionInterface 175 | virtual bool OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late); 176 | virtual void OnExtensionUnload(); 177 | virtual void OnExtensionsAllLoaded(); 178 | 179 | /** Returns whether or not this is a Metamod-based extension */ 180 | virtual bool IsMetamodExtension(); 181 | 182 | /** 183 | * @brief Called when the pause state changes. 184 | * 185 | * @param state True if being paused, false if being unpaused. 186 | */ 187 | virtual void OnExtensionPauseChange(bool state); 188 | 189 | /** Returns name */ 190 | virtual const char *GetExtensionName(); 191 | /** Returns URL */ 192 | virtual const char *GetExtensionURL(); 193 | /** Returns log tag */ 194 | virtual const char *GetExtensionTag(); 195 | /** Returns author */ 196 | virtual const char *GetExtensionAuthor(); 197 | /** Returns version string */ 198 | virtual const char *GetExtensionVerString(); 199 | /** Returns description string */ 200 | virtual const char *GetExtensionDescription(); 201 | /** Returns date string */ 202 | virtual const char *GetExtensionDateString(); 203 | #if defined SMEXT_CONF_METAMOD 204 | public: //ISmmPlugin 205 | /** Called when the extension is attached to Metamod. */ 206 | virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late); 207 | /** Returns the author to MM */ 208 | virtual const char *GetAuthor(); 209 | /** Returns the name to MM */ 210 | virtual const char *GetName(); 211 | /** Returns the description to MM */ 212 | virtual const char *GetDescription(); 213 | /** Returns the URL to MM */ 214 | virtual const char *GetURL(); 215 | /** Returns the license to MM */ 216 | virtual const char *GetLicense(); 217 | /** Returns the version string to MM */ 218 | virtual const char *GetVersion(); 219 | /** Returns the date string to MM */ 220 | virtual const char *GetDate(); 221 | /** Returns the logtag to MM */ 222 | virtual const char *GetLogTag(); 223 | /** Called on unload */ 224 | virtual bool Unload(char *error, size_t maxlength); 225 | /** Called on pause */ 226 | virtual bool Pause(char *error, size_t maxlength); 227 | /** Called on unpause */ 228 | virtual bool Unpause(char *error, size_t maxlength); 229 | private: 230 | bool m_SourceMMLoaded; 231 | bool m_WeAreUnloaded; 232 | bool m_WeGotPauseChange; 233 | #endif 234 | }; 235 | 236 | extern SDKExtension *g_pExtensionIface; 237 | extern IExtension *myself; 238 | 239 | extern IShareSys *g_pShareSys; 240 | extern IShareSys *sharesys; /* Note: Newer name */ 241 | extern ISourceMod *g_pSM; 242 | extern ISourceMod *smutils; /* Note: Newer name */ 243 | 244 | /* Optional interfaces are below */ 245 | #if defined SMEXT_ENABLE_FORWARDSYS 246 | extern IForwardManager *g_pForwards; 247 | extern IForwardManager *forwards; /* Note: Newer name */ 248 | #endif //SMEXT_ENABLE_FORWARDSYS 249 | #if defined SMEXT_ENABLE_HANDLESYS 250 | extern IHandleSys *g_pHandleSys; 251 | extern IHandleSys *handlesys; /* Note: Newer name */ 252 | #endif //SMEXT_ENABLE_HANDLESYS 253 | #if defined SMEXT_ENABLE_PLAYERHELPERS 254 | extern IPlayerManager *playerhelpers; 255 | #endif //SMEXT_ENABLE_PLAYERHELPERS 256 | #if defined SMEXT_ENABLE_DBMANAGER 257 | extern IDBManager *dbi; 258 | #endif //SMEXT_ENABLE_DBMANAGER 259 | #if defined SMEXT_ENABLE_GAMECONF 260 | extern IGameConfigManager *gameconfs; 261 | #endif //SMEXT_ENABLE_DBMANAGER 262 | #if defined SMEXT_ENABLE_MEMUTILS 263 | extern IMemoryUtils *memutils; 264 | #endif 265 | #if defined SMEXT_ENABLE_GAMEHELPERS 266 | extern IGameHelpers *gamehelpers; 267 | #endif 268 | #if defined SMEXT_ENABLE_TIMERSYS 269 | extern ITimerSystem *timersys; 270 | #endif 271 | #if defined SMEXT_ENABLE_ADTFACTORY 272 | extern IADTFactory *adtfactory; 273 | #endif 274 | #if defined SMEXT_ENABLE_THREADER 275 | extern IThreader *threader; 276 | #endif 277 | #if defined SMEXT_ENABLE_LIBSYS 278 | extern ILibrarySys *libsys; 279 | #endif 280 | #if defined SMEXT_ENABLE_PLUGINSYS 281 | extern SourceMod::IPluginManager *plsys; 282 | #endif 283 | #if defined SMEXT_ENABLE_MENUS 284 | extern IMenuManager *menus; 285 | #endif 286 | #if defined SMEXT_ENABLE_ADMINSYS 287 | extern IAdminSystem *adminsys; 288 | #endif 289 | #if defined SMEXT_ENABLE_USERMSGS 290 | extern IUserMessages *usermsgs; 291 | #endif 292 | #if defined SMEXT_ENABLE_TRANSLATOR 293 | extern ITranslator *translator; 294 | #endif 295 | #if defined SMEXT_ENABLE_NINVOKE 296 | extern INativeInterface *ninvoke; 297 | #endif 298 | 299 | #if defined SMEXT_CONF_METAMOD 300 | PLUGIN_GLOBALVARS(); 301 | extern IVEngineServer *engine; 302 | extern IServerGameDLL *gamedll; 303 | #endif 304 | 305 | /** Creates a SourceMod interface macro pair */ 306 | #define SM_MKIFACE(name) SMINTERFACE_##name##_NAME, SMINTERFACE_##name##_VERSION 307 | /** Automates retrieving SourceMod interfaces */ 308 | #define SM_GET_IFACE(prefix, addr) \ 309 | if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \ 310 | { \ 311 | if (error != NULL && maxlength) \ 312 | { \ 313 | size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \ 314 | if (len >= maxlength) \ 315 | { \ 316 | error[maxlength - 1] = '\0'; \ 317 | } \ 318 | } \ 319 | return false; \ 320 | } 321 | /** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */ 322 | #define SM_GET_LATE_IFACE(prefix, addr) \ 323 | g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr) 324 | /** Validates a SourceMod interface pointer */ 325 | #define SM_CHECK_IFACE(prefix, addr) \ 326 | if (!addr) \ 327 | { \ 328 | if (error != NULL && maxlength) \ 329 | { \ 330 | size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \ 331 | if (len >= maxlength) \ 332 | { \ 333 | error[maxlength - 1] = '\0'; \ 334 | } \ 335 | } \ 336 | return false; \ 337 | } 338 | 339 | #endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_ 340 | -------------------------------------------------------------------------------- /sourcemod/gamedata/sendproxy.txt: -------------------------------------------------------------------------------- 1 | "Games" 2 | { 3 | "csgo" 4 | { 5 | "Offsets" 6 | { 7 | "UpdateOnRemove" 8 | { 9 | "windows" "109" 10 | "linux" "110" 11 | } 12 | } 13 | } 14 | 15 | "#default" 16 | { 17 | "#supported" 18 | { 19 | "game" "dod" 20 | "game" "hl2mp" 21 | "game" "cstrike" 22 | "game" "tf" 23 | } 24 | "Offsets" 25 | { 26 | "UpdateOnRemove" 27 | { 28 | "windows" "105" 29 | "linux" "106" 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /sourcemod/scripting/include/sendproxy.inc: -------------------------------------------------------------------------------- 1 | #if !defined _SENDPROXYMANAGER_INC_ 2 | #define _SENDPROXYMANAGER_INC_ 3 | 4 | 5 | 6 | enum SendPropType { 7 | Prop_Int = 0, 8 | Prop_Float = 1, 9 | Prop_String = 2, 10 | //Prop_Array = 3, 11 | Prop_Vector = 4, 12 | Prop_Max 13 | }; 14 | 15 | funcenum SendProxyCallback 16 | { 17 | Action:public(entity, const String:PropName[], &iValue, element), //Prop_Int 18 | Action:public(entity, const String:PropName[], &Float:flValue, element), //Prop_Float 19 | Action:public(entity, const String:PropName[], String:modifiedValue[4096], element), //Prop_String 20 | Action:public(entity, const String:PropName[], Float:vecValues[3], element), //Prop_Vector 21 | }; 22 | 23 | funcenum PropChangedCallback 24 | { 25 | public(entity, const String:PropName[], const String:oldValue[], const String:newValue[]), 26 | }; 27 | 28 | //Returns true upon success, false upon failure 29 | native bool:SendProxy_Hook(entity, String:propname[], SendPropType:proptype, SendProxyCallback:callback); 30 | native bool:SendProxy_HookArrayProp(entity, const String:name[], element, SendPropType:type, SendProxyCallback:callback); 31 | native bool:SendProxy_UnhookArrayProp(entity, const String:name[], element, SendPropType:type, SendProxyCallback:callback); 32 | native bool:SendProxy_Unhook(entity, String:propname[], SendProxyCallback:callback); 33 | native bool:SendProxy_IsHooked(entity, String:propname[]); 34 | 35 | native bool:SendProxy_HookPropChange(entity, const String:name[], PropChangedCallback:callback); 36 | native SendProxy_UnhookPropChange(entity, const String:name[], PropChangedCallback:callback); 37 | 38 | #if !defined REQUIRE_EXTENSIONS 39 | public __ext_sendproxymanager_SetNTVOptional() 40 | { 41 | MarkNativeAsOptional("SendProxy_Hook"); 42 | MarkNativeAsOptional("SendProxy_HookArrayProp"); 43 | MarkNativeAsOptional("SendProxy_Unhook"); 44 | MarkNativeAsOptional("SendProxy_IsHooked"); 45 | MarkNativeAsOptional("SendProxy_HookPropChange"); 46 | MarkNativeAsOptional("SendProxy_UnhookPropChange"); 47 | } 48 | #endif 49 | 50 | public Extension:__ext_sendproxymanager = 51 | { 52 | name = "SendProxy Manager", 53 | file = "sendproxy.ext", 54 | #if defined AUTOLOAD_EXTENSIONS 55 | autoload = 1, 56 | #else 57 | autoload = 0, 58 | #endif 59 | #if defined REQUIRE_EXTENSIONS 60 | required = 1, 61 | #else 62 | required = 0, 63 | #endif 64 | }; 65 | 66 | #endif --------------------------------------------------------------------------------