Compare commits

...

81 Commits

Author SHA1 Message Date
David Anderson
4169e25451 Removed -dev tag for release. 2010-02-09 21:12:39 -08:00
David Anderson
85fc65bae5 Updated changelog for 1.3.1. 2010-02-08 20:58:15 -08:00
Nicholas Hastings
aed62d5670 Added missing file for Battlegrounds support (bug 4146). 2010-02-08 20:47:51 -08:00
Nicholas Hastings
01d46b8c9c Added SDKTools support for CSProMod (bug 4255, r+a13=dvander) 2010-02-08 20:25:11 -08:00
Nicholas Hastings
f70b48276e Fixed base plugins using GetMaxClients() instead of MaxClients (bug 3985, r+a13=dvander). 2010-02-08 20:14:52 -08:00
Nicholas Hastings
f0070e45a0 Fixed CreateEntityByName for Insurgency (bug 4180, r+a13=dvander). 2010-02-08 20:10:24 -08:00
Nicholas Hastings
11782cee90 Updated Garry's Mod offsets (bug 4230, r+a13=dvander). 2010-02-08 20:08:14 -08:00
Nicholas Hastings
24b86584a2 Fixed nextmap errors on Garry's Mod (bug 4268, r+a13=dvander). 2010-02-08 20:06:48 -08:00
Fyren
01b3eee1b8 Compiler confused |any| tag with |String| on array arguments (bug 4274, r=dvander, a13=blocking). 2010-02-08 20:00:06 -08:00
David Anderson
2fb3f8ab0f Fixed GetClientCookieTime not being exported (bug 4237, r=fyren, a13=blocking). 2010-02-08 19:58:36 -08:00
Nicholas Hastings
2c7b0e04e9 Fixed FindEntityByClassname crash in Synergy (bug 4235, r=dvander, a13=blocking). 2010-02-08 19:57:20 -08:00
Fyren
9f3e9a2ff4 Fixed NULL-deref in entity handling code (bug 4249, r=dvander, a13=blocking). 2010-02-08 19:55:14 -08:00
Nicholas Hastings
d9d5b65f2c Fixed Day of Defeat offsets for 20100203 update (bug 4262, r=dvander, a13=blocking). 2010-02-04 19:28:06 -06:00
Scott Ehlert
90cc2d6c37 Webternet and Updater extensions now load on Windows 2000 (bug 4234, r+a13=dvander). 2010-01-20 15:11:13 -06:00
David Anderson
1ab5403f9f Fixed accidental hook against garbage offset (bug 4231, r=fyren, a13=blocking). 2010-01-20 04:03:46 -08:00
David Anderson
4d03a4ef60 Added PlayerRunCmd offset for DoD:s (bug 4231 mitigation, r=me). 2010-01-20 04:01:39 -08:00
Scott Ehlert
46b714108a Updated .hgignore for Explorer files beginning with a lowercase letter (argh!) 2010-01-20 02:39:52 -06:00
David Anderson
242e1c99e2 Bumped version to 1.3.1-dev. 2010-01-14 23:34:20 -08:00
David Anderson
3d0e661cd6 Added tag sourcemod-1.3.0 for changeset a71318396392 2010-01-14 23:33:20 -08:00
David Anderson
d076aca9ea Forgotten file needed version bump. 2010-01-14 22:26:57 -08:00
David Anderson
f824a53f21 Another credits update. 2010-01-14 03:34:26 -08:00
David Anderson
87ca5e6e05 Prep for release. 2010-01-14 03:30:20 -08:00
David Anderson
23af5357c0 Updated credits for 1.3 release. 2010-01-14 03:29:16 -08:00
David Anderson
d6b82d5dcc Updated changelog. 2010-01-14 03:26:16 -08:00
David Anderson
664da97c42 Registering "sm" logs an error, but will not throw. 2010-01-14 01:11:38 -08:00
Greyscale
b6507b12d4 Fixed missing #endif in adminmenu.inc (bug 4216, r+a13=dvander). 2010-01-14 00:22:45 -08:00
David Anderson
a5ab381c0a Fixed command listener spew on server shutdown (bug 4198, r=fyren, a13=blocking). 2010-01-13 21:48:51 -08:00
David Anderson
8ec5e42c7a Merge. 2010-01-11 20:10:57 -08:00
David Anderson
006423dcf2 Triggering build. 2010-01-11 20:10:38 -08:00
Nicholas Hastings
d0f4d943b6 Added missing SDK define for L4D2 (bug 4209, r+a13=dvander). 2010-01-10 17:38:03 -08:00
Nicholas Hastings
2fd9674e09 Follow-up to bug 4194 (r=dvander). 2010-01-10 17:29:32 -08:00
David Anderson
23fca5e645 Merge. 2010-01-10 17:17:22 -08:00
David Anderson
4beb7fe869 Backed out changeset f8861500d3bc (bug 4211). 2010-01-10 17:17:16 -08:00
David Anderson
2e832f2d01 Fixed reentrancy problems with iterators, forwards, and function removals (bug
4059, r=fyren, a13=blocking).
2010-01-10 16:58:17 -08:00
Fyren
43602da743 Fixed GuessSDKVersion() not working on ep2v (bug 4194, r=dvander, a13=blocking). 2010-01-09 11:33:19 -08:00
Nicholas Hastings
763b73b9c5 Fixed SetUserCvar (sm_rename) on TF/DoD Linux (bug 4196, r=dvander, a13=blocking). 2010-01-07 01:26:01 -08:00
Nicholas Hastings
ffb6e84b45 Add Insurgency to list of games that support HUD messages (bug 4136, r+a13=dvander). 2009-12-19 20:42:32 -08:00
David Anderson
025f216e09 Fixed crashes from rare plugin loading errors (bug 4153, r=ds). 2009-12-19 18:19:28 -08:00
David Anderson
603ac75a08 Fixed SourceMod crashing after flushing the profiler (bug 4149, r=ds). 2009-12-19 18:18:17 -08:00
David Anderson
1b07722848 Add ability to change dontBroadcast status on hooked events (bug 3886, r=ds). 2009-12-19 18:16:41 -08:00
Nicholas Hastings
4de8d67e27 Another TF2 gamedata fix (bug 4151, r=dvander). 2009-12-19 12:57:26 -08:00
Nicholas Hastings
83baabe00a Battlegrounds 2 gamedata support (bug 4146, r+a13=dvander). 2009-12-19 00:03:57 -08:00
Nicholas Hastings
3080ca1ccb TF2 gamedata updates (bug 4147, r=dvander). 2009-12-18 22:01:41 -08:00
David Anderson
c3b0f8a4d2 Fixed infinite loop in Windows build failure path (bug 4144, r=ds). 2009-12-14 23:07:54 -08:00
David Anderson
726ee43736 Fixed profiler being set to NULL (bug 4143, r=fyren). 2009-12-14 23:08:15 -08:00
Fyren
8e1f37a5d2 Improve/fix GetEntity (bug 4092, r=pred) 2009-12-15 23:13:53 -08:00
Dog
ce342ef6fc Fixed CommitSuicide offset on DoD:S (bug 4109, r=dvander). 2009-12-14 20:26:45 -08:00
Nicholas Hastings
0a6acda737 Fixed CreateEntityByName for Insurgency (bug 4046, r+a13=dvander). 2009-12-14 20:31:16 -08:00
Nicholas Hastings
c907c723c3 Updated Synergy gamedata (bug 3987, r=dvander). 2009-12-14 20:30:44 -08:00
Nicholas Hastings
479815911d Added HudText support for Zombie Master (bug 4004, r+a13=dvander). 2009-12-14 20:30:04 -08:00
Nicholas Hastings
29954ec122 Added Neotokyo support (bug 4126, r+a13=dvander). 2009-12-14 20:29:23 -08:00
David Anderson
75455b65da Fixed basecomm description spelling (bug 4112, r=me). 2009-12-14 20:27:26 -08:00
Fyren
5688eb55ec Fix wonky handling of path separators for "sm plugins" commands (bug 3857, r=dvander) 2009-11-23 02:27:24 -08:00
Scott Ehlert
2e4aae95db Updated .hgignore to ignore some Windows and OS X files. 2009-11-22 01:39:29 -06:00
Scott Ehlert
cc43b63508 Updated sample_ext and mms_sample_ext for Orange Box Valve and Left 4 Dead 2 (bug 4118, r=pred). 2009-11-22 01:33:08 -06:00
David Anderson
59593a2d5f Use GetVSPInfo() from MM:S 1.8 legacy API (bug 4081, r=ds). 2009-11-20 15:18:58 -06:00
Fyren
e3f5d5b6cf Fix leak in nominations plugin (bug 4104, r=pred) 2009-11-18 15:44:51 -08:00
Fyren
6085125367 Fix rare basevotes map vote problem (bug 3905, r=dvander) 2009-11-18 15:42:21 -08:00
Scott Ehlert
27805463e3 Added IMemoryUtils::ResolveSymbol() for resolving symbols hidden via GCC's -fvisibility=hidden (bug 4091, r=dvander,pred).
Right now, this is only used on L4D2 where it is needed.
2009-11-06 16:24:40 -06:00
David Anderson
45f2b9f8ca Clarified handle invariants in clientprefs.inc (no bug, r=me). 2009-11-04 13:52:12 -05:00
Fyren
2bd979d62e Don't call edict_t::StateChanged(ushort) on L4D2 (bug 4090, r=dvander) 2009-11-01 02:53:34 -08:00
Scott Ehlert
e434c43e28 Use SOURCE_ENGINE_ORANGEBOXVALVE constant from MM:S 1.8 (bug 4087, r=dvander). 2009-10-30 14:04:43 -05:00
Fyren
02922df1cd More L4D2 gamedata changes 2009-10-30 01:24:55 -07:00
Scott Ehlert
035875f5c1 Fixed Windows build, I think. 2009-10-30 00:03:54 -05:00
Fyren
e3a3dda1d8 Typo fix 2009-10-29 20:34:00 -07:00
Scott Ehlert
7187dde64d Changed name in credits. 2009-10-29 17:35:00 -05:00
Matt Woodrow
fd09d7b176 New sdk uses _linux for vstdlib/tier0 2009-10-30 15:20:48 +13:00
Matt Woodrow
4e8fc2749b AMBuild updated to use new MM:S version 2009-10-30 14:58:17 +13:00
Fyren
8b362700ff Updated GuessSDKVersion 2009-10-30 14:34:34 +13:00
Matt Woodrow
e926a3b94b SourceMod MSVC project files updated, windows tested and loading, gamedata fix. 2009-10-30 14:29:45 +13:00
Matt Woodrow
83d1fc9abe L4D2 gamedata updates 2009-10-30 13:27:05 +13:00
Matt Woodrow
d6a5d99e55 AMBuild updated for new L4D2 engine 2009-10-30 13:27:19 +13:00
Fyren
6322a711c2 Inital SM fixes for l4d2 and linux makefile updates 2009-10-30 13:26:13 +13:00
David Anderson
e024871b50 Use GetSourceEngineBuild() from MM:S 1.8 legacy API (bug 4083, r=ds). 2009-10-29 01:33:57 -07:00
David Anderson
b4e939e273 Let SourceMod use OnUnlinkConCommandBase from MM:S 1.8 legacy API (bug 4080, r=ds). 2009-10-29 00:53:31 -07:00
David Anderson
13743376ee Build against MM:S 1.8 with core-legacy (bug 4076, r=ds). 2009-10-28 23:30:52 -07:00
David Anderson
69cfd36054 Fix iloop race when using AddCommandListener and SourceMod unloads (bug 4077, r=pred). 2009-10-29 00:07:15 -07:00
David Anderson
7d15ec4d15 Fixed crash when activating command listeners on EP1 while inside a command callback (bug 4072, r=pred). 2009-10-28 00:50:48 -07:00
David Anderson
b52a10f28b Added feature testing functionality (bug 4021, r=pred). 2009-10-28 00:37:34 -07:00
David Anderson
da7c65f0e3 Fix maphistory command not returning a value (bug 4069, r=pred, a13=blocking). 2009-10-28 01:55:42 -07:00
David Anderson
a5d2945fc5 Added @spec target (bug 2718, r=fyren). 2009-10-27 03:41:36 -07:00
125 changed files with 4169 additions and 1239 deletions

View File

@ -13,3 +13,10 @@
/CrazyDebug.* /CrazyDebug.*
/Debug.* /Debug.*
/Release.* /Release.*
# Files generated by Mac OS X Finder
(^|/)\.DS_Store$
# Files generated by Windows Explorer
(^|/)[dD]esktop\.ini$
(^|/)[tT]humbs\.db$

View File

@ -3,3 +3,4 @@ e6ef5ecdf8d75740ca2685a709bf321f8873bc3b sourcemod-1.1.0
e877885fac80be71822641f7a9122cebc9812521 sourcemod-1.1.1 e877885fac80be71822641f7a9122cebc9812521 sourcemod-1.1.1
b3ffa8a4511c4eadaf533fc790aa6b14f7f0c6ea sourcemod-1.1.2 b3ffa8a4511c4eadaf533fc790aa6b14f7f0c6ea sourcemod-1.1.2
3a73bbf60f34befa9b66be03fa5974b394bb3411 sourcemod-1.2.0 3a73bbf60f34befa9b66be03fa5974b394bb3411 sourcemod-1.2.0
a71318396392e3c6d0ff31e069a60fbde59e0cea sourcemod-1.3.0

View File

@ -17,6 +17,8 @@ class SM:
'name': 'ORANGEBOXVALVE'} 'name': 'ORANGEBOXVALVE'}
self.sdkInfo['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '5', self.sdkInfo['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '5',
'name': 'LEFT4DEAD'} 'name': 'LEFT4DEAD'}
self.sdkInfo['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '6',
'name': 'LEFT4DEAD2'}
if AMBuild.target['platform'] == 'windows': if AMBuild.target['platform'] == 'windows':
self.sdkInfo['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2', self.sdkInfo['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2',
'name': 'DARKMESSIAH'} 'name': 'DARKMESSIAH'}
@ -26,11 +28,12 @@ class SM:
self.compiler.DetectAll(AMBuild) self.compiler.DetectAll(AMBuild)
#Detect variables #Detect variables
envvars = { 'MMSOURCE17': 'mmsource-1.7', envvars = { 'MMSOURCE18': 'mmsource-1.8',
'HL2SDK': 'hl2sdk', 'HL2SDK': 'hl2sdk',
'HL2SDKOB': 'hl2sdk-ob', 'HL2SDKOB': 'hl2sdk-ob',
'HL2SDKL4D': 'hl2sdk-l4d', 'HL2SDKL4D': 'hl2sdk-l4d',
'HL2SDKOBVALVE': 'hl2sdk-ob-valve', 'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
'HL2SDKL4D2': 'hl2sdk-l4d2',
'MYSQL5': 'mysql-5.0' 'MYSQL5': 'mysql-5.0'
} }
@ -46,12 +49,14 @@ class SM:
raise Exception('Path for {0} was not found: {1}'.format(i, path)) raise Exception('Path for {0} was not found: {1}'.format(i, path))
else: else:
head = os.getcwd() head = os.getcwd()
while head != None and head != '/': oldhead = None
while head != None and head != oldhead:
path = os.path.join(head, envvars[i]) path = os.path.join(head, envvars[i])
if os.path.isdir(path): if os.path.isdir(path):
break break
oldhead = head
head, tail = os.path.split(head) head, tail = os.path.split(head)
if head == None or head == '/': if head == None or head == oldhead:
raise Exception('Could not find a valid path for {0}'.format(i)) raise Exception('Could not find a valid path for {0}'.format(i))
AMBuild.cache.CacheVariable(i, path) AMBuild.cache.CacheVariable(i, path)
@ -156,7 +161,7 @@ class SM:
self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public')) self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public'))
self.compiler.AddToListVar('RCINCLUDES', self.compiler.AddToListVar('RCINCLUDES',
os.path.join(AMBuild.outputFolder, 'includes')) os.path.join(AMBuild.outputFolder, 'includes'))
self.mmsPath = AMBuild.cache['MMSOURCE17'] self.mmsPath = AMBuild.cache['MMSOURCE18']
def DefaultCompiler(self): def DefaultCompiler(self):
return self.compiler.Clone() return self.compiler.Clone()
@ -195,13 +200,22 @@ class SM:
else: else:
staticLibs = os.path.join(sdkPath, 'lib', 'linux') staticLibs = os.path.join(sdkPath, 'lib', 'linux')
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder) workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']: if sdk == 'l4d2':
link = os.path.join(workFolder, i) for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_linux.so', 'tier0_linux.so']:
target = os.path.join(staticLibs, i) link = os.path.join(workFolder, i)
try: target = os.path.join(staticLibs, i)
os.lstat(link) try:
except: os.lstat(link)
job.AddCommand(SymlinkCommand(link, target)) except:
job.AddCommand(SymlinkCommand(link, target))
else:
for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']:
link = os.path.join(workFolder, i)
target = os.path.join(staticLibs, i)
try:
os.lstat(link)
except:
job.AddCommand(SymlinkCommand(link, target))
elif AMBuild.target['platform'] == 'windows': elif AMBuild.target['platform'] == 'windows':
for lib in ['tier0', 'tier1', 'vstdlib', 'mathlib']: for lib in ['tier0', 'tier1', 'vstdlib', 'mathlib']:
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib' libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
@ -254,8 +268,12 @@ class SM:
if not noLink: if not noLink:
if AMBuild.target['platform'] == 'linux': if AMBuild.target['platform'] == 'linux':
compiler['POSTLINKFLAGS'][0:0] = ['-lm'] compiler['POSTLINKFLAGS'][0:0] = ['-lm']
compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so'] if sdk == 'l4d2':
compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so'] compiler['POSTLINKFLAGS'][0:0] = ['tier0_linux.so']
compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_linux.so']
else:
compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so']
compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so']
return compiler return compiler

View File

@ -2,6 +2,158 @@ SourceMod Changelog
---------------------------- ----------------------------
SourceMod 1.3.1 [2010-02-09]
URL: http://wiki.alliedmods.net/SourceMod_1.3.1_Release_Notes
User Changes:
- Added extended support for CSProMod (bug 4255).
- Fixed client disconnect crash on many third party games (bug 4231).
- Improved support for Battlegrounds 2 (bug 4146).
- Improved support for Insurgency (bug 4180).
- Improved support for Garry's Mod (bug 4230, bug 4268).
- Improved support for Synergy (bug 4235).
- Updated Day of Defeat support for 20010123 update (bug 4262).
- Fixed Webternet extension not loading on Windows 2000 (bug 4234).
Developer Changes:
- Fixed compiler complaints when using |any| tag on array arguments (bug 4274).
- Fixed GetClientCookieTime not being exported (bug 4237).
- Fixed potential crash in entity handling code (bug 4249).
----------------------------
SourceMod 1.3.0 [2010-01-15]
URL: http://wiki.alliedmods.net/SourceMod_1.3.0_Release_Notes
Major Features:
* Left 4 Dead 2 support
* Non-networked entity support
User Changes:
- Added Left 4 Dead 2 support (bug 4075).
- Added much richer voting progress feedback (bug 1997).
- Improved support for various third-party games (Nicholas "psychonic" Hastings).
- Added @spec target (bug 2718).
- Added sm_resetcvar command (bug 3636).
- Added "motd" chat trigger (bug 2694).
- Updated GeoIP to OCT-2009.
- Fixed rare map vote error (bug 3905).
- Fixed small leak in the nominations plugin (bug 4104).
- Fixed last client being excluded from some command effects (bug 3984).
- Fixed crashes in plugin [|un|re]loading (bug 4034, bug 4038, bug 4044, bug 4153).
- Special target "@me" is now filtered for certain statuses properly (bug 4000).
- Improved non-admin to admin chat (bug 3844).
- Removed "auto.*" extension folders (bug 3949).
Developer Changes:
- Added non-networked entity support (bug 2459).
- Added improved random number generator (bug 3831).
- Added GetClientCookieTime native (bug 3736).
- Added AskPluginLoad2 callback (bug 3716).
- Added PlayerRunCmd callback (bug 3289).
- Added PointOutsideWorld native (bug 3906).
- Added API for "blanket" command hooks (bug 4015).
- Added ability to test for SourceMod features (bug 4021).
- Added ability to change broadcast status on hooked events (bug 3886).
- OnClientCommand no longer receives unconnected clients (bug 3732).
- Fixed various bugs in client listening API (bug 3818).
- Fixed crash in BanClient (bug 3912).
- Fixed various crashes in self-removing callbacks (bug 4059).
- Fixed rare HUD text crash on TF (bug 4016).
- Fixed OnConfigsExecuted not running on EP1 games with large configs (bug 3828).
- Fixed entity output hooks not working (bug 3988).
- Gamedata folder matches are now case-insensitive (bug 3913).
- Blocked plugins from hooking "sm" command (bug 4013).
----------------------------
SourceMod 1.2.4 [2009-10-03]
URL: http://wiki.alliedmods.net/SourceMod_1.2.4_Release_Notes
- Updated for L4D changes (bugs 4032, 4033, 4035).
- Updated GeoLite Country database for GeoIP extension.
- Fixed crash when block-loading more than eight plugins (bug 4034).
- Fixed rare crash in hudtext code on TF (bug 4016).
- Fixed crash when reloading a blocked plugin failed (bug 4038).
- Fixed Huntsman not firing critical callback on TF (bug 3927).
- Registering the "sm" command no longer has any effect (bug 4013).
- Fixed translation bug in extension API (bug 4010).
----------------------------
SourceMod 1.2.3 [2009-08-28]
URL: http://wiki.alliedmods.net/SourceMod_1.2.3_Release_Notes
- Fix extension filename lookup. (bug 3975).
----------------------------
SourceMod 1.2.2 [2009-08-28]
URL: http://wiki.alliedmods.net/SourceMod_1.2.2_Release_Notes
- Removed auto folders. (bug 3949).
- Added PointOutsideWorld native to sdktools. (bug 3906).
- Added "motd" chat trigger to basetriggers. (bug 2694).
- Added manual extension reloading command to root console menu. (bug 3934)
- Fixed 'list' type custom menu entries overwriting admin restrictions. (bug 3783).
- Added sm_resetcvar command to basecommands. (bug 3636).
- Updated gamedata for DOD:S. (bug 3948).
- Updated gamedata for TF2. (bug 3948).
- Added new .ep2v build config for valve OB based games. (bug 3948).
- Fixed incorrect escaping in clientprefs SQLite queries. (bug 3904)
- Updated gamedata for Synergy. (bug 3315).
- Upgraded to pcre-7.9 (bug 3923).
- Switched Insurgency chat printing to SayText. (bug 3738).
- Updated gamedata for Insurgency. (bug 3511).
- Updated gamedata for ZM. (bug 3746).
- Updated gamedata for Empires. (bug 3500).
- Updated gamedata for ZPS. (bug 3877).
- Updated gamedata for AoC. (bug 3891).
- Fixed RemovePlayerDisguise signature for TF2. (bug 3892).
----------------------------
SourceMod 1.2.1 [2009-05-31]
URL: http://wiki.alliedmods.net/SourceMod_1.2.1_Release_Notes
- Updated SDKTools for latest Team Fortress update.
- Added L4D handling to GuessSDKVersion() (bug 3842).
- Updated Zombie Panic Source offsets (bug 3632).
- Fixed crash when clientprefs saw disconnect from 64th client (bug 3821).
- Fixed Plugin_Handled acting like a Stop in usermsg hooks (bug 3685).
- Fixed early tv_enable causing crashes (bug 3766).
- Fixed unhook event crash (bug 3814).
- Fixed compiler reading uninitialized strings while processing varargs (bug 3811).
- Fixed compiler choosing whether to emit stradjust.pri on dynamic arrays based on uninitialized memory (bug 3810).
- Fixed Windows L4D CreateFakeClient signature (bug 3792).
- Fixed sm_slap for EP1 games (bug 3768).
- Fixed casting problems in TextParsers breaking TrimString for non-ASCII characters (bug 3800).
- Fixed OnClientConnect rejectmsg handling, improved doc (bug 3690).
- Fixed clientprefs not loading cookies for clients on late load (bug 3735).
- Fixed GetCommandFlags on original engine games (bug 3759).
- Fixed compiler asserting when returning a string literal (bug 3836).
- Fixed compiler erroring when tagging functions for string return (bug 3837).
- Fixed compiler not handling constant chained relational operators correctly (bug 3838).
- Fixed revote bug and inflexibilities in RedrawClientVoteMenu (bug 3834).
- Fixed auto update URL being set too late (bug 3699).
- Disabled nextmap in Synergy and Dystopia (bug 3687, bug 3741).
- Removed unnecessary SSE optimizations from msvc9 project files (bug 3756).
- Removed short-lived tag system (bug 3751).
- Removed the alive check from sm_rename. (bug 3698).
- Switched FortressForever to Valve menus (bug 3819).
----------------------------
SourceMod 1.2.0 [2009-03-05] SourceMod 1.2.0 [2009-03-05]
URL: http://wiki.alliedmods.net/SourceMod_1.2.0_Release_Notes URL: http://wiki.alliedmods.net/SourceMod_1.2.0_Release_Notes

View File

@ -33,7 +33,7 @@
class ConCommandBaseIterator class ConCommandBaseIterator
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
ICvarIteratorInternal *cvarIter; ICvarIteratorInternal *cvarIter;
#else #else
ConCommandBase *cvarIter; ConCommandBase *cvarIter;
@ -42,7 +42,7 @@ class ConCommandBaseIterator
public: public:
ConCommandBaseIterator() ConCommandBaseIterator()
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
cvarIter = icvar->FactoryInternalIterator(); cvarIter = icvar->FactoryInternalIterator();
cvarIter->SetFirst(); cvarIter->SetFirst();
#else #else
@ -52,14 +52,14 @@ public:
~ConCommandBaseIterator() ~ConCommandBaseIterator()
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
g_pMemAlloc->Free(cvarIter); g_pMemAlloc->Free(cvarIter);
#endif #endif
} }
inline bool IsValid() inline bool IsValid()
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
return cvarIter->IsValid(); return cvarIter->IsValid();
#else #else
return cvarIter != NULL; return cvarIter != NULL;
@ -68,7 +68,7 @@ public:
inline void Next() inline void Next()
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
cvarIter->Next(); cvarIter->Next();
#else #else
cvarIter = const_cast<ConCommandBase*>(cvarIter->GetNext()); cvarIter = const_cast<ConCommandBase*>(cvarIter->GetNext());
@ -77,7 +77,7 @@ public:
inline ConCommandBase *Get() inline ConCommandBase *Get()
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
return cvarIter->Get(); return cvarIter->Get();
#else #else
return cvarIter; return cvarIter;

View File

@ -58,6 +58,40 @@ const ParamType CONVARCHANGE_PARAMS[] = {Param_Cell, Param_String, Param_String}
typedef List<const ConVar *> ConVarList; typedef List<const ConVar *> ConVarList;
KTrie<ConVarInfo *> convar_cache; KTrie<ConVarInfo *> convar_cache;
class ConVarReentrancyGuard
{
ConVar *cvar;
ConVarReentrancyGuard *up;
public:
static ConVarReentrancyGuard *chain;
ConVarReentrancyGuard(ConVar *cvar)
: cvar(cvar), up(chain)
{
chain = this;
}
~ConVarReentrancyGuard()
{
assert(chain == this);
chain = up;
}
static bool IsCvarInChain(ConVar *cvar)
{
ConVarReentrancyGuard *guard = chain;
while (guard != NULL)
{
if (guard->cvar == cvar)
return true;
guard = guard->up;
}
return false;
}
};
ConVarReentrancyGuard *ConVarReentrancyGuard::chain = NULL;
ConVarManager::ConVarManager() : m_ConVarType(0), m_bIsDLLQueryHooked(false), m_bIsVSPQueryHooked(false) ConVarManager::ConVarManager() : m_ConVarType(0), m_bIsDLLQueryHooked(false), m_bIsVSPQueryHooked(false)
{ {
} }
@ -182,7 +216,7 @@ void ConVarManager::OnSourceModVSPReceived()
} }
/* For later MM:S versions, use the updated API, since it's cleaner. */ /* For later MM:S versions, use the updated API, since it's cleaner. */
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
int engine = g_SMAPI->GetSourceEngineBuild(); int engine = g_SMAPI->GetSourceEngineBuild();
if (engine == SOURCE_ENGINE_ORIGINAL || vsp_version < 2) if (engine == SOURCE_ENGINE_ORIGINAL || vsp_version < 2)
{ {
@ -536,7 +570,8 @@ void ConVarManager::UnhookConVarChange(ConVar *pConVar, IPluginFunction *pFuncti
} }
/* If the forward now has 0 functions in it... */ /* If the forward now has 0 functions in it... */
if (pForward->GetFunctionCount() == 0) if (pForward->GetFunctionCount() == 0 &&
!ConVarReentrancyGuard::IsCvarInChain(pConVar))
{ {
/* Free this forward */ /* Free this forward */
g_Forwards.ReleaseForward(pForward); g_Forwards.ReleaseForward(pForward);
@ -647,6 +682,8 @@ void ConVarManager::OnConVarChanged(ConVar *pConVar, const char *oldValue)
if (pForward != NULL) if (pForward != NULL)
{ {
ConVarReentrancyGuard guard(pConVar);
/* Now call forwards in plugins that have hooked this */ /* Now call forwards in plugins that have hooked this */
pForward->PushCell(pInfo->handle); pForward->PushCell(pInfo->handle);
pForward->PushString(oldValue); pForward->PushString(oldValue);

View File

@ -31,7 +31,7 @@
/** /**
* On SourceHook v4.3 or lower, there are no DVP hooks. Very sad, right? * On SourceHook v4.3 or lower, there are no DVP hooks. Very sad, right?
* Only do this on newer version. For the older code, we'll do an incredibly * Only do this on newer versions. For the older code, we'll do an incredibly
* hacky detour. * hacky detour.
* *
* The idea of the "non-hacky" (yeah... no) code is that every unique * The idea of the "non-hacky" (yeah... no) code is that every unique
@ -49,6 +49,7 @@
#include "ConCmdManager.h" #include "ConCmdManager.h"
#include "HalfLife2.h" #include "HalfLife2.h"
#include "ConCommandBaseIterator.h" #include "ConCommandBaseIterator.h"
#include "ShareSys.h"
#if defined PLATFORM_LINUX #if defined PLATFORM_LINUX
# include <dlfcn.h> # include <dlfcn.h>
@ -63,8 +64,13 @@
# else # else
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false); SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
# endif # endif
#elif SH_IMPL_VERSION == 3 #else
extern bool __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>); # if SH_IMPL_VERSION >= 4
extern int __SourceHook_FHVPAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>,bool);
extern int __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);
# else
extern bool __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);
# endif
extern bool __SourceHook_FHRemoveConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>); extern bool __SourceHook_FHRemoveConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);
#endif #endif
@ -150,7 +156,10 @@ class GenericCommandHooker : public IConCommandLinkListener
while (iter != vtables.end()) while (iter != vtables.end())
{ {
if ((*iter).refcount) if ((*iter).refcount)
{
iter++;
continue; continue;
}
/* Damn it. This event happens AFTER the plugin has unloaded! /* Damn it. This event happens AFTER the plugin has unloaded!
* There's two options. Remove the hook now and hope SH's memory * There's two options. Remove the hook now and hope SH's memory
* protection will prevent a crash. Otherwise, we can wait until * protection will prevent a crash. Otherwise, we can wait until
@ -283,6 +292,23 @@ class GenericCommandHooker
Patch cgc; Patch cgc;
public: public:
static void DelayedActivation(void *inparam)
{
GenericCommandHooker *cdtrs = reinterpret_cast<GenericCommandHooker*>(inparam);
/* Safe to re-enter because the frame queue is lock+swapped. */
if ((!cdtrs->ces.applied || !cdtrs->cgc.applied) &&
g_HL2.PeekCommandStack() != NULL)
{
g_SourceMod.AddFrameAction(GenericCommandHooker::DelayedActivation, cdtrs);
return;
}
if (!cdtrs->ces.applied)
cdtrs->ApplyPatch(&cdtrs->ces);
if (!cdtrs->cgc.applied)
cdtrs->ApplyPatch(&cdtrs->cgc);
}
bool Enable() bool Enable()
{ {
const char *platform = NULL; const char *platform = NULL;
@ -320,6 +346,12 @@ public:
if (!PrepPatch("CGameClient::ExecuteString", "CGC", platform, &cgc)) if (!PrepPatch("CGameClient::ExecuteString", "CGC", platform, &cgc))
return false; return false;
if (g_HL2.PeekCommandStack() != NULL)
{
g_SourceMod.AddFrameAction(GenericCommandHooker::DelayedActivation, this);
return true;
}
ApplyPatch(&ces); ApplyPatch(&ces);
ApplyPatch(&cgc); ApplyPatch(&cgc);
@ -531,10 +563,12 @@ void DummyHook()
* BEGIN THE ACTUALLY GENERIC CODE. * BEGIN THE ACTUALLY GENERIC CODE.
*/ */
#define FEATURECAP_COMMANDLISTENER "command listener"
static GenericCommandHooker s_GenericHooker; static GenericCommandHooker s_GenericHooker;
ConsoleDetours g_ConsoleDetours; ConsoleDetours g_ConsoleDetours;
ConsoleDetours::ConsoleDetours() : triedToEnable(false), isEnabled(false) ConsoleDetours::ConsoleDetours() : status(FeatureStatus_Unknown)
{ {
} }
@ -542,6 +576,7 @@ void ConsoleDetours::OnSourceModAllInitialized()
{ {
m_pForward = g_Forwards.CreateForwardEx("OnAnyCommand", ET_Hook, 3, NULL, Param_Cell, m_pForward = g_Forwards.CreateForwardEx("OnAnyCommand", ET_Hook, 3, NULL, Param_Cell,
Param_String, Param_Cell); Param_String, Param_Cell);
g_ShareSys.AddCapabilityProvider(NULL, this, FEATURECAP_COMMANDLISTENER);
} }
void ConsoleDetours::OnSourceModShutdown() void ConsoleDetours::OnSourceModShutdown()
@ -559,18 +594,23 @@ void ConsoleDetours::OnSourceModShutdown()
s_GenericHooker.Disable(); s_GenericHooker.Disable();
} }
bool ConsoleDetours::IsAvailable() FeatureStatus ConsoleDetours::GetFeatureStatus(FeatureType type, const char *name)
{ {
if (triedToEnable) return GetStatus();
return isEnabled; }
isEnabled = s_GenericHooker.Enable();
triedToEnable = true; FeatureStatus ConsoleDetours::GetStatus()
return isEnabled; {
if (status == FeatureStatus_Unknown)
{
status = s_GenericHooker.Enable() ? FeatureStatus_Available : FeatureStatus_Unavailable;
}
return status;
} }
bool ConsoleDetours::AddListener(IPluginFunction *fun, const char *command) bool ConsoleDetours::AddListener(IPluginFunction *fun, const char *command)
{ {
if (!IsAvailable()) if (GetStatus() != FeatureStatus_Available)
return false; return false;
if (command == NULL) if (command == NULL)

View File

@ -36,7 +36,9 @@
#include "ForwardSys.h" #include "ForwardSys.h"
#include <sm_trie_tpl.h> #include <sm_trie_tpl.h>
class ConsoleDetours : public SMGlobalClass class ConsoleDetours :
public SMGlobalClass,
public IFeatureProvider
{ {
friend class PlayerManager; friend class PlayerManager;
friend class GenericCommandHooker; friend class GenericCommandHooker;
@ -50,6 +52,8 @@ public:
public: //SMGlobalClass public: //SMGlobalClass
void OnSourceModAllInitialized(); void OnSourceModAllInitialized();
void OnSourceModShutdown(); void OnSourceModShutdown();
public: //IFeatureProvider
FeatureStatus GetFeatureStatus(FeatureType type, const char *name);
public: public:
bool AddListener(IPluginFunction *fun, const char *command); bool AddListener(IPluginFunction *fun, const char *command);
bool RemoveListener(IPluginFunction *fun, const char *command); bool RemoveListener(IPluginFunction *fun, const char *command);
@ -60,15 +64,14 @@ private:
#else #else
static cell_t Dispatch(ConCommand *pBase); static cell_t Dispatch(ConCommand *pBase);
#endif #endif
bool IsAvailable();
public: public:
inline bool IsEnabled() FeatureStatus GetStatus();
bool IsEnabled()
{ {
return isEnabled; return status == FeatureStatus_Available;
} }
private: private:
bool triedToEnable; FeatureStatus status;
bool isEnabled;
IChangeableForward *m_pForward; IChangeableForward *m_pForward;
KTrie<Listener*> m_CmdLookup; KTrie<Listener*> m_CmdLookup;
List<Listener*> m_Listeners; List<Listener*> m_Listeners;

View File

@ -68,7 +68,11 @@ void Hook_ExecDispatchPre(const CCommand &cmd)
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false); SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
void Hook_ExecDispatchPre() void Hook_ExecDispatchPre()
#else #else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>); # if SH_IMPL_VERSION >= 4
extern int __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# endif
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>); extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
void Hook_ExecDispatchPre() void Hook_ExecDispatchPre()
#endif #endif

View File

@ -1,5 +1,5 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ============================================================================= * =============================================================================
* SourceMod * SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
@ -42,6 +42,20 @@ SH_DECL_HOOK2(IGameEventManager2, FireEvent, SH_NOATTRIB, 0, bool, IGameEvent *,
const ParamType GAMEEVENT_PARAMS[] = {Param_Cell, Param_String, Param_Cell}; const ParamType GAMEEVENT_PARAMS[] = {Param_Cell, Param_String, Param_Cell};
typedef List<EventHook *> EventHookList; typedef List<EventHook *> EventHookList;
class EventForwardFilter : public IForwardFilter
{
EventInfo *pEventInfo;
public:
EventForwardFilter(EventInfo *pEventInfo) : pEventInfo(pEventInfo)
{
}
void Preprocess(IPluginFunction *fun, FwdParamInfo *params)
{
params[2].val = pEventInfo->bDontBroadcast ? 1 : 0;
}
};
EventManager::EventManager() : m_EventType(0) EventManager::EventManager() : m_EventType(0)
{ {
/* Create an event lookup trie */ /* Create an event lookup trie */
@ -327,6 +341,7 @@ EventInfo *EventManager::CreateEvent(IPluginContext *pContext, const char *name,
pInfo->pEvent = pEvent; pInfo->pEvent = pEvent;
pInfo->pOwner = pContext->GetIdentity(); pInfo->pOwner = pContext->GetIdentity();
pInfo->bDontBroadcast = false;
return pInfo; return pInfo;
} }
@ -365,6 +380,7 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
IChangeableForward *pForward; IChangeableForward *pForward;
const char *name; const char *name;
cell_t res = Pl_Continue; cell_t res = Pl_Continue;
bool broadcast = bDontBroadcast;
/* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */ /* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */
if (!pEvent) if (!pEvent)
@ -390,10 +406,16 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
HandleSecurity sec(NULL, g_pCoreIdent); HandleSecurity sec(NULL, g_pCoreIdent);
Handle_t hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL); Handle_t hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL);
info.bDontBroadcast = bDontBroadcast;
EventForwardFilter filter(&info);
pForward->PushCell(hndl); pForward->PushCell(hndl);
pForward->PushString(name); pForward->PushString(name);
pForward->PushCell(bDontBroadcast); pForward->PushCell(bDontBroadcast);
pForward->Execute(&res, NULL); pForward->Execute(&res, &filter);
broadcast = info.bDontBroadcast;
g_HandleSys.FreeHandle(hndl, &sec); g_HandleSys.FreeHandle(hndl, &sec);
} }
@ -414,6 +436,9 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
m_EventStack.push(NULL); m_EventStack.push(NULL);
} }
if (broadcast != bDontBroadcast)
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, true, &IGameEventManager2::FireEvent, (pEvent, broadcast));
RETURN_META_VALUE(MRES_IGNORED, true); RETURN_META_VALUE(MRES_IGNORED, true);
} }
@ -441,6 +466,7 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
{ {
if (pHook->postCopy) if (pHook->postCopy)
{ {
info.bDontBroadcast = bDontBroadcast;
info.pEvent = m_EventCopies.front(); info.pEvent = m_EventCopies.front();
info.pOwner = NULL; info.pOwner = NULL;
hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL); hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL);

View File

@ -53,6 +53,7 @@ struct EventInfo
} }
IGameEvent *pEvent; IGameEvent *pEvent;
IdentityToken_t *pOwner; IdentityToken_t *pOwner;
bool bDontBroadcast;
}; };
struct EventHook struct EventHook

View File

@ -63,6 +63,8 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION
#if SOURCE_ENGINE == SE_LEFT4DEAD #if SOURCE_ENGINE == SE_LEFT4DEAD
#define GAMEFIX "2.l4d" #define GAMEFIX "2.l4d"
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
#define GAMEFIX "2.l4d2"
#elif SOURCE_ENGINE == SE_ORANGEBOX #elif SOURCE_ENGINE == SE_ORANGEBOX
#define GAMEFIX "2.ep2" #define GAMEFIX "2.ep2"
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE #elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
@ -71,7 +73,7 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena
#define GAMEFIX "2.darkm" #define GAMEFIX "2.darkm"
#else #else
#define GAMEFIX "2.ep1" #define GAMEFIX "2.ep1"
#endif //SOURCE_ENGINE == SE_LEFT4DEAD #endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#else //METAMOD_PLAPI_VERSION #else //METAMOD_PLAPI_VERSION
#define GAMEFIX "1.ep1" #define GAMEFIX "1.ep1"
#endif //METAMOD_PLAPI_VERSION #endif //METAMOD_PLAPI_VERSION

View File

@ -1,5 +1,5 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ============================================================================= * =============================================================================
* SourceMod * SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
@ -255,6 +255,7 @@ CForward *CForward::CreateForward(const char *name, ExecType et, unsigned int nu
} }
CForward *pForward = g_Forwards.ForwardMake(); CForward *pForward = g_Forwards.ForwardMake();
pForward->m_IterGuard = NULL;
pForward->m_curparam = 0; pForward->m_curparam = 0;
pForward->m_ExecType = et; pForward->m_ExecType = et;
snprintf(pForward->m_name, FORWARDS_NAME_MAX, "%s", name ? name : ""); snprintf(pForward->m_name, FORWARDS_NAME_MAX, "%s", name ? name : "");
@ -294,7 +295,7 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
cell_t high_result = 0; cell_t high_result = 0;
cell_t low_result = 0; cell_t low_result = 0;
int err; int err;
unsigned int failed=0, success=0; unsigned int success=0;
unsigned int num_params = m_curparam; unsigned int num_params = m_curparam;
FwdParamInfo temp_info[SP_MAX_EXEC_PARAMS]; FwdParamInfo temp_info[SP_MAX_EXEC_PARAMS];
FwdParamInfo *param; FwdParamInfo *param;
@ -304,10 +305,15 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
memcpy(temp_info, m_params, sizeof(m_params)); memcpy(temp_info, m_params, sizeof(m_params));
m_curparam = 0; m_curparam = 0;
for (iter=m_functions.begin(); iter!=m_functions.end(); iter++) FuncIteratorGuard guard(&m_IterGuard, &iter);
while (iter != m_functions.end())
{ {
func = (*iter); func = (*iter);
if (filter)
filter->Preprocess(func, temp_info);
for (unsigned int i=0; i<num_params; i++) for (unsigned int i=0; i<num_params; i++)
{ {
int err = SP_ERROR_PARAM; int err = SP_ERROR_PARAM;
@ -359,11 +365,7 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
} }
/* Call the function and deal with the return value. */ /* Call the function and deal with the return value. */
if ((err=func->Execute(&cur_result)) != SP_ERROR_NONE) if ((err=func->Execute(&cur_result)) == SP_ERROR_NONE)
{
failed++;
}
else
{ {
success++; success++;
switch (m_ExecType) switch (m_ExecType)
@ -403,6 +405,9 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
} }
} }
} }
if (!guard.Triggered())
iter++;
} }
done: done:
@ -682,6 +687,7 @@ bool CForward::RemoveFunction(IPluginFunction *func)
{ {
if ((*iter) == func) if ((*iter) == func)
{ {
m_IterGuard->FixIteratorChain(iter);
found = true; found = true;
lst->erase(iter); lst->erase(iter);
break; break;

View File

@ -61,6 +61,58 @@ struct FwdParamInfo
ParamType pushedas; ParamType pushedas;
}; };
class SourceMod::IForwardFilter
{
public:
virtual void Preprocess(IPluginFunction *fun, FwdParamInfo *params)
{
}
};
class FuncIteratorGuard
{
bool triggered;
FuncIteratorGuard **pprev;
FuncIter *iter;
FuncIteratorGuard *next;
public:
FuncIteratorGuard(FuncIteratorGuard **pprev, FuncIter *iter)
: triggered(false), pprev(pprev), iter(iter), next(*pprev)
{
*pprev = this;
}
~FuncIteratorGuard()
{
*pprev = next;
}
inline bool Triggered()
{
bool t = triggered;
triggered = false;
return t;
}
/**
* This should not read from |this| before the NULL check, because FwdSys
* can call (NULL)->FixIteratorChain().
*/
void FixIteratorChain(FuncIter &other)
{
FuncIteratorGuard *guard = this;
while (guard != NULL)
{
if (*guard->iter == other)
{
*(guard->iter) = ++(*(guard->iter));
guard->triggered = true;
}
guard = guard->next;
}
}
};
class CForward : public IChangeableForward class CForward : public IChangeableForward
{ {
public: //ICallable public: //ICallable
@ -103,6 +155,7 @@ protected:
*/ */
mutable List<IPluginFunction *> m_functions; mutable List<IPluginFunction *> m_functions;
mutable List<IPluginFunction *> m_paused; mutable List<IPluginFunction *> m_paused;
FuncIteratorGuard *m_IterGuard;
/* Type and name information */ /* Type and name information */
FwdParamInfo m_params[SP_MAX_EXEC_PARAMS]; FwdParamInfo m_params[SP_MAX_EXEC_PARAMS];

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ============================================================================= * =============================================================================
* SourceMod * SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
@ -25,8 +25,6 @@
* this exception to all derivative works. AlliedModders LLC defines further * this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>. * or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/ */
#include <string.h> #include <string.h>
@ -117,6 +115,8 @@ static bool DoesEngineMatch(const char *value)
if (strcmp(value, "orangebox_valve") == 0) if (strcmp(value, "orangebox_valve") == 0)
#elif SOURCE_ENGINE == SE_LEFT4DEAD #elif SOURCE_ENGINE == SE_LEFT4DEAD
if (strcmp(value, "left4dead") == 0) if (strcmp(value, "left4dead") == 0)
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
if (strcmp(value, "left4dead2") == 0)
#else #else
#error "Unknown engine type" #error "Unknown engine type"
#endif #endif
@ -504,7 +504,11 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
void *handle = dlopen(info.dli_fname, RTLD_NOW); void *handle = dlopen(info.dli_fname, RTLD_NOW);
if (handle) if (handle)
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD2
final_addr = g_MemUtils.ResolveSymbol(handle, &s_TempSig.sig[1]);
#else
final_addr = dlsym(handle, &s_TempSig.sig[1]); final_addr = dlsym(handle, &s_TempSig.sig[1]);
#endif
dlclose(handle); dlclose(handle);
} else { } else {
g_Logger.LogError("[SM] Unable to load library \"%s\" (gameconf \"%s\")", g_Logger.LogError("[SM] Unable to load library \"%s\" (gameconf \"%s\")",

View File

@ -96,14 +96,16 @@ CHalfLife2::~CHalfLife2()
CSharedEdictChangeInfo *g_pSharedChangeInfo = NULL; CSharedEdictChangeInfo *g_pSharedChangeInfo = NULL;
#endif #endif
#if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
bool is_original_engine = false; bool is_original_engine = false;
#endif
void CHalfLife2::OnSourceModStartup(bool late) void CHalfLife2::OnSourceModStartup(bool late)
{ {
#if SOURCE_ENGINE != SE_DARKMESSIAH #if SOURCE_ENGINE != SE_DARKMESSIAH
/* The Ship currently is the only known game to use an older version of the engine */ /* The Ship currently is the only known game to use an older version of the engine */
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL) if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL)
#else #else
if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0) if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0)
@ -172,7 +174,7 @@ void CHalfLife2::OnSourceModAllInitialized_Post()
} }
} }
#if !defined METAMOD_PLAPI_VERSION #if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
bool CHalfLife2::IsOriginalEngine() bool CHalfLife2::IsOriginalEngine()
{ {
return is_original_engine; return is_original_engine;
@ -357,11 +359,13 @@ void CHalfLife2::SetEdictStateChanged(edict_t *pEdict, unsigned short offset)
#if SOURCE_ENGINE != SE_DARKMESSIAH #if SOURCE_ENGINE != SE_DARKMESSIAH
if (g_pSharedChangeInfo != NULL) if (g_pSharedChangeInfo != NULL)
{ {
#if SOURCE_ENGINE != SE_LEFT4DEAD2
if (offset) if (offset)
{ {
pEdict->StateChanged(offset); pEdict->StateChanged(offset);
} }
else else
#endif
{ {
pEdict->StateChanged(); pEdict->StateChanged();
} }
@ -543,7 +547,7 @@ bool CHalfLife2::IsLANServer()
bool CHalfLife2::KVLoadFromFile(KeyValues *kv, IBaseFileSystem *filesystem, const char *resourceName, const char *pathID) bool CHalfLife2::KVLoadFromFile(KeyValues *kv, IBaseFileSystem *filesystem, const char *resourceName, const char *pathID)
{ {
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL) if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL)
#else #else
if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0) if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0)
@ -668,7 +672,10 @@ edict_t *CHalfLife2::GetHandleEntity(CBaseHandle &hndl)
edict_t *pStoredEdict; edict_t *pStoredEdict;
CBaseEntity *pStoredEntity; CBaseEntity *pStoredEntity;
pStoredEdict = GetEntity(index, &pStoredEntity); if (!IndexToAThings(index, &pStoredEntity, &pStoredEdict))
{
return NULL;
}
if (pStoredEdict == NULL || pStoredEntity == NULL) if (pStoredEdict == NULL || pStoredEntity == NULL)
{ {

View File

@ -145,7 +145,7 @@ public:
const char *CurrentCommandName(); const char *CurrentCommandName();
void AddDelayedKick(int client, int userid, const char *msg); void AddDelayedKick(int client, int userid, const char *msg);
void ProcessDelayedKicks(); void ProcessDelayedKicks();
#if !defined METAMOD_PLAPI_VERSION #if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
bool IsOriginalEngine(); bool IsOriginalEngine();
#endif #endif
private: private:
@ -166,6 +166,6 @@ private:
extern CHalfLife2 g_HL2; extern CHalfLife2 g_HL2;
edict_t *GetEntity(cell_t num, CBaseEntity **pData); bool IndexToAThings(cell_t, CBaseEntity **pEntData, edict_t **pEdictData);
#endif //_INCLUDE_SOURCEMOD_CHALFLIFE2_H_ #endif //_INCLUDE_SOURCEMOD_CHALFLIFE2_H_

View File

@ -7,7 +7,8 @@ HL2SDK_ORIG = ../../hl2sdk
HL2SDK_OB = ../../hl2sdk-ob HL2SDK_OB = ../../hl2sdk-ob
HL2SDK_OB_VALVE = ../../hl2sdk-ob-valve HL2SDK_OB_VALVE = ../../hl2sdk-ob-valve
HL2SDK_L4D = ../../hl2sdk-l4d HL2SDK_L4D = ../../hl2sdk-l4d
MMSOURCE17 = ../../mmsource-1.7 HL2SDK_L4D2 = ../../hl2sdk-l4d2
MMSOURCE17 = ../../mmsource-central
##################################### #####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###
@ -92,11 +93,27 @@ ifeq "$(ENGINE)" "left4dead"
BINARY = sourcemod.2.l4d.so BINARY = sourcemod.2.l4d.so
override ENGSET = true override ENGSET = true
endif endif
ifeq "$(ENGINE)" "left4dead2"
HL2SDK = $(HL2SDK_L4D2)
HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=6
METAMOD = $(MMSOURCE17)/core
INCLUDE += -I$(HL2SDK)/public/game/server
SRCDS = $(SRCDS_BASE)/left4dead2_demo
BINARY = sourcemod.2.l4d2.so
override ENGSET = true
endif
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6
ifeq "$(ENGINE)" "left4dead2"
LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_linux.so \
tier0_linux.so -static-libgcc
else
LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so \ LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so \
tier0_i486.so -static-libgcc tier0_i486.so -static-libgcc
endif
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \ INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \
-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook \ -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook \
@ -136,8 +153,13 @@ $(BIN_DIR)/%.o: %.c
all: check all: check
mkdir -p $(BIN_DIR) mkdir -p $(BIN_DIR)
ifeq "$(ENGINE)" "left4dead2"
ln -sf $(SRCDS)/bin/vstdlib_linux.so vstdlib_linux.so;
ln -sf $(SRCDS)/bin/tier0_linux.so tier0_linux.so;
else
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so;
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so;
endif
$(MAKE) -f Makefile sourcemod $(MAKE) -f Makefile sourcemod
check: check:

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ============================================================================= * =============================================================================
* SourceMod * SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
@ -25,15 +25,14 @@
* this exception to all derivative works. AlliedModders LLC defines further * this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>. * or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/ */
#include "MemoryUtils.h" #include "MemoryUtils.h"
#include "ShareSys.h" #include "ShareSys.h"
#ifdef PLATFORM_LINUX #ifdef PLATFORM_LINUX
#include <string.h> #include <fcntl.h>
#include <elf.h> #include <link.h>
#include <sys/mman.h>
#endif #endif
MemoryUtils g_MemUtils; MemoryUtils g_MemUtils;
@ -56,6 +55,17 @@ MemoryUtils::MemoryUtils()
} }
#endif #endif
MemoryUtils::~MemoryUtils()
{
#ifdef PLATFORM_LINUX
for (size_t i = 0; i < m_SymTables.size(); i++)
{
delete m_SymTables[i];
}
m_SymTables.clear();
#endif
}
void MemoryUtils::OnSourceModAllInitialized() void MemoryUtils::OnSourceModAllInitialized()
{ {
g_ShareSys.AddInterface(NULL, this); g_ShareSys.AddInterface(NULL, this);
@ -98,6 +108,149 @@ void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t l
return NULL; return NULL;
} }
void *MemoryUtils::ResolveSymbol(void *handle, const char *symbol)
{
#ifdef PLATFORM_WINDOWS
return GetProcAddress((HMODULE)handle, symbol);
#elif defined PLATFORM_LINUX
struct link_map *dlmap;
struct stat dlstat;
int dlfile;
uintptr_t map_base;
Elf32_Ehdr *file_hdr;
Elf32_Shdr *sections, *shstrtab_hdr, *symtab_hdr, *strtab_hdr;
Elf32_Sym *symtab;
const char *shstrtab, *strtab;
uint16_t section_count;
uint32_t symbol_count;
LibSymbolTable *libtable;
SymbolTable *table;
Symbol *symbol_entry;
dlmap = (struct link_map *)handle;
symtab_hdr = NULL;
strtab_hdr = NULL;
table = NULL;
/* See if we already have a symbol table for this library */
for (size_t i = 0; i < m_SymTables.size(); i++)
{
libtable = m_SymTables[i];
if (libtable->lib_base == dlmap->l_addr)
{
table = &libtable->table;
break;
}
}
/* If we don't have a symbol table for this library, then create one */
if (table == NULL)
{
libtable = new LibSymbolTable();
libtable->table.Initialize();
libtable->lib_base = dlmap->l_addr;
libtable->last_pos = 0;
table = &libtable->table;
m_SymTables.push_back(libtable);
}
/* See if the symbol is already cached in our table */
symbol_entry = table->FindSymbol(symbol, strlen(symbol));
if (symbol_entry != NULL)
{
return symbol_entry->address;
}
/* If symbol isn't in our table, then we have open the actual library */
dlfile = open(dlmap->l_name, O_RDONLY);
if (dlfile == -1 || fstat(dlfile, &dlstat) == -1)
{
close(dlfile);
return NULL;
}
/* Map library file into memory */
file_hdr = (Elf32_Ehdr *)mmap(NULL, dlstat.st_size, PROT_READ, MAP_PRIVATE, dlfile, 0);
map_base = (uintptr_t)file_hdr;
if (file_hdr == MAP_FAILED)
{
close(dlfile);
return NULL;
}
close(dlfile);
if (file_hdr->e_shoff == 0 || file_hdr->e_shstrndx == SHN_UNDEF)
{
munmap(file_hdr, dlstat.st_size);
return NULL;
}
sections = (Elf32_Shdr *)(map_base + file_hdr->e_shoff);
section_count = file_hdr->e_shnum;
/* Get ELF section header string table */
shstrtab_hdr = &sections[file_hdr->e_shstrndx];
shstrtab = (const char *)(map_base + shstrtab_hdr->sh_offset);
/* Iterate sections while looking for ELF symbol table and string table */
for (uint16_t i = 0; i < section_count; i++)
{
Elf32_Shdr &hdr = sections[i];
const char *section_name = shstrtab + hdr.sh_name;
if (strcmp(section_name, ".symtab") == 0)
{
symtab_hdr = &hdr;
}
else if (strcmp(section_name, ".strtab") == 0)
{
strtab_hdr = &hdr;
}
}
/* Uh oh, we don't have a symbol table or a string table */
if (symtab_hdr == NULL || strtab_hdr == NULL)
{
munmap(file_hdr, dlstat.st_size);
return NULL;
}
symtab = (Elf32_Sym *)(map_base + symtab_hdr->sh_offset);
strtab = (const char *)(map_base + strtab_hdr->sh_offset);
symbol_count = symtab_hdr->sh_size / symtab_hdr->sh_entsize;
/* Iterate symbol table starting from the position we were at last time */
for (uint32_t i = libtable->last_pos; i < symbol_count; i++)
{
Elf32_Sym &sym = symtab[i];
unsigned char sym_type = ELF32_ST_TYPE(sym.st_info);
const char *sym_name = strtab + sym.st_name;
Symbol *cur_sym;
/* Skip symbols that are undefined or do not refer to functions or objects */
if (sym.st_shndx == SHN_UNDEF || (sym_type != STT_FUNC && sym_type != STT_OBJECT))
{
continue;
}
/* Caching symbols as we go along */
cur_sym = table->InternSymbol(sym_name, strlen(sym_name), (void *)(dlmap->l_addr + sym.st_value));
if (strcmp(symbol, sym_name) == 0)
{
symbol_entry = cur_sym;
libtable->last_pos = ++i;
break;
}
}
munmap(file_hdr, dlstat.st_size);
return symbol_entry ? symbol_entry->address : NULL;
#endif
}
bool MemoryUtils::GetLibraryInfo(const void *libPtr, DynLibInfo &lib) bool MemoryUtils::GetLibraryInfo(const void *libPtr, DynLibInfo &lib)
{ {
unsigned long baseAddr; unsigned long baseAddr;

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ============================================================================= * =============================================================================
* SourceMod * SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2000 AlliedModders LLC. All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
@ -25,8 +25,6 @@
* this exception to all derivative works. AlliedModders LLC defines further * this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>. * or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/ */
#ifndef _INCLUDE_SOURCEMOD_MEMORYUTILS_H_ #ifndef _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
@ -34,6 +32,12 @@
#include <IMemoryUtils.h> #include <IMemoryUtils.h>
#include "sm_globals.h" #include "sm_globals.h"
#ifdef PLATFORM_LINUX
#include <sh_vector.h>
#include "sm_symtable.h"
using namespace SourceHook;
#endif
using namespace SourceMod; using namespace SourceMod;
@ -43,16 +47,34 @@ struct DynLibInfo
size_t memorySize; size_t memorySize;
}; };
#ifdef PLATFORM_LINUX
typedef uint32_t Elf32_Addr;
struct LibSymbolTable
{
SymbolTable table;
Elf32_Addr lib_base;
uint32_t last_pos;
};
#endif
class MemoryUtils : class MemoryUtils :
public IMemoryUtils, public IMemoryUtils,
public SMGlobalClass public SMGlobalClass
{ {
public:
~MemoryUtils();
public: // SMGlobalClass public: // SMGlobalClass
void OnSourceModAllInitialized(); void OnSourceModAllInitialized();
public: // IMemoryUtils public: // IMemoryUtils
void *FindPattern(const void *libPtr, const char *pattern, size_t len); void *FindPattern(const void *libPtr, const char *pattern, size_t len);
void *ResolveSymbol(void *handle, const char *symbol);
public: public:
bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib); bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
#ifdef PLATFORM_LINUX
private:
CVector<LibSymbolTable *> m_SymTables;
#endif
}; };
extern MemoryUtils g_MemUtils; extern MemoryUtils g_MemUtils;

View File

@ -49,7 +49,11 @@ SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &)
#elif SOURCE_ENGINE == SE_DARKMESSIAH #elif SOURCE_ENGINE == SE_DARKMESSIAH
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false); SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
#else #else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>); # if SH_IMPL_VERSION >= 4
extern int __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
#endif
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>); extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
#endif #endif

View File

@ -76,7 +76,11 @@ SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &)
#elif SOURCE_ENGINE == SE_DARKMESSIAH #elif SOURCE_ENGINE == SE_DARKMESSIAH
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false); SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
#else #else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>); # if SH_IMPL_VERSION >= 4
extern int __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# endif
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>); extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
#endif #endif
@ -690,7 +694,7 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
ClientConsolePrint(pEntity, ClientConsolePrint(pEntity,
" David \"BAILOPAN\" Anderson, Borja \"faluco\" Ferrer"); " David \"BAILOPAN\" Anderson, Borja \"faluco\" Ferrer");
ClientConsolePrint(pEntity, ClientConsolePrint(pEntity,
" Scott \"Damaged Soul\" Ehlert, Matt \"pRED\" Woodrow"); " Scott \"DS\" Ehlert, Matt \"pRED\" Woodrow");
ClientConsolePrint(pEntity, ClientConsolePrint(pEntity,
" Michael \"ferret\" McKoy, Pavol \"PM OnoTo\" Marko"); " Michael \"ferret\" McKoy, Pavol \"PM OnoTo\" Marko");
ClientConsolePrint(pEntity, ClientConsolePrint(pEntity,

View File

@ -1125,7 +1125,7 @@ void CPluginManager::LoadAutoPlugin(const char *plugin)
{ {
g_Logger.LogError("[SM] Failed to load plugin \"%s\": %s", plugin, error); g_Logger.LogError("[SM] Failed to load plugin \"%s\": %s", plugin, error);
pl->SetErrorState( pl->SetErrorState(
pl->GetStatus() == Plugin_BadLoad ? Plugin_BadLoad : Plugin_Failed, pl->GetStatus() <= Plugin_Created ? Plugin_BadLoad : pl->GetStatus(),
"%s", "%s",
error); error);
} }
@ -2052,7 +2052,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
char pluginfile[256]; char pluginfile[256];
const char *ext = g_LibSys.GetFileExtension(filename) ? "" : ".smx"; const char *ext = g_LibSys.GetFileExtension(filename) ? "" : ".smx";
UTIL_Format(pluginfile, sizeof(pluginfile), "%s%s", filename, ext); g_SourceMod.BuildPath(Path_None, pluginfile, sizeof(pluginfile), "%s%s", filename, ext);
IPlugin *pl = LoadPlugin(pluginfile, false, PluginType_MapUpdated, error, sizeof(error), &wasloaded); IPlugin *pl = LoadPlugin(pluginfile, false, PluginType_MapUpdated, error, sizeof(error), &wasloaded);
@ -2099,7 +2099,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
{ {
char pluginfile[256]; char pluginfile[256];
const char *ext = g_LibSys.GetFileExtension(arg) ? "" : ".smx"; const char *ext = g_LibSys.GetFileExtension(arg) ? "" : ".smx";
UTIL_Format(pluginfile, sizeof(pluginfile), "%s%s", arg, ext); g_SourceMod.BuildPath(Path_None, pluginfile, sizeof(pluginfile), "%s%s", arg, ext);
if (!sm_trie_retrieve(m_LoadLookup, pluginfile, (void **)&pl)) if (!sm_trie_retrieve(m_LoadLookup, pluginfile, (void **)&pl))
{ {
@ -2189,7 +2189,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
{ {
char pluginfile[256]; char pluginfile[256];
const char *ext = g_LibSys.GetFileExtension(arg) ? "" : ".smx"; const char *ext = g_LibSys.GetFileExtension(arg) ? "" : ".smx";
UTIL_Format(pluginfile, sizeof(pluginfile), "%s%s", arg, ext); g_SourceMod.BuildPath(Path_None, pluginfile, sizeof(pluginfile), "%s%s", arg, ext);
if (!sm_trie_retrieve(m_LoadLookup, pluginfile, (void **)&pl)) if (!sm_trie_retrieve(m_LoadLookup, pluginfile, (void **)&pl))
{ {
@ -2310,7 +2310,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
{ {
char pluginfile[256]; char pluginfile[256];
const char *ext = g_LibSys.GetFileExtension(arg) ? "" : ".smx"; const char *ext = g_LibSys.GetFileExtension(arg) ? "" : ".smx";
UTIL_Format(pluginfile, sizeof(pluginfile), "%s%s", arg, ext); g_SourceMod.BuildPath(Path_None, pluginfile, sizeof(pluginfile), "%s%s", arg, ext);
if (!sm_trie_retrieve(m_LoadLookup, pluginfile, (void **)&pl)) if (!sm_trie_retrieve(m_LoadLookup, pluginfile, (void **)&pl))
{ {
@ -2321,7 +2321,10 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
char name[PLATFORM_MAX_PATH]; char name[PLATFORM_MAX_PATH];
const sm_plugininfo_t *info = pl->GetPublicInfo(); const sm_plugininfo_t *info = pl->GetPublicInfo();
strcpy(name, (IS_STR_FILLED(info->name)) ? info->name : pl->GetFilename()); if (pl->GetStatus() <= Plugin_Paused)
strcpy(name, (IS_STR_FILLED(info->name)) ? info->name : pl->GetFilename());
else
strcpy(name, pl->GetFilename());
if (ReloadPlugin(pl)) if (ReloadPlugin(pl))
{ {

View File

@ -47,7 +47,7 @@
#include "sm_trie.h" #include "sm_trie.h"
#include "sourcemod.h" #include "sourcemod.h"
#include <IRootConsoleMenu.h> #include <IRootConsoleMenu.h>
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#include "convar_sm_l4d.h" #include "convar_sm_l4d.h"
#elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) #elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE)
#include "convar_sm_ob.h" #include "convar_sm_ob.h"

View File

@ -527,3 +527,85 @@ NativeEntry *ShareSystem::AddFakeNative(IPluginFunction *pFunc, const char *name
return pEntry; return pEntry;
} }
void ShareSystem::AddCapabilityProvider(IExtension *myself, IFeatureProvider *provider,
const char *name)
{
if (m_caps.retrieve(name) != NULL)
return;
Capability cap;
cap.ext = myself;
cap.provider = provider;
m_caps.insert(name, cap);
}
void ShareSystem::DropCapabilityProvider(IExtension *myself, IFeatureProvider *provider,
const char *name)
{
Capability *pCap = m_caps.retrieve(name);
if (pCap == NULL)
return;
if (pCap->ext != myself || pCap->provider != provider)
return;
m_caps.remove(name);
}
FeatureStatus ShareSystem::TestFeature(IPluginRuntime *pRuntime, FeatureType feature,
const char *name)
{
switch (feature)
{
case FeatureType_Native:
return TestNative(pRuntime, name);
case FeatureType_Capability:
return TestCap(name);
default:
break;
}
return FeatureStatus_Unknown;
}
FeatureStatus ShareSystem::TestNative(IPluginRuntime *pRuntime, const char *name)
{
uint32_t index;
if (pRuntime->FindNativeByName(name, &index) == SP_ERROR_NONE)
{
sp_native_t *native;
if (pRuntime->GetNativeByIndex(index, &native) == SP_ERROR_NONE)
{
if (native->status == SP_NATIVE_BOUND)
return FeatureStatus_Available;
else
return FeatureStatus_Unknown;
}
}
NativeEntry *entry = FindNative(name);
if (entry == NULL)
return FeatureStatus_Unknown;
if ((entry->replacement.owner != NULL || entry->owner != NULL) &&
(entry->replacement.func != NULL || entry->func != NULL))
{
return FeatureStatus_Available;
}
else
{
return FeatureStatus_Unavailable;
}
}
FeatureStatus ShareSystem::TestCap(const char *name)
{
Capability *cap = m_caps.retrieve(name);
if (cap == NULL)
return FeatureStatus_Unknown;
return cap->provider->GetFeatureStatus(FeatureType_Capability, name);
}

View File

@ -87,6 +87,12 @@ struct NativeEntry
FakeNative *fake; FakeNative *fake;
}; };
struct Capability
{
IExtension *ext;
IFeatureProvider *provider;
};
class ShareSystem : class ShareSystem :
public IShareSys, public IShareSys,
public SMGlobalClass, public SMGlobalClass,
@ -110,6 +116,10 @@ public: //IShareSys
void AddDependency(IExtension *myself, const char *filename, bool require, bool autoload); void AddDependency(IExtension *myself, const char *filename, bool require, bool autoload);
void RegisterLibrary(IExtension *myself, const char *name); void RegisterLibrary(IExtension *myself, const char *name);
void OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives); void OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives);
void AddCapabilityProvider(IExtension *myself, IFeatureProvider *provider,
const char *name);
void DropCapabilityProvider(IExtension *myself, IFeatureProvider *provider,
const char *name);
public: //SMGlobalClass public: //SMGlobalClass
/* Pre-empt in case anything tries to register idents early */ /* Pre-empt in case anything tries to register idents early */
void Initialize(); void Initialize();
@ -119,6 +129,9 @@ public: //IHandleTypeDispatch
public: public:
IdentityToken_t *CreateCoreIdentity(); IdentityToken_t *CreateCoreIdentity();
void RemoveInterfaces(IExtension *pExtension); void RemoveInterfaces(IExtension *pExtension);
FeatureStatus TestFeature(IPluginRuntime *pRuntime, FeatureType feature, const char *name);
FeatureStatus TestNative(IPluginRuntime *pRuntime, const char *name);
FeatureStatus TestCap(const char *name);
public: public:
inline IdentityToken_t *GetIdentRoot() inline IdentityToken_t *GetIdentRoot()
{ {
@ -143,6 +156,7 @@ private:
HandleType_t m_IfaceType; HandleType_t m_IfaceType;
IdentityType_t m_CoreType; IdentityType_t m_CoreType;
KTrie<NativeEntry *> m_NtvCache; KTrie<NativeEntry *> m_NtvCache;
KTrie<Capability> m_caps;
}; };
extern ShareSystem g_ShareSys; extern ShareSystem g_ShareSys;

View File

@ -34,7 +34,7 @@
UserMessages g_UserMsgs; UserMessages g_UserMsgs;
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
SH_DECL_HOOK3(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int, const char *); SH_DECL_HOOK3(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int, const char *);
#else #else
SH_DECL_HOOK2(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int); SH_DECL_HOOK2(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int);
@ -168,13 +168,13 @@ bf_write *UserMessages::StartMessage(int msg_id, const cell_t players[], unsigne
if (m_CurFlags & USERMSG_BLOCKHOOKS) if (m_CurFlags & USERMSG_BLOCKHOOKS)
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id)); buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id));
#else #else
buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id); buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
#endif #endif
} else { } else {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id)); buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id));
#else #else
buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id); buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
@ -316,7 +316,7 @@ void UserMessages::_DecRefCounter()
} }
} }
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name) bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name)
#else #else
bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type) bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type)
@ -346,7 +346,7 @@ bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_typ
RETURN_META_VALUE(MRES_IGNORED, NULL); RETURN_META_VALUE(MRES_IGNORED, NULL);
} }
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name) bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name)
#else #else
bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type) bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type)
@ -500,7 +500,7 @@ void UserMessages::OnMessageEnd_Pre()
{ {
bf_write *engine_bfw; bf_write *engine_bfw;
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId, g_SMAPI->GetUserMessage(m_CurId)); engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId, g_SMAPI->GetUserMessage(m_CurId));
#else #else
engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId); engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId);

View File

@ -79,7 +79,7 @@ public: //IUserMessages
IUserMessageListener *pListener, IUserMessageListener *pListener,
bool intercept=false); bool intercept=false);
public: public:
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
bf_write *OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name); bf_write *OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name);
bf_write *OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name); bf_write *OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name);
#else #else

View File

@ -386,6 +386,9 @@ public:
virtual void SetValue( const char *value ); virtual void SetValue( const char *value );
virtual void SetValue( float value ); virtual void SetValue( float value );
virtual void SetValue( int value ); virtual void SetValue( int value );
#if SOURCE_ENGINE == SE_LEFT4DEAD2
virtual void SetValue( Color value );
#endif
// Reset to default value // Reset to default value
void Revert( void ); void Revert( void );

View File

@ -126,6 +126,6 @@ private:
prof_point_t m_ProfStart; prof_point_t m_ProfStart;
}; };
extern ProfileEngine g_Profiler; extern IProfiler *sm_profiler;
#endif //_INCLUDE_SOURCEMOD_PLUGIN_PROFILER_H_ #endif //_INCLUDE_SOURCEMOD_PLUGIN_PROFILER_H_

View File

@ -35,6 +35,7 @@
#include "common_logic.h" #include "common_logic.h"
#include "ThreadSupport.h" #include "ThreadSupport.h"
#include "TextParsers.h" #include "TextParsers.h"
#include "Profiler.h"
sm_core_t smcore; sm_core_t smcore;
IHandleSys *handlesys; IHandleSys *handlesys;
@ -52,7 +53,8 @@ IForwardManager *forwardsys;
static sm_logic_t logic = static sm_logic_t logic =
{ {
NULL, NULL,
g_pThreader g_pThreader,
sm_profiler
}; };
static void logic_init(const sm_core_t* core, sm_logic_t* _logic) static void logic_init(const sm_core_t* core, sm_logic_t* _logic)

View File

@ -104,7 +104,8 @@ static sm_core_t core_bridge =
UTIL_TrimWhitespace, UTIL_TrimWhitespace,
log_error, log_error,
get_cvar_string, get_cvar_string,
UTIL_Format UTIL_Format,
UTIL_ReplaceAll
}; };
void InitLogicBridge() void InitLogicBridge()

View File

@ -7,18 +7,21 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
CrazyDebug - Dark Messiah|Win32 = CrazyDebug - Dark Messiah|Win32 CrazyDebug - Dark Messiah|Win32 = CrazyDebug - Dark Messiah|Win32
CrazyDebug - Episode 1|Win32 = CrazyDebug - Episode 1|Win32 CrazyDebug - Episode 1|Win32 = CrazyDebug - Episode 1|Win32
CrazyDebug - Left 4 Dead 2|Win32 = CrazyDebug - Left 4 Dead 2|Win32
CrazyDebug - Left 4 Dead|Win32 = CrazyDebug - Left 4 Dead|Win32 CrazyDebug - Left 4 Dead|Win32 = CrazyDebug - Left 4 Dead|Win32
CrazyDebug - Old Metamod|Win32 = CrazyDebug - Old Metamod|Win32 CrazyDebug - Old Metamod|Win32 = CrazyDebug - Old Metamod|Win32
CrazyDebug - Orange Box Valve|Win32 = CrazyDebug - Orange Box Valve|Win32 CrazyDebug - Orange Box Valve|Win32 = CrazyDebug - Orange Box Valve|Win32
CrazyDebug - Orange Box|Win32 = CrazyDebug - Orange Box|Win32 CrazyDebug - Orange Box|Win32 = CrazyDebug - Orange Box|Win32
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
Debug - Episode 1|Win32 = Debug - Episode 1|Win32 Debug - Episode 1|Win32 = Debug - Episode 1|Win32
Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32
Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32 Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32
Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
Release - Episode 1|Win32 = Release - Episode 1|Win32 Release - Episode 1|Win32 = Release - Episode 1|Win32
Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32
Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Old Metamod|Win32 = Release - Old Metamod|Win32 Release - Old Metamod|Win32 = Release - Old Metamod|Win32
Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32
@ -29,6 +32,8 @@ Global
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Dark Messiah|Win32.Build.0 = CrazyDebug - Dark Messiah|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Dark Messiah|Win32.Build.0 = CrazyDebug - Dark Messiah|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Episode 1|Win32.ActiveCfg = CrazyDebug - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Episode 1|Win32.ActiveCfg = CrazyDebug - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Episode 1|Win32.Build.0 = CrazyDebug - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Episode 1|Win32.Build.0 = CrazyDebug - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead 2|Win32.ActiveCfg = CrazyDebug - Left 4 Dead 2|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead 2|Win32.Build.0 = CrazyDebug - Left 4 Dead 2|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead|Win32.ActiveCfg = CrazyDebug - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead|Win32.ActiveCfg = CrazyDebug - Left 4 Dead|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead|Win32.Build.0 = CrazyDebug - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Left 4 Dead|Win32.Build.0 = CrazyDebug - Left 4 Dead|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Old Metamod|Win32.ActiveCfg = CrazyDebug - Old Metamod|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Old Metamod|Win32.ActiveCfg = CrazyDebug - Old Metamod|Win32
@ -41,6 +46,8 @@ Global
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32
@ -53,6 +60,8 @@ Global
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32 {E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32

View File

@ -60,6 +60,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -224,6 +225,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -308,6 +310,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -472,6 +475,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -556,6 +560,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -638,6 +643,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -719,6 +725,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -803,6 +810,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -885,6 +893,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -966,6 +975,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -1050,6 +1060,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -1214,6 +1225,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -1298,6 +1310,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -1504,6 +1517,256 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="CrazyDebug - Left 4 Dead 2|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="0"
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\engine&quot;;&quot;$(HL2SDKL4D2)\public\game\server&quot;;&quot;$(HL2SDKL4D2)\public\mathlib&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;;&quot;$(HL2SDKL4D2)\public\vstdlib&quot;;&quot;$(MMSOURCE18)\core&quot;;&quot;$(MMSOURCE18)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;SOURCE_ENGINE=6"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\mathlib.lib&quot; dbghelp.lib &quot;Wsock32.lib&quot;"
OutputFile="$(OutDir)\sourcemod.2.l4d2.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Left 4 Dead 2|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="0"
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\engine&quot;;&quot;$(HL2SDKL4D2)\public\game\server&quot;;&quot;$(HL2SDKL4D2)\public\mathlib&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;;&quot;$(HL2SDKL4D2)\public\vstdlib&quot;;&quot;$(MMSOURCE18)\core&quot;;&quot;$(MMSOURCE18)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;SOURCE_ENGINE=6"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\mathlib.lib&quot; &quot;Wsock32.lib&quot;"
OutputFile="$(OutDir)\sourcemod.2.l4d2.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Left 4 Dead 2|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/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"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\engine&quot;;&quot;$(HL2SDKL4D2)\public\game\server&quot;;&quot;$(HL2SDKL4D2)\public\mathlib&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;;&quot;$(HL2SDKL4D2)\public\vstdlib&quot;;&quot;$(MMSOURCE18)\core&quot;;&quot;$(MMSOURCE18)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;SOURCE_ENGINE=6"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\public"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\mathlib.lib&quot; &quot;Wsock32.lib&quot;"
OutputFile="$(OutDir)\sourcemod.2.l4d2.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
@ -1648,6 +1911,22 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug - Left 4 Dead 2|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release - Left 4 Dead 2|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath="..\Database.cpp" RelativePath="..\Database.cpp"
@ -1999,6 +2278,10 @@
RelativePath="..\sm_stringutil.h" RelativePath="..\sm_stringutil.h"
> >
</File> </File>
<File
RelativePath="..\sm_symtable.h"
>
</File>
<File <File
RelativePath="..\sm_trie.h" RelativePath="..\sm_trie.h"
> >

View File

@ -324,14 +324,14 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand &
{ {
ConsolePrint(" SourceMod was developed by AlliedModders, LLC."); ConsolePrint(" SourceMod was developed by AlliedModders, LLC.");
ConsolePrint(" Development would not have been possible without the following people:"); ConsolePrint(" Development would not have been possible without the following people:");
ConsolePrint(" David \"BAILOPAN\" Anderson, lead developer"); ConsolePrint(" David \"BAILOPAN\" Anderson");
ConsolePrint(" Borja \"faluco\" Ferrer, core developer"); ConsolePrint(" Matt \"pRED\" Woodrow");
ConsolePrint(" Scott \"Damaged Soul\" Ehlert, core developer"); ConsolePrint(" Scott \"DS\" Ehlert");
ConsolePrint(" Matt \"pRED\" Woodrow, core developer"); ConsolePrint(" Fyren");
ConsolePrint(" Michael \"ferret\" McKoy, plugin developer"); ConsolePrint(" Borja \"faluco\" Ferrer");
ConsolePrint(" Pavol \"PM OnoTo\" Marko, SourceHook developer"); ConsolePrint(" Pavol \"PM OnoTo\" Marko");
ConsolePrint(" Special thanks to Viper of GameConnect"); ConsolePrint(" Special thanks to Liam, psychonic, ferret, and Mani");
ConsolePrint(" Special thanks to Mani of Mani-Admin-Plugin"); ConsolePrint(" Special thanks to Viper and SteamFriends");
ConsolePrint(" http://www.sourcemod.net/"); ConsolePrint(" http://www.sourcemod.net/");
} }
else if (strcmp(cmdname, "version") == 0) else if (strcmp(cmdname, "version") == 0)

231
core/sm_symtable.h Normal file
View File

@ -0,0 +1,231 @@
/**
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*/
#ifndef _INCLUDE_SOURCEMOD_CORE_SYMBOLTABLE_H_
#define _INCLUDE_SOURCEMOD_CORE_SYMBOLTABLE_H_
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#define KESTRING_TABLE_START_SIZE 65536
struct Symbol
{
size_t length;
uint32_t hash;
void *address;
Symbol *tbl_next;
inline char *buffer()
{
return reinterpret_cast<char *>(this + 1);
}
};
class SymbolTable
{
public:
~SymbolTable()
{
for (uint32_t i = 0; i < nbuckets; i++)
{
Symbol *sym = buckets[i];
while (sym != NULL)
{
Symbol *next = sym->tbl_next;
free(sym);
sym = next;
}
}
free(buckets);
}
bool Initialize()
{
buckets = (Symbol **)malloc(sizeof(Symbol *) * KESTRING_TABLE_START_SIZE);
if (buckets == NULL)
{
return false;
}
memset(buckets, 0, sizeof(Symbol *) * KESTRING_TABLE_START_SIZE);
nbuckets = KESTRING_TABLE_START_SIZE;
nused = 0;
bucketmask = KESTRING_TABLE_START_SIZE - 1;
return true;
}
static inline uint32_t HashString(const char *data, size_t len)
{
#undef get16bits
#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
|| defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
#define get16bits(d) (*((const uint16_t *) (d)))
#endif
#if !defined (get16bits)
#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
+(uint32_t)(((const uint8_t *)(d))[0]) )
#endif
uint32_t hash = len, tmp;
int rem;
if (len <= 0 || data == NULL)
{
return 0;
}
rem = len & 3;
len >>= 2;
/* Main loop */
for (;len > 0; len--) {
hash += get16bits (data);
tmp = (get16bits (data+2) << 11) ^ hash;
hash = (hash << 16) ^ tmp;
data += 2 * sizeof (uint16_t);
hash += hash >> 11;
}
/* Handle end cases */
switch (rem) {
case 3: hash += get16bits (data);
hash ^= hash << 16;
hash ^= data[sizeof (uint16_t)] << 18;
hash += hash >> 11;
break;
case 2: hash += get16bits (data);
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1: hash += *data;
hash ^= hash << 10;
hash += hash >> 1;
}
/* Force "avalanching" of final 127 bits */
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;
return hash;
#undef get16bits
}
Symbol **FindSymbolBucket(const char *str, size_t len, uint32_t hash)
{
uint32_t bucket = hash & bucketmask;
Symbol **pkvs = &buckets[bucket];
Symbol *kvs = *pkvs;
while (kvs != NULL)
{
if (len == kvs->length && memcmp(str, kvs->buffer(), len * sizeof(char)) == 0)
{
return pkvs;
}
pkvs = &kvs->tbl_next;
kvs = *pkvs;
}
return pkvs;
}
void ResizeSymbolTable()
{
uint32_t xnbuckets = nbuckets * 2;
Symbol **xbuckets = (Symbol **)malloc(sizeof(Symbol *) * xnbuckets);
if (xbuckets == NULL)
{
return;
}
memset(xbuckets, 0, sizeof(Symbol *) * xnbuckets);
uint32_t xbucketmask = xnbuckets - 1;
for (uint32_t i = 0; i < nbuckets; i++)
{
Symbol *sym = buckets[i];
while (sym != NULL)
{
Symbol *next = sym->tbl_next;
uint32_t bucket = sym->hash & xbucketmask;
sym->tbl_next = xbuckets[bucket];
xbuckets[bucket] = sym;
sym = next;
}
}
free(buckets);
buckets = xbuckets;
nbuckets = xnbuckets;
bucketmask = xbucketmask;
}
Symbol *FindSymbol(const char *str, size_t len)
{
uint32_t hash = HashString(str, len);
Symbol **pkvs = FindSymbolBucket(str, len, hash);
return *pkvs;
}
Symbol *InternSymbol(const char* str, size_t len, void *address)
{
uint32_t hash = HashString(str, len);
Symbol **pkvs = FindSymbolBucket(str, len, hash);
if (*pkvs != NULL)
{
return *pkvs;
}
Symbol *kvs = (Symbol *)malloc(sizeof(Symbol) + sizeof(char) * (len + 1));
kvs->length = len;
kvs->hash = hash;
kvs->address = address;
kvs->tbl_next = NULL;
memcpy(kvs + 1, str, sizeof(char) * (len + 1));
*pkvs = kvs;
nused++;
if (nused > nbuckets && nbuckets <= INT_MAX / 2)
{
ResizeSymbolTable();
}
return kvs;
}
private:
uint32_t nbuckets;
uint32_t nused;
uint32_t bucketmask;
Symbol **buckets;
};
#endif //_INCLUDE_SOURCEMOD_CORE_SYMBOLTABLE_H_

View File

@ -46,7 +46,7 @@
#include "Logger.h" #include "Logger.h"
#include "ConsoleDetours.h" #include "ConsoleDetours.h"
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#define NET_SETCONVAR 6 #define NET_SETCONVAR 6
#else #else
#define NET_SETCONVAR 5 #define NET_SETCONVAR 5
@ -69,7 +69,7 @@ struct GlobCmdIter
struct ConCmdIter struct ConCmdIter
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
ICvarIteratorInternal *pLast; ICvarIteratorInternal *pLast;
#else #else
const ConCommandBase *pLast; const ConCommandBase *pLast;
@ -103,7 +103,7 @@ public:
else if (type == htConCmdIter) else if (type == htConCmdIter)
{ {
ConCmdIter *iter = (ConCmdIter * )object; ConCmdIter *iter = (ConCmdIter * )object;
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
// ICvarIteratorInternal has no virtual destructor // ICvarIteratorInternal has no virtual destructor
g_pMemAlloc->Free(iter->pLast); g_pMemAlloc->Free(iter->pLast);
#endif #endif
@ -670,7 +670,8 @@ static cell_t sm_RegServerCmd(IPluginContext *pContext, const cell_t *params)
if (strcasecmp(name, "sm") == 0) if (strcasecmp(name, "sm") == 0)
{ {
return pContext->ThrowNativeError("Cannot register \"sm\" command"); g_Logger.LogError("Request to register \"sm\" command denied.");
return 0;
} }
pContext->LocalToString(params[3], &help); pContext->LocalToString(params[3], &help);
@ -698,7 +699,8 @@ static cell_t sm_RegConsoleCmd(IPluginContext *pContext, const cell_t *params)
if (strcasecmp(name, "sm") == 0) if (strcasecmp(name, "sm") == 0)
{ {
return pContext->ThrowNativeError("Cannot register \"sm\" command"); g_Logger.LogError("Request to register \"sm\" command denied.");
return 0;
} }
pContext->LocalToString(params[3], &help); pContext->LocalToString(params[3], &help);
@ -729,7 +731,8 @@ static cell_t sm_RegAdminCmd(IPluginContext *pContext, const cell_t *params)
if (strcasecmp(name, "sm") == 0) if (strcasecmp(name, "sm") == 0)
{ {
return pContext->ThrowNativeError("Cannot register \"sm\" command"); g_Logger.LogError("Request to register \"sm\" command denied.");
return 0;
} }
pContext->LocalToString(params[4], &help); pContext->LocalToString(params[4], &help);
@ -1183,7 +1186,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params
pContext->LocalToPhysAddr(params[3], &pIsCmd); pContext->LocalToPhysAddr(params[3], &pIsCmd);
pContext->LocalToPhysAddr(params[4], &pFlags); pContext->LocalToPhysAddr(params[4], &pFlags);
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
ICvarIteratorInternal *cvarIter = icvar->FactoryInternalIterator(); ICvarIteratorInternal *cvarIter = icvar->FactoryInternalIterator();
cvarIter->SetFirst(); cvarIter->SetFirst();
if (!cvarIter->IsValid()) if (!cvarIter->IsValid())
@ -1210,7 +1213,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params
} }
pIter = new ConCmdIter; pIter = new ConCmdIter;
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
pIter->pLast = cvarIter; pIter->pLast = cvarIter;
#else #else
pIter->pLast = pConCmd; pIter->pLast = pConCmd;
@ -1245,7 +1248,7 @@ static cell_t FindNextConCommand(IPluginContext *pContext, const cell_t *params)
return 0; return 0;
} }
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
ICvarIteratorInternal *cvarIter = pIter->pLast; ICvarIteratorInternal *cvarIter = pIter->pLast;
cvarIter->Next(); cvarIter->Next();
if (!cvarIter->IsValid()) if (!cvarIter->IsValid())

View File

@ -42,6 +42,7 @@
#include "ForwardSys.h" #include "ForwardSys.h"
#include "Logger.h" #include "Logger.h"
#include "ExtensionSys.h" #include "ExtensionSys.h"
#include <sm_trie_tpl.h>
#if defined PLATFORM_WINDOWS #if defined PLATFORM_WINDOWS
#include <windows.h> #include <windows.h>
@ -491,6 +492,11 @@ static cell_t LibraryExists(IPluginContext *pContext, const cell_t *params)
char *str; char *str;
pContext->LocalToString(params[1], &str); pContext->LocalToString(params[1], &str);
if (strcmp(str, "__CanTestFeatures__") == 0)
{
return 1;
}
if (g_PluginSys.LibraryExists(str)) if (g_PluginSys.LibraryExists(str))
{ {
return 1; return 1;
@ -630,6 +636,43 @@ static cell_t VerifyCoreVersion(IPluginContext *pContext, const cell_t *params)
return 4; return 4;
} }
static cell_t GetFeatureStatus(IPluginContext *pContext, const cell_t *params)
{
FeatureType type = (FeatureType)params[1];
char *name;
pContext->LocalToString(params[2], &name);
return g_ShareSys.TestFeature(pContext->GetRuntime(),type, name);
}
static cell_t RequireFeature(IPluginContext *pContext, const cell_t *params)
{
FeatureType type = (FeatureType)params[1];
char *name;
pContext->LocalToString(params[2], &name);
if (g_ShareSys.TestFeature(pContext->GetRuntime(),type, name) != FeatureStatus_Available)
{
char buffer[255];
char *msg = buffer;
char default_message[255];
CPlugin *pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext());
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 3);
if (pContext->GetLastNativeError() != SP_ERROR_NONE || buffer[0] == '\0')
{
UTIL_Format(default_message, sizeof(default_message), "Feature \"%s\" not available", name);
msg = default_message;
}
pPlugin->SetErrorState(Plugin_Error, "%s", msg);
return pContext->ThrowNativeErrorEx(SP_ERROR_ABORTED, "%s", msg);
}
return 1;
}
REGISTER_NATIVES(coreNatives) REGISTER_NATIVES(coreNatives)
{ {
{"AutoExecConfig", AutoExecConfig}, {"AutoExecConfig", AutoExecConfig},
@ -654,6 +697,8 @@ REGISTER_NATIVES(coreNatives)
{"GetExtensionFileStatus", GetExtensionFileStatus}, {"GetExtensionFileStatus", GetExtensionFileStatus},
{"FindPluginByNumber", FindPluginByNumber}, {"FindPluginByNumber", FindPluginByNumber},
{"VerifyCoreVersion", VerifyCoreVersion}, {"VerifyCoreVersion", VerifyCoreVersion},
{"GetFeatureStatus", GetFeatureStatus},
{"RequireFeature", RequireFeature},
{NULL, NULL}, {NULL, NULL},
}; };

View File

@ -69,39 +69,36 @@ inline edict_t *BaseEntityToEdict(CBaseEntity *pEntity)
inline edict_t *GetEdict(cell_t num) inline edict_t *GetEdict(cell_t num)
{ {
CBaseEntity *pEntity = g_HL2.ReferenceToEntity(num); edict_t *pEdict;
if (!IndexToAThings(num, NULL, &pEdict))
if (!pEntity)
{
return 0;
}
edict_t *pEdict = ::BaseEntityToEdict(pEntity);
if (!pEdict || pEdict->IsFree())
{ {
return NULL; return NULL;
} }
int index = g_HL2.ReferenceToIndex(num);
if (index > 0 && index <= g_Players.GetMaxClients())
{
CPlayer *pPlayer = g_Players.GetPlayerByIndex(index);
if (!pPlayer || !pPlayer->IsConnected())
{
return NULL;
}
}
return pEdict; return pEdict;
} }
edict_t *GetEntity(cell_t num, CBaseEntity **pData) inline CBaseEntity *GetEntity(cell_t num)
{
CBaseEntity *pEntity;
if (!IndexToAThings(num, &pEntity, NULL))
{
return NULL;
}
return pEntity;
}
/* Given an entity reference or index, fill out a CBaseEntity and/or edict.
If lookup is successful, returns true and writes back the two parameters.
If lookup fails, returns false and doesn't touch the params. */
bool IndexToAThings(cell_t num, CBaseEntity **pEntData, edict_t **pEdictData)
{ {
CBaseEntity *pEntity = g_HL2.ReferenceToEntity(num); CBaseEntity *pEntity = g_HL2.ReferenceToEntity(num);
if (!pEntity) if (!pEntity)
{ {
return 0; return false;
} }
int index = g_HL2.ReferenceToIndex(num); int index = g_HL2.ReferenceToIndex(num);
@ -110,20 +107,35 @@ edict_t *GetEntity(cell_t num, CBaseEntity **pData)
CPlayer *pPlayer = g_Players.GetPlayerByIndex(index); CPlayer *pPlayer = g_Players.GetPlayerByIndex(index);
if (!pPlayer || !pPlayer->IsConnected()) if (!pPlayer || !pPlayer->IsConnected())
{ {
return NULL; return false;
} }
} }
*pData = pEntity; if (pEntData)
edict_t *pEdict = ::BaseEntityToEdict(pEntity);
if (!pEdict || pEdict->IsFree())
{ {
return NULL; *pEntData = pEntity;
} }
return pEdict; if (pEdictData)
{
edict_t *pEdict = ::BaseEntityToEdict(pEntity);
if (!pEdict || pEdict->IsFree())
{
pEdict = NULL;
}
*pEdictData = pEdict;
}
return true;
} }
/*
<predcrab> AThings is like guaranteed r+ by dvander though
<predcrab> he wont even read the rest of the patch to nit stuff
<Fyren> Like I wasn't going to r? you anyway!
<predcrab> he still sees!
<predcrab> he's everywhere
*/
class VEmptyClass {}; class VEmptyClass {};
datamap_t *VGetDataDescMap(CBaseEntity *pThisPtr, int offset) datamap_t *VGetDataDescMap(CBaseEntity *pThisPtr, int offset)
@ -312,8 +324,7 @@ static cell_t GetEntityNetClass(IPluginContext *pContext, const cell_t *params)
static cell_t GetEntData(IPluginContext *pContext, const cell_t *params) static cell_t GetEntData(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity = GetEntity(params[1]);
GetEntity(params[1], &pEntity);
if (!pEntity) if (!pEntity)
{ {
@ -342,9 +353,9 @@ static cell_t GetEntData(IPluginContext *pContext, const cell_t *params)
static cell_t SetEntData(IPluginContext *pContext, const cell_t *params) static cell_t SetEntData(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity;
edict_t *pEdict = GetEntity(params[1], &pEntity); edict_t *pEdict;
if (!pEntity) if (!IndexToAThings(params[1], &pEntity, &pEdict))
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -386,8 +397,7 @@ static cell_t SetEntData(IPluginContext *pContext, const cell_t *params)
static cell_t GetEntDataFloat(IPluginContext *pContext, const cell_t *params) static cell_t GetEntDataFloat(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity = GetEntity(params[1]);
GetEntity(params[1], &pEntity);
if (!pEntity) if (!pEntity)
{ {
@ -408,9 +418,9 @@ static cell_t GetEntDataFloat(IPluginContext *pContext, const cell_t *params)
static cell_t SetEntDataFloat(IPluginContext *pContext, const cell_t *params) static cell_t SetEntDataFloat(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity;
edict_t *pEdict = GetEntity(params[1], &pEntity); edict_t *pEdict;
if (!pEntity) if (!IndexToAThings(params[1], &pEntity, &pEdict))
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -433,8 +443,7 @@ static cell_t SetEntDataFloat(IPluginContext *pContext, const cell_t *params)
static cell_t GetEntDataVector(IPluginContext *pContext, const cell_t *params) static cell_t GetEntDataVector(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity = GetEntity(params[1]);
GetEntity(params[1], &pEntity);
if (!pEntity) if (!pEntity)
{ {
@ -462,9 +471,9 @@ static cell_t GetEntDataVector(IPluginContext *pContext, const cell_t *params)
static cell_t SetEntDataVector(IPluginContext *pContext, const cell_t *params) static cell_t SetEntDataVector(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity;
edict_t *pEdict = GetEntity(params[1], &pEntity); edict_t *pEdict;
if (!pEntity) if (!IndexToAThings(params[1], &pEntity, &pEdict))
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -495,8 +504,7 @@ static cell_t SetEntDataVector(IPluginContext *pContext, const cell_t *params)
/* THIS GUY IS DEPRECATED. */ /* THIS GUY IS DEPRECATED. */
static cell_t GetEntDataEnt(IPluginContext *pContext, const cell_t *params) static cell_t GetEntDataEnt(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity = GetEntity(params[1]);
GetEntity(params[1], &pEntity);
if (!pEntity) if (!pEntity)
{ {
@ -532,7 +540,10 @@ int CheckBaseHandle(CBaseHandle &hndl)
edict_t *pStoredEdict; edict_t *pStoredEdict;
CBaseEntity *pStoredEntity; CBaseEntity *pStoredEntity;
pStoredEdict = GetEntity(index, &pStoredEntity); if (!IndexToAThings(index, &pStoredEntity, &pStoredEdict))
{
return -1;
}
if (pStoredEdict == NULL || pStoredEntity == NULL) if (pStoredEdict == NULL || pStoredEntity == NULL)
{ {
@ -556,8 +567,7 @@ int CheckBaseHandle(CBaseHandle &hndl)
static cell_t GetEntDataEnt2(IPluginContext *pContext, const cell_t *params) static cell_t GetEntDataEnt2(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity = GetEntity(params[1]);
GetEntity(params[1], &pEntity);
if (pEntity == NULL) if (pEntity == NULL)
{ {
@ -580,9 +590,9 @@ static cell_t GetEntDataEnt2(IPluginContext *pContext, const cell_t *params)
static cell_t SetEntDataEnt(IPluginContext *pContext, const cell_t *params) static cell_t SetEntDataEnt(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity;
edict_t *pEdict = GetEntity(params[1], &pEntity); edict_t *pEdict;
if (!pEntity) if (!IndexToAThings(params[1], &pEntity, &pEdict))
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -599,8 +609,7 @@ static cell_t SetEntDataEnt(IPluginContext *pContext, const cell_t *params)
{ {
hndl.Set(NULL); hndl.Set(NULL);
} else { } else {
CBaseEntity *pOther; CBaseEntity *pOther = GetEntity(params[3]);
GetEntity(params[3], &pOther);
if (!pOther) if (!pOther)
{ {
@ -622,9 +631,9 @@ static cell_t SetEntDataEnt(IPluginContext *pContext, const cell_t *params)
static cell_t SetEntDataEnt2(IPluginContext *pContext, const cell_t *params) static cell_t SetEntDataEnt2(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity;
edict_t *pEdict = GetEntity(params[1], &pEntity); edict_t *pEdict;
if (!pEntity) if (!IndexToAThings(params[1], &pEntity, &pEdict))
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -643,8 +652,7 @@ static cell_t SetEntDataEnt2(IPluginContext *pContext, const cell_t *params)
} }
else else
{ {
CBaseEntity *pOther; CBaseEntity *pOther = GetEntity(params[3]);
GetEntity(params[3], &pOther);
if (!pOther) if (!pOther)
{ {
@ -752,7 +760,7 @@ static cell_t FindDataMapOffs(IPluginContext *pContext, const cell_t *params)
datamap_t *pMap; datamap_t *pMap;
typedescription_t *td; typedescription_t *td;
char *offset; char *offset;
GetEntity(params[1], &pEntity); pEntity = GetEntity(params[1]);
if (!pEntity) if (!pEntity)
{ {
@ -856,8 +864,7 @@ static cell_t FindDataMapOffs(IPluginContext *pContext, const cell_t *params)
static cell_t GetEntDataString(IPluginContext *pContext, const cell_t *params) static cell_t GetEntDataString(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity = GetEntity(params[1]);
GetEntity(params[1], &pEntity);
if (!pEntity) if (!pEntity)
{ {
@ -880,9 +887,9 @@ static cell_t GetEntDataString(IPluginContext *pContext, const cell_t *params)
static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params) static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
{ {
CBaseEntity *pEntity; CBaseEntity *pEntity;
edict_t *pEdict = GetEntity(params[1], &pEntity); edict_t *pEdict;
if (!pEntity) if (!IndexToAThings(params[1], &pEntity, &pEdict))
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -968,9 +975,7 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
edict_t *pEdict; edict_t *pEdict;
int bit_count; int bit_count;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1060,9 +1065,7 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
edict_t *pEdict; edict_t *pEdict;
int bit_count; int bit_count;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1150,9 +1153,7 @@ static cell_t GetEntPropFloat(IPluginContext *pContext, const cell_t *params)
const char *class_name; const char *class_name;
edict_t *pEdict; edict_t *pEdict;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1221,9 +1222,7 @@ static cell_t SetEntPropFloat(IPluginContext *pContext, const cell_t *params)
const char *class_name; const char *class_name;
edict_t *pEdict; edict_t *pEdict;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1297,9 +1296,7 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
const char *class_name; const char *class_name;
edict_t *pEdict; edict_t *pEdict;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1367,9 +1364,7 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
const char *class_name; const char *class_name;
edict_t *pEdict; edict_t *pEdict;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1431,8 +1426,7 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
} }
else else
{ {
CBaseEntity *pOther; CBaseEntity *pOther = GetEntity(params[4]);
GetEntity(params[4], &pOther);
if (!pOther) if (!pOther)
{ {
@ -1459,9 +1453,7 @@ static cell_t GetEntPropVector(IPluginContext *pContext, const cell_t *params)
const char *class_name; const char *class_name;
edict_t *pEdict; edict_t *pEdict;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1537,9 +1529,7 @@ static cell_t SetEntPropVector(IPluginContext *pContext, const cell_t *params)
const char *class_name; const char *class_name;
edict_t *pEdict; edict_t *pEdict;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1621,9 +1611,7 @@ static cell_t GetEntPropString(IPluginContext *pContext, const cell_t *params)
edict_t *pEdict; edict_t *pEdict;
bool bIsStringIndex; bool bIsStringIndex;
pEdict = GetEntity(params[1], &pEntity); if (!IndexToAThings(params[1], &pEntity, &pEdict))
if (!pEntity)
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }
@ -1711,9 +1699,9 @@ static cell_t SetEntPropString(IPluginContext *pContext, const cell_t *params)
char *prop; char *prop;
int offset; int offset;
int maxlen; int maxlen;
edict_t *pEdict = GetEntity(params[1], &pEntity); edict_t *pEdict;
if (!pEntity) if (!IndexToAThings(params[1], &pEntity, &pEdict))
{ {
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]); return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
} }

View File

@ -348,6 +348,23 @@ static cell_t sm_SetEventString(IPluginContext *pContext, const cell_t *params)
return 1; return 1;
} }
static cell_t sm_SetEventBroadcast(IPluginContext *pContext, const cell_t *params)
{
Handle_t hndl = static_cast<Handle_t>(params[1]);
HandleError err;
EventInfo *pInfo;
if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err);
}
pInfo->bDontBroadcast = params[2] ? true : false;
return 1;
}
REGISTER_NATIVES(gameEventNatives) REGISTER_NATIVES(gameEventNatives)
{ {
{"HookEvent", sm_HookEvent}, {"HookEvent", sm_HookEvent},
@ -365,5 +382,7 @@ REGISTER_NATIVES(gameEventNatives)
{"SetEventInt", sm_SetEventInt}, {"SetEventInt", sm_SetEventInt},
{"SetEventFloat", sm_SetEventFloat}, {"SetEventFloat", sm_SetEventFloat},
{"SetEventString", sm_SetEventString}, {"SetEventString", sm_SetEventString},
{"SetEventBroadcast", sm_SetEventBroadcast},
{NULL, NULL} {NULL, NULL}
}; };

View File

@ -73,7 +73,12 @@ static cell_t IsDedicatedServer(IPluginContext *pContext, const cell_t *params)
static cell_t GetEngineTime(IPluginContext *pContext, const cell_t *params) static cell_t GetEngineTime(IPluginContext *pContext, const cell_t *params)
{ {
#if SOURCE_ENGINE == SE_LEFT4DEAD2
float fTime = Plat_FloatTime();
#else
float fTime = engine->Time(); float fTime = engine->Time();
#endif
return sp_ftoc(fTime); return sp_ftoc(fTime);
} }
@ -438,28 +443,29 @@ static cell_t smn_IsPlayerAlive(IPluginContext *pContext, const cell_t *params)
static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params) static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
{ {
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
int version = g_SMAPI->GetSourceEngineBuild(); int version = g_SMAPI->GetSourceEngineBuild();
if (version == SOURCE_ENGINE_ORIGINAL) switch (version)
{ {
case SOURCE_ENGINE_ORIGINAL:
return 10; return 10;
} case SOURCE_ENGINE_EPISODEONE:
else if (version == SOURCE_ENGINE_DARKMESSIAH)
{
return 15;
}
else if (version == SOURCE_ENGINE_EPISODEONE)
{
return 20; return 20;
}
else if (version == SOURCE_ENGINE_ORANGEBOX) # if defined METAMOD_PLAPI_VERSION
{ /* Newer games. */
case SOURCE_ENGINE_DARKMESSIAH:
return 15;
case SOURCE_ENGINE_ORANGEBOX:
return 30; return 30;
} case SOURCE_ENGINE_ORANGEBOXVALVE:
else if (version == SOURCE_ENGINE_LEFT4DEAD) return 35;
{ case SOURCE_ENGINE_LEFT4DEAD:
return 40; return 40;
case SOURCE_ENGINE_LEFT4DEAD2:
return 50;
# endif
} }
#else #else
if (g_HL2.IsOriginalEngine()) if (g_HL2.IsOriginalEngine())

View File

@ -87,7 +87,7 @@ bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen
ismm->AddListener(this, this); ismm->AddListener(this, this);
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
if ((vsp_interface = g_SMAPI->GetVSPInfo(&vsp_version)) == NULL) if ((vsp_interface = g_SMAPI->GetVSPInfo(&vsp_version)) == NULL)
#endif #endif
{ {
@ -177,7 +177,7 @@ void SourceMod_Core::OnVSPListening(IServerPluginCallbacks *iface)
return; return;
} }
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
if (vsp_version == 0) if (vsp_version == 0)
{ {
g_SMAPI->GetVSPInfo(&vsp_version); g_SMAPI->GetVSPInfo(&vsp_version);
@ -205,11 +205,13 @@ void SourceMod_Core::OnVSPListening(IServerPluginCallbacks *iface)
} }
} }
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
void SourceMod_Core::OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand) void SourceMod_Core::OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand)
{ {
#if SOURCE_ENGINE < SE_ORANGEBOX
Global_OnUnlinkConCommandBase(pCommand); Global_OnUnlinkConCommandBase(pCommand);
#endif
} }
#else #else

View File

@ -32,7 +32,7 @@
#ifndef _INCLUDE_SOURCEMOD_MM_API_H_ #ifndef _INCLUDE_SOURCEMOD_MM_API_H_
#define _INCLUDE_SOURCEMOD_MM_API_H_ #define _INCLUDE_SOURCEMOD_MM_API_H_
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#include "convar_sm_l4d.h" #include "convar_sm_l4d.h"
#elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) #elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE)
#include "convar_sm_ob.h" #include "convar_sm_ob.h"
@ -76,7 +76,7 @@ public:
const char *GetLogTag(); const char *GetLogTag();
public: public:
void OnVSPListening(IServerPluginCallbacks *iface); void OnVSPListening(IServerPluginCallbacks *iface);
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
void OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand); void OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand);
#else #else
void OnPluginUnload(PluginId id); void OnPluginUnload(PluginId id);

View File

@ -7,7 +7,8 @@ HL2SDK_ORIG = ../../../hl2sdk
HL2SDK_OB = ../../../hl2sdk-ob HL2SDK_OB = ../../../hl2sdk-ob
HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve
HL2SDK_L4D = ../../../hl2sdk-l4d HL2SDK_L4D = ../../../hl2sdk-l4d
MMSOURCE17 = ../../../mmsource-1.7 HL2SDK_L4D2 = ../../../hl2sdk-l4d2
MMSOURCE17 = ../../../mmsource-central
##################################### #####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###
@ -79,16 +80,33 @@ ifeq "$(ENGINE)" "left4dead"
USEMETA = true USEMETA = true
CFLAGS += -DHOOKING_ENABLED CFLAGS += -DHOOKING_ENABLED
endif endif
ifeq "$(ENGINE)" "left4dead2"
HL2SDK = $(HL2SDK_L4D2)
HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=6
METAMOD = $(MMSOURCE17)/core
INCLUDE += -I$(HL2SDK)/public/game/server
SRCDS = $(SRCDS_BASE)/left4dead2_demo
GAMEFIX = 2.l4d2
override ENGSET = true
USEMETA = true
CFLAGS += -DHOOKING_ENABLED
endif
ifeq "$(USEMETA)" "true" ifeq "$(USEMETA)" "true"
ifeq "$(ENGINE)" "left4dead2"
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_linux.so tier0_linux.so
else
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
endif
LINK += $(LINK_HL2) LINK += $(LINK_HL2)
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \ INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn \ -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn \
-I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit -I$(SMSDK)/public/jit/x86 -I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit -I$(SMSDK)/public/jit/x86
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6
else else
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit \ INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit \
-I$(SMSDK)/public/jit/x86 -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/jit/x86 -I$(SMSDK)/public/sourcepawn
@ -142,8 +160,13 @@ $(BIN_DIR)/%.o: %.cpp
all: check all: check
mkdir -p $(BIN_DIR)/sdk mkdir -p $(BIN_DIR)/sdk
if [ "$(USEMETA)" = "true" ]; then \ if [ "$(USEMETA)" = "true" ]; then \
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \ if [ "$(ENGINE)" = "left4dead2" ]; then \
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \ ln -sf $(SRCDS)/bin/vstdlib_linux.so vstdlib_linux.so; \
ln -sf $(SRCDS)/bin/tier0_linux.so tier0_linux.so; \
else \
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
fi \
fi fi
$(MAKE) -f Makefile extension $(MAKE) -f Makefile extension

View File

@ -7,12 +7,14 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
Debug - Episode 1|Win32 = Debug - Episode 1|Win32 Debug - Episode 1|Win32 = Debug - Episode 1|Win32
Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32
Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32 Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32
Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
Release - Episode 1|Win32 = Release - Episode 1|Win32 Release - Episode 1|Win32 = Release - Episode 1|Win32
Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32
Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Old Metamod|Win32 = Release - Old Metamod|Win32 Release - Old Metamod|Win32 = Release - Old Metamod|Win32
Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32
@ -23,6 +25,8 @@ Global
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32
@ -35,6 +39,8 @@ Global
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32 {E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32

View File

@ -974,6 +974,164 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="Debug - Left 4 Dead 2|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\jit;..\..\..\public\jit\x86;..\..\..\public\extensions;..\..\..\public\sourcepawn;&quot;$(MMSOURCE18)\core&quot;;&quot;$(MMSOURCE18)\core\sourcehook&quot;;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BINTOOLS_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;HOOKING_ENABLED;SOURCE_ENGINE=6"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableEnhancedInstructionSet="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\..\public"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\mathlib.lib&quot;"
OutputFile="$(OutDir)\bintools.ext.2.l4d2.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Left 4 Dead 2|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\jit;..\..\..\public\jit\x86;..\..\..\public\extensions;..\..\..\public\sourcepawn;&quot;$(MMSOURCE18)\core&quot;;&quot;$(MMSOURCE18)\core\sourcehook&quot;;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BINTOOLS_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;HOOKING_ENABLED;SOURCE_ENGINE=6"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\mathlib.lib&quot;"
OutputFile="$(OutDir)\bintools.ext.2.l4d2.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>

View File

@ -444,5 +444,6 @@ sp_nativeinfo_t g_ClientPrefNatives[] =
{"ShowCookieMenu", ShowSettingsMenu}, {"ShowCookieMenu", ShowSettingsMenu},
{"SetCookieMenuItem", AddSettingsMenuItem}, {"SetCookieMenuItem", AddSettingsMenuItem},
{"SetCookiePrefabMenu", AddSettingsPrefabMenuItem}, {"SetCookiePrefabMenu", AddSettingsPrefabMenuItem},
{"GetClientCookieTime", GetClientCookieTime},
{NULL, NULL} {NULL, NULL}
}; };

View File

@ -376,17 +376,17 @@
# endif # endif
#endif #endif
/* VS2008 does not support Windows build targets prior to WinXP, */ /* VS2008 does not support Windows build targets prior to Windows 2000, */
/* so, if no build target has been defined we will target WinXP. */ /* so, if no build target has been defined we will target Windows 2000. */
#if defined(_MSC_VER) && (_MSC_VER >= 1500) #if defined(_MSC_VER) && (_MSC_VER >= 1500)
# ifndef _WIN32_WINNT # ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0501 # define _WIN32_WINNT 0x0500
# endif # endif
# ifndef WINVER # ifndef WINVER
# define WINVER 0x0501 # define WINVER 0x0500
# endif # endif
# if (_WIN32_WINNT < 0x0501) || (WINVER < 0x0501) # if (_WIN32_WINNT < 0x0500) || (WINVER < 0x0500)
# error VS2008 does not support Windows build targets prior to WinXP # error VS2008 does not support Windows build targets prior to Windows 2000
# endif # endif
#endif #endif

View File

@ -59,6 +59,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -139,6 +140,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -179,666 +181,6 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="Debug - Old Metamod|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="..;..\sdk;..\..;..\..\sourcepawn;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=2"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK)\lib\public\tier0.lib&quot; &quot;$(HL2SDK)\lib\public\tier1.lib&quot; &quot;$(HL2SDK)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample.ext.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Old Metamod|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP /D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..;..\sdk;..\..;..\..\sourcepawn;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(MMSOURCE17)\core-legacy&quot;;&quot;$(MMSOURCE17)\core-legacy\sourcehook&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=2"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK)\lib\public\tier0.lib&quot; &quot;$(HL2SDK)\lib\public\tier1.lib&quot; &quot;$(HL2SDK)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample.ext.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Orange Box|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="..;..\sdk;..\..;..\..\sourcepawn;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=3"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKOB)\lib\public\tier0.lib&quot; &quot;$(HL2SDKOB)\lib\public\tier1.lib&quot; &quot;$(HL2SDKOB)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample.ext.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Orange Box|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP /D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..;..\sdk;..\..;..\..\sourcepawn;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=3"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKOB)\lib\public\tier0.lib&quot; &quot;$(HL2SDKOB)\lib\public\tier1.lib&quot; &quot;$(HL2SDKOB)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample.ext.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Left 4 Dead|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="..;..\sdk;..\..;..\..\sourcepawn;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=4"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample.ext.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Left 4 Dead|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP /D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..;..\sdk;..\..;..\..\sourcepawn;&quot;$(HL2SDKL4D)\public&quot;;&quot;$(HL2SDKL4D)\public\engine&quot;;&quot;$(HL2SDKL4D)\public\game\server&quot;;&quot;$(HL2SDKL4D)\public\tier0&quot;;&quot;$(HL2SDKL4D)\public\tier1&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=4"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample.ext.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug - Episode 1|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
Optimization="0"
AdditionalIncludeDirectories="..;..\sdk;..\..;..\..\sourcepawn;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;;..\..\..\public;..\..\..\public\sourcepawn"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=2"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK)\lib\public\tier0.lib&quot; &quot;$(HL2SDK)\lib\public\tier1.lib&quot; &quot;$(HL2SDK)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample.ext.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Episode 1|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP /D SE_EPISODEONE=2 /D SE_ORANGEBOX=3 /D SE_LEFT4DEAD=4"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..;..\sdk;..\..;..\..\sourcepawn;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\dlls&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=2"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDK)\lib\public\tier0.lib&quot; &quot;$(HL2SDK)\lib\public\tier1.lib&quot; &quot;$(HL2SDK)\lib\public\vstdlib.lib&quot;"
OutputFile="$(OutDir)\sample.ext.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>

View File

@ -7,7 +7,8 @@ HL2SDK_ORIG = ../../../hl2sdk
HL2SDK_OB = ../../../hl2sdk-ob HL2SDK_OB = ../../../hl2sdk-ob
HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve
HL2SDK_L4D = ../../../hl2sdk-l4d HL2SDK_L4D = ../../../hl2sdk-l4d
MMSOURCE17 = ../../../mmsource-1.7 HL2SDK_L4D2 = ../../../hl2sdk-l4d2
MMSOURCE17 = ../../../mmsource-central
##################################### #####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###
@ -78,20 +79,31 @@ ifeq "$(ENGINE)" "left4dead"
GAMEFIX = 2.l4d GAMEFIX = 2.l4d
override ENGSET = true override ENGSET = true
endif endif
ifeq "$(ENGINE)" "left4dead2"
ifeq "$(USEMETA)" "true" HL2SDK = $(HL2SDK_L4D2)
LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so tier0_i486.so HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/lib/linux
LINK += $(LINK_HL2) CFLAGS += -DSOURCE_ENGINE=6
METAMOD = $(MMSOURCE17)/core
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/tier0 \ INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common -I$(HL2SDK)/game/shared
-I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/extensions \ SRCDS = $(SRCDS_BASE)/left4dead2_demo
-I$(SMSDK)/public/sourcepawn GAMEFIX = 2.l4d2
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 override ENGSET = true
else
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
endif endif
ifeq "$(ENGINE)" "left4dead2"
LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_linux.so tier0_linux.so
else
LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so tier0_i486.so
endif
LINK += $(LINK_HL2)
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/tier0 \
-I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/extensions \
-I$(SMSDK)/public/sourcepawn
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6
LINK += -m32 -ldl -lm LINK += -m32 -ldl -lm
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
@ -137,10 +149,13 @@ $(BIN_DIR)/%.o: %.cpp
all: check all: check
mkdir -p $(BIN_DIR)/sdk mkdir -p $(BIN_DIR)/sdk
if [ "$(USEMETA)" = "true" ]; then \ ifeq "$(ENGINE)" "left4dead2"
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \ ln -sf $(SRCDS)/bin/vstdlib_linux.so vstdlib_linux.so;
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \ ln -sf $(SRCDS)/bin/tier0_linux.so tier0_linux.so;
fi else
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so;
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so;
endif
$(MAKE) -f Makefile extension $(MAKE) -f Makefile extension
check: check:

View File

@ -337,50 +337,75 @@ bool SDKTools::LevelInit(char const *pMapName, char const *pMapEntities, char co
bool SDKTools::ProcessCommandTarget(cmd_target_info_t *info) bool SDKTools::ProcessCommandTarget(cmd_target_info_t *info)
{ {
if (strcmp(info->pattern, "@aim") != 0)
{
return false;
}
IGamePlayer *pAdmin = info->admin ? playerhelpers->GetGamePlayer(info->admin) : NULL; IGamePlayer *pAdmin = info->admin ? playerhelpers->GetGamePlayer(info->admin) : NULL;
/* The server can't aim, of course. */ if (strcmp(info->pattern, "@aim") == 0)
if (pAdmin == NULL)
{ {
return false; /* The server can't aim, of course. */
} if (pAdmin == NULL)
{
return false;
}
int player_index; int player_index;
if ((player_index = GetClientAimTarget(pAdmin->GetEdict(), true)) < 1) if ((player_index = GetClientAimTarget(pAdmin->GetEdict(), true)) < 1)
{
info->reason = COMMAND_TARGET_NONE;
info->num_targets = 0;
return true;
}
IGamePlayer *pTarget = playerhelpers->GetGamePlayer(player_index);
if (pTarget == NULL)
{
info->reason = COMMAND_TARGET_NONE;
info->num_targets = 0;
return true;
}
info->reason = playerhelpers->FilterCommandTarget(pAdmin, pTarget, info->flags);
if (info->reason != COMMAND_TARGET_VALID)
{
info->num_targets = 0;
return true;
}
info->targets[0] = player_index;
info->num_targets = 1;
info->reason = COMMAND_TARGET_VALID;
info->target_name_style = COMMAND_TARGETNAME_RAW;
snprintf(info->target_name, info->target_name_maxlength, "%s", pTarget->GetName());
return true;
}
else if (strcmp(info->pattern, "@spec") == 0)
{ {
info->reason = COMMAND_TARGET_NONE; const char *teamname = tools_GetTeamName(1);
if (strcasecmp(teamname, "spectator") != 0)
return false;
info->num_targets = 0; info->num_targets = 0;
for (int i = 1; i <= playerhelpers->GetMaxClients(); i++)
{
IGamePlayer *player = playerhelpers->GetGamePlayer(i);
if (player == NULL || !player->IsInGame())
continue;
IPlayerInfo *plinfo = player->GetPlayerInfo();
if (plinfo == NULL)
continue;
if (plinfo->GetTeamIndex() == 1 &&
playerhelpers->FilterCommandTarget(pAdmin, player, info->flags) ==
COMMAND_TARGET_VALID)
{
info->targets[info->num_targets++] = i;
}
}
info->reason = info->num_targets > 0 ? COMMAND_TARGET_VALID : COMMAND_TARGET_EMPTY_FILTER;
info->target_name_style = COMMAND_TARGETNAME_ML;
snprintf(info->target_name, info->target_name_maxlength, "all spectators");
return true; return true;
} }
IGamePlayer *pTarget = playerhelpers->GetGamePlayer(player_index); return false;
if (pTarget == NULL)
{
info->reason = COMMAND_TARGET_NONE;
info->num_targets = 0;
return true;
}
info->reason = playerhelpers->FilterCommandTarget(pAdmin, pTarget, info->flags);
if (info->reason != COMMAND_TARGET_VALID)
{
info->num_targets = 0;
return true;
}
info->targets[0] = player_index;
info->num_targets = 1;
info->reason = COMMAND_TARGET_VALID;
info->target_name_style = COMMAND_TARGETNAME_RAW;
snprintf(info->target_name, info->target_name_maxlength, "%s", pTarget->GetName());
return true;
} }
const char *SDKTools::GetExtensionVerString() const char *SDKTools::GetExtensionVerString()

View File

@ -128,6 +128,8 @@ extern ICallWrapper *g_pAcceptInput;
extern SourceHook::CallClass<IVEngineServer> *enginePatch; extern SourceHook::CallClass<IVEngineServer> *enginePatch;
extern SourceHook::CallClass<IEngineSound> *enginesoundPatch; extern SourceHook::CallClass<IEngineSound> *enginesoundPatch;
extern const char *tools_GetTeamName(int team);
#include <compat_wrappers.h> #include <compat_wrappers.h>
#define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func) #define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func)

View File

@ -33,6 +33,7 @@
#include "extension.h" #include "extension.h"
CHookManager g_Hooks; CHookManager g_Hooks;
static bool PRCH_enabled = false;
SH_DECL_MANUALHOOK2_void(PlayerRunCmdHook, 0, 0, 0, CUserCmd *, IMoveHelper *); SH_DECL_MANUALHOOK2_void(PlayerRunCmdHook, 0, 0, 0, CUserCmd *, IMoveHelper *);
@ -47,6 +48,7 @@ void CHookManager::Initialize()
if (g_pGameConf->GetOffset("PlayerRunCmd", &offset)) if (g_pGameConf->GetOffset("PlayerRunCmd", &offset))
{ {
SH_MANUALHOOK_RECONFIGURE(PlayerRunCmdHook, offset, 0, 0); SH_MANUALHOOK_RECONFIGURE(PlayerRunCmdHook, offset, 0, 0);
PRCH_enabled = true;
} }
m_usercmdsFwd = forwards->CreateForward("OnPlayerRunCmd", ET_Event, 6, NULL, Param_Cell, Param_CellByRef, Param_CellByRef, Param_Array, Param_Array, Param_CellByRef); m_usercmdsFwd = forwards->CreateForward("OnPlayerRunCmd", ET_Event, 6, NULL, Param_Cell, Param_CellByRef, Param_CellByRef, Param_Array, Param_Array, Param_CellByRef);
@ -59,6 +61,9 @@ void CHookManager::Shutdown()
void CHookManager::OnClientPutInServer(int client) void CHookManager::OnClientPutInServer(int client)
{ {
if (!PRCH_enabled)
return;
edict_t *pEdict = PEntityOfEntIndex(client); edict_t *pEdict = PEntityOfEntIndex(client);
if (!pEdict) if (!pEdict)
{ {
@ -82,6 +87,9 @@ void CHookManager::OnClientPutInServer(int client)
void CHookManager::OnClientDisconnecting(int client) void CHookManager::OnClientDisconnecting(int client)
{ {
if (!PRCH_enabled)
return;
edict_t *pEdict = PEntityOfEntIndex(client); edict_t *pEdict = PEntityOfEntIndex(client);
if (!pEdict) if (!pEdict)
{ {

View File

@ -7,12 +7,14 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32 Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
Debug - Episode 1|Win32 = Debug - Episode 1|Win32 Debug - Episode 1|Win32 = Debug - Episode 1|Win32
Debug - Left 4 Dead 2|Win32 = Debug - Left 4 Dead 2|Win32
Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32 Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32 Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32
Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32 Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32 Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32 Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
Release - Episode 1|Win32 = Release - Episode 1|Win32 Release - Episode 1|Win32 = Release - Episode 1|Win32
Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32
Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32 Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
Release - Old Metamod|Win32 = Release - Old Metamod|Win32 Release - Old Metamod|Win32 = Release - Old Metamod|Win32
Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32 Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32
@ -23,6 +25,8 @@ Global
{7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead 2|Win32.ActiveCfg = Debug - Left 4 Dead 2|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead 2|Win32.Build.0 = Debug - Left 4 Dead 2|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32
@ -35,6 +39,8 @@ Global
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32 {7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32

View File

@ -60,6 +60,7 @@
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;" PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -1007,6 +1008,172 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="Debug - Left 4 Dead 2|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_ORANGEBOXVALVE=4 /D SE_LEFT4DEAD=5 /D SE_LEFT4DEAD2=6"
Optimization="0"
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;&quot;$(HL2SDKL4D2)\common&quot;;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\engine&quot;;&quot;$(HL2SDKL4D2)\public\game\server&quot;;&quot;$(HL2SDKL4D2)\public\mathlib&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\game\shared&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;;&quot;$(MMSOURCE18)\core&quot;;&quot;$(MMSOURCE18)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=6"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\..\public"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\mathlib.lib&quot;"
OutputFile="$(OutDir)\sdktools.ext.2.l4d2.dll"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release - Left 4 Dead 2|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/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"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;&quot;$(HL2SDKL4D2)\common&quot;;&quot;$(HL2SDKL4D2)\public&quot;;&quot;$(HL2SDKL4D2)\public\engine&quot;;&quot;$(HL2SDKL4D2)\public\game\server&quot;;&quot;$(HL2SDKL4D2)\public\mathlib&quot;;&quot;$(HL2SDKL4D2)\public\tier0&quot;;&quot;$(HL2SDKL4D2)\public\tier1&quot;;&quot;$(MMSOURCE18)\core&quot;;&quot;$(MMSOURCE18)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;SOURCE_ENGINE=6"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&quot;$(HL2SDKL4D2)\lib\public\tier0.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\tier1.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKL4D2)\lib\public\mathlib.lib&quot;"
OutputFile="$(OutDir)\sdktools.ext.2.l4d2.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>

View File

@ -110,33 +110,39 @@ static cell_t GetTeamCount(IPluginContext *pContext, const cell_t *params)
} }
static int g_teamname_offset = -1; static int g_teamname_offset = -1;
const char *tools_GetTeamName(int team)
{
if (size_t(team) >= g_Teams.size())
return NULL;
if (g_teamname_offset == 0)
return NULL;
if (g_teamname_offset == -1)
{
SendProp *prop = g_pGameHelpers->FindInSendTable(g_Teams[team].ClassName, "m_szTeamname");
if (prop == NULL)
{
g_teamname_offset = 0;
return NULL;
}
g_teamname_offset = prop->GetOffset();
}
return (const char *)((unsigned char *)g_Teams[team].pEnt + g_teamname_offset);
}
static cell_t GetTeamName(IPluginContext *pContext, const cell_t *params) static cell_t GetTeamName(IPluginContext *pContext, const cell_t *params)
{ {
int teamindex = params[1]; int teamindex = params[1];
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName) if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
{
return pContext->ThrowNativeError("Team index %d is invalid", teamindex); return pContext->ThrowNativeError("Team index %d is invalid", teamindex);
}
if (g_teamname_offset == 0) if (g_teamname_offset == 0)
{
return pContext->ThrowNativeError("Team names are not available on this game."); return pContext->ThrowNativeError("Team names are not available on this game.");
}
if (g_teamname_offset == -1) const char *name = tools_GetTeamName(teamindex);
{ if (name == NULL)
SendProp *prop = g_pGameHelpers->FindInSendTable(g_Teams[teamindex].ClassName, "m_szTeamname"); return pContext->ThrowNativeError("Team names are not available on this game.");
if (prop == NULL)
{
g_teamname_offset = 0;
return pContext->ThrowNativeError("Team names are not available on this game.");
}
g_teamname_offset = prop->GetOffset();
}
char *name = (char *)((unsigned char *)g_Teams[teamindex].pEnt + g_teamname_offset);
pContext->StringToLocalUTF8(params[2], params[3], name, NULL); pContext->StringToLocalUTF8(params[2], params[3], name, NULL);

View File

@ -530,7 +530,7 @@ static cell_t smn_TRGetPointContents(IPluginContext *pContext, const cell_t *par
{ {
mask = enginetrace->GetPointContents(pos); mask = enginetrace->GetPointContents(pos);
} else { } else {
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
mask = enginetrace->GetPointContents(pos, 0, &hentity); mask = enginetrace->GetPointContents(pos, 0, &hentity);
#else #else
mask = enginetrace->GetPointContents(pos, &hentity); mask = enginetrace->GetPointContents(pos, &hentity);

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ============================================================================= * =============================================================================
* SourceMod SDKTools Extension * SourceMod SDKTools Extension
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
@ -25,8 +25,6 @@
* this exception to all derivative works. AlliedModders LLC defines further * this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>. * or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/ */
#include "extension.h" #include "extension.h"
@ -131,7 +129,11 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
{ {
return 0; return 0;
} }
#if SOURCE_ENGINE == SE_LEFT4DEAD2
s_call_addr = memutils->ResolveSymbol(handle, &sig[1]);
#else
s_call_addr = dlsym(handle, &sig[1]); s_call_addr = dlsym(handle, &sig[1]);
#endif
dlclose(handle); dlclose(handle);
return (s_call_addr != NULL) ? 1 : 0; return (s_call_addr != NULL) ? 1 : 0;

View File

@ -126,7 +126,7 @@ void GetIServer()
int offset; int offset;
void *vfunc = NULL; void *vfunc = NULL;
#if defined METAMOD_PLAPI_VERSION #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
/* Get the CreateFakeClient function pointer */ /* Get the CreateFakeClient function pointer */
if (!(vfunc=SH_GET_ORIG_VFNPTR_ENTRY(engine, &IVEngineServer::CreateFakeClient))) if (!(vfunc=SH_GET_ORIG_VFNPTR_ENTRY(engine, &IVEngineServer::CreateFakeClient)))
{ {

View File

@ -657,7 +657,7 @@ static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *para
return gamehelpers->EntityToBCompatRef(pEntity); return gamehelpers->EntityToBCompatRef(pEntity);
} }
#if SOURCE_ENGINE == SE_LEFT4DEAD #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params) static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params)
{ {
static ValveCall *pCall = NULL; static ValveCall *pCall = NULL;
@ -713,6 +713,34 @@ static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params)
} }
#endif #endif
#if SOURCE_ENGINE == SE_LEFT4DEAD2
static cell_t DispatchSpawn(IPluginContext *pContext, const cell_t *params)
{
static ValveCall *pCall = NULL;
if (!pCall)
{
ValvePassInfo pass[3];
InitPass(pass[0], Valve_CBaseEntity, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[1], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[2], Valve_POD, PassType_Basic, PASSFLAG_BYVAL);
if (!CreateBaseCall("DispatchSpawn", ValveCall_Static, &pass[2], pass, 2, &pCall))
{
return pContext->ThrowNativeError("\"DispatchSpawn\" not supported by this mod");
} else if (!pCall) {
return pContext->ThrowNativeError("\"DispatchSpawn\" wrapper failed to initialize");
}
}
int ret;
START_CALL();
DECODE_VALVE_PARAM(1, vparams, 0);
/* All X-refs to DispatchSpawn I checked use true - Unsure of what it does */
*(bool *)(vptr + 4) = true;
FINISH_CALL_SIMPLE(&ret);
return (ret == -1) ? 0 : 1;
}
#else
static cell_t DispatchSpawn(IPluginContext *pContext, const cell_t *params) static cell_t DispatchSpawn(IPluginContext *pContext, const cell_t *params)
{ {
static ValveCall *pCall = NULL; static ValveCall *pCall = NULL;
@ -736,6 +764,7 @@ static cell_t DispatchSpawn(IPluginContext *pContext, const cell_t *params)
return (ret == -1) ? 0 : 1; return (ret == -1) ? 0 : 1;
} }
#endif
static cell_t DispatchKeyValue(IPluginContext *pContext, const cell_t *params) static cell_t DispatchKeyValue(IPluginContext *pContext, const cell_t *params)
{ {

View File

@ -89,6 +89,7 @@
"engine" "orangebox" "engine" "orangebox"
"engine" "orangebox_valve" "engine" "orangebox_valve"
"engine" "left4dead" "engine" "left4dead"
"engine" "left4dead2"
} }
"Offsets" "Offsets"
@ -128,9 +129,13 @@
"game" "diprip" "game" "diprip"
"game" "synergy" "game" "synergy"
"game" "left4dead" "game" "left4dead"
"game" "left4dead2"
"game" "obsidian" "game" "obsidian"
"game" "empires" "game" "empires"
"game" "gesource" "game" "gesource"
"game" "NeotokyoSource"
"game" "bg2"
"game" "cspromod"
} }
"Keys" "Keys"
@ -148,6 +153,9 @@
"game" "synergy" "game" "synergy"
"game" "dod" "game" "dod"
"game" "empires" "game" "empires"
"game" "NeotokyoSource"
"game" "bg2"
"game" "cspromod"
} }
"Keys" "Keys"
@ -168,6 +176,10 @@
"game" "tf" "game" "tf"
"game" "ageofchivalry" "game" "ageofchivalry"
"game" "obsidian" "game" "obsidian"
"game" "zombie_master"
"game" "bg2"
"game" "insurgency"
"game" "cspromod"
} }
"Keys" "Keys"

View File

@ -17,7 +17,6 @@
"#supported" "#supported"
{ {
"game" "cstrike" "game" "cstrike"
"game" "garrysmod"
"game" "hl2mp" "game" "hl2mp"
"game" "ship" "game" "ship"
"game" "insurgency" "game" "insurgency"
@ -28,6 +27,8 @@
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
"game" "zombie_master" "game" "zombie_master"
"game" "NeotokyoSource"
"game" "cspromod"
} }
"Offsets" "Offsets"

View File

@ -18,6 +18,8 @@
{ {
"game" "ageofchivalry" "game" "ageofchivalry"
"game" "zps" "game" "zps"
"game" "bg2"
"game" "garrysmod"
} }
"Offsets" "Offsets"

View File

@ -0,0 +1,51 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* To override data in this file, create a subdirectory named "custom" and
* place your own gamedata file(s) inside of it. Such files will be parsed
* after SM's own.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
/* CGlobalEntityList */
"#default"
{
"#supported"
{
"game" "left4dead2"
}
"Offsets"
{
/* Offset into LevelShutdown */
"gEntList"
{
"windows" "11"
}
"EntInfo"
{
"windows" "4"
"linux" "4"
}
}
"Signatures"
{
"LevelShutdown"
{
"library" "server"
"windows" "\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8"
}
"gEntList"
{
"library" "server"
"linux" "@gEntList"
}
}
}
}

View File

@ -20,6 +20,11 @@
"engine" "left4dead" "engine" "left4dead"
} }
"engine.l4d2.txt"
{
"engine" "left4dead2"
}
"engine.ep2.txt" "engine.ep2.txt"
{ {
"engine" "orangebox" "engine" "orangebox"

View File

@ -27,6 +27,8 @@
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
"game" "zombie_master" "game" "zombie_master"
"game" "NeotokyoSource"
"game" "cspromod"
} }
"Offsets" "Offsets"
@ -78,12 +80,12 @@
"game" "hl2mp" "game" "hl2mp"
"game" "ship" "game" "ship"
"game" "!Dystopia" "game" "!Dystopia"
"game" "insurgency"
"game" "pvkii" "game" "pvkii"
"game" "sourceforts" "game" "sourceforts"
"game" "FortressForever" "game" "FortressForever"
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
"game" "NeotokyoSource"
} }
"Offsets" "Offsets"
@ -134,6 +136,7 @@
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
"game" "zombie_master" "game" "zombie_master"
"game" "NeotokyoSource"
} }
"Signatures" "Signatures"
@ -155,12 +158,12 @@
{ {
"game" "cstrike" "game" "cstrike"
"game" "hl2mp" "game" "hl2mp"
"game" "insurgency"
"game" "pvkii" "game" "pvkii"
"game" "sourceforts" "game" "sourceforts"
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
"game" "FortressForever" "game" "FortressForever"
"game" "NeotokyoSource"
} }
"Signatures" "Signatures"
@ -236,6 +239,7 @@
{ {
"game" "cstrike" "game" "cstrike"
"game" "hl2mp" "game" "hl2mp"
"game" "NeotokyoSource"
} }
"Signatures" "Signatures"
{ {

View File

@ -20,6 +20,8 @@
"game" "zps" "game" "zps"
"game" "empires" "game" "empires"
"game" "synergy" "game" "synergy"
"game" "bg2"
"game" "garrysmod"
} }
"Offsets" "Offsets"
@ -96,7 +98,6 @@
"game" "ageofchivalry" "game" "ageofchivalry"
"game" "zps" "game" "zps"
"game" "empires" "game" "empires"
"game" "synergy"
} }
"Signatures" "Signatures"
@ -120,6 +121,8 @@
"game" "zps" "game" "zps"
"game" "empires" "game" "empires"
"game" "synergy" "game" "synergy"
"game" "bg2"
"game" "garrysmod"
} }
"Offsets" "Offsets"

View File

@ -0,0 +1,358 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* To override data in this file, create a subdirectory named "custom" and
* place your own gamedata file(s) inside of it. Such files will be parsed
* after SM's own.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
/* Sounds */
"#default"
{
"Keys"
{
"SlapSoundCount" "2"
"SlapSound1" "player/damage1.wav"
"SlapSound2" "player/damage2.wav"
}
}
/* General Temp Entities */
"#default"
{
"#supported"
{
"game" "left4dead2"
}
"Offsets"
{
/* Offset into CBaseTempEntity constructor */
"s_pTempEntities"
{
"windows" "17"
}
"GetTEName"
{
"windows" "4"
"linux" "4"
}
"GetTENext"
{
"windows" "8"
"linux" "8"
}
"TE_GetServerClass"
{
"windows" "0"
"linux" "0"
}
}
"Signatures"
{
"CBaseTempEntity"
{
"library" "server"
"windows" "\x8B\xC1\x8B\x4C\x24\x04\xC7\x00\x2A\x2A\x2A\x2A\x89\x48\x04\x8B\x15\x2A\x2A\x2A\x2A\x89\x50\x08\xA3\x2A\x2A\x2A\x2A\xC2\x04\x00"
}
"s_pTempEntities"
{
"library" "server"
"linux" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
}
}
}
/* Create Entity Signatures */
"#default"
{
"#supported"
{
"game" "left4dead2"
}
"Signatures"
{
"DispatchSpawn"
{
"library" "server"
"linux" "@_Z13DispatchSpawnP11CBaseEntityb"
"windows" "\x53\x55\x56\x8B\x74\x24\x10\x85\xF6\x57\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\x50\x2A\x8B\xCB"
}
"CreateEntityByName"
{
"library" "server"
"linux" "@_Z18CreateEntityByNamePKcib"
"windows" "\x56\x8B\x74\x24\x0C\x83\xFE\xFF\x57\x8B\x7C\x24\x0C\x74\x27\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B\x50\x2A\x56\xFF\xD2"
}
}
}
/* CGlobalEntityList */
"#default"
{
"#supported"
{
"game" "left4dead2"
}
"Signatures"
{
/* Functions in CGlobalEntityList */
"FindEntityByClassname"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x19\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x83\xC0\x01\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x39\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\xEB\x03"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
}
}
/* General GameRules */
"#default"
{
"#supported"
{
"game" "left4dead2"
}
"Offsets"
{
/* Offset into CreateGameRulesObject */
"g_pGameRules"
{
"windows" "2"
}
}
"Signatures"
{
/* This signature sometimes has multiple matches, but this
* does not matter as g_pGameRules is involved in all of them.
* The same g_pGameRules offset applies to each match.
*
* Sometimes this block of bytes is at the beginning of the static
* CreateGameRulesObject function and sometimes it is in the middle
* of an entirely different function. This depends on the game.
*/
"CreateGameRulesObject"
{
"library" "server"
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
}
"g_pGameRules"
{
"library" "server"
"linux" "@g_pGameRules"
}
}
}
/* IServer interface pointer */
"#default"
{
"Keys"
{
/* Signature for the beginning of IVEngineServer::CreateFakeClient.
*
* The engine binary is not actually scanned in order to look for
* this. SourceHook is used to used to determine the address of the
* function and this signature is used to verify that it contains
* the expected code. A pointer to sv (IServer interface) is used
* here.
*/
"CreateFakeClient_Windows" "\x8B\x44\x24\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8"
}
"Offsets"
{
/* Offset into IVEngineServer::CreateFakeClient */
"sv"
{
"windows" "6"
}
}
"Signatures"
{
/* CBaseServer object for IServer interface */
"sv"
{
"library" "engine"
"linux" "@sv"
}
}
}
/* EntityFactoryDictionary function */
"#default"
{
"Signatures"
{
"EntityFactory"
{
"library" "server"
"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"
"linux" "@_Z23EntityFactoryDictionaryv"
}
}
}
/* CBaseEntityOutput::FireOutput */
"#default"
{
"#supported"
{
"game" "left4dead2"
}
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x1C\x01\x00\x00\x53\x55\x56\x8B\x71\x14\x85\xF6"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
"Offsets"
{
"FireOutputBackup"
{
"windows" "6"
"linux" "10"
}
}
}
/* SetUserInfo data */
"#default"
{
"Offsets"
{
/**
* CBaseClient::SetUserCVar(char const*,char const*);
* Linux offset straight from VTable dump.
* Windows offset is crazy. Found the windows SetName function using string "(%d)%-.*s" (aD_S in IDA)
* Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
*/
"SetUserCvar"
{
/* Not 100% sure on this, why would windows change and not linux - TEST ME */
"windows" "18"
"linux" "63"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
* Linux: mov byte ptr [esi+0B0h], 0
* Win: mov byte ptr [esi+0B0h], 0
*
* L4D2: This has been moved into CBaseClient::UpdateUserSettings(), rest of the details are still relevant.
*/
"InfoChanged"
{
"windows" "176"
"linux" "176"
}
}
}
/* Left 4 Dead */
"left4dead2"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "505"
"linux" "506"
}
"RemovePlayerItem"
{
"windows" "288"
"linux" "289"
}
"Weapon_GetSlot"
{
"windows" "286"
"linux" "287"
}
"Ignite"
{
"windows" "221"
"linux" "222"
}
"Extinguish"
{
"windows" "224"
"linux" "225"
}
"Teleport"
{
"windows" "117"
"linux" "118"
}
"CommitSuicide"
{
"windows" "473"
"linux" "473"
}
"GetVelocity"
{
"windows" "149"
"linux" "150"
}
"EyeAngles"
{
"windows" "140"
"linux" "141"
}
"AcceptInput"
{
"windows" "43"
"linux" "44"
}
"DispatchKeyValue"
{
"windows" "33"
"linux" "32"
}
"DispatchKeyValueFloat"
{
"windows" "32"
"linux" "33"
}
"DispatchKeyValueVector"
{
"windows" "31"
"linux" "34"
}
"SetEntityModel"
{
"windows" "26"
"linux" "27"
}
"WeaponEquip"
{
"windows" "279"
"linux" "280"
}
"Activate"
{
"windows" "35"
"linux" "36"
}
"PlayerRunCmd"
{
"windows" "451"
"linux" "452"
}
}
}
}

View File

@ -0,0 +1,138 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* To override data in this file, create a subdirectory named "custom" and
* place your own gamedata file(s) inside of it. Such files will be parsed
* after SM's own.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
/* Battleground 2 1.5a */
"bg2"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "342"
"linux" "343"
}
"RemovePlayerItem"
{
"windows" "236"
"linux" "237"
}
"Weapon_GetSlot"
{
"windows" "234"
"linux" "235"
}
"Ignite"
{
"windows" "191"
"linux" "192"
}
"Extinguish"
{
"windows" "195"
"linux" "196"
}
"Teleport"
{
"windows" "99"
"linux" "100"
}
"CommitSuicide"
{
"windows" "379"
"linux" "379"
}
"GetVelocity"
{
"windows" "128"
"linux" "129"
}
"EyeAngles"
{
"windows" "120"
"linux" "121"
}
"AcceptInput"
{
"windows" "34"
"linux" "35"
}
"DispatchKeyValue"
{
"windows" "29"
"linux" "28"
}
"DispatchKeyValueFloat"
{
"windows" "28"
"linux" "29"
}
"DispatchKeyValueVector"
{
"windows" "27"
"linux" "30"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
}
"WeaponEquip"
{
"windows" "227"
"linux" "228"
}
"Activate"
{
"windows" "31"
"linux" "32"
}
"PlayerRunCmd"
{
"windows" "360"
"linux" "361"
}
"FireOutputBackup"
{
"windows" "6"
"linux" "10"
}
}
"Signatures"
{
"DispatchSpawn"
{
"library" "server"
"linux" "@_Z13DispatchSpawnP11CBaseEntity"
"windows" "\x53\x55\x56\x8B\x74\x24\x10\x57\x85\xF6\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\x50\x64\x8B\xCB"
}
"CreateEntityByName"
{
"library" "server"
"linux" "@_Z18CreateEntityByNamePKci"
"windows" "\x56\x8B\x74\x24\x0C\x57\x8B\x7C\x24\x0C\x83\xFE\xFF\x74\x27\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B\x50\x54\x56\xFF\xD2"
}
"FindEntityByClassname"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x3B\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\x8D\xA4"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x20\x1C\x00\x00\x53\x55\x56\x8B\x71\x14\x57\x89"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
}
}

View File

@ -0,0 +1,127 @@
"Games"
{
/* CSpromod 1.04 */
"cspromod"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "330"
"linux" "331"
}
"RemovePlayerItem"
{
"windows" "226"
"linux" "227"
}
"Weapon_GetSlot"
{
"windows" "224"
"linux" "225"
}
"Ignite"
{
"windows" "188"
"linux" "189"
}
"Extinguish"
{
"windows" "189"
"linux" "190"
}
"Teleport"
{
"windows" "98"
"linux" "99"
}
"CommitSuicide"
{
"windows" "358"
"linux" "359"
}
"GetVelocity"
{
"windows" "126"
"linux" "127"
}
"EyeAngles"
{
"windows" "118"
"linux" "119"
}
"AcceptInput"
{
"windows" "35"
"linux" "36"
}
"DispatchKeyValue"
{
"windows" "31"
"linux" "30"
}
"DispatchKeyValueFloat"
{
"windows" "30"
"linux" "31"
}
"DispatchKeyValueVector"
{
"windows" "29"
"linux" "32"
}
"SetEntityModel"
{
"windows" "25"
"linux" "26"
}
"WeaponEquip"
{
"windows" "217"
"linux" "218"
}
"Activate"
{
"windows" "32"
"linux" "33"
}
"PlayerRunCmd"
{
"windows" "348"
"linux" "349"
}
"FireOutputBackup"
{
"windows" "6"
"linux" "6"
}
}
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x2A\x2A\x2A\x2A\x53\x55\x56\x8B\x71\x2A\x85\xF6"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
"DispatchSpawn"
{
"library" "server"
"linux" "@_Z13DispatchSpawnP11CBaseEntity"
"windows" "\x53\x55\x56\x8B\x74\x2A\x2A\x85\xF6\x57\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\x2A\x2A\x8B\xCB\xFF"
}
"CreateEntityByName"
{
"library" "server"
"linux" "@_Z18CreateEntityByNamePKci"
"windows" "\x56\x8B\x74\x2A\x2A\x83\xFE\xFF\x57\x8B\x7C\x2A\x2A\x74\x2A\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B\x2A\x2A\x56\xFF\xD2"
}
"FindEntityByClassname"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x2A\x85\xC9\x57\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\xFF\x2A\x2A\x2A\x83\xC0\x2A\xC1\xE0\x2A\x8B\x3C\x30\xEB\x2A\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x2A\x8B\x5C\x2A\x2A\x8B\x2D\x2A\x2A\x2A\x2A\xEB\x2A\x8D\x2A\x2A\x8B\x37\x85\xF6\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\x2A\x83\xC4\x2A\xEB\x11\x39"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
}
}
}

View File

@ -18,28 +18,28 @@
{ {
"GiveNamedItem" "GiveNamedItem"
{ {
"windows" "357" "windows" "385"
"linux" "358" "linux" "386"
} }
"RemovePlayerItem" "RemovePlayerItem"
{ {
"windows" "244" "windows" "258"
"linux" "245" "linux" "259"
} }
"Weapon_GetSlot" "Weapon_GetSlot"
{ {
"windows" "242" "windows" "256"
"linux" "243" "linux" "257"
} }
"Ignite" "Ignite"
{ {
"windows" "199" "windows" "201"
"linux" "200" "linux" "202"
} }
"Extinguish" "Extinguish"
{ {
"windows" "203" "windows" "205"
"linux" "204" "linux" "206"
} }
"Teleport" "Teleport"
{ {
@ -48,8 +48,8 @@
} }
"CommitSuicide" "CommitSuicide"
{ {
"windows" "396" "windows" "422"
"linux" "396" "linux" "423"
} }
"GetVelocity" "GetVelocity"
{ {
@ -88,14 +88,19 @@
} }
"WeaponEquip" "WeaponEquip"
{ {
"windows" "235" "windows" "249"
"linux" "236" "linux" "250"
} }
"Activate" "Activate"
{ {
"windows" "31" "windows" "31"
"linux" "32" "linux" "32"
} }
"PlayerRunCmd"
{
"windows" "403"
"linux" "404"
}
} }
} }
} }

View File

@ -12,9 +12,7 @@
"Games" "Games"
{ {
/* Garry's Mod 10 - Windows only /* Garry's Mod 10 - Windows only
* This mod is not officially supported, and the definitions are * This mod is not officially supported
* for Garry's Mod pre-Orange Box.
* (credits: Damaged Soul)
*/ */
"garrysmod" "garrysmod"
{ {
@ -22,55 +20,98 @@
{ {
"GiveNamedItem" "GiveNamedItem"
{ {
"windows" "366" "windows" "391"
} }
"RemovePlayerItem" "RemovePlayerItem"
{ {
"windows" "264" "windows" "279"
} }
"Weapon_GetSlot" "Weapon_GetSlot"
{ {
"windows" "262" "windows" "277"
} }
"Ignite" "Ignite"
{ {
"windows" "220" "windows" "228"
} }
"Extinguish" "Extinguish"
{ {
"windows" "221" "windows" "232"
} }
"Teleport" "Teleport"
{ {
"windows" "99" "windows" "101"
} }
"CommitSuicide" "CommitSuicide"
{ {
"windows" "394" "windows" "429"
} }
"GetVelocity" "GetVelocity"
{ {
"windows" "127" "windows" "131"
} }
"EyeAngles" "EyeAngles"
{ {
"windows" "119" "windows" "123"
} }
"AcceptInput" "AcceptInput"
{ {
"windows" "35" "windows" "34"
} }
"DispatchKeyValue" "DispatchKeyValue"
{ {
"windows" "31" "windows" "29"
} }
"DispatchKeyValueFloat" "DispatchKeyValueFloat"
{ {
"windows" "30" "windows" "28"
} }
"DispatchKeyValueVector" "DispatchKeyValueVector"
{ {
"windows" "29" "windows" "27"
}
"SetEntityModel"
{
"windows" "23"
}
"WeaponEquip"
{
"windows" "270"
}
"Activate"
{
"windows" "31"
}
"PlayerRunCmd"
{
"windows" "409"
}
"FireOutputBackup"
{
"windows" "6"
}
}
"Signatures"
{
"DispatchSpawn"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\x74\x24\x10\x57\x85\xF6\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\x50\x64\x8B\xCB"
}
"CreateEntityByName"
{
"library" "server"
"windows" "\x56\x8B\x74\x24\x0C\x57\x8B\x7C\x24\x0C\x83\xFE\xFF\x74\x27\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B\x50\x54\x56\xFF\xD2"
}
"FindEntityByClassname"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x2A\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\x8D\xA4\x24\x00\x00\x00\x00\x8B\x37\x85\xF6\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\x2A\x83\xC4\x04\xEB\x2A\x39\x2A\x2A\x74\x2A\x53"
}
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x2A\x2A\x2A\x2A\x53\x55\x56\x8B\x71\x2A\x57\x89"
} }
} }
} }

View File

@ -82,15 +82,52 @@
"windows" "288" "windows" "288"
"linux" "289" "linux" "289"
} }
"g_pGameRules"
{
"windows" "2"
}
} }
"Signatures" "Signatures"
{ {
"Offsets"
{
/* Offset into CreateGameRulesObject */
"g_pGameRules"
{
"windows" "2"
}
}
"Signatures"
{
"CreateGameRulesObject"
{
"library" "server"
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x6A\x01\xFF\x50"
}
"g_pGameRules"
{
"library" "server"
"linux" "@g_pGameRules"
}
"FireOutput" "FireOutput"
{ {
"library" "server" "library" "server"
"windows" "\x81\xEC\x20\x01\x00\x00\x53\x55\x56\x8B\x71\x14" "windows" "\x81\xEC\x2A\x01\x00\x00\x53\x55\x56\x8B\x71\x14"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" "linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
} }
"DispatchSpawn"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\x74\x24\x10\x57\x85\xF6\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\x50\x60"
"linux" "@_Z13DispatchSpawnP11CBaseEntity"
}
"CreateEntityByName"
{
"library" "server"
"windows" "\x56\x8B\x74\x24\x0C\x57\x8B\x7C\x24\x0C\x83\x2A\x2A\x74\x27\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B\x2A\x2A\x56\xFF\xD2\xA3\xCC"
"linux" "@_Z18CreateEntityByNamePKci"
}
} }
} }
} }

View File

@ -0,0 +1,85 @@
"Games"
{
"NeotokyoSource"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "330"
}
"RemovePlayerItem"
{
"windows" "227"
}
"Weapon_GetSlot"
{
"windows" "225"
}
"Ignite"
{
"windows" "189"
}
"Extinguish"
{
"windows" "190"
}
"Teleport"
{
"windows" "99"
}
"CommitSuicide"
{
"windows" "360"
}
"GetVelocity"
{
"windows" "127"
}
"EyeAngles"
{
"windows" "119"
}
"AcceptInput"
{
"windows" "35"
}
"DispatchKeyValue"
{
"windows" "31"
}
"DispatchKeyValueFloat"
{
"windows" "30"
}
"DispatchKeyValueVector"
{
"windows" "29"
}
"SetEntityModel"
{
"windows" "25"
}
"WeaponEquip"
{
"windows" "218"
}
"Activate"
{
"windows" "32"
}
"PlayerRunCmd"
{
"windows" "348"
}
}
"Signatures"
{
"LevelShutdown"
{
"library" "server"
"windows" "\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x6A\x00"
}
}
}
}

View File

@ -11,7 +11,7 @@
"Games" "Games"
{ {
/* Synergy Release 11 */ /* Synergy Release 14 */
"synergy" "synergy"
{ {
"Offsets" "Offsets"
@ -19,28 +19,28 @@
/* CBasePlayer */ /* CBasePlayer */
"GiveNamedItem" "GiveNamedItem"
{ {
"windows" "354" "windows" "355"
"linux" "355" "linux" "356"
} }
"RemovePlayerItem" "RemovePlayerItem"
{ {
"windows" "237" "windows" "238"
"linux" "238" "linux" "239"
} }
"Weapon_GetSlot" "Weapon_GetSlot"
{ {
"windows" "235" "windows" "236"
"linux" "236" "linux" "237"
} }
"Ignite" "Ignite"
{ {
"windows" "192" "windows" "193"
"linux" "193" "linux" "194"
} }
"Extinguish" "Extinguish"
{ {
"windows" "196" "windows" "197"
"linux" "197" "linux" "198"
} }
"Teleport" "Teleport"
{ {
@ -49,18 +49,18 @@
} }
"CommitSuicide" "CommitSuicide"
{ {
"windows" "392" "windows" "396"
"linux" "392" "linux" "396"
} }
"GetVelocity" "GetVelocity"
{ {
"windows" "129" "windows" "130"
"linux" "130" "linux" "131"
} }
"EyeAngles" "EyeAngles"
{ {
"windows" "121" "windows" "122"
"linux" "122" "linux" "123"
} }
"DispatchKeyValue" "DispatchKeyValue"
{ {
@ -89,14 +89,56 @@
} }
"WeaponEquip" "WeaponEquip"
{ {
"windows" "228" "windows" "229"
"linux" "229" "linux" "230"
} }
"Activate" "Activate"
{ {
"windows" "31" "windows" "31"
"linux" "32" "linux" "32"
} }
"RemoveAllItems"
{
"windows" "303"
"linux" "304"
}
"PlayerRunCmd"
{
"windows" "375"
"linux" "376"
}
"FireOutputBackup"
{
"windows" "6"
"linux" "10"
}
}
"Signatures"
{
"FindEntityByClassname"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x2A\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\x8D\xA4\x24\x00\x00\x00\x00\x8B\x37\x85\xF6\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\x2A\x83\xC4\x04\xEB\x2A\x39\x2A\x2A\x74\x2A\x53"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
"DispatchSpawn"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\x74\x24\x10\x57\x85\xF6\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\x50\x64\x8B\xCB"
"linux" "@_Z13DispatchSpawnP11CBaseEntity"
}
"CreateEntityByName"
{
"library" "server"
"windows" "\x56\x8B\x74\x24\x0C\x57\x8B\x7C\x24\x0C\x83\xFE\xFF\x74\x27\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B\x50\x54\x56\xFF\xD2"
"linux" "@_Z18CreateEntityByNamePKci"
}
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x2A\x2A\x2A\x2A\x53\x55\x56\x8B\x71\x2A\x57\x89"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
} }
} }
} }

View File

@ -18,28 +18,28 @@
{ {
"GiveNamedItem" "GiveNamedItem"
{ {
"windows" "423" "windows" "385"
"linux" "427" "linux" "386"
} }
"RemovePlayerItem" "RemovePlayerItem"
{ {
"windows" "244" "windows" "259"
"linux" "245" "linux" "259"
} }
"Weapon_GetSlot" "Weapon_GetSlot"
{ {
"windows" "242" "windows" "256"
"linux" "243" "linux" "257"
} }
"Ignite" "Ignite"
{ {
"windows" "199" "windows" "201"
"linux" "200" "linux" "202"
} }
"Extinguish" "Extinguish"
{ {
"windows" "203" "windows" "205"
"linux" "204" "linux" "206"
} }
"Teleport" "Teleport"
{ {
@ -48,8 +48,8 @@
} }
"CommitSuicide" "CommitSuicide"
{ {
"windows" "397" "windows" "425"
"linux" "397" "linux" "425"
} }
"GetVelocity" "GetVelocity"
{ {
@ -88,8 +88,8 @@
} }
"WeaponEquip" "WeaponEquip"
{ {
"windows" "234" "windows" "249"
"linux" "235" "linux" "250"
} }
"Activate" "Activate"
{ {
@ -98,8 +98,8 @@
} }
"PlayerRunCmd" "PlayerRunCmd"
{ {
"windows" "375" "windows" "403"
"linux" "376" "linux" "404"
} }
} }
} }

View File

@ -20,6 +20,11 @@
"engine" "left4dead" "engine" "left4dead"
} }
"engine.l4d2.txt"
{
"engine" "left4dead2"
}
"engine.ep2.txt" "engine.ep2.txt"
{ {
"engine" "orangebox" "engine" "orangebox"
@ -87,7 +92,6 @@
"game.garrysmod.txt" "game.garrysmod.txt"
{ {
"engine" "original"
"game" "garrysmod" "game" "garrysmod"
} }
@ -130,4 +134,12 @@
{ {
"game" "ageofchivalry" "game" "ageofchivalry"
} }
"game.neotokyo.txt"
{
"game" "NeotokyoSource"
}
"game.bg2.txt"
{
"game" "bg2"
}
} }

View File

@ -24,7 +24,7 @@
"RemoveDisguise" "RemoveDisguise"
{ {
"library" "server" "library" "server"
"windows" "\x51\x56\x8B\xF1\x8B\x8E\x0C\x01\x00\x00\x57\x8B\xBE\x94\x00\x00\x00" "windows" "\x51\x56\x8B\xF1\x8B\x2A\x2A\x2A\x2A\x2A\x57\x8B\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x3B\xF8"
"linux" "@_ZN15CTFPlayerShared14RemoveDisguiseEv" "linux" "@_ZN15CTFPlayerShared14RemoveDisguiseEv"
} }
"Disguise" "Disguise"
@ -56,8 +56,8 @@
{ {
"ForceRespawn" "ForceRespawn"
{ {
"windows" "288" "windows" "312"
"linux" "289" "linux" "313"
} }
} }
} }

View File

@ -1,7 +1,7 @@
# (C)2004-2008 SourceMod Development Team # (C)2004-2008 SourceMod Development Team
# Makefile written by David "BAILOPAN" Anderson # Makefile written by David "BAILOPAN" Anderson
MMSOURCE17 = ../../mmsource-1.7 MMSOURCE17 = ../../mmsource-central
##################################### #####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###

View File

@ -1,8 +1,8 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 sw=4 tw=99 noet :
* ============================================================================= * =============================================================================
* SourceMod * SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
@ -25,8 +25,6 @@
* this exception to all derivative works. AlliedModders LLC defines further * this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>. * or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/ */
#include <ISmmPluginExt.h> #include <ISmmPluginExt.h>
@ -48,8 +46,6 @@
return (c == '/' || c == '\\'); return (c == '/' || c == '\\');
} }
#include <Windows.h> #include <Windows.h>
#define TF_PATH "\\tf\\"
#define DOD_PATH "\\dod\\"
#else #else
#define DLL_EXPORT extern "C" __attribute__((visibility("default"))) #define DLL_EXPORT extern "C" __attribute__((visibility("default")))
#define openlib(lib) dlopen(lib, RTLD_NOW) #define openlib(lib) dlopen(lib, RTLD_NOW)
@ -63,8 +59,6 @@
return (c == '/'); return (c == '/');
} }
#include <dlfcn.h> #include <dlfcn.h>
#define TF_PATH "/tf/"
#define DOD_PATH "/dod/"
#endif #endif
#define METAMOD_API_MAJOR 2 #define METAMOD_API_MAJOR 2
@ -74,6 +68,7 @@
#define FILENAME_1_6_EP1 "sourcemod.2.ep1" PLATFORM_EXT #define FILENAME_1_6_EP1 "sourcemod.2.ep1" PLATFORM_EXT
#define FILENAME_1_6_L4D "sourcemod.2.l4d" PLATFORM_EXT #define FILENAME_1_6_L4D "sourcemod.2.l4d" PLATFORM_EXT
#define FILENAME_1_6_DARKM "sourcemod.2.darkm" PLATFORM_EXT #define FILENAME_1_6_DARKM "sourcemod.2.darkm" PLATFORM_EXT
#define FILENAME_1_6_L4D2 "sourcemod.2.l4d2" PLATFORM_EXT
HINSTANCE g_hCore = NULL; HINSTANCE g_hCore = NULL;
bool load_attempted = false; bool load_attempted = false;
@ -217,12 +212,6 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co
} }
case SOURCE_ENGINE_ORANGEBOX: case SOURCE_ENGINE_ORANGEBOX:
{ {
if (strstr(mli->pl_path, TF_PATH) || strstr(mli->pl_path, DOD_PATH))
{
filename = FILENAME_1_6_EP2VALVE;
break;
}
filename = FILENAME_1_6_EP2; filename = FILENAME_1_6_EP2;
break; break;
} }
@ -236,6 +225,16 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co
filename = FILENAME_1_6_DARKM; filename = FILENAME_1_6_DARKM;
break; break;
} }
case SOURCE_ENGINE_ORANGEBOXVALVE:
{
filename = FILENAME_1_6_EP2VALVE;
break;
}
case SOURCE_ENGINE_LEFT4DEAD2:
{
filename = FILENAME_1_6_L4D2;
break;
}
default: default:
{ {
return NULL; return NULL;

View File

@ -41,7 +41,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..;&quot;$(MMSOURCE17)\core&quot;;&quot;$(MMSOURCE17)\core\sourcehook&quot;" AdditionalIncludeDirectories="..;&quot;$(MMSOURCE18)\core&quot;;&quot;$(MMSOURCE18)\core\sourcehook&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LOADER_EXPORTS;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LOADER_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -58,6 +58,7 @@
/> />
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
@ -136,6 +137,7 @@
/> />
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\..\public"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"

View File

@ -526,9 +526,7 @@ FetchUser(Handle:db, client)
FetchUsersWeCan(Handle:db) FetchUsersWeCan(Handle:db)
{ {
new max_clients = GetMaxClients(); for (new i=1; i<=MaxClients; i++)
for (new i=1; i<=max_clients; i++)
{ {
if (PlayerAuth[i] && GetUserAdmin(i) == INVALID_ADMIN_ID) if (PlayerAuth[i] && GetUserAdmin(i) == INVALID_ADMIN_ID)
{ {

View File

@ -45,8 +45,6 @@ public Plugin:myinfo =
url = "http://www.sourcemod.net/" url = "http://www.sourcemod.net/"
}; };
new g_maxPlayers;
/* Forwards */ /* Forwards */
new Handle:hOnAdminMenuReady = INVALID_HANDLE; new Handle:hOnAdminMenuReady = INVALID_HANDLE;
new Handle:hOnAdminMenuCreated = INVALID_HANDLE; new Handle:hOnAdminMenuCreated = INVALID_HANDLE;
@ -97,8 +95,6 @@ public OnConfigsExecuted()
public OnMapStart() public OnMapStart()
{ {
g_maxPlayers = GetMaxClients();
ParseConfigs(); ParseConfigs();
} }
@ -215,14 +211,13 @@ public Action:Command_DisplayMenu(client, args)
stock UTIL_AddTargetsToMenu2(Handle:menu, source_client, flags) stock UTIL_AddTargetsToMenu2(Handle:menu, source_client, flags)
{ {
new max_clients = GetMaxClients();
decl String:user_id[12]; decl String:user_id[12];
decl String:name[MAX_NAME_LENGTH]; decl String:name[MAX_NAME_LENGTH];
decl String:display[MAX_NAME_LENGTH+12]; decl String:display[MAX_NAME_LENGTH+12];
new num_clients; new num_clients;
for (new i = 1; i <= max_clients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (!IsClientConnected(i) || IsClientInKickQueue(i)) if (!IsClientConnected(i) || IsClientInKickQueue(i))
{ {

View File

@ -512,7 +512,7 @@ public ParamCheck(client)
new String:temp[4]; new String:temp[4];
//loop through players. Add name as text and name/userid/steamid as info //loop through players. Add name as text and name/userid/steamid as info
for (new i=1; i<=g_maxPlayers; i++) for (new i=1; i<=MaxClients; i++)
{ {
if (IsClientInGame(i)) if (IsClientInGame(i))
{ {

View File

@ -42,7 +42,7 @@ public Plugin:myinfo =
{ {
name = "Basic Comm Control", name = "Basic Comm Control",
author = "AlliedModders LLC", author = "AlliedModders LLC",
description = "Provides methods of controllingg communication.", description = "Provides methods of controlling communication.",
version = SOURCEMOD_VERSION, version = SOURCEMOD_VERSION,
url = "http://www.sourcemod.net/" url = "http://www.sourcemod.net/"
}; };
@ -157,9 +157,8 @@ public Action:Command_Say(client, args)
public ConVarChange_Alltalk(Handle:convar, const String:oldValue[], const String:newValue[]) public ConVarChange_Alltalk(Handle:convar, const String:oldValue[], const String:newValue[])
{ {
new mode = GetConVarInt(g_Cvar_Deadtalk); new mode = GetConVarInt(g_Cvar_Deadtalk);
new maxClients = GetMaxClients();
for (new i = 1; i <= maxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (!IsClientInGame(i)) if (!IsClientInGame(i))
{ {

View File

@ -189,10 +189,9 @@ public Action:Command_Who(client, args)
} }
/* List all players */ /* List all players */
new maxClients = GetMaxClients();
decl String:flagstring[255]; decl String:flagstring[255];
for (new i=1; i<=maxClients; i++) for (new i=1; i<=MaxClients; i++)
{ {
if (!IsClientInGame(i)) if (!IsClientInGame(i))
{ {

View File

@ -132,8 +132,6 @@ public MenuHandler_Map(Handle:menu, MenuAction:action, param1, param2)
else // no action was selected. else // no action was selected.
{ {
/* Re-enable the menu option */ /* Re-enable the menu option */
g_VoteMapInUse = false;
ResetMenu(); ResetMenu();
} }
} }
@ -187,9 +185,16 @@ public AdminMenu_VoteMap(Handle:topmenu,
} }
else if (action == TopMenuAction_SelectOption) else if (action == TopMenuAction_SelectOption)
{ {
g_VoteMapInUse = true; if (!g_VoteMapInUse)
ResetMenu(); {
DisplayMenu(g_MapList, param, MENU_TIME_FOREVER); ResetMenu();
g_VoteMapInUse = true;
DisplayMenu(g_MapList, param, MENU_TIME_FOREVER);
}
else
{
PrintToChat(param, "[SM] %T", "Map Vote In Use", param);
}
} }
else if (action == TopMenuAction_DrawOption) else if (action == TopMenuAction_DrawOption)
{ {

View File

@ -53,9 +53,7 @@ KillBeacon(client)
KillAllBeacons() KillAllBeacons()
{ {
new maxclients = GetMaxClients(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxclients; i++)
{ {
KillBeacon(i); KillBeacon(i);
} }

View File

@ -74,8 +74,7 @@ KillDrugTimer(client)
KillAllDrugs() KillAllDrugs()
{ {
new maxclients = GetMaxClients(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxclients; i++)
{ {
if (g_DrugTimers[i] != INVALID_HANDLE) if (g_DrugTimers[i] != INVALID_HANDLE)
{ {

View File

@ -58,9 +58,7 @@ KillFireBomb(client)
KillAllFireBombs() KillAllFireBombs()
{ {
new maxclients = GetMaxClients(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxclients; i++)
{ {
KillFireBomb(i); KillFireBomb(i);
} }
@ -162,9 +160,8 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
if (GetConVarInt(g_Cvar_FireBombMode) > 0) if (GetConVarInt(g_Cvar_FireBombMode) > 0)
{ {
new teamOnly = ((GetConVarInt(g_Cvar_FireBombMode) == 1) ? true : false); new teamOnly = ((GetConVarInt(g_Cvar_FireBombMode) == 1) ? true : false);
new maxClients = GetMaxClients();
for (new i = 1; i <= maxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client) if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client)
{ {

View File

@ -105,9 +105,7 @@ KillFreezeBomb(client)
KillAllFreezes( ) KillAllFreezes( )
{ {
new maxclients = GetMaxClients( ); for(new i = 1; i <= MaxClients; i++)
for(new i = 1; i <= maxclients; i++)
{ {
if (g_FreezeSerial[i] != 0) if (g_FreezeSerial[i] != 0)
{ {
@ -254,9 +252,8 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
if (GetConVarInt(g_Cvar_FreezeBombMode) > 0) if (GetConVarInt(g_Cvar_FreezeBombMode) > 0)
{ {
new bool:teamOnly = ((GetConVarInt(g_Cvar_FreezeBombMode) == 1) ? true : false); new bool:teamOnly = ((GetConVarInt(g_Cvar_FreezeBombMode) == 1) ? true : false);
new maxClients = GetMaxClients( );
for (new i = 1; i <= maxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client) if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client)
{ {

View File

@ -57,9 +57,7 @@ KillTimeBomb(client)
KillAllTimeBombs() KillAllTimeBombs()
{ {
new maxclients = GetMaxClients(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxclients; i++)
{ {
KillTimeBomb(i); KillTimeBomb(i);
} }
@ -141,9 +139,8 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
if (GetConVarInt(g_Cvar_TimeBombMode) > 0) if (GetConVarInt(g_Cvar_TimeBombMode) > 0)
{ {
new teamOnly = ((GetConVarInt(g_Cvar_TimeBombMode) == 1) ? true : false); new teamOnly = ((GetConVarInt(g_Cvar_TimeBombMode) == 1) ? true : false);
new maxClients = GetMaxClients();
for (new i = 1; i <= maxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client) if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client)
{ {

View File

@ -38,8 +38,9 @@
/* Decide whether topmenus should be required */ /* Decide whether topmenus should be required */
#if !defined REQUIRE_PLUGIN #if !defined REQUIRE_PLUGIN
#if defined REQUIRE_EXTENSIONS #if defined REQUIRE_EXTENSIONS
#define TEMP_REQUIRE_EXTENSIONS #define TEMP_REQUIRE_EXTENSIONS
#undef REQUIRE_EXTENSIONS #undef REQUIRE_EXTENSIONS
#endif
#endif #endif
#include <topmenus> #include <topmenus>

View File

@ -85,10 +85,14 @@ enum CookieMenuAction
/** /**
* Creates a new Client preference cookie. * Creates a new Client preference cookie.
* *
* Handles returned by RegClientCookie can be closed via CloseHandle() when
* no longer needed.
*
* @param name Name of the new preference cookie. * @param name Name of the new preference cookie.
* @param description Optional description of the preference cookie. * @param description Optional description of the preference cookie.
* @param access What CookieAccess level to assign to this cookie. * @param access What CookieAccess level to assign to this cookie.
* @return A handle to the newly created cookie. If the cookie already exists, a handle to it will still be returned. * @return A handle to the newly created cookie. If the cookie already
* exists, a handle to it will still be returned.
* @error Cookie name is blank. * @error Cookie name is blank.
*/ */
native Handle:RegClientCookie(const String:name[], const String:description[], CookieAccess:access); native Handle:RegClientCookie(const String:name[], const String:description[], CookieAccess:access);
@ -96,6 +100,9 @@ native Handle:RegClientCookie(const String:name[], const String:description[], C
/** /**
* Searches for a Client preference cookie. * Searches for a Client preference cookie.
* *
* Handles returned by FindClientCookie can be closed via CloseHandle() when
* no longer needed.
*
* @param name Name of cookie to find. * @param name Name of cookie to find.
* @return A handle to the cookie if it is found. INVALID_HANDLE otherwise. * @return A handle to the cookie if it is found. INVALID_HANDLE otherwise.
*/ */

View File

@ -858,6 +858,8 @@ native RemoveServerTag(const String:tag[]);
*/ */
functag public Action:CommandListener(client, const String:command[], argc); functag public Action:CommandListener(client, const String:command[], argc);
#define FEATURECAP_COMMANDLISTENER "command listener"
/** /**
* Adds a callback that will fire when a command is sent to the server. * Adds a callback that will fire when a command is sent to the server.
* *
@ -866,6 +868,9 @@ functag public Action:CommandListener(client, const String:command[], argc);
* Using Reg*Cmd to intercept is in poor practice, as it physically creates a * Using Reg*Cmd to intercept is in poor practice, as it physically creates a
* new command and can slow down dispatch in general. * new command and can slow down dispatch in general.
* *
* To see if this feature is available, use FeatureType_Capability and
* FEATURECAP_COMMANDLISTENER.
*
* @param callback Callback. * @param callback Callback.
* @param command Command, or if not specified, a global listener. * @param command Command, or if not specified, a global listener.
* The command is case insensitive. * The command is case insensitive.

View File

@ -151,8 +151,22 @@ public Extension:__ext_core =
native VerifyCoreVersion(); native VerifyCoreVersion();
/**
* Sets a native as optional, such that if it is unloaded, removed,
* or otherwise non-existent, the plugin will still work. Calling
* removed natives results in a run-time error.
*
* @param name Native name.
* @noreturn
*/
native MarkNativeAsOptional(const String:name[]);
public __ext_core_SetNTVOptional() public __ext_core_SetNTVOptional()
{ {
MarkNativeAsOptional("GetFeatureStatus");
MarkNativeAsOptional("RequireFeature");
MarkNativeAsOptional("AddCommandListener");
MarkNativeAsOptional("RemoveCommandListener");
VerifyCoreVersion(); VerifyCoreVersion();
} }

View File

@ -241,3 +241,17 @@ native SetEventString(Handle:event, const String:key[], const String:value[]);
* @error Invalid or corrupt Handle. * @error Invalid or corrupt Handle.
*/ */
native GetEventName(Handle:event, String:name[], maxlength); native GetEventName(Handle:event, String:name[], maxlength);
/**
* Sets whether an event's broadcasting will be disabled or not.
*
* This has no effect on events Handles that are not from HookEvent
* or HookEventEx callbacks.
*
* @param event Handle to an event from an event hook.
* @param dontBroadcast True to disable broadcasting, false otherwise.
* @noreturn
* @error Invalid Handle.
*/
native SetEventBroadcast(Handle:event, bool:dontBroadcast);

View File

@ -40,7 +40,9 @@
#define SOURCE_SDK_DARKMESSIAH 15 /**< Modified version of original engine used by Dark Messiah (no SDK) */ #define SOURCE_SDK_DARKMESSIAH 15 /**< Modified version of original engine used by Dark Messiah (no SDK) */
#define SOURCE_SDK_EPISODE1 20 /**< SDK+Engine released after Episode 1 */ #define SOURCE_SDK_EPISODE1 20 /**< SDK+Engine released after Episode 1 */
#define SOURCE_SDK_EPISODE2 30 /**< SDK+Engine released after Episode 2/Orange Box */ #define SOURCE_SDK_EPISODE2 30 /**< SDK+Engine released after Episode 2/Orange Box */
#define SOURCE_SDK_EPISODE2VALVE 35 /**< SDK+Engine released after Episode 2/Orange Box */
#define SOURCE_SDK_LEFT4DEAD 40 /**< Engine released after Left 4 Dead (no SDK yet) */ #define SOURCE_SDK_LEFT4DEAD 40 /**< Engine released after Left 4 Dead (no SDK yet) */
#define SOURCE_SDK_LEFT4DEAD2 50 /**< Engine released after Left 4 Dead 2 (no SDK yet) */
#define MOTDPANEL_TYPE_TEXT 0 /**< Treat msg as plain text */ #define MOTDPANEL_TYPE_TEXT 0 /**< Treat msg as plain text */
#define MOTDPANEL_TYPE_INDEX 1 /**< Msg is auto determined by the engine */ #define MOTDPANEL_TYPE_INDEX 1 /**< Msg is auto determined by the engine */
@ -271,10 +273,9 @@ native PrintToChat(client, const String:format[], any:...);
*/ */
stock PrintToChatAll(const String:format[], any:...) stock PrintToChatAll(const String:format[], any:...)
{ {
new maxClients = GetMaxClients();
decl String:buffer[192]; decl String:buffer[192];
for (new i = 1; i <= maxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (IsClientInGame(i)) if (IsClientInGame(i))
{ {
@ -305,10 +306,9 @@ native PrintCenterText(client, const String:format[], any:...);
*/ */
stock PrintCenterTextAll(const String:format[], any:...) stock PrintCenterTextAll(const String:format[], any:...)
{ {
new maxClients = GetMaxClients();
decl String:buffer[192]; decl String:buffer[192];
for (new i = 1; i <= maxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (IsClientInGame(i)) if (IsClientInGame(i))
{ {
@ -339,10 +339,9 @@ native PrintHintText(client, const String:format[], any:...);
*/ */
stock PrintHintTextToAll(const String:format[], any:...) stock PrintHintTextToAll(const String:format[], any:...)
{ {
new maxClients = GetMaxClients();
decl String:buffer[192]; decl String:buffer[192];
for (new i = 1; i <= maxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (IsClientInGame(i)) if (IsClientInGame(i))
{ {

View File

@ -99,7 +99,6 @@ stock Handle:FindPluginByFile(const String:filename[])
#pragma deprecated Use FindTarget() or ProcessTargetString() #pragma deprecated Use FindTarget() or ProcessTargetString()
stock SearchForClients(const String:pattern[], clients[], maxClients) stock SearchForClients(const String:pattern[], clients[], maxClients)
{ {
new maxclients = GetMaxClients();
new total = 0; new total = 0;
if (maxClients == 0) if (maxClients == 0)
@ -113,7 +112,7 @@ stock SearchForClients(const String:pattern[], clients[], maxClients)
if (!input) if (!input)
{ {
decl String:name[65] decl String:name[65]
for (new i=1; i<=maxclients; i++) for (new i=1; i<=MaxClients; i++)
{ {
if (!IsClientInGame(i)) if (!IsClientInGame(i))
{ {
@ -137,7 +136,7 @@ stock SearchForClients(const String:pattern[], clients[], maxClients)
} }
decl String:name[65] decl String:name[65]
for (new i=1; i<=maxclients; i++) for (new i=1; i<=MaxClients; i++)
{ {
if (!IsClientInGame(i)) if (!IsClientInGame(i))
{ {

View File

@ -490,11 +490,10 @@ native bool:VoteMenu(Handle:menu, clients[], numClients, time, flags=0);
*/ */
stock VoteMenuToAll(Handle:menu, time, flags=0) stock VoteMenuToAll(Handle:menu, time, flags=0)
{ {
new num = GetMaxClients();
new total; new total;
decl players[num]; decl players[MaxClients];
for (new i=1; i<=num; i++) for (new i=1; i<=MaxClients; i++)
{ {
if (!IsClientInGame(i)) if (!IsClientInGame(i))
{ {

Some files were not shown because too many files have changed in this diff Show More