Added support for CS: Global Offensive (bug 5299, r=asherkin).
authorNicholas Hastings <skamonkey@gmail.com>
Sun May 27 16:08:03 2012 -0400 (2012-05-27)
changeset 3515c14c14e06cc1
parent 3514 377c7da70d7c
child 3516 fce8d68b8d1b
Added support for CS: Global Offensive (bug 5299, r=asherkin).
AMBuildScript
core/ExtensionSys.cpp
core/HalfLife2.h
core/Makefile
core/MenuStyle_Base.cpp
core/PluginSys.h
core/convar_sm_swarm.h
core/logic_bridge.cpp
core/msvc10/sourcemod_mm.vcxproj
core/smn_halflife.cpp
core/sourcemm_api.h
extensions/sdktools/Makefile
extensions/sdktools/msvc10/sdktools.vcxproj
extensions/sdktools/output.cpp
extensions/sdktools/vnatives.cpp
extensions/sdktools/vsound.cpp
extensions/sdktools/vsound.h
gamedata/core.games/common.games.txt
gamedata/core.games/engine.csgo.txt
gamedata/core.games/master.games.txt
gamedata/sdktools.games/engine.csgo.txt
gamedata/sdktools.games/master.games.txt
loader/loader.cpp
plugins/include/halflife.inc
public/sm_platform.h
     1.1 --- a/AMBuildScript	Sun May 27 11:39:50 2012 -0400
     1.2 +++ b/AMBuildScript	Sun May 27 16:08:03 2012 -0400
     1.3 @@ -27,6 +27,10 @@
     1.4  		                         'name': 'BLOODYGOODTIME', 'platform': ['windows']}
     1.5  		self.possibleSdks['eye'] =   {'sdk': 'HL2SDK-EYE',      'ext': '2.eye', 'def': '5',
     1.6  		                         'name': 'EYE', 'platform': ['windows']}
     1.7 +		self.possibleSdks['csgo'] =  {'sdk': 'HL2SDKCSGO',     'ext': '2.csgo',  'def': '11',
     1.8 +		                         'name': 'CSGO',           'platform': ['windows', 'linux']}
     1.9 +		# self.possibleSdks['portal2'] =  {'sdk': 'HL2SDK-PORTAL2',     'ext': '2.portal2',  'def': '10',
    1.10 +		#                          'name': 'PORTAL2',           'platform': ['windows']}
    1.11  		
    1.12  		self.sdkInfo = { }
    1.13  
    1.14 @@ -35,7 +39,7 @@
    1.15  			self.compiler.DetectAll(AMBuild)
    1.16  
    1.17  			#Detect variables
    1.18 -			envvars = { 'MMSOURCE18':    'mmsource-1.8',
    1.19 +			envvars = { 'MMSOURCE19':    'mmsource-1.9',
    1.20  									'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
    1.21  									'HL2SDKL4D':     'hl2sdk-l4d',
    1.22  									'HL2SDKL4D2':    'hl2sdk-l4d2',
    1.23 @@ -45,6 +49,7 @@
    1.24  			if AMBuild.target['platform'] != 'darwin':
    1.25  				envvars['HL2SDK'] = 'hl2sdk'
    1.26  				envvars['HL2SDKOB'] = 'hl2sdk-ob'
    1.27 +				envvars['HL2SDKCSGO'] = 'hl2sdk-csgo'
    1.28  
    1.29  			#Dark Messiah is Windows-only
    1.30  			if AMBuild.target['platform'] == 'windows':
    1.31 @@ -225,7 +230,7 @@
    1.32  			self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public'))
    1.33  			self.compiler.AddToListVar('RCINCLUDES',
    1.34  			                           os.path.join(AMBuild.outputFolder, 'includes'))
    1.35 -		self.mmsPath = AMBuild.cache['MMSOURCE18']
    1.36 +		self.mmsPath = AMBuild.cache['MMSOURCE19']
    1.37  
    1.38  	def DefaultCompiler(self):
    1.39  		return self.compiler.Clone()
    1.40 @@ -268,18 +273,22 @@
    1.41  			else:
    1.42  				staticLibs = os.path.join(sdkPath, 'lib', 'linux')
    1.43  			workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
    1.44 -			if sdk in ['ep2v', 'l4d', 'l4d2']:
    1.45 -				for i in ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so']:
    1.46 -					link = os.path.join(workFolder, i)
    1.47 -					target = os.path.join(staticLibs, i)
    1.48 +			if sdk in ['ep2v', 'l4d', 'l4d2', 'csgo']:
    1.49 +				libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so']
    1.50 +				if sdk == 'csgo':
    1.51 +					libs.append('interfaces_i486.a')
    1.52 +				for lib in libs:
    1.53 +					link = os.path.join(workFolder, lib)
    1.54 +					target = os.path.join(staticLibs, lib)
    1.55  					try:
    1.56  						os.lstat(link)
    1.57  					except:
    1.58  						job.AddCommand(SymlinkCommand(link, target))
    1.59  			else:
    1.60 -				for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']:
    1.61 -					link = os.path.join(workFolder, i)
    1.62 -					target = os.path.join(staticLibs, i)
    1.63 +				libs = ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']
    1.64 +				for lib in libs:
    1.65 +					link = os.path.join(workFolder, lib)
    1.66 +					target = os.path.join(staticLibs, lib)
    1.67  					try:
    1.68  						os.lstat(link)
    1.69  					except:
    1.70 @@ -287,9 +296,12 @@
    1.71  		elif AMBuild.target['platform'] == 'darwin':
    1.72  			staticLibs = os.path.join(sdkPath, 'lib', 'mac')
    1.73  			workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
    1.74 -			for i in ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']:
    1.75 -				link = os.path.join(workFolder, i)
    1.76 -				target = os.path.join(staticLibs, i)
    1.77 +			libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']
    1.78 +			if sdk == 'csgo':
    1.79 +				libs.append('interfaces_i486.a')
    1.80 +			for lib in libs:
    1.81 +				link = os.path.join(workFolder, lib)
    1.82 +				target = os.path.join(staticLibs, lib)
    1.83  				try:
    1.84  					os.lstat(link)
    1.85  				except:
    1.86 @@ -306,6 +318,8 @@
    1.87  	def PostSetupHL2Job(self, job, builder, sdk):
    1.88  		if AMBuild.target['platform'] in ['linux', 'darwin']:
    1.89  			builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a'])
    1.90 +			if sdk == 'csgo':
    1.91 +				builder.AddObjectFiles(['interfaces_i486.a'])
    1.92  	
    1.93  	def DefaultHL2Compiler(self, path, sdk, noLink = False, oldMms = '-legacy'):
    1.94  		compiler = self.DefaultExtCompiler(path)
    1.95 @@ -319,6 +333,10 @@
    1.96  
    1.97  		info = self.possibleSdks
    1.98  		compiler['CDEFINES'].extend(['SE_' + info[i]['name'] + '=' + info[i]['def'] for i in info])
    1.99 +				
   1.100 +		# We don't build for Portal 2 (yet?, ever?), but using this define in code as 
   1.101 +		# it saves trouble if we ever need to
   1.102 +		compiler['CDEFINES'].append('SE_PORTAL2=10')
   1.103  
   1.104  		paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'],
   1.105  						 ['public', 'tier0'], ['public', 'tier1']]
   1.106 @@ -336,8 +354,11 @@
   1.107  
   1.108  		compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def'])
   1.109  
   1.110 -		if sdk == 'swarm' and AMBuild.target['platform'] == 'windows':
   1.111 -			compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
   1.112 +		if sdk in ['swarm','csgo']:
   1.113 +			if AMBuild.target['platform'] == 'windows':
   1.114 +				compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
   1.115 +			else:
   1.116 +				compiler['CDEFINES'].extend(['COMPILER_GCC', 'POSIX'])
   1.117  
   1.118  		if sdk == 'ep1':
   1.119  			if AMBuild.target['platform'] == 'linux':
   1.120 @@ -354,7 +375,7 @@
   1.121  		if not noLink:
   1.122  			if AMBuild.target['platform'] == 'linux':
   1.123  				compiler['POSTLINKFLAGS'][0:0] = ['-lm']
   1.124 -				if sdk in ['ep2v', 'l4d', 'l4d2']:
   1.125 +				if sdk in ['ep2v', 'l4d', 'l4d2', 'csgo']:
   1.126  					compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so']
   1.127  					compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
   1.128  				else:
     2.1 --- a/core/ExtensionSys.cpp	Sun May 27 11:39:50 2012 -0400
     2.2 +++ b/core/ExtensionSys.cpp	Sun May 27 16:08:03 2012 -0400
     2.3 @@ -78,6 +78,10 @@
     2.4  #define GAMEFIX "2.ep2v"
     2.5  #elif SOURCE_ENGINE == SE_DARKMESSIAH
     2.6  #define GAMEFIX "2.darkm"
     2.7 +#elif SOURCE_ENGINE == SE_PORTAL2
     2.8 +#define GAMEFIX "2.portal2"
     2.9 +#elif SOURCE_ENGINE == SE_CSGO
    2.10 +#define GAMEFIX "2.csgo"
    2.11  #else
    2.12  #define GAMEFIX "2.ep1"
    2.13  #endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
     3.1 --- a/core/HalfLife2.h	Sun May 27 11:39:50 2012 -0400
     3.2 +++ b/core/HalfLife2.h	Sun May 27 16:08:03 2012 -0400
     3.3 @@ -45,6 +45,9 @@
     3.4  #include <datamap.h>
     3.5  #include <ihandleentity.h>
     3.6  #include <tier0/icommandline.h>
     3.7 +#if SOURCE_ENGINE >= SE_PORTAL2
     3.8 +#include <string_t.h>
     3.9 +#endif
    3.10  
    3.11  class CCommand;
    3.12  
    3.13 @@ -88,6 +91,7 @@
    3.14  	char buffer[384];
    3.15  };
    3.16  
    3.17 +// copy from game/shared/entitylist_base.h
    3.18  class CEntInfo
    3.19  {
    3.20  public:
    3.21 @@ -95,6 +99,10 @@
    3.22  	int				m_SerialNumber;
    3.23  	CEntInfo		*m_pPrev;
    3.24  	CEntInfo		*m_pNext;
    3.25 +#if SOURCE_ENGINE >= SE_PORTAL2
    3.26 +	string_t		m_iName;
    3.27 +	string_t		m_iClassName;
    3.28 +#endif
    3.29  };
    3.30  
    3.31  class CHalfLife2 : 
     4.1 --- a/core/Makefile	Sun May 27 11:39:50 2012 -0400
     4.2 +++ b/core/Makefile	Sun May 27 16:08:03 2012 -0400
     4.3 @@ -7,6 +7,7 @@
     4.4  HL2SDK_OB_VALVE = ../../hl2sdk-ob-valve
     4.5  HL2SDK_L4D = ../../hl2sdk-l4d
     4.6  HL2SDK_L4D2 = ../../hl2sdk-l4d2
     4.7 +HL2SDK_CSGO = ../../hl2sdk-csgo
     4.8  MMSOURCE = ../../mmsource-central
     4.9  
    4.10  #####################################
    4.11 @@ -48,7 +49,7 @@
    4.12  
    4.13  override ENGSET = false
    4.14  
    4.15 -ifneq (,$(filter original orangebox orangeboxvalve left4dead left4dead2,$(ENGINE)))
    4.16 +ifneq (,$(filter original orangebox orangeboxvalve left4dead left4dead2 csgo,$(ENGINE)))
    4.17  	override ENGSET = true
    4.18  endif
    4.19  
    4.20 @@ -93,6 +94,14 @@
    4.21  	INCLUDE += -I$(HL2SDK)/public/game/server
    4.22  	BINARY = sourcemod.2.l4d2.so
    4.23  endif
    4.24 +ifeq "$(ENGINE)" "csgo"
    4.25 +	HL2SDK = $(HL2SDK_CSGO)
    4.26 +	HL2LIB = $(HL2SDK)/lib/linux
    4.27 +	CFLAGS += -DSOURCE_ENGINE=11
    4.28 +	METAMOD = $(MMSOURCE)/core
    4.29 +	INCLUDE += -I$(HL2SDK)/public/game/server
    4.30 +	BINARY = sourcemod.2.csgo.so
    4.31 +endif
    4.32  
    4.33  HL2PUB = $(HL2SDK)/public
    4.34  
    4.35 @@ -118,19 +127,24 @@
    4.36  endif
    4.37  
    4.38  CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_BLOODYGOODTIME=4 -DSE_EYE=5 \
    4.39 -	-DSE_ORANGEBOXVALVE=6 -DSE_LEFT4DEAD=7 -DSE_LEFT4DEAD2=8 -DSE_ALIENSWARM=9
    4.40 +	-DSE_ORANGEBOXVALVE=6 -DSE_LEFT4DEAD=7 -DSE_LEFT4DEAD2=8 -DSE_ALIENSWARM=9 -DSE_PORTAL2=10 \
    4.41 +	-DSE_CSGO=11
    4.42  
    4.43  LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a $(LIB_PREFIX)vstdlib$(LIB_SUFFIX) \
    4.44  	$(LIB_PREFIX)tier0$(LIB_SUFFIX) -static-libgcc
    4.45 +
    4.46 +ifeq "$(ENGINE)" "csgo"
    4.47 +	LINK += $(HL2LIB)/interfaces_i486.a
    4.48 +endif
    4.49  	
    4.50  INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \
    4.51  	-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook \
    4.52  	-I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
    4.53  
    4.54 -CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
    4.55 +CFLAGS += -D_LINUX -DPOSIX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
    4.56  	-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \
    4.57  	-Wno-uninitialized -Wno-unused -Wno-switch -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H \
    4.58 -	-DSM_DEFAULT_THREADER -m32
    4.59 +	-DSM_DEFAULT_THREADER -m32 -DCOMPILER_GCC
    4.60  CPPFLAGS += -Wno-non-virtual-dtor -Wno-overloaded-virtual -fno-threadsafe-statics -fno-exceptions -fno-rtti
    4.61  
    4.62  ################################################
    4.63 @@ -169,7 +183,7 @@
    4.64  check:
    4.65  	if [ "$(ENGSET)" = "false" ]; then \
    4.66  		echo "You must supply one of the following values for ENGINE:"; \
    4.67 -		echo "left4dead2, left4dead, orangeboxvalve, orangebox, or original"; \
    4.68 +		echo "csgo, left4dead2, left4dead, orangeboxvalve, orangebox, or original"; \
    4.69  		exit 1; \
    4.70  	fi
    4.71  
     5.1 --- a/core/MenuStyle_Base.cpp	Sun May 27 11:39:50 2012 -0400
     5.2 +++ b/core/MenuStyle_Base.cpp	Sun May 27 16:08:03 2012 -0400
     5.3 @@ -322,13 +322,19 @@
     5.4  					if (pCollideable)
     5.5  					{
     5.6  						const Vector & pos = pCollideable->GetCollisionOrigin();
     5.7 -		
     5.8  						enginesound->EmitSound(filter, 
     5.9  							client, 
    5.10  							CHAN_AUTO, 
    5.11 +#if SOURCE_ENGINE >= SE_PORTAL2
    5.12 +							sound, 
    5.13 +							-1, 
    5.14 +#endif
    5.15  							sound, 
    5.16  							VOL_NORM, 
    5.17  							ATTN_NORM, 
    5.18 +#if SOURCE_ENGINE >= SE_PORTAL2
    5.19 +							0, 
    5.20 +#endif
    5.21  							0, 
    5.22  							PITCH_NORM, 
    5.23  							&pos);
     6.1 --- a/core/PluginSys.h	Sun May 27 11:39:50 2012 -0400
     6.2 +++ b/core/PluginSys.h	Sun May 27 16:08:03 2012 -0400
     6.3 @@ -47,7 +47,7 @@
     6.4  #include "sm_trie.h"
     6.5  #include "sourcemod.h"
     6.6  #include <IRootConsoleMenu.h>
     6.7 -#if SOURCE_ENGINE == SE_ALIENSWARM
     6.8 +#if SOURCE_ENGINE >= SE_ALIENSWARM
     6.9  #include "convar_sm_swarm.h"
    6.10  #elif (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
    6.11  #include "convar_sm_l4d.h"
     7.1 --- a/core/convar_sm_swarm.h	Sun May 27 11:39:50 2012 -0400
     7.2 +++ b/core/convar_sm_swarm.h	Sun May 27 16:08:03 2012 -0400
     7.3 @@ -381,8 +381,14 @@
     7.4  	FnChangeCallback_t GetChangeCallback( int slot ) const { return m_pParent->m_fnChangeCallbacks[ slot ]; }
     7.5  
     7.6  	// Retrieve value
     7.7 +#if SOURCE_ENGINE == SE_CSGO
     7.8 +	virtual float					GetFloat( void ) const;
     7.9 +	virtual int						GetInt( void ) const;
    7.10 +#else
    7.11  	FORCEINLINE_CVAR float			GetFloat( void ) const;
    7.12  	FORCEINLINE_CVAR int			GetInt( void ) const;
    7.13 +#endif
    7.14 +
    7.15  	FORCEINLINE_CVAR Color			GetColor( void ) const;
    7.16  	FORCEINLINE_CVAR bool			GetBool() const {  return !!GetInt(); }
    7.17  	FORCEINLINE_CVAR char const	   *GetString( void ) const;
    7.18 @@ -895,7 +901,9 @@
    7.19  //-----------------------------------------------------------------------------
    7.20  // Purpose: Utility class to quickly allow ConCommands to call member methods
    7.21  //-----------------------------------------------------------------------------
    7.22 +#ifdef _WIN32
    7.23  #pragma warning (disable : 4355 )
    7.24 +#endif
    7.25  
    7.26  template< class T >
    7.27  class CConCommandMemberAccessor : public ConCommand, public ICommandCallback, public ICommandCompletionCallback
    7.28 @@ -942,7 +950,9 @@
    7.29  	FnMemberCommandCompletionCallback_t m_CompletionFunc;
    7.30  };
    7.31  
    7.32 +#ifdef _WIN32
    7.33  #pragma warning ( default : 4355 )
    7.34 +#endif
    7.35  
    7.36  
    7.37  //-----------------------------------------------------------------------------
     8.1 --- a/core/logic_bridge.cpp	Sun May 27 11:39:50 2012 -0400
     8.2 +++ b/core/logic_bridge.cpp	Sun May 27 16:08:03 2012 -0400
     8.3 @@ -167,12 +167,16 @@
     8.4  	return "left4dead2";
     8.5  #elif SOURCE_ENGINE == SE_ALIENSWARM
     8.6  	return "alienswarm";
     8.7 +#elif SOURCE_ENGINE == SE_PORTAL2
     8.8 +	return "portal2";
     8.9 +#elif SOURCE_ENGINE == SE_CSGO
    8.10 +	return "csgo";
    8.11  #endif
    8.12  }
    8.13  
    8.14  static bool symbols_are_hidden()
    8.15  {
    8.16 -#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
    8.17 +#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_CSGO)
    8.18  	return true;
    8.19  #else
    8.20  	return false;
     9.1 --- a/core/msvc10/sourcemod_mm.vcxproj	Sun May 27 11:39:50 2012 -0400
     9.2 +++ b/core/msvc10/sourcemod_mm.vcxproj	Sun May 27 16:08:03 2012 -0400
     9.3 @@ -1644,7 +1644,7 @@
     9.4      <ClCompile>
     9.5        <AdditionalOptions>/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_BLOODYGOODTIME=4 /D SE_EYE=5 /D SE_ORANGEBOXVALVE=6 /D SE_LEFT4DEAD=7 /D SE_LEFT4DEAD2=8 /D SE_ALIENSWARM=9 /D SE_PORTAL2=10 /D SE_CSGO=11 /D COMPILER_MSVC /D COMPILER_MSVC32 %(AdditionalOptions)</AdditionalOptions>
     9.6        <Optimization>Disabled</Optimization>
     9.7 -      <AdditionalIncludeDirectories>..\;..\systems;..\..\public;..\..\public\sourcepawn;$(HL2SDK-CSGO)\public;$(HL2SDK-CSGO)\public\engine;$(HL2SDK-CSGO)\public\game\server;$(HL2SDK-CSGO)\public\mathlib;$(HL2SDK-CSGO)\public\tier0;$(HL2SDK-CSGO)\public\tier1;$(HL2SDK-CSGO)\public\vstdlib;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     9.8 +      <AdditionalIncludeDirectories>..\;..\systems;..\..\public;..\..\public\sourcepawn;$(HL2SDKCSGO)\public;$(HL2SDKCSGO)\public\engine;$(HL2SDKCSGO)\public\game\server;$(HL2SDKCSGO)\public\mathlib;$(HL2SDKCSGO)\public\tier0;$(HL2SDKCSGO)\public\tier1;$(HL2SDKCSGO)\public\vstdlib;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     9.9        <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;SOURCE_ENGINE=11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    9.10        <MinimalRebuild>true</MinimalRebuild>
    9.11        <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
    9.12 @@ -1661,7 +1661,7 @@
    9.13        <AdditionalIncludeDirectories>..\..\public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    9.14      </ResourceCompile>
    9.15      <Link>
    9.16 -      <AdditionalDependencies>$(HL2SDK-CSGO)\lib\public\tier0.lib;$(HL2SDK-CSGO)\lib\public\tier1.lib;$(HL2SDKL4D2)\lib\public\vstdlib.lib;$(HL2SDK-CSGO)\lib\public\mathlib.lib;$(HL2SDK-CSGO)\lib\public\interfaces.lib;dbghelp.lib;Wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
    9.17 +      <AdditionalDependencies>$(HL2SDKCSGO)\lib\public\tier0.lib;$(HL2SDKCSGO)\lib\public\tier1.lib;$(HL2SDKL4D2)\lib\public\vstdlib.lib;$(HL2SDKCSGO)\lib\public\mathlib.lib;$(HL2SDKCSGO)\lib\public\interfaces.lib;dbghelp.lib;Wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
    9.18        <OutputFile>$(OutDir)sourcemod.2.csgo.dll</OutputFile>
    9.19        <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
    9.20        <GenerateDebugInformation>true</GenerateDebugInformation>
    9.21 @@ -1676,7 +1676,7 @@
    9.22      <ClCompile>
    9.23        <AdditionalOptions>/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_BLOODYGOODTIME=4 /D SE_EYE=5 /D SE_ORANGEBOXVALVE=6 /D SE_LEFT4DEAD=7 /D SE_LEFT4DEAD2=8 /D SE_ALIENSWARM=9 /D SE_PORTAL2=10 /D SE_CSGO=11 /D COMPILER_MSVC /D COMPILER_MSVC32 %(AdditionalOptions)</AdditionalOptions>
    9.24        <Optimization>Disabled</Optimization>
    9.25 -      <AdditionalIncludeDirectories>..\;..\systems;..\..\public;..\..\public\sourcepawn;$(HL2SDK-CSGO)\public;$(HL2SDK-CSGO)\public\engine;$(HL2SDK-CSGO)\public\game\server;$(HL2SDK-CSGO)\public\mathlib;$(HL2SDK-CSGO)\public\tier0;$(HL2SDK-CSGO)\public\tier1;$(HL2SDK-CSGO)\public\vstdlib;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    9.26 +      <AdditionalIncludeDirectories>..\;..\systems;..\..\public;..\..\public\sourcepawn;$(HL2SDKCSGO)\public;$(HL2SDKCSGO)\public\engine;$(HL2SDKCSGO)\public\game\server;$(HL2SDKCSGO)\public\mathlib;$(HL2SDKCSGO)\public\tier0;$(HL2SDKCSGO)\public\tier1;$(HL2SDKCSGO)\public\vstdlib;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    9.27        <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;SOURCE_ENGINE=11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    9.28        <MinimalRebuild>true</MinimalRebuild>
    9.29        <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
    9.30 @@ -1693,7 +1693,7 @@
    9.31        <AdditionalIncludeDirectories>..\..\public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    9.32      </ResourceCompile>
    9.33      <Link>
    9.34 -      <AdditionalDependencies>$(HL2SDK-CSGO)\lib\public\tier0.lib;$(HL2SDK-CSGO)\lib\public\tier1.lib;$(HL2SDK-CSGO)\lib\public\vstdlib.lib;$(HL2SDK-CSGO)\lib\public\mathlib.lib;$(HL2SDK-CSGO)\lib\public\interfaces.lib;Wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
    9.35 +      <AdditionalDependencies>$(HL2SDKCSGO)\lib\public\tier0.lib;$(HL2SDKCSGO)\lib\public\tier1.lib;$(HL2SDKCSGO)\lib\public\vstdlib.lib;$(HL2SDKCSGO)\lib\public\mathlib.lib;$(HL2SDKCSGO)\lib\public\interfaces.lib;Wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
    9.36        <OutputFile>$(OutDir)sourcemod.2.csgo.dll</OutputFile>
    9.37        <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
    9.38        <GenerateDebugInformation>true</GenerateDebugInformation>
    9.39 @@ -1708,7 +1708,7 @@
    9.40      <ClCompile>
    9.41        <AdditionalOptions>/MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_BLOODYGOODTIME=4 /D SE_EYE=5 /D SE_ORANGEBOXVALVE=6 /D SE_LEFT4DEAD=7 /D SE_LEFT4DEAD2=8 /D SE_ALIENSWARM=9 /D SE_PORTAL2=10 /D SE_CSGO=11 /D COMPILER_MSVC /D COMPILER_MSVC32 %(AdditionalOptions)</AdditionalOptions>
    9.42        <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
    9.43 -      <AdditionalIncludeDirectories>..\;..\systems;..\..\public;..\..\public\sourcepawn;$(HL2SDK-CSGO)\public;$(HL2SDK-CSGO)\public\engine;$(HL2SDK-CSGO)\public\game\server;$(HL2SDK-CSGO)\public\mathlib;$(HL2SDK-CSGO)\public\tier0;$(HL2SDK-CSGO)\public\tier1;$(HL2SDK-CSGO)\public\vstdlib;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    9.44 +      <AdditionalIncludeDirectories>..\;..\systems;..\..\public;..\..\public\sourcepawn;$(HL2SDKCSGO)\public;$(HL2SDKCSGO)\public\engine;$(HL2SDKCSGO)\public\game\server;$(HL2SDKCSGO)\public\mathlib;$(HL2SDKCSGO)\public\tier0;$(HL2SDKCSGO)\public\tier1;$(HL2SDKCSGO)\public\vstdlib;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    9.45        <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;SOURCE_ENGINE=11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    9.46        <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
    9.47        <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
    9.48 @@ -1723,7 +1723,7 @@
    9.49        <AdditionalIncludeDirectories>..\..\public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    9.50      </ResourceCompile>
    9.51      <Link>
    9.52 -      <AdditionalDependencies>$(HL2SDK-CSGO)\lib\public\tier0.lib;$(HL2SDK-CSGO)\lib\public\tier1.lib;$(HL2SDK-CSGO)\lib\public\vstdlib.lib;$(HL2SDK-CSGO)\lib\public\mathlib.lib;$(HL2SDK-CSGO)\lib\public\interfaces.lib;Wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
    9.53 +      <AdditionalDependencies>$(HL2SDKCSGO)\lib\public\tier0.lib;$(HL2SDKCSGO)\lib\public\tier1.lib;$(HL2SDKCSGO)\lib\public\vstdlib.lib;$(HL2SDKCSGO)\lib\public\mathlib.lib;$(HL2SDKCSGO)\lib\public\interfaces.lib;Wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
    9.54        <OutputFile>$(OutDir)sourcemod.2.csgo.dll</OutputFile>
    9.55        <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
    9.56        <GenerateDebugInformation>true</GenerateDebugInformation>
    10.1 --- a/core/smn_halflife.cpp	Sun May 27 11:39:50 2012 -0400
    10.2 +++ b/core/smn_halflife.cpp	Sun May 27 16:08:03 2012 -0400
    10.3 @@ -476,6 +476,10 @@
    10.4  		return 50;
    10.5  	case SOURCE_ENGINE_ALIENSWARM:
    10.6  		return 60;
    10.7 +	case SOURCE_ENGINE_PORTAL2:
    10.8 +		return 70;
    10.9 +	case SOURCE_ENGINE_CSGO:
   10.10 +		return 80;
   10.11  # endif
   10.12  	}
   10.13  #else
    11.1 --- a/core/sourcemm_api.h	Sun May 27 11:39:50 2012 -0400
    11.2 +++ b/core/sourcemm_api.h	Sun May 27 16:08:03 2012 -0400
    11.3 @@ -32,7 +32,7 @@
    11.4  #ifndef _INCLUDE_SOURCEMOD_MM_API_H_
    11.5  #define _INCLUDE_SOURCEMOD_MM_API_H_
    11.6  
    11.7 -#if SOURCE_ENGINE == SE_ALIENSWARM
    11.8 +#if SOURCE_ENGINE >= SE_ALIENSWARM
    11.9  #include "convar_sm_swarm.h"
   11.10  #elif (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
   11.11  #include "convar_sm_l4d.h"
    12.1 --- a/extensions/sdktools/Makefile	Sun May 27 11:39:50 2012 -0400
    12.2 +++ b/extensions/sdktools/Makefile	Sun May 27 16:08:03 2012 -0400
    12.3 @@ -2,12 +2,12 @@
    12.4  # Makefile written by David "BAILOPAN" Anderson
    12.5  
    12.6  SMSDK = ../..
    12.7 -SRCDS_BASE = ~/srcds
    12.8  HL2SDK_ORIG = ../../../hl2sdk
    12.9  HL2SDK_OB = ../../../hl2sdk-ob
   12.10  HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve
   12.11  HL2SDK_L4D = ../../../hl2sdk-l4d
   12.12  HL2SDK_L4D2 = ../../../hl2sdk-l4d2
   12.13 +HL2SDK_CSGO = ../../../hl2sdk-csgo
   12.14  MMSOURCE17 = ../../../mmsource-central
   12.15  
   12.16  #####################################
   12.17 @@ -43,7 +43,6 @@
   12.18  	CFLAGS += -DSOURCE_ENGINE=1
   12.19  	METAMOD = $(MMSOURCE17)/core-legacy
   12.20  	INCLUDE += -I$(HL2SDK)/public/dlls -I$(HL2SDK)/game_shared
   12.21 -	SRCDS = $(SRCDS_BASE)
   12.22  	GAMEFIX = 1.ep1
   12.23  	override ENGSET = true
   12.24  endif
   12.25 @@ -54,7 +53,6 @@
   12.26  	CFLAGS += -DSOURCE_ENGINE=3
   12.27  	METAMOD = $(MMSOURCE17)/core
   12.28  	INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common -I$(HL2SDK)/game/shared -I$(HL2SDK)/public/toolframework
   12.29 -	SRCDS = $(SRCDS_BASE)/orangebox
   12.30  	GAMEFIX = 2.ep2
   12.31  	override ENGSET = true
   12.32  endif
   12.33 @@ -65,7 +63,6 @@
   12.34  	CFLAGS += -DSOURCE_ENGINE=6
   12.35  	METAMOD = $(MMSOURCE17)/core
   12.36  	INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common -I$(HL2SDK)/game/shared -I$(HL2SDK)/public/toolframework
   12.37 -	SRCDS = $(SRCDS_BASE)/orangebox
   12.38  	GAMEFIX = 2.ep2v
   12.39  	override ENGSET = true
   12.40  endif
   12.41 @@ -76,7 +73,6 @@
   12.42  	CFLAGS += -DSOURCE_ENGINE=7
   12.43  	METAMOD = $(MMSOURCE17)/core
   12.44  	INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common -I$(HL2SDK)/game/shared -I$(HL2SDK)/public/toolframework
   12.45 -	SRCDS = $(SRCDS_BASE)/l4d
   12.46  	GAMEFIX = 2.l4d
   12.47  	override ENGSET = true
   12.48  endif
   12.49 @@ -87,30 +83,45 @@
   12.50  	CFLAGS += -DSOURCE_ENGINE=8
   12.51  	METAMOD = $(MMSOURCE17)/core
   12.52  	INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common -I$(HL2SDK)/game/shared -I$(HL2SDK)/public/toolframework
   12.53 -	SRCDS = $(SRCDS_BASE)/left4dead2
   12.54  	GAMEFIX = 2.l4d2
   12.55  	override ENGSET = true
   12.56  endif
   12.57 +ifeq "$(ENGINE)" "csgo"
   12.58 +	HL2SDK = $(HL2SDK_CSGO)
   12.59 +	HL2PUB = $(HL2SDK)/public
   12.60 +	HL2LIB = $(HL2SDK)/lib/linux
   12.61 +	CFLAGS += -DSOURCE_ENGINE=11
   12.62 +	METAMOD = $(MMSOURCE17)/core
   12.63 +	INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common -I$(HL2SDK)/game/shared -I$(HL2SDK)/public/toolframework
   12.64 +	GAMEFIX = 2.csgo
   12.65 +	override ENGSET = true
   12.66 +endif
   12.67  
   12.68 -ifeq ($(ENGINE),$(filter $(ENGINE), left4dead2 orangeboxvalve))
   12.69 +ifeq ($(ENGINE),$(filter $(ENGINE), csgo left4dead2 orangeboxvalve))
   12.70  	LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a libvstdlib.so libtier0.so
   12.71  else
   12.72  	LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so tier0_i486.so
   12.73  endif
   12.74  
   12.75 +ifeq "$(ENGINE)" "csgo"
   12.76 +	LINK_HL2 += $(HL2LIB)/interfaces_i486.a
   12.77 +endif
   12.78 +
   12.79  LINK += $(LINK_HL2)
   12.80  
   12.81  INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/tier0 \
   12.82  	-I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/extensions \
   12.83  	-I$(SMSDK)/public/sourcepawn
   12.84 +
   12.85  CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_BLOODYGOODTIME=4 -DSE_EYE=5 \
   12.86 -	-DSE_ORANGEBOXVALVE=6 -DSE_LEFT4DEAD=7 -DSE_LEFT4DEAD2=8 -DSE_ALIENSWARM=9
   12.87 +	-DSE_ORANGEBOXVALVE=6 -DSE_LEFT4DEAD=7 -DSE_LEFT4DEAD2=8 -DSE_ALIENSWARM=9 -DSE_PORTAL2=10 \
   12.88 +	-DSE_CSGO=11
   12.89  
   12.90  LINK += -m32 -ldl -lm
   12.91  
   12.92 -CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
   12.93 -	-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -Wno-switch \
   12.94 -	-Wno-unused -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
   12.95 +CFLAGS += -D_LINUX -DPOSIX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
   12.96 +	-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -DCOMPILER_GCC \
   12.97 +	-Wno-switch -Wall -Werror -Wno-uninitialized -Wno-invalid-offsetof -Wno-unused -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
   12.98  CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti -fno-threadsafe-statics
   12.99  
  12.100  ################################################
  12.101 @@ -153,12 +164,12 @@
  12.102  	mkdir -p $(BIN_DIR)/sdk
  12.103  	mkdir -p $(BIN_DIR)/CDetour
  12.104  	mkdir -p $(BIN_DIR)/asm
  12.105 -ifeq ($(ENGINE),$(filter $(ENGINE), left4dead2 orangeboxvalve))
  12.106 -	ln -sf $(SRCDS)/bin/libvstdlib.so libvstdlib.so;
  12.107 -	ln -sf $(SRCDS)/bin/libtier0.so libtier0.so;
  12.108 +ifeq ($(ENGINE),$(filter $(ENGINE), csgo left4dead2 orangeboxvalve))
  12.109 +	ln -sf $(HL2LIB)/libvstdlib.so libvstdlib.so;
  12.110 +	ln -sf $(HL2LIB)/libtier0.so libtier0.so;
  12.111  else
  12.112 -	ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so;
  12.113 -	ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so;
  12.114 +	ln -sf $(HL2LIB)/vstdlib_i486.so vstdlib_i486.so;
  12.115 +	ln -sf $(HL2LIB)/tier0_i486.so tier0_i486.so;
  12.116  endif
  12.117  	$(MAKE) -f Makefile extension
  12.118  
    13.1 --- a/extensions/sdktools/msvc10/sdktools.vcxproj	Sun May 27 11:39:50 2012 -0400
    13.2 +++ b/extensions/sdktools/msvc10/sdktools.vcxproj	Sun May 27 16:08:03 2012 -0400
    13.3 @@ -964,7 +964,7 @@
    13.4      <ClCompile>
    13.5        <AdditionalOptions>/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_BLOODYGOODTIME=4 /D SE_EYE=5 /D SE_ORANGEBOXVALVE=6 /D SE_LEFT4DEAD=7 /D SE_LEFT4DEAD2=8 /D SE_ALIENSWARM=9 /D SE_PORTAL2=10 /D SE_CSGO=11 /D COMPILER_MSVC /D COMPILER_MSVC32 %(AdditionalOptions)</AdditionalOptions>
    13.6        <Optimization>Disabled</Optimization>
    13.7 -      <AdditionalIncludeDirectories>..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;$(HL2SDK-CSGO)\common;$(HL2SDK-CSGO)\public;$(HL2SDK-CSGO)\public\engine;$(HL2SDK-CSGO)\public\game\server;$(HL2SDK-CSGO)\public\toolframework;$(HL2SDK-CSGO)\public\mathlib;$(HL2SDK-CSGO)\public\tier0;$(HL2SDK-CSGO)\game\shared;$(HL2SDK-CSGO)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    13.8 +      <AdditionalIncludeDirectories>..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;$(HL2SDKCSGO)\common;$(HL2SDKCSGO)\public;$(HL2SDKCSGO)\public\engine;$(HL2SDKCSGO)\public\game\server;$(HL2SDKCSGO)\public\toolframework;$(HL2SDKCSGO)\public\mathlib;$(HL2SDKCSGO)\public\tier0;$(HL2SDKCSGO)\game\shared;$(HL2SDKCSGO)\public\tier1;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    13.9        <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
   13.10        <MinimalRebuild>true</MinimalRebuild>
   13.11        <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
   13.12 @@ -981,7 +981,7 @@
   13.13        <AdditionalIncludeDirectories>..\..\..\public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
   13.14      </ResourceCompile>
   13.15      <Link>
   13.16 -      <AdditionalDependencies>$(HL2SDK-CSGO)\lib\public\tier0.lib;$(HL2SDK-CSGO)\lib\public\tier1.lib;$(HL2SDK-CSGO)\lib\public\vstdlib.lib;$(HL2SDK-CSGO)\lib\public\mathlib.lib;$(HL2SDK-CSGO)\lib\public\interfaces.lib;%(AdditionalDependencies)</AdditionalDependencies>
   13.17 +      <AdditionalDependencies>$(HL2SDKCSGO)\lib\public\tier0.lib;$(HL2SDKCSGO)\lib\public\tier1.lib;$(HL2SDKCSGO)\lib\public\vstdlib.lib;$(HL2SDKCSGO)\lib\public\mathlib.lib;$(HL2SDKCSGO)\lib\public\interfaces.lib;%(AdditionalDependencies)</AdditionalDependencies>
   13.18        <OutputFile>$(OutDir)sdktools.ext.2.csgo.dll</OutputFile>
   13.19        <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
   13.20        <GenerateDebugInformation>true</GenerateDebugInformation>
   13.21 @@ -996,7 +996,7 @@
   13.22      <ClCompile>
   13.23        <AdditionalOptions>/MP /D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_BLOODYGOODTIME=4 /D SE_EYE=5 /D SE_ORANGEBOXVALVE=6 /D SE_LEFT4DEAD=7 /D SE_LEFT4DEAD2=8 /D SE_ALIENSWARM=9 /D SE_PORTAL2=10 /D SE_CSGO=11 /D COMPILER_MSVC /D COMPILER_MSVC32 %(AdditionalOptions)</AdditionalOptions>
   13.24        <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
   13.25 -      <AdditionalIncludeDirectories>..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;$(HL2SDK-CSGO)\common;$(HL2SDK-CSGO)\public;$(HL2SDK-CSGO)\public\engine;$(HL2SDK-CSGO)\public\game\server;$(HL2SDK-CSGO)\public\toolframework;$(HL2SDK-CSGO)\public\mathlib;$(HL2SDK-CSGO)\public\tier0;$(HL2SDK-CSGO)\public\tier1;$(HL2SDK-CSGO)\game\shared;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
   13.26 +      <AdditionalIncludeDirectories>..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;$(HL2SDKCSGO)\common;$(HL2SDKCSGO)\public;$(HL2SDKCSGO)\public\engine;$(HL2SDKCSGO)\public\game\server;$(HL2SDKCSGO)\public\toolframework;$(HL2SDKCSGO)\public\mathlib;$(HL2SDKCSGO)\public\tier0;$(HL2SDKCSGO)\public\tier1;$(HL2SDKCSGO)\game\shared;$(MMSOURCE18)\core;$(MMSOURCE18)\core\sourcehook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
   13.27        <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
   13.28        <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
   13.29        <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
   13.30 @@ -1010,7 +1010,7 @@
   13.31        <PreprocessorDefinitions>BINARY_NAME="$(TargetFileName)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
   13.32      </ResourceCompile>
   13.33      <Link>
   13.34 -      <AdditionalDependencies>$(HL2SDK-CSGO)\lib\public\tier0.lib;$(HL2SDK-CSGO)\lib\public\tier1.lib;$(HL2SDK-CSGO)\lib\public\vstdlib.lib;$(HL2SDK-CSGO)\lib\public\mathlib.lib;$(HL2SDK-CSGO)\lib\public\interfaces.lib;%(AdditionalDependencies)</AdditionalDependencies>
   13.35 +      <AdditionalDependencies>$(HL2SDKCSGO)\lib\public\tier0.lib;$(HL2SDKCSGO)\lib\public\tier1.lib;$(HL2SDKCSGO)\lib\public\vstdlib.lib;$(HL2SDKCSGO)\lib\public\mathlib.lib;$(HL2SDKCSGO)\lib\public\interfaces.lib;%(AdditionalDependencies)</AdditionalDependencies>
   13.36        <OutputFile>$(OutDir)sdktools.ext.2.csgo.dll</OutputFile>
   13.37        <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
   13.38        <GenerateDebugInformation>true</GenerateDebugInformation>
    14.1 --- a/extensions/sdktools/output.cpp	Sun May 27 11:39:50 2012 -0400
    14.2 +++ b/extensions/sdktools/output.cpp	Sun May 27 16:08:03 2012 -0400
    14.3 @@ -105,7 +105,7 @@
    14.4  	}
    14.5  
    14.6  	char sOutput[20];
    14.7 -	Q_snprintf(sOutput, sizeof(sOutput), "%x", pOutput);
    14.8 +	Q_snprintf(sOutput, sizeof(sOutput), "%p", pOutput);
    14.9  
   14.10  	// attempt to directly lookup a hook using the pOutput pointer
   14.11  	OutputNameStruct *pOutputName = NULL;
    15.1 --- a/extensions/sdktools/vnatives.cpp	Sun May 27 11:39:50 2012 -0400
    15.2 +++ b/extensions/sdktools/vnatives.cpp	Sun May 27 16:08:03 2012 -0400
    15.3 @@ -528,7 +528,11 @@
    15.4  			CellRecipientFilter rf;
    15.5  			rf.SetToReliable(true);
    15.6  			rf.Initialize(player_list, total_players);
    15.7 +#if SOURCE_ENGINE < SE_PORTAL2
    15.8  			engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, &pos);
    15.9 +#else
   15.10 +			engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, -1, sound_name, VOL_NORM, ATTN_NORM, 0, 0, PITCH_NORM, &pos);
   15.11 +#endif
   15.12  		}
   15.13  	}
   15.14  
    16.1 --- a/extensions/sdktools/vsound.cpp	Sun May 27 11:39:50 2012 -0400
    16.2 +++ b/extensions/sdktools/vsound.cpp	Sun May 27 16:08:03 2012 -0400
    16.3 @@ -33,8 +33,13 @@
    16.4  #include <IForwardSys.h>
    16.5  
    16.6  SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const Vector &, const char *, float, soundlevel_t, int, int, float);
    16.7 +#if SOURCE_ENGINE >= SE_PORTAL2
    16.8 +SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 0, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
    16.9 +SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 1, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
   16.10 +#else
   16.11  SH_DECL_HOOK14_void(IEngineSound, EmitSound, SH_NOATTRIB, 0, IRecipientFilter &, int, int, const char *, float, float, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
   16.12  SH_DECL_HOOK14_void(IEngineSound, EmitSound, SH_NOATTRIB, 1, IRecipientFilter &, int, int, const char *, float, soundlevel_t, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
   16.13 +#endif
   16.14  
   16.15  bool g_InSoundHook = false;
   16.16  
   16.17 @@ -252,10 +257,17 @@
   16.18  	}
   16.19  }
   16.20  
   16.21 +#if SOURCE_ENGINE >= SE_PORTAL2
   16.22 +int SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample, 
   16.23 +							 float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, 
   16.24 +							 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   16.25 +							 float soundtime, int speakerentity)
   16.26 +#else
   16.27  void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample, 
   16.28  							 float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, const Vector *pOrigin, 
   16.29  							 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   16.30  							 float soundtime, int speakerentity)
   16.31 +#endif
   16.32  {
   16.33  	SoundHookIter iter;
   16.34  	IPluginFunction *pFunc;
   16.35 @@ -287,12 +299,26 @@
   16.36  		case Pl_Handled:
   16.37  		case Pl_Stop:
   16.38  			{
   16.39 +#if SOURCE_ENGINE >= SE_PORTAL2
   16.40 +				RETURN_META_VALUE(MRES_SUPERCEDE, -1);
   16.41 +#else
   16.42  				RETURN_META(MRES_SUPERCEDE);
   16.43 +#endif
   16.44  			}
   16.45  		case Pl_Changed:
   16.46  			{
   16.47  				CellRecipientFilter crf;
   16.48  				crf.Initialize(players, size);
   16.49 +#if SOURCE_ENGINE >= SE_PORTAL2
   16.50 +				RETURN_META_VALUE_NEWPARAMS(
   16.51 +					MRES_IGNORED,
   16.52 +					-1,
   16.53 +					static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float, soundlevel_t, 
   16.54 +					int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>(&IEngineSound::EmitSound), 
   16.55 +					(crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, iSoundlevel, nSeed, iFlags, iPitch, pOrigin, 
   16.56 +					pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
   16.57 +					);
   16.58 +#else
   16.59  				RETURN_META_NEWPARAMS(
   16.60  					MRES_IGNORED,
   16.61  					static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float, soundlevel_t, 
   16.62 @@ -300,15 +326,27 @@
   16.63  					(crf, iEntIndex, iChannel, buffer, flVolume, iSoundlevel, iFlags, iPitch, pOrigin, 
   16.64  					pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
   16.65  					);
   16.66 +#endif
   16.67  			}
   16.68  		}
   16.69  	}
   16.70 +
   16.71 +#if SOURCE_ENGINE >= SE_PORTAL2
   16.72 +	RETURN_META_VALUE(MRES_IGNORED, -1 );
   16.73 +#endif
   16.74  }
   16.75  
   16.76 +#if SOURCE_ENGINE >= SE_PORTAL2
   16.77 +int SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample, 
   16.78 +							 float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, 
   16.79 +							 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   16.80 +							 float soundtime, int speakerentity)
   16.81 +#else
   16.82  void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample, 
   16.83  							 float flVolume, float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin, 
   16.84  							 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   16.85  							 float soundtime, int speakerentity)
   16.86 +#endif
   16.87  {
   16.88  	SoundHookIter iter;
   16.89  	IPluginFunction *pFunc;
   16.90 @@ -341,22 +379,41 @@
   16.91  		case Pl_Handled:
   16.92  		case Pl_Stop:
   16.93  			{
   16.94 +#if SOURCE_ENGINE >= SE_PORTAL2
   16.95 +				RETURN_META_VALUE(MRES_SUPERCEDE, -1);
   16.96 +#else
   16.97  				RETURN_META(MRES_SUPERCEDE);
   16.98 +#endif
   16.99  			}
  16.100  		case Pl_Changed:
  16.101  			{
  16.102  				CellRecipientFilter crf;
  16.103  				crf.Initialize(players, size);
  16.104 +#if SOURCE_ENGINE >= SE_PORTAL2
  16.105 +				RETURN_META_VALUE_NEWPARAMS(
  16.106 +					MRES_IGNORED,
  16.107 +					-1,
  16.108 +					static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, float, 
  16.109 +					int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>(&IEngineSound::EmitSound), 
  16.110 +					(crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, SNDLVL_TO_ATTN(static_cast<soundlevel_t>(sndlevel)), 
  16.111 +					nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
  16.112 +					);
  16.113 +#else
  16.114  				RETURN_META_NEWPARAMS(
  16.115  					MRES_IGNORED,
  16.116 -					static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float, float, 
  16.117 +					static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char *, float, float, 
  16.118  					int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>(&IEngineSound::EmitSound), 
  16.119  					(crf, iEntIndex, iChannel, buffer, flVolume, SNDLVL_TO_ATTN(static_cast<soundlevel_t>(sndlevel)), 
  16.120  					iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
  16.121  					);
  16.122 +#endif
  16.123  			}
  16.124  		}
  16.125  	}
  16.126 +
  16.127 +#if SOURCE_ENGINE >= SE_PORTAL2
  16.128 +	RETURN_META_VALUE(MRES_IGNORED, -1 );
  16.129 +#endif
  16.130  }
  16.131  
  16.132  /************************
  16.133 @@ -452,7 +509,11 @@
  16.134  	char *name;
  16.135  	pContext->LocalToString(params[3], &name);
  16.136  
  16.137 +#if SOURCE_ENGINE >= SE_PORTAL2
  16.138 +	engsound->StopSound(entity, channel, name, -1);
  16.139 +#else
  16.140  	engsound->StopSound(entity, channel, name);
  16.141 +#endif
  16.142  
  16.143  	return 1;
  16.144  }
  16.145 @@ -547,6 +608,53 @@
  16.146  			player[0] = cl_array[i];
  16.147  			crf.Reset();
  16.148  			crf.Initialize(player, 1);
  16.149 +#if SOURCE_ENGINE >= SE_PORTAL2
  16.150 +			if (g_InSoundHook)
  16.151 +			{
  16.152 +				SH_CALL(enginesoundPatch, 
  16.153 +					static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float, 
  16.154 +					soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>
  16.155 +
  16.156 +					(&IEngineSound::EmitSound))
  16.157 +					(crf, 
  16.158 +					player[0], 
  16.159 +					channel, 
  16.160 +					sample, 
  16.161 +					-1, 
  16.162 +					sample, 
  16.163 +					vol, 
  16.164 +					(soundlevel_t)level, 
  16.165 +					0, 
  16.166 +					flags, 
  16.167 +					pitch, 
  16.168 +					pOrigin,
  16.169 +					pDir,
  16.170 +					pOrigVec,
  16.171 +					updatePos,
  16.172 +					soundtime,
  16.173 +					speakerentity);
  16.174 +			}
  16.175 +			else
  16.176 +			{
  16.177 +				engsound->EmitSound(crf, 
  16.178 +					player[0], 
  16.179 +					channel, 
  16.180 +					sample, 
  16.181 +					-1, 
  16.182 +					sample, 
  16.183 +					vol, 
  16.184 +					(soundlevel_t)level, 
  16.185 +					0, 
  16.186 +					flags, 
  16.187 +					pitch, 
  16.188 +					pOrigin,
  16.189 +					pDir,
  16.190 +					pOrigVec,
  16.191 +					updatePos,
  16.192 +					soundtime,
  16.193 +					speakerentity);
  16.194 +			}
  16.195 +#else
  16.196  			if (g_InSoundHook)
  16.197  			{
  16.198  				SH_CALL(enginesoundPatch, 
  16.199 @@ -585,8 +693,55 @@
  16.200  					soundtime,
  16.201  					speakerentity);
  16.202  			}
  16.203 +#endif
  16.204  		}
  16.205  	} else {
  16.206 +#if SOURCE_ENGINE >= SE_PORTAL2
  16.207 +		if (g_InSoundHook)
  16.208 +		{
  16.209 +			SH_CALL(enginesoundPatch, 
  16.210 +				static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float, 
  16.211 +				soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>
  16.212 +				(&IEngineSound::EmitSound))
  16.213 +				(crf, 
  16.214 +				entity, 
  16.215 +				channel, 
  16.216 +				sample, 
  16.217 +				-1, 
  16.218 +				sample, 
  16.219 +				vol, 
  16.220 +				(soundlevel_t)level, 
  16.221 +				0, 
  16.222 +				flags, 
  16.223 +				pitch, 
  16.224 +				pOrigin,
  16.225 +				pDir,
  16.226 +				pOrigVec,
  16.227 +				updatePos,
  16.228 +				soundtime,
  16.229 +				speakerentity);
  16.230 +		}
  16.231 +		else
  16.232 +		{
  16.233 +			engsound->EmitSound(crf, 
  16.234 +				entity, 
  16.235 +				channel, 
  16.236 +				sample, 
  16.237 +				-1, 
  16.238 +				sample, 
  16.239 +				vol, 
  16.240 +				(soundlevel_t)level, 
  16.241 +				0, 
  16.242 +				flags, 
  16.243 +				pitch, 
  16.244 +				pOrigin,
  16.245 +				pDir,
  16.246 +				pOrigVec,
  16.247 +				updatePos,
  16.248 +				soundtime,
  16.249 +				speakerentity);
  16.250 +		}
  16.251 +#else
  16.252  		if (g_InSoundHook)
  16.253  		{
  16.254  			SH_CALL(enginesoundPatch, 
  16.255 @@ -625,6 +780,7 @@
  16.256  				soundtime,
  16.257  				speakerentity);
  16.258  		}
  16.259 +#endif
  16.260  	}
  16.261  
  16.262  	return 1;
  16.263 @@ -712,6 +868,9 @@
  16.264  		sentence, 
  16.265  		vol, 
  16.266  		(soundlevel_t)level, 
  16.267 +#if SOURCE_ENGINE >= SE_PORTAL2
  16.268 +		0, 
  16.269 +#endif
  16.270  		flags, 
  16.271  		pitch, 
  16.272  		pOrigin,
    17.1 --- a/extensions/sdktools/vsound.h	Sun May 27 11:39:50 2012 -0400
    17.2 +++ b/extensions/sdktools/vsound.h	Sun May 27 16:08:03 2012 -0400
    17.3 @@ -50,6 +50,17 @@
    17.4  	void Shutdown();
    17.5  	void AddHook(int type, IPluginFunction *pFunc);
    17.6  	bool RemoveHook(int type, IPluginFunction *pFunc);
    17.7 +#if SOURCE_ENGINE >= SE_PORTAL2
    17.8 +	void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float delay);
    17.9 +	int OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *, unsigned int, const char *pSample, float flVolume, 
   17.10 +		soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, 
   17.11 +		const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   17.12 +		float soundtime, int speakerentity);
   17.13 +	int OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample, 
   17.14 +		float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, 
   17.15 +		const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   17.16 +		float soundtime, int speakerentity);
   17.17 +#else
   17.18  	void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol, 
   17.19  		soundlevel_t soundlevel, int fFlags, int pitch, float delay);
   17.20  	void OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume, 
   17.21 @@ -60,6 +71,7 @@
   17.22  		float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin, 
   17.23  		const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   17.24  		float soundtime, int speakerentity);
   17.25 +#endif
   17.26  private:
   17.27  	size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter);
   17.28  	void _IncRefCounter(int type);
    18.1 --- a/gamedata/core.games/common.games.txt	Sun May 27 11:39:50 2012 -0400
    18.2 +++ b/gamedata/core.games/common.games.txt	Sun May 27 16:08:03 2012 -0400
    18.3 @@ -93,6 +93,7 @@
    18.4  			"engine"			"left4dead"
    18.5  			"engine"			"left4dead2"
    18.6  			"engine"			"alienswarm"
    18.7 +			"engine"			"csgo"
    18.8  		}
    18.9  		
   18.10  		"Offsets"
   18.11 @@ -149,6 +150,7 @@
   18.12  			"game"					"dinodday"
   18.13  			"game"					"esmod"
   18.14  			"game"					"nucleardawn"
   18.15 +			"game"					"csgo"
   18.16  		}
   18.17  
   18.18  		"Keys"
   18.19 @@ -179,6 +181,7 @@
   18.20  			"game"					"fistful_of_frags"
   18.21  			"game"					"dinodday"
   18.22  			"game"					"nucleardawn"
   18.23 +			"game"					"csgo"
   18.24  		}
   18.25  		
   18.26  		"Keys"
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/gamedata/core.games/engine.csgo.txt	Sun May 27 16:08:03 2012 -0400
    19.3 @@ -0,0 +1,54 @@
    19.4 +/**
    19.5 + * Do not edit this file.  Any changes will be overwritten by the gamedata
    19.6 + * updater or by upgrading your SourceMod install.
    19.7 + *
    19.8 + * To override data in this file, create a subdirectory named "custom" and
    19.9 + * place your own gamedata file(s) inside of it.  Such files will be parsed
   19.10 + * after SM's own.
   19.11 + *
   19.12 + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
   19.13 + */
   19.14 +
   19.15 +"Games"
   19.16 +{
   19.17 +	/* CGlobalEntityList */
   19.18 +	"#default"
   19.19 +	{
   19.20 +		"#supported"
   19.21 +		{
   19.22 +			"game"		"csgo"
   19.23 +		}
   19.24 +		
   19.25 +		"Offsets"
   19.26 +		{
   19.27 +			/* Offset into LevelShutdown */
   19.28 +			"gEntList"
   19.29 +			{
   19.30 +				"windows"	"11"
   19.31 +			}
   19.32 +
   19.33 +			"EntInfo"
   19.34 +			{
   19.35 +				"windows"	"4"
   19.36 +				"linux"		"4"
   19.37 +				"mac"		"4"
   19.38 +			}
   19.39 +		}
   19.40 +		
   19.41 +		"Signatures"
   19.42 +		{
   19.43 +			"LevelShutdown"
   19.44 +			{
   19.45 +				"library"	"server"
   19.46 +				"windows"	"\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8"
   19.47 +			}
   19.48 +			
   19.49 +			"gEntList"
   19.50 +			{
   19.51 +				"library"	"server"
   19.52 +				"linux"		"@gEntList"
   19.53 +				"mac"		"@gEntList"
   19.54 +			}
   19.55 +		}
   19.56 +	}
   19.57 +}
    20.1 --- a/gamedata/core.games/master.games.txt	Sun May 27 11:39:50 2012 -0400
    20.2 +++ b/gamedata/core.games/master.games.txt	Sun May 27 16:08:03 2012 -0400
    20.3 @@ -59,5 +59,10 @@
    20.4  	{
    20.5  		"engine"	"eye"
    20.6  	}
    20.7 +	
    20.8 +	"engine.csgo.txt"
    20.9 +	{
   20.10 +		"engine"	"csgo"
   20.11 +	}
   20.12  
   20.13  }
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/gamedata/sdktools.games/engine.csgo.txt	Sun May 27 16:08:03 2012 -0400
    21.3 @@ -0,0 +1,316 @@
    21.4 +/**
    21.5 + * Do not edit this file.  Any changes will be overwritten by the gamedata
    21.6 + * updater or by upgrading your SourceMod install.
    21.7 + *
    21.8 + * To override data in this file, create a subdirectory named "custom" and
    21.9 + * place your own gamedata file(s) inside of it.  Such files will be parsed
   21.10 + * after SM's own.
   21.11 + *
   21.12 + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
   21.13 + */
   21.14 +
   21.15 +"Games"
   21.16 +{
   21.17 +	/* Sounds */
   21.18 +	"#default"
   21.19 +	{
   21.20 +		"Keys"
   21.21 +		{
   21.22 +			"SlapSoundCount"	"3"
   21.23 +			"SlapSound1"		"player/damage1.wav"
   21.24 +			"SlapSound2"		"player/damage2.wav"
   21.25 +			"SlapSound2"		"player/damage3.wav"
   21.26 +		}
   21.27 +	}
   21.28 +	
   21.29 +	/* General Temp Entities */
   21.30 +	"#default"
   21.31 +	{
   21.32 +		"Offsets"
   21.33 +		{
   21.34 +			/* Offset into CBaseTempEntity constructor */
   21.35 +			"s_pTempEntities"
   21.36 +			{
   21.37 +				"windows"	"19"
   21.38 +			}
   21.39 +			"GetTEName"
   21.40 +			{
   21.41 +				"windows"	"4"
   21.42 +				"linux"		"4"
   21.43 +				"mac"		"4"
   21.44 +			}
   21.45 +			"GetTENext"
   21.46 +			{
   21.47 +				"windows"	"8"
   21.48 +				"linux"		"8"
   21.49 +				"mac"		"8"
   21.50 +			}
   21.51 +			"TE_GetServerClass"
   21.52 +			{
   21.53 +				"windows"	"0"
   21.54 +				"linux"		"0"
   21.55 +				"mac"		"0"
   21.56 +			}
   21.57 +		}
   21.58 +
   21.59 +		"Signatures"
   21.60 +		{
   21.61 +			"CBaseTempEntity"
   21.62 +			{
   21.63 +				"library"	"server"
   21.64 +				"windows"	"\x55\x8B\xEC\x8B\xC1\x8B\x4D\x08\xC7\x00\x2A\x2A\x2A\x2A\x89\x48\x2A\x8B"
   21.65 +			}
   21.66 +			"s_pTempEntities"
   21.67 +			{
   21.68 +				"library"	"server"
   21.69 +				"linux"		"@_ZN15CBaseTempEntity15s_pTempEntitiesE"
   21.70 +				"mac"		"@_ZN15CBaseTempEntity15s_pTempEntitiesE"
   21.71 +			}
   21.72 +		}
   21.73 +	}
   21.74 +
   21.75 +	/* CGlobalEntityList */
   21.76 +	"#default"
   21.77 +	{
   21.78 +		"Signatures"
   21.79 +		{
   21.80 +			/* Functions in CGlobalEntityList */
   21.81 +			"FindEntityByClassname"
   21.82 +			{
   21.83 +				"library"	"server"
   21.84 +				"windows"	"\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x08\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x83\xF8\xFF\x75\x2A\xB8\xFF\x1F\x00\x00\x8D\x04\x40\x8B\x74\xC6\x2A\xEB"
   21.85 +				"linux"		"@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
   21.86 +				"mac"		"@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
   21.87 +			}
   21.88 +		}
   21.89 +	}
   21.90 +
   21.91 +	/* General GameRules */
   21.92 +	"#default"
   21.93 +	{
   21.94 +		"Offsets"
   21.95 +		{
   21.96 +			/* Offset into CreateGameRulesObject */
   21.97 +			"g_pGameRules"
   21.98 +			{
   21.99 +				"windows"	"2"
  21.100 +			}
  21.101 +		}
  21.102 +		
  21.103 +		"Signatures"
  21.104 +		{
  21.105 +			/* This signature sometimes has multiple matches, but this
  21.106 +			 * does not matter as g_pGameRules is involved in all of them.
  21.107 +			 * The same g_pGameRules offset applies to each match.
  21.108 +			 *
  21.109 +			 * Sometimes this block of bytes is at the beginning of the static
  21.110 +			 * CreateGameRulesObject function and sometimes it is in the middle
  21.111 +			 * of an entirely different function. This depends on the game.
  21.112 +			 */
  21.113 +			"CreateGameRulesObject"
  21.114 +			{
  21.115 +				"library"	"server"
  21.116 +				"windows"	"\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
  21.117 +			}
  21.118 +			"g_pGameRules"
  21.119 +			{
  21.120 +				"library"	"server"
  21.121 +				"linux"		"@g_pGameRules"
  21.122 +				"mac"		"@g_pGameRules"
  21.123 +			}
  21.124 +		}
  21.125 +	}
  21.126 +
  21.127 +	/* IServer interface pointer */
  21.128 +	"#default"
  21.129 +	{
  21.130 +		"Keys"
  21.131 +		{
  21.132 +			/* Signature for the beginning of IVEngineServer::CreateFakeClient.
  21.133 +			 *
  21.134 +			 * The engine binary is not actually scanned in order to look for
  21.135 +			 * this. SourceHook is used to used to determine the address of the
  21.136 +			 * function and this signature is used to verify that it contains
  21.137 +			 * the expected code. A pointer to sv (IServer interface) is used
  21.138 +			 * here.
  21.139 +			 */
  21.140 +			"CreateFakeClient_Windows"	"\x55\x8B\xEC\x8B\x2A\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x75"
  21.141 +		}
  21.142 +		
  21.143 +		"Offsets"
  21.144 +		{
  21.145 +			/* Offset into IVEngineServer::CreateFakeClient */
  21.146 +			"sv"
  21.147 +			{
  21.148 +				"windows"	"8"
  21.149 +			}
  21.150 +		}
  21.151 +		
  21.152 +		"Signatures"
  21.153 +		{
  21.154 +			/* CBaseServer object for IServer interface */
  21.155 +			"sv"
  21.156 +			{
  21.157 +				"library"	"engine"
  21.158 +				"linux"		"@sv"
  21.159 +				"mac"		"@sv"
  21.160 +			}
  21.161 +		}
  21.162 +	}
  21.163 +	
  21.164 +	/* EntityFactoryDictionary function */
  21.165 +	"#default"
  21.166 +	{
  21.167 +		"Signatures"
  21.168 +		{
  21.169 +			"EntityFactory"
  21.170 +			{
  21.171 +				"library"	"server"
  21.172 +				"windows"	"\xB8\x01\x00\x00\x00\x84\x2A\x2A\x2A\x2A\x2A\x75\x1D\x09\x2A\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8\x2A\x2A\x2A\x2A\xC3"
  21.173 +				"linux"		"@_Z23EntityFactoryDictionaryv"
  21.174 +				"mac"		"@_Z23EntityFactoryDictionaryv"
  21.175 +			}
  21.176 +		}
  21.177 +	}
  21.178 +
  21.179 +	/* CBaseEntityOutput::FireOutput */
  21.180 +	"#default"
  21.181 +	{
  21.182 +		"Signatures"
  21.183 +		{
  21.184 +			"FireOutput"
  21.185 +			{
  21.186 +				"library"	"server"
  21.187 +				"windows"	"\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x57"
  21.188 +				"linux"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
  21.189 +				"mac"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
  21.190 +			}
  21.191 +		}
  21.192 +	}
  21.193 +	
  21.194 +	/* SetUserInfo data */
  21.195 +	"#default"
  21.196 +	{
  21.197 +		"Offsets"
  21.198 +		{
  21.199 +			/**
  21.200 +			 * CBaseClient::SetUserCVar(char  const*,char  const*);
  21.201 +			 * Linux offset straight from VTable dump.
  21.202 +			 * Windows offset is crazy. Found the windows SetName function using string "(%d)%-.*s" (aD_S in IDA)
  21.203 +			 * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
  21.204 +			 */
  21.205 +			"SetUserCvar"
  21.206 +			{
  21.207 +				/* Not 100% sure on this, why would windows change and not linux - TEST ME */
  21.208 +				"windows"	"17"
  21.209 +				"linux"		"64"
  21.210 +				"mac"		"64"
  21.211 +			}
  21.212 +			/**
  21.213 +			 * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
  21.214 +			 * Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
  21.215 +			 * Linux: 	mov     byte ptr [esi+0B0h], 0
  21.216 +			 * Win:		mov     byte ptr [esi+0B0h], 0
  21.217 +			 *
  21.218 +			 * L4D2: This has been moved into CBaseClient::UpdateUserSettings(), rest of the details are still relevant.
  21.219 +			 */
  21.220 +			"InfoChanged"
  21.221 +			{
  21.222 +				"windows"	"168"
  21.223 +				"linux"		"168"
  21.224 +				"mac"		"168"
  21.225 +			}
  21.226 +		}
  21.227 +	}
  21.228 +	
  21.229 +	"csgo"
  21.230 +	{
  21.231 +		"Offsets"
  21.232 +		{
  21.233 +			"GiveNamedItem"
  21.234 +			{
  21.235 +				"windows"	"435"
  21.236 +				"linux"		"436"
  21.237 +				"mac"		"436"
  21.238 +			}
  21.239 +			"RemovePlayerItem"
  21.240 +			{
  21.241 +				"windows"	"285"
  21.242 +				"linux"		"286"
  21.243 +				"mac"		"286"
  21.244 +			}
  21.245 +			"Weapon_GetSlot"
  21.246 +			{
  21.247 +				"windows"	"283"
  21.248 +				"linux"		"284"
  21.249 +				"mac"		"284"
  21.250 +			}
  21.251 +			"Ignite"
  21.252 +			{
  21.253 +				"windows"	"219"
  21.254 +				"linux"		"220"
  21.255 +				"mac"		"220"
  21.256 +			}
  21.257 +			"Extinguish"
  21.258 +			{
  21.259 +				"windows"	"222"
  21.260 +				"linux"		"223"
  21.261 +				"mac"		"223"
  21.262 +			}
  21.263 +			"Teleport"
  21.264 +			{
  21.265 +				"windows"	"111"
  21.266 +				"linux"		"112"
  21.267 +				"mac"		"112"
  21.268 +			}
  21.269 +			"CommitSuicide"
  21.270 +			{
  21.271 +				"windows"	"484"
  21.272 +				"linux"		"484"
  21.273 +				"mac"		"484"
  21.274 +			}
  21.275 +			"GetVelocity"
  21.276 +			{
  21.277 +				"windows"	"136"
  21.278 +				"linux"		"137"
  21.279 +				"mac"		"137"
  21.280 +			}
  21.281 +			"EyeAngles"
  21.282 +			{
  21.283 +				"windows"	"127"
  21.284 +				"linux"		"128"
  21.285 +				"mac"		"128"
  21.286 +			}
  21.287 +			"AcceptInput"
  21.288 +			{
  21.289 +				"windows"	"39"
  21.290 +				"linux"		"40"
  21.291 +				"mac"		"40"
  21.292 +			}
  21.293 +			"SetEntityModel"
  21.294 +			{
  21.295 +				"windows"	"26"
  21.296 +				"linux"		"27"
  21.297 +				"mac"		"27"
  21.298 +			}
  21.299 +			"WeaponEquip"
  21.300 +			{
  21.301 +				"windows"	"276"
  21.302 +				"linux"		"277"
  21.303 +				"mac"		"277"
  21.304 +			}
  21.305 +			"Activate"
  21.306 +			{
  21.307 +				"windows"	"36"
  21.308 +				"linux"		"37"
  21.309 +				"mac"		"37"
  21.310 +			}
  21.311 +			"PlayerRunCmd"
  21.312 +			{
  21.313 +				"windows"	"455"
  21.314 +				"linux"		"456"
  21.315 +				"mac"		"456"
  21.316 +			}
  21.317 +		}
  21.318 +	}
  21.319 +}
    22.1 --- a/gamedata/sdktools.games/master.games.txt	Sun May 27 11:39:50 2012 -0400
    22.2 +++ b/gamedata/sdktools.games/master.games.txt	Sun May 27 16:08:03 2012 -0400
    22.3 @@ -60,6 +60,11 @@
    22.4  		"engine"	"eye"
    22.5  	}
    22.6  	
    22.7 +	"engine.csgo.txt"
    22.8 +	{
    22.9 +		"engine"	"csgo"
   22.10 +	}
   22.11 +	
   22.12  	"game.tf.txt"
   22.13  	{
   22.14  		"game"		"tf"
    23.1 --- a/loader/loader.cpp	Sun May 27 11:39:50 2012 -0400
    23.2 +++ b/loader/loader.cpp	Sun May 27 16:08:03 2012 -0400
    23.3 @@ -76,6 +76,8 @@
    23.4  #define FILENAME_1_6_SWARM			"sourcemod.2.swarm" PLATFORM_EXT
    23.5  #define FILENAME_1_6_BGT			"sourcemod.2.bgt" PLATFORM_EXT
    23.6  #define FILENAME_1_6_EYE			"sourcemod.2.eye" PLATFORM_EXT
    23.7 +#define FILENAME_1_6_PORTAL2		"sourcemod.2.portal2" PLATFORM_EXT
    23.8 +#define FILENAME_1_6_CSGO			"sourcemod.2.csgo" PLATFORM_EXT
    23.9  
   23.10  HINSTANCE g_hCore = NULL;
   23.11  bool load_attempted = false;
   23.12 @@ -257,6 +259,16 @@
   23.13  			filename = FILENAME_1_6_EYE;
   23.14  			break;
   23.15  		}
   23.16 +	case SOURCE_ENGINE_PORTAL2:
   23.17 +		{
   23.18 +			filename = FILENAME_1_6_PORTAL2;
   23.19 +			break;
   23.20 +		}
   23.21 +	case SOURCE_ENGINE_CSGO:
   23.22 +		{
   23.23 +			filename = FILENAME_1_6_CSGO;
   23.24 +			break;
   23.25 +		}
   23.26  	default:
   23.27  		{
   23.28  			return NULL;
    24.1 --- a/plugins/include/halflife.inc	Sun May 27 11:39:50 2012 -0400
    24.2 +++ b/plugins/include/halflife.inc	Sun May 27 16:08:03 2012 -0400
    24.3 @@ -46,6 +46,7 @@
    24.4  #define SOURCE_SDK_LEFT4DEAD		40		/**< Engine released after Left 4 Dead (no SDK yet) */
    24.5  #define SOURCE_SDK_LEFT4DEAD2		50		/**< Engine released after Left 4 Dead 2 (no SDK yet) */
    24.6  #define SOURCE_SDK_ALIENSWARM		60		/**< SDK+Engine released after Alien Swarm */
    24.7 +#define SOURCE_SDK_CSGO				80		/**< Engine released after CS:GO (no SDK yet) */
    24.8  
    24.9  #define MOTDPANEL_TYPE_TEXT		0	/**< Treat msg as plain text */
   24.10  #define MOTDPANEL_TYPE_INDEX	1	/**< Msg is auto determined by the engine */
    25.1 --- a/public/sm_platform.h	Sun May 27 11:39:50 2012 -0400
    25.2 +++ b/public/sm_platform.h	Sun May 27 16:08:03 2012 -0400
    25.3 @@ -70,7 +70,9 @@
    25.4  # define PLATFORM_APPLE
    25.5  # define PLATFORM_LIB_EXT		"dylib"
    25.6  #endif
    25.7 -#define PLATFORM_POSIX
    25.8 +#ifndef PLATFORM_POSIX
    25.9 +# define PLATFORM_POSIX
   25.10 +#endif
   25.11  #include <errno.h>
   25.12  #include <unistd.h>
   25.13  #include <dirent.h>