Compare commits
177 Commits
1.10-fork
...
sourcemod-
Author | SHA1 | Date | |
---|---|---|---|
|
0c16c6ebe9 | ||
|
1b9ce5f484 | ||
|
8a0a911d43 | ||
|
fae6673957 | ||
|
63f50b1e73 | ||
|
f53746f720 | ||
|
5dd18eeaad | ||
|
7316b6255c | ||
|
eb2605f1a3 | ||
|
01a3a09d96 | ||
|
01e7fb463b | ||
|
c4390478fc | ||
|
7d97de8a10 | ||
|
51bee0f420 | ||
|
04642a7cc0 | ||
|
f8f6f2cf6c | ||
|
99ae90ecc5 | ||
|
d64125ddd4 | ||
|
7fb3632fd7 | ||
|
49e2303a5b | ||
|
fe0b9f7320 | ||
|
b16c758f88 | ||
|
da729c3c08 | ||
|
f1bcb2ad3e | ||
|
9270399eb1 | ||
|
76e6edbad4 | ||
|
58ca1508bc | ||
|
eed1df28ec | ||
|
a602d7d107 | ||
|
9a08986fd1 | ||
|
5d1820853a | ||
|
753aced2a3 | ||
|
df47457321 | ||
|
d9e818e5d9 | ||
|
47c840c9b4 | ||
|
2bfc5d3e1e | ||
|
4307c57697 | ||
|
bff0faff52 | ||
|
749966ae66 | ||
|
9f11132fb5 | ||
|
2dfbd1fc1f | ||
|
7c659837bf | ||
|
7cf342a1a7 | ||
|
e8d6aab989 | ||
|
0819278465 | ||
|
d89c57ba79 | ||
|
23b10fc559 | ||
|
36e8e881e8 | ||
|
67011834df | ||
|
ed9f68814f | ||
|
79a8008280 | ||
|
643dce8cb1 | ||
|
3669b98986 | ||
|
e075b7b9b2 | ||
|
b95fda8342 | ||
|
5abec70579 | ||
|
8800d5311c | ||
|
3705210879 | ||
|
5f4befcb6a | ||
|
314011f118 | ||
|
a9b7a5dc5c | ||
|
9b78c68b1b | ||
|
328109be1f | ||
|
aba0f29666 | ||
|
bdefb58e5f | ||
|
7ad3a57c47 | ||
|
5a2f3cf433 | ||
|
fffc27a348 | ||
|
cecb7cb6a2 | ||
|
f5cc5eb757 | ||
|
689406744b | ||
|
603da899b7 | ||
|
9b4d1f6972 | ||
|
d56b222637 | ||
|
dfefda81e1 | ||
|
0c463b1f86 | ||
|
bf345eea8c | ||
|
5328447b74 | ||
|
db6881b7e3 | ||
|
3e96b1617a | ||
|
7ef8b415bb | ||
|
9a5d6957b9 | ||
|
b5a2ec7a5e | ||
|
373136af4e | ||
|
8673c11341 | ||
|
8c082de148 | ||
|
e62d47a85e | ||
|
2d32c587ba | ||
|
31e29ee94c | ||
|
e95e453258 | ||
|
48b0f61551 | ||
|
ef88fc21a1 | ||
|
558c8c9745 | ||
|
2f60680cfb | ||
|
1ffcf7a664 | ||
|
c00b688ab7 | ||
|
4169e25451 | ||
|
85fc65bae5 | ||
|
aed62d5670 | ||
|
01d46b8c9c | ||
|
f70b48276e | ||
|
f0070e45a0 | ||
|
11782cee90 | ||
|
24b86584a2 | ||
|
01b3eee1b8 | ||
|
2fb3f8ab0f | ||
|
2c7b0e04e9 | ||
|
9f3e9a2ff4 | ||
|
d9d5b65f2c | ||
|
90cc2d6c37 | ||
|
1ab5403f9f | ||
|
4d03a4ef60 | ||
|
46b714108a | ||
|
242e1c99e2 | ||
|
3d0e661cd6 | ||
|
d076aca9ea | ||
|
f824a53f21 | ||
|
87ca5e6e05 | ||
|
23af5357c0 | ||
|
d6b82d5dcc | ||
|
664da97c42 | ||
|
b6507b12d4 | ||
|
a5ab381c0a | ||
|
8ec5e42c7a | ||
|
006423dcf2 | ||
|
d0f4d943b6 | ||
|
2fd9674e09 | ||
|
23fca5e645 | ||
|
4beb7fe869 | ||
|
2e832f2d01 | ||
|
43602da743 | ||
|
763b73b9c5 | ||
|
ffb6e84b45 | ||
|
025f216e09 | ||
|
603ac75a08 | ||
|
1b07722848 | ||
|
4de8d67e27 | ||
|
83baabe00a | ||
|
3080ca1ccb | ||
|
c3b0f8a4d2 | ||
|
726ee43736 | ||
|
8e1f37a5d2 | ||
|
ce342ef6fc | ||
|
0a6acda737 | ||
|
c907c723c3 | ||
|
479815911d | ||
|
29954ec122 | ||
|
75455b65da | ||
|
5688eb55ec | ||
|
2e4aae95db | ||
|
cc43b63508 | ||
|
59593a2d5f | ||
|
e3f5d5b6cf | ||
|
6085125367 | ||
|
27805463e3 | ||
|
45f2b9f8ca | ||
|
2bd979d62e | ||
|
e434c43e28 | ||
|
02922df1cd | ||
|
035875f5c1 | ||
|
e3a3dda1d8 | ||
|
7187dde64d | ||
|
fd09d7b176 | ||
|
4e8fc2749b | ||
|
8b362700ff | ||
|
e926a3b94b | ||
|
83d1fc9abe | ||
|
d6a5d99e55 | ||
|
6322a711c2 | ||
|
e024871b50 | ||
|
b4e939e273 | ||
|
13743376ee | ||
|
69cfd36054 | ||
|
7d15ec4d15 | ||
|
b52a10f28b | ||
|
da7c65f0e3 | ||
|
a5d2945fc5 |
@ -6,6 +6,7 @@
|
||||
# Files generated by Visual Studio
|
||||
\.aps$
|
||||
\.ncb$
|
||||
\.sdf$
|
||||
\.suo$
|
||||
\.user$
|
||||
|
||||
@ -13,3 +14,10 @@
|
||||
/CrazyDebug.*
|
||||
/Debug.*
|
||||
/Release.*
|
||||
|
||||
# Files generated by Mac OS X Finder
|
||||
(^|/)\.DS_Store$
|
||||
|
||||
# Files generated by Windows Explorer
|
||||
(^|/)[dD]esktop\.ini$
|
||||
(^|/)[tT]humbs\.db$
|
||||
|
4
.hgtags
4
.hgtags
@ -3,3 +3,7 @@ e6ef5ecdf8d75740ca2685a709bf321f8873bc3b sourcemod-1.1.0
|
||||
e877885fac80be71822641f7a9122cebc9812521 sourcemod-1.1.1
|
||||
b3ffa8a4511c4eadaf533fc790aa6b14f7f0c6ea sourcemod-1.1.2
|
||||
3a73bbf60f34befa9b66be03fa5974b394bb3411 sourcemod-1.2.0
|
||||
a71318396392e3c6d0ff31e069a60fbde59e0cea sourcemod-1.3.0
|
||||
3f33d01fcc28b509bed30f7be07ed215cc000538 sourcemod-1.3.1
|
||||
a3e8f7a7fdf7f012dd02ad491a2e1ccdad151687 sourcemod-1.3.2
|
||||
c5062ca8283033cf33f45da6f19e486ca10835ff sourcemod-1.3.3
|
||||
|
@ -17,6 +17,8 @@ class SM:
|
||||
'name': 'ORANGEBOXVALVE'}
|
||||
self.sdkInfo['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '5',
|
||||
'name': 'LEFT4DEAD'}
|
||||
self.sdkInfo['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '6',
|
||||
'name': 'LEFT4DEAD2'}
|
||||
if AMBuild.target['platform'] == 'windows':
|
||||
self.sdkInfo['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2',
|
||||
'name': 'DARKMESSIAH'}
|
||||
@ -26,11 +28,12 @@ class SM:
|
||||
self.compiler.DetectAll(AMBuild)
|
||||
|
||||
#Detect variables
|
||||
envvars = { 'MMSOURCE17': 'mmsource-1.7',
|
||||
envvars = { 'MMSOURCE18': 'mmsource-1.8',
|
||||
'HL2SDK': 'hl2sdk',
|
||||
'HL2SDKOB': 'hl2sdk-ob',
|
||||
'HL2SDKL4D': 'hl2sdk-l4d',
|
||||
'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
|
||||
'HL2SDKL4D2': 'hl2sdk-l4d2',
|
||||
'MYSQL5': 'mysql-5.0'
|
||||
}
|
||||
|
||||
@ -46,12 +49,14 @@ class SM:
|
||||
raise Exception('Path for {0} was not found: {1}'.format(i, path))
|
||||
else:
|
||||
head = os.getcwd()
|
||||
while head != None and head != '/':
|
||||
oldhead = None
|
||||
while head != None and head != oldhead:
|
||||
path = os.path.join(head, envvars[i])
|
||||
if os.path.isdir(path):
|
||||
break
|
||||
oldhead = 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))
|
||||
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.outputFolder, 'includes'))
|
||||
self.mmsPath = AMBuild.cache['MMSOURCE17']
|
||||
self.mmsPath = AMBuild.cache['MMSOURCE18']
|
||||
|
||||
def DefaultCompiler(self):
|
||||
return self.compiler.Clone()
|
||||
@ -195,13 +200,22 @@ class SM:
|
||||
else:
|
||||
staticLibs = os.path.join(sdkPath, 'lib', 'linux')
|
||||
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
|
||||
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))
|
||||
if sdk == 'ep2v' or sdk == 'l4d2':
|
||||
for i in ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so']:
|
||||
link = os.path.join(workFolder, i)
|
||||
target = os.path.join(staticLibs, i)
|
||||
try:
|
||||
os.lstat(link)
|
||||
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':
|
||||
for lib in ['tier0', 'tier1', 'vstdlib', 'mathlib']:
|
||||
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
|
||||
@ -254,8 +268,12 @@ class SM:
|
||||
if not noLink:
|
||||
if AMBuild.target['platform'] == 'linux':
|
||||
compiler['POSTLINKFLAGS'][0:0] = ['-lm']
|
||||
compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so']
|
||||
compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so']
|
||||
if sdk == 'ep2v' or sdk == 'l4d2':
|
||||
compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so']
|
||||
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
|
||||
else:
|
||||
compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so']
|
||||
compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so']
|
||||
|
||||
return compiler
|
||||
|
||||
|
212
changelog.txt
212
changelog.txt
@ -2,6 +2,218 @@ SourceMod Changelog
|
||||
|
||||
----------------------------
|
||||
|
||||
SourceMod 1.3.4 [2010-07-18]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.3.4_Release_Notes
|
||||
|
||||
User Changes:
|
||||
|
||||
- Support for latest TF update (bug 4506).
|
||||
- Support for latest L4D2 update (bug 4509).
|
||||
|
||||
Developer Changes:
|
||||
|
||||
- Added FindFlagChar native (bug 3776).
|
||||
- Added GetConVarDefault native (bug 4502).
|
||||
- Added forward for TF's GetHoliday function (bug 4462).
|
||||
|
||||
----------------------------
|
||||
|
||||
SourceMod 1.3.3 [2010-06-23]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.3.3_Release_Notes
|
||||
|
||||
User Changes:
|
||||
|
||||
- Added support for CS:S on Orange Box
|
||||
- Added gamedata for Resistance and Liberation (bug 4418).
|
||||
- Updated gamedata for SourceForts, Empires, Obsidian Conflict, Zombie Master.
|
||||
- Fixed memory corruption and leaks with some voice functionality (bug 4415).
|
||||
- Fixed UI bug in sm_motd (bug 4460).
|
||||
|
||||
Developer Changes:
|
||||
|
||||
- Added new player condition (TFCond_CritCola, bug 4447).
|
||||
- Fixed clientprefs deleting cookies twice in rare cases (bug 4412).
|
||||
- Fixed OnClientConnected forward not firing for bots (bug 4443).
|
||||
- Fixed sm_dump_datamaps crash (bug 4424).
|
||||
- Fixed switch case comparisons failing with large numbers (bug 4457).
|
||||
- Fixed rare crash in output hooks (bug 4422).
|
||||
- Fixed bug with dynamically sized arrays being sliced (bug 4428).
|
||||
- Fixed SendConVarValue() on TF2, DOD:S, L4D, and L4D2 (bug 4273).
|
||||
- Fixed TF2 natives not being marked optional (bug 4389).
|
||||
|
||||
----------------------------
|
||||
|
||||
SourceMod 1.3.2 [2010-05-02]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.3.2_Release_Notes
|
||||
|
||||
User Changes:
|
||||
|
||||
- Support for recent TF, DoD, and L4D2 updates (bug 4356, bug 4361, bug 4371, bug 4374, bug 4375).
|
||||
- Fixed rare crash when replicating cvars to clients (bug 4315).
|
||||
- Lots of extra game support for Insurgency, ZPS, CSProMod, PVKII, and FortressForever (thanks
|
||||
Nicholas "psychonic" hastings).
|
||||
|
||||
Developer Changes:
|
||||
|
||||
- Added TF functions for stunning, conditions, regeneration, and power play (bug 4166, bug 4331).
|
||||
|
||||
----------------------------
|
||||
|
||||
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]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.2.0_Release_Notes
|
||||
|
@ -80,21 +80,21 @@ sm_reserve_type 0
|
||||
sm_reserved_slots 0
|
||||
|
||||
// Specifies whether or not reserved slots will be hidden (subtracted from max
|
||||
// slot count). Valid values are 0 (visible) or 1 (hidden).
|
||||
// slot count). Valid values are 0 (Visible) or 1 (Hidden).
|
||||
// --
|
||||
// Requires: reservedslots.smx
|
||||
// Default: 0
|
||||
sm_hide_slots 0
|
||||
|
||||
// Specifies whether or not non-admins can send messages to admins using
|
||||
// say_team @<message>. Valid values are 0 (disabled) or 1 (enabled)
|
||||
// say_team @<message>. Valid values are 0 (Disabled) or 1 (Enabled)
|
||||
// --
|
||||
// Requires: basechat.smx
|
||||
// Default: 1
|
||||
sm_chat_mode 1
|
||||
|
||||
// Specifies whether or not "timeleft" will automaticly be triggered every
|
||||
// x seconds. Valid values are 0 (disabled) to 1800 seconds.
|
||||
// x seconds. Valid values are 0 (Disabled) to 1800 seconds.
|
||||
// --
|
||||
// Requires: basetriggers.smx
|
||||
// Default: 0
|
||||
@ -107,3 +107,28 @@ sm_timeleft_interval 0
|
||||
// Requires: basetriggers.smx
|
||||
// Default: 1
|
||||
sm_trigger_show 1
|
||||
|
||||
// Specifies whether or not to display vote progress to clients in the
|
||||
// "hint" box (near the bottom of the screen in most games).
|
||||
// Valid values are 0 (Disabled) or 1 (Enabled).
|
||||
// --
|
||||
// Default: 0
|
||||
sm_vote_progress_hintbox 0
|
||||
|
||||
// Specifies whether or not to display vote progress to clients in the
|
||||
// chat area. Valid values are 0 (Disabled) or 1 (Enabled).
|
||||
// --
|
||||
// Default: 0
|
||||
sm_vote_progress_chat 0
|
||||
|
||||
// Specifies whether or not to display vote progress in the server console.
|
||||
// Valid values are 0 (Disabled) or 1 (Enabled).
|
||||
// --
|
||||
// Default: 0
|
||||
sm_vote_progress_console 0
|
||||
|
||||
// Specifies whether or not to display vote progress to clients in the
|
||||
// client console. Valid values are 0 (Disabled) or 1 (Enabled).
|
||||
// --
|
||||
// Default: 0
|
||||
sm_vote_progress_client_console 0
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
class ConCommandBaseIterator
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
ICvarIteratorInternal *cvarIter;
|
||||
#else
|
||||
ConCommandBase *cvarIter;
|
||||
@ -42,7 +42,7 @@ class ConCommandBaseIterator
|
||||
public:
|
||||
ConCommandBaseIterator()
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
cvarIter = icvar->FactoryInternalIterator();
|
||||
cvarIter->SetFirst();
|
||||
#else
|
||||
@ -52,14 +52,14 @@ public:
|
||||
|
||||
~ConCommandBaseIterator()
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
g_pMemAlloc->Free(cvarIter);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool IsValid()
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
return cvarIter->IsValid();
|
||||
#else
|
||||
return cvarIter != NULL;
|
||||
@ -68,7 +68,7 @@ public:
|
||||
|
||||
inline void Next()
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
cvarIter->Next();
|
||||
#else
|
||||
cvarIter = const_cast<ConCommandBase*>(cvarIter->GetNext());
|
||||
@ -77,7 +77,7 @@ public:
|
||||
|
||||
inline ConCommandBase *Get()
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
return cvarIter->Get();
|
||||
#else
|
||||
return cvarIter;
|
||||
|
@ -58,6 +58,40 @@ const ParamType CONVARCHANGE_PARAMS[] = {Param_Cell, Param_String, Param_String}
|
||||
typedef List<const ConVar *> ConVarList;
|
||||
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)
|
||||
{
|
||||
}
|
||||
@ -182,7 +216,7 @@ void ConVarManager::OnSourceModVSPReceived()
|
||||
}
|
||||
|
||||
/* 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();
|
||||
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 (pForward->GetFunctionCount() == 0)
|
||||
if (pForward->GetFunctionCount() == 0 &&
|
||||
!ConVarReentrancyGuard::IsCvarInChain(pConVar))
|
||||
{
|
||||
/* Free this forward */
|
||||
g_Forwards.ReleaseForward(pForward);
|
||||
@ -647,6 +682,8 @@ void ConVarManager::OnConVarChanged(ConVar *pConVar, const char *oldValue)
|
||||
|
||||
if (pForward != NULL)
|
||||
{
|
||||
ConVarReentrancyGuard guard(pConVar);
|
||||
|
||||
/* Now call forwards in plugins that have hooked this */
|
||||
pForward->PushCell(pInfo->handle);
|
||||
pForward->PushString(oldValue);
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* The idea of the "non-hacky" (yeah... no) code is that every unique
|
||||
@ -49,6 +49,7 @@
|
||||
#include "ConCmdManager.h"
|
||||
#include "HalfLife2.h"
|
||||
#include "ConCommandBaseIterator.h"
|
||||
#include "ShareSys.h"
|
||||
|
||||
#if defined PLATFORM_LINUX
|
||||
# include <dlfcn.h>
|
||||
@ -63,8 +64,13 @@
|
||||
# else
|
||||
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
|
||||
# endif
|
||||
#elif SH_IMPL_VERSION == 3
|
||||
extern bool __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);
|
||||
#else
|
||||
# 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>);
|
||||
#endif
|
||||
|
||||
@ -150,7 +156,10 @@ class GenericCommandHooker : public IConCommandLinkListener
|
||||
while (iter != vtables.end())
|
||||
{
|
||||
if ((*iter).refcount)
|
||||
{
|
||||
iter++;
|
||||
continue;
|
||||
}
|
||||
/* Damn it. This event happens AFTER the plugin has unloaded!
|
||||
* There's two options. Remove the hook now and hope SH's memory
|
||||
* protection will prevent a crash. Otherwise, we can wait until
|
||||
@ -283,6 +292,23 @@ class GenericCommandHooker
|
||||
Patch cgc;
|
||||
|
||||
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()
|
||||
{
|
||||
const char *platform = NULL;
|
||||
@ -320,6 +346,12 @@ public:
|
||||
if (!PrepPatch("CGameClient::ExecuteString", "CGC", platform, &cgc))
|
||||
return false;
|
||||
|
||||
if (g_HL2.PeekCommandStack() != NULL)
|
||||
{
|
||||
g_SourceMod.AddFrameAction(GenericCommandHooker::DelayedActivation, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
ApplyPatch(&ces);
|
||||
ApplyPatch(&cgc);
|
||||
|
||||
@ -531,10 +563,12 @@ void DummyHook()
|
||||
* BEGIN THE ACTUALLY GENERIC CODE.
|
||||
*/
|
||||
|
||||
#define FEATURECAP_COMMANDLISTENER "command listener"
|
||||
|
||||
static GenericCommandHooker s_GenericHooker;
|
||||
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,
|
||||
Param_String, Param_Cell);
|
||||
g_ShareSys.AddCapabilityProvider(NULL, this, FEATURECAP_COMMANDLISTENER);
|
||||
}
|
||||
|
||||
void ConsoleDetours::OnSourceModShutdown()
|
||||
@ -559,18 +594,23 @@ void ConsoleDetours::OnSourceModShutdown()
|
||||
s_GenericHooker.Disable();
|
||||
}
|
||||
|
||||
bool ConsoleDetours::IsAvailable()
|
||||
FeatureStatus ConsoleDetours::GetFeatureStatus(FeatureType type, const char *name)
|
||||
{
|
||||
if (triedToEnable)
|
||||
return isEnabled;
|
||||
isEnabled = s_GenericHooker.Enable();
|
||||
triedToEnable = true;
|
||||
return isEnabled;
|
||||
return GetStatus();
|
||||
}
|
||||
|
||||
FeatureStatus ConsoleDetours::GetStatus()
|
||||
{
|
||||
if (status == FeatureStatus_Unknown)
|
||||
{
|
||||
status = s_GenericHooker.Enable() ? FeatureStatus_Available : FeatureStatus_Unavailable;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
bool ConsoleDetours::AddListener(IPluginFunction *fun, const char *command)
|
||||
{
|
||||
if (!IsAvailable())
|
||||
if (GetStatus() != FeatureStatus_Available)
|
||||
return false;
|
||||
|
||||
if (command == NULL)
|
||||
|
@ -36,7 +36,9 @@
|
||||
#include "ForwardSys.h"
|
||||
#include <sm_trie_tpl.h>
|
||||
|
||||
class ConsoleDetours : public SMGlobalClass
|
||||
class ConsoleDetours :
|
||||
public SMGlobalClass,
|
||||
public IFeatureProvider
|
||||
{
|
||||
friend class PlayerManager;
|
||||
friend class GenericCommandHooker;
|
||||
@ -50,6 +52,8 @@ public:
|
||||
public: //SMGlobalClass
|
||||
void OnSourceModAllInitialized();
|
||||
void OnSourceModShutdown();
|
||||
public: //IFeatureProvider
|
||||
FeatureStatus GetFeatureStatus(FeatureType type, const char *name);
|
||||
public:
|
||||
bool AddListener(IPluginFunction *fun, const char *command);
|
||||
bool RemoveListener(IPluginFunction *fun, const char *command);
|
||||
@ -60,15 +64,14 @@ private:
|
||||
#else
|
||||
static cell_t Dispatch(ConCommand *pBase);
|
||||
#endif
|
||||
bool IsAvailable();
|
||||
public:
|
||||
inline bool IsEnabled()
|
||||
FeatureStatus GetStatus();
|
||||
bool IsEnabled()
|
||||
{
|
||||
return isEnabled;
|
||||
return status == FeatureStatus_Available;
|
||||
}
|
||||
private:
|
||||
bool triedToEnable;
|
||||
bool isEnabled;
|
||||
FeatureStatus status;
|
||||
IChangeableForward *m_pForward;
|
||||
KTrie<Listener*> m_CmdLookup;
|
||||
List<Listener*> m_Listeners;
|
||||
|
@ -68,7 +68,11 @@ void Hook_ExecDispatchPre(const CCommand &cmd)
|
||||
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
|
||||
void Hook_ExecDispatchPre()
|
||||
#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>);
|
||||
void Hook_ExecDispatchPre()
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* vim: set ts=4 sw=4 tw=99 noet :
|
||||
* =============================================================================
|
||||
* SourceMod
|
||||
* 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};
|
||||
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)
|
||||
{
|
||||
/* Create an event lookup trie */
|
||||
@ -327,6 +341,7 @@ EventInfo *EventManager::CreateEvent(IPluginContext *pContext, const char *name,
|
||||
|
||||
pInfo->pEvent = pEvent;
|
||||
pInfo->pOwner = pContext->GetIdentity();
|
||||
pInfo->bDontBroadcast = false;
|
||||
|
||||
return pInfo;
|
||||
}
|
||||
@ -365,6 +380,7 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
|
||||
IChangeableForward *pForward;
|
||||
const char *name;
|
||||
cell_t res = Pl_Continue;
|
||||
bool broadcast = bDontBroadcast;
|
||||
|
||||
/* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */
|
||||
if (!pEvent)
|
||||
@ -390,10 +406,16 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
|
||||
HandleSecurity sec(NULL, g_pCoreIdent);
|
||||
Handle_t hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL);
|
||||
|
||||
info.bDontBroadcast = bDontBroadcast;
|
||||
|
||||
EventForwardFilter filter(&info);
|
||||
|
||||
pForward->PushCell(hndl);
|
||||
pForward->PushString(name);
|
||||
pForward->PushCell(bDontBroadcast);
|
||||
pForward->Execute(&res, NULL);
|
||||
pForward->Execute(&res, &filter);
|
||||
|
||||
broadcast = info.bDontBroadcast;
|
||||
|
||||
g_HandleSys.FreeHandle(hndl, &sec);
|
||||
}
|
||||
@ -414,6 +436,9 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
|
||||
m_EventStack.push(NULL);
|
||||
}
|
||||
|
||||
if (broadcast != bDontBroadcast)
|
||||
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, true, &IGameEventManager2::FireEvent, (pEvent, broadcast));
|
||||
|
||||
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||
}
|
||||
|
||||
@ -441,6 +466,7 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
|
||||
{
|
||||
if (pHook->postCopy)
|
||||
{
|
||||
info.bDontBroadcast = bDontBroadcast;
|
||||
info.pEvent = m_EventCopies.front();
|
||||
info.pOwner = NULL;
|
||||
hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL);
|
||||
|
@ -53,6 +53,7 @@ struct EventInfo
|
||||
}
|
||||
IGameEvent *pEvent;
|
||||
IdentityToken_t *pOwner;
|
||||
bool bDontBroadcast;
|
||||
};
|
||||
|
||||
struct EventHook
|
||||
|
@ -63,6 +63,8 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena
|
||||
#if defined METAMOD_PLAPI_VERSION
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#define GAMEFIX "2.l4d"
|
||||
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
|
||||
#define GAMEFIX "2.l4d2"
|
||||
#elif SOURCE_ENGINE == SE_ORANGEBOX
|
||||
#define GAMEFIX "2.ep2"
|
||||
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
||||
@ -71,7 +73,7 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena
|
||||
#define GAMEFIX "2.darkm"
|
||||
#else
|
||||
#define GAMEFIX "2.ep1"
|
||||
#endif //SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
#else //METAMOD_PLAPI_VERSION
|
||||
#define GAMEFIX "1.ep1"
|
||||
#endif //METAMOD_PLAPI_VERSION
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* vim: set ts=4 sw=4 tw=99 noet :
|
||||
* =============================================================================
|
||||
* SourceMod
|
||||
* 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();
|
||||
pForward->m_IterGuard = NULL;
|
||||
pForward->m_curparam = 0;
|
||||
pForward->m_ExecType = et;
|
||||
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 low_result = 0;
|
||||
int err;
|
||||
unsigned int failed=0, success=0;
|
||||
unsigned int success=0;
|
||||
unsigned int num_params = m_curparam;
|
||||
FwdParamInfo temp_info[SP_MAX_EXEC_PARAMS];
|
||||
FwdParamInfo *param;
|
||||
@ -304,10 +305,15 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
|
||||
memcpy(temp_info, m_params, sizeof(m_params));
|
||||
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);
|
||||
|
||||
if (filter)
|
||||
filter->Preprocess(func, temp_info);
|
||||
|
||||
for (unsigned int i=0; i<num_params; i++)
|
||||
{
|
||||
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. */
|
||||
if ((err=func->Execute(&cur_result)) != SP_ERROR_NONE)
|
||||
{
|
||||
failed++;
|
||||
}
|
||||
else
|
||||
if ((err=func->Execute(&cur_result)) == SP_ERROR_NONE)
|
||||
{
|
||||
success++;
|
||||
switch (m_ExecType)
|
||||
@ -403,6 +405,9 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!guard.Triggered())
|
||||
iter++;
|
||||
}
|
||||
|
||||
done:
|
||||
@ -682,6 +687,7 @@ bool CForward::RemoveFunction(IPluginFunction *func)
|
||||
{
|
||||
if ((*iter) == func)
|
||||
{
|
||||
m_IterGuard->FixIteratorChain(iter);
|
||||
found = true;
|
||||
lst->erase(iter);
|
||||
break;
|
||||
|
@ -61,6 +61,58 @@ struct FwdParamInfo
|
||||
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
|
||||
{
|
||||
public: //ICallable
|
||||
@ -103,6 +155,7 @@ protected:
|
||||
*/
|
||||
mutable List<IPluginFunction *> m_functions;
|
||||
mutable List<IPluginFunction *> m_paused;
|
||||
FuncIteratorGuard *m_IterGuard;
|
||||
|
||||
/* Type and name information */
|
||||
FwdParamInfo m_params[SP_MAX_EXEC_PARAMS];
|
||||
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* vim: set ts=4 sw=4 tw=99 noet :
|
||||
* =============================================================================
|
||||
* 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
|
||||
@ -25,8 +25,6 @@
|
||||
* 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>.
|
||||
*
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -117,6 +115,8 @@ static bool DoesEngineMatch(const char *value)
|
||||
if (strcmp(value, "orangebox_valve") == 0)
|
||||
#elif SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
if (strcmp(value, "left4dead") == 0)
|
||||
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
|
||||
if (strcmp(value, "left4dead2") == 0)
|
||||
#else
|
||||
#error "Unknown engine type"
|
||||
#endif
|
||||
@ -504,7 +504,11 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
|
||||
void *handle = dlopen(info.dli_fname, RTLD_NOW);
|
||||
if (handle)
|
||||
{
|
||||
#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
final_addr = g_MemUtils.ResolveSymbol(handle, &s_TempSig.sig[1]);
|
||||
#else
|
||||
final_addr = dlsym(handle, &s_TempSig.sig[1]);
|
||||
#endif
|
||||
dlclose(handle);
|
||||
} else {
|
||||
g_Logger.LogError("[SM] Unable to load library \"%s\" (gameconf \"%s\")",
|
||||
|
@ -96,14 +96,16 @@ CHalfLife2::~CHalfLife2()
|
||||
CSharedEdictChangeInfo *g_pSharedChangeInfo = NULL;
|
||||
#endif
|
||||
|
||||
#if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
|
||||
bool is_original_engine = false;
|
||||
#endif
|
||||
|
||||
void CHalfLife2::OnSourceModStartup(bool late)
|
||||
{
|
||||
#if SOURCE_ENGINE != SE_DARKMESSIAH
|
||||
|
||||
/* 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)
|
||||
#else
|
||||
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()
|
||||
{
|
||||
return is_original_engine;
|
||||
@ -357,11 +359,13 @@ void CHalfLife2::SetEdictStateChanged(edict_t *pEdict, unsigned short offset)
|
||||
#if SOURCE_ENGINE != SE_DARKMESSIAH
|
||||
if (g_pSharedChangeInfo != NULL)
|
||||
{
|
||||
#if SOURCE_ENGINE != SE_LEFT4DEAD2
|
||||
if (offset)
|
||||
{
|
||||
pEdict->StateChanged(offset);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pEdict->StateChanged();
|
||||
}
|
||||
@ -543,7 +547,7 @@ bool CHalfLife2::IsLANServer()
|
||||
|
||||
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)
|
||||
#else
|
||||
if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0)
|
||||
@ -668,7 +672,10 @@ edict_t *CHalfLife2::GetHandleEntity(CBaseHandle &hndl)
|
||||
edict_t *pStoredEdict;
|
||||
CBaseEntity *pStoredEntity;
|
||||
|
||||
pStoredEdict = GetEntity(index, &pStoredEntity);
|
||||
if (!IndexToAThings(index, &pStoredEntity, &pStoredEdict))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pStoredEdict == NULL || pStoredEntity == NULL)
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ public:
|
||||
const char *CurrentCommandName();
|
||||
void AddDelayedKick(int client, int userid, const char *msg);
|
||||
void ProcessDelayedKicks();
|
||||
#if !defined METAMOD_PLAPI_VERSION
|
||||
#if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
|
||||
bool IsOriginalEngine();
|
||||
#endif
|
||||
private:
|
||||
@ -166,6 +166,6 @@ private:
|
||||
|
||||
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_
|
||||
|
@ -7,7 +7,8 @@ HL2SDK_ORIG = ../../hl2sdk
|
||||
HL2SDK_OB = ../../hl2sdk-ob
|
||||
HL2SDK_OB_VALVE = ../../hl2sdk-ob-valve
|
||||
HL2SDK_L4D = ../../hl2sdk-l4d
|
||||
MMSOURCE17 = ../../mmsource-1.7
|
||||
HL2SDK_L4D2 = ../../hl2sdk-l4d2
|
||||
MMSOURCE17 = ../../mmsource-central
|
||||
|
||||
#####################################
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
@ -92,11 +93,27 @@ ifeq "$(ENGINE)" "left4dead"
|
||||
BINARY = sourcemod.2.l4d.so
|
||||
override ENGSET = true
|
||||
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
|
||||
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 libvstdlib.so \
|
||||
libtier0.so -static-libgcc
|
||||
else
|
||||
LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so \
|
||||
tier0_i486.so -static-libgcc
|
||||
endif
|
||||
|
||||
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 \
|
||||
@ -136,8 +153,13 @@ $(BIN_DIR)/%.o: %.c
|
||||
|
||||
all: check
|
||||
mkdir -p $(BIN_DIR)
|
||||
ifeq "$(ENGINE)" "left4dead2"
|
||||
ln -sf $(SRCDS)/bin/libvstdlib.so libvstdlib.so;
|
||||
ln -sf $(SRCDS)/bin/libtier0.so libtier0.so;
|
||||
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 sourcemod
|
||||
|
||||
check:
|
||||
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* vim: set ts=4 sw=4 tw=99 noet :
|
||||
* =============================================================================
|
||||
* 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
|
||||
@ -25,15 +25,14 @@
|
||||
* 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>.
|
||||
*
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
#include "MemoryUtils.h"
|
||||
#include "ShareSys.h"
|
||||
#ifdef PLATFORM_LINUX
|
||||
#include <string.h>
|
||||
#include <elf.h>
|
||||
#include <fcntl.h>
|
||||
#include <link.h>
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
MemoryUtils g_MemUtils;
|
||||
@ -56,6 +55,17 @@ MemoryUtils::MemoryUtils()
|
||||
}
|
||||
#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()
|
||||
{
|
||||
g_ShareSys.AddInterface(NULL, this);
|
||||
@ -98,6 +108,149 @@ void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t l
|
||||
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 = §ions[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)
|
||||
{
|
||||
unsigned long baseAddr;
|
||||
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* vim: set ts=4 sw=4 tw=99 noet :
|
||||
* =============================================================================
|
||||
* 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
|
||||
@ -25,8 +25,6 @@
|
||||
* 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>.
|
||||
*
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
|
||||
@ -34,6 +32,12 @@
|
||||
|
||||
#include <IMemoryUtils.h>
|
||||
#include "sm_globals.h"
|
||||
#ifdef PLATFORM_LINUX
|
||||
#include <sh_vector.h>
|
||||
#include "sm_symtable.h"
|
||||
|
||||
using namespace SourceHook;
|
||||
#endif
|
||||
|
||||
using namespace SourceMod;
|
||||
|
||||
@ -43,16 +47,34 @@ struct DynLibInfo
|
||||
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 :
|
||||
public IMemoryUtils,
|
||||
public SMGlobalClass
|
||||
{
|
||||
public:
|
||||
~MemoryUtils();
|
||||
public: // SMGlobalClass
|
||||
void OnSourceModAllInitialized();
|
||||
public: // IMemoryUtils
|
||||
void *FindPattern(const void *libPtr, const char *pattern, size_t len);
|
||||
void *ResolveSymbol(void *handle, const char *symbol);
|
||||
public:
|
||||
bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
|
||||
#ifdef PLATFORM_LINUX
|
||||
private:
|
||||
CVector<LibSymbolTable *> m_SymTables;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern MemoryUtils g_MemUtils;
|
||||
|
@ -49,7 +49,11 @@ SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &)
|
||||
#elif SOURCE_ENGINE == SE_DARKMESSIAH
|
||||
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
|
||||
#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>);
|
||||
#endif
|
||||
|
||||
|
@ -76,7 +76,11 @@ SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &)
|
||||
#elif SOURCE_ENGINE == SE_DARKMESSIAH
|
||||
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
|
||||
#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>);
|
||||
#endif
|
||||
|
||||
@ -462,7 +466,7 @@ bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName,
|
||||
pListener->OnClientConnected(client);
|
||||
if (!pPlayer->IsConnected())
|
||||
{
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -516,6 +520,11 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cell_t res;
|
||||
OnClientConnected->PushCell(client);
|
||||
OnClientConnected->Execute(&res, NULL);
|
||||
|
||||
/* Now do authorization */
|
||||
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
|
||||
{
|
||||
@ -690,7 +699,7 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
|
||||
ClientConsolePrint(pEntity,
|
||||
" David \"BAILOPAN\" Anderson, Borja \"faluco\" Ferrer");
|
||||
ClientConsolePrint(pEntity,
|
||||
" Scott \"Damaged Soul\" Ehlert, Matt \"pRED\" Woodrow");
|
||||
" Scott \"DS\" Ehlert, Matt \"pRED\" Woodrow");
|
||||
ClientConsolePrint(pEntity,
|
||||
" Michael \"ferret\" McKoy, Pavol \"PM OnoTo\" Marko");
|
||||
ClientConsolePrint(pEntity,
|
||||
@ -1437,6 +1446,7 @@ CPlayer::CPlayer()
|
||||
m_TempAdmin = false;
|
||||
m_Info = NULL;
|
||||
m_bAdminCheckSignalled = false;
|
||||
m_UserId = -1;
|
||||
m_bIsInKickQueue = false;
|
||||
m_LastPassword.clear();
|
||||
m_LangId = SOURCEMOD_LANGUAGE_ENGLISH;
|
||||
@ -1614,8 +1624,22 @@ void CPlayer::Kick(const char *str)
|
||||
{
|
||||
MarkAsBeingKicked();
|
||||
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(m_iIndex));
|
||||
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
|
||||
pClient->Disconnect("%s", str);
|
||||
if (pNetChan == NULL)
|
||||
{
|
||||
/* What does this even mean? Hell if I know. */
|
||||
int userid = GetUserId();
|
||||
if (userid > 0)
|
||||
{
|
||||
char buffer[255];
|
||||
UTIL_Format(buffer, sizeof(buffer), "kickid %d %s\n", userid, str);
|
||||
engine->ServerCommand(buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
|
||||
pClient->Disconnect("%s", str);
|
||||
}
|
||||
}
|
||||
|
||||
void CPlayer::Authorize_Post()
|
||||
|
@ -1125,7 +1125,7 @@ void CPluginManager::LoadAutoPlugin(const char *plugin)
|
||||
{
|
||||
g_Logger.LogError("[SM] Failed to load plugin \"%s\": %s", plugin, error);
|
||||
pl->SetErrorState(
|
||||
pl->GetStatus() == Plugin_BadLoad ? Plugin_BadLoad : Plugin_Failed,
|
||||
pl->GetStatus() <= Plugin_Created ? Plugin_BadLoad : pl->GetStatus(),
|
||||
"%s",
|
||||
error);
|
||||
}
|
||||
@ -2052,7 +2052,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
|
||||
|
||||
char pluginfile[256];
|
||||
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);
|
||||
|
||||
@ -2099,7 +2099,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
|
||||
{
|
||||
char pluginfile[256];
|
||||
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))
|
||||
{
|
||||
@ -2189,7 +2189,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
|
||||
{
|
||||
char pluginfile[256];
|
||||
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))
|
||||
{
|
||||
@ -2310,7 +2310,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
|
||||
{
|
||||
char pluginfile[256];
|
||||
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))
|
||||
{
|
||||
@ -2321,7 +2321,10 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
|
||||
|
||||
char name[PLATFORM_MAX_PATH];
|
||||
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))
|
||||
{
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include "sm_trie.h"
|
||||
#include "sourcemod.h"
|
||||
#include <IRootConsoleMenu.h>
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
#include "convar_sm_l4d.h"
|
||||
#elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE)
|
||||
#include "convar_sm_ob.h"
|
||||
|
@ -527,3 +527,85 @@ NativeEntry *ShareSystem::AddFakeNative(IPluginFunction *pFunc, const char *name
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -87,7 +87,13 @@ struct NativeEntry
|
||||
FakeNative *fake;
|
||||
};
|
||||
|
||||
class ShareSystem :
|
||||
struct Capability
|
||||
{
|
||||
IExtension *ext;
|
||||
IFeatureProvider *provider;
|
||||
};
|
||||
|
||||
class ShareSystem :
|
||||
public IShareSys,
|
||||
public SMGlobalClass,
|
||||
public IHandleTypeDispatch
|
||||
@ -110,6 +116,10 @@ public: //IShareSys
|
||||
void AddDependency(IExtension *myself, const char *filename, bool require, bool autoload);
|
||||
void RegisterLibrary(IExtension *myself, const char *name);
|
||||
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
|
||||
/* Pre-empt in case anything tries to register idents early */
|
||||
void Initialize();
|
||||
@ -119,6 +129,9 @@ public: //IHandleTypeDispatch
|
||||
public:
|
||||
IdentityToken_t *CreateCoreIdentity();
|
||||
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:
|
||||
inline IdentityToken_t *GetIdentRoot()
|
||||
{
|
||||
@ -143,6 +156,7 @@ private:
|
||||
HandleType_t m_IfaceType;
|
||||
IdentityType_t m_CoreType;
|
||||
KTrie<NativeEntry *> m_NtvCache;
|
||||
KTrie<Capability> m_caps;
|
||||
};
|
||||
|
||||
extern ShareSystem g_ShareSys;
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
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 *);
|
||||
#else
|
||||
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 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));
|
||||
#else
|
||||
buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
|
||||
#endif
|
||||
} 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));
|
||||
#else
|
||||
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)
|
||||
#else
|
||||
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);
|
||||
}
|
||||
|
||||
#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)
|
||||
#else
|
||||
bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type)
|
||||
@ -500,7 +500,7 @@ void UserMessages::OnMessageEnd_Pre()
|
||||
{
|
||||
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));
|
||||
#else
|
||||
engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId);
|
||||
|
@ -79,7 +79,7 @@ public: //IUserMessages
|
||||
IUserMessageListener *pListener,
|
||||
bool intercept=false);
|
||||
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_Post(IRecipientFilter *filter, int msg_type, const char *msg_name);
|
||||
#else
|
||||
|
@ -386,6 +386,9 @@ public:
|
||||
virtual void SetValue( const char *value );
|
||||
virtual void SetValue( float value );
|
||||
virtual void SetValue( int value );
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD2
|
||||
virtual void SetValue( Color value );
|
||||
#endif
|
||||
|
||||
// Reset to default value
|
||||
void Revert( void );
|
||||
|
@ -126,6 +126,6 @@ private:
|
||||
prof_point_t m_ProfStart;
|
||||
};
|
||||
|
||||
extern ProfileEngine g_Profiler;
|
||||
extern IProfiler *sm_profiler;
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_PLUGIN_PROFILER_H_
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "common_logic.h"
|
||||
#include "ThreadSupport.h"
|
||||
#include "TextParsers.h"
|
||||
#include "Profiler.h"
|
||||
|
||||
sm_core_t smcore;
|
||||
IHandleSys *handlesys;
|
||||
@ -52,7 +53,8 @@ IForwardManager *forwardsys;
|
||||
static sm_logic_t logic =
|
||||
{
|
||||
NULL,
|
||||
g_pThreader
|
||||
g_pThreader,
|
||||
sm_profiler
|
||||
};
|
||||
|
||||
static void logic_init(const sm_core_t* core, sm_logic_t* _logic)
|
||||
|
@ -104,7 +104,8 @@ static sm_core_t core_bridge =
|
||||
UTIL_TrimWhitespace,
|
||||
log_error,
|
||||
get_cvar_string,
|
||||
UTIL_Format
|
||||
UTIL_Format,
|
||||
UTIL_ReplaceAll
|
||||
};
|
||||
|
||||
void InitLogicBridge()
|
||||
|
@ -7,18 +7,21 @@ Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
CrazyDebug - Dark Messiah|Win32 = CrazyDebug - Dark Messiah|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 - Old Metamod|Win32 = CrazyDebug - Old Metamod|Win32
|
||||
CrazyDebug - Orange Box Valve|Win32 = CrazyDebug - Orange Box Valve|Win32
|
||||
CrazyDebug - Orange Box|Win32 = CrazyDebug - Orange Box|Win32
|
||||
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|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 - Old Metamod|Win32 = Debug - Old Metamod|Win32
|
||||
Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32
|
||||
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
|
||||
Release - Dark Messiah|Win32 = Release - Dark Messiah|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 - Old Metamod|Win32 = Release - Old Metamod|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 - 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 - 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.Build.0 = CrazyDebug - Left 4 Dead|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 - 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 - 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.Build.0 = Debug - Left 4 Dead|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 - 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 - 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.Build.0 = Release - Left 4 Dead|Win32
|
||||
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32
|
||||
|
@ -60,6 +60,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -224,6 +225,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -308,6 +310,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -472,6 +475,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -556,6 +560,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -638,6 +643,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -719,6 +725,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -803,6 +810,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -885,6 +893,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -966,6 +975,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -1050,6 +1060,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -1214,6 +1225,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -1298,6 +1310,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -1504,6 +1517,256 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</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;"$(HL2SDKL4D2)\public";"$(HL2SDKL4D2)\public\engine";"$(HL2SDKL4D2)\public\game\server";"$(HL2SDKL4D2)\public\mathlib";"$(HL2SDKL4D2)\public\tier0";"$(HL2SDKL4D2)\public\tier1";"$(HL2SDKL4D2)\public\vstdlib";"$(MMSOURCE18)\core";"$(MMSOURCE18)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D2)\lib\public\tier0.lib" "$(HL2SDKL4D2)\lib\public\tier1.lib" "$(HL2SDKL4D2)\lib\public\vstdlib.lib" "$(HL2SDKL4D2)\lib\public\mathlib.lib" dbghelp.lib "Wsock32.lib""
|
||||
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;"$(HL2SDKL4D2)\public";"$(HL2SDKL4D2)\public\engine";"$(HL2SDKL4D2)\public\game\server";"$(HL2SDKL4D2)\public\mathlib";"$(HL2SDKL4D2)\public\tier0";"$(HL2SDKL4D2)\public\tier1";"$(HL2SDKL4D2)\public\vstdlib";"$(MMSOURCE18)\core";"$(MMSOURCE18)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D2)\lib\public\tier0.lib" "$(HL2SDKL4D2)\lib\public\tier1.lib" "$(HL2SDKL4D2)\lib\public\vstdlib.lib" "$(HL2SDKL4D2)\lib\public\mathlib.lib" "Wsock32.lib""
|
||||
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;"$(HL2SDKL4D2)\public";"$(HL2SDKL4D2)\public\engine";"$(HL2SDKL4D2)\public\game\server";"$(HL2SDKL4D2)\public\mathlib";"$(HL2SDKL4D2)\public\tier0";"$(HL2SDKL4D2)\public\tier1";"$(HL2SDKL4D2)\public\vstdlib";"$(MMSOURCE18)\core";"$(MMSOURCE18)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D2)\lib\public\tier0.lib" "$(HL2SDKL4D2)\lib\public\tier1.lib" "$(HL2SDKL4D2)\lib\public\vstdlib.lib" "$(HL2SDKL4D2)\lib\public\mathlib.lib" "Wsock32.lib""
|
||||
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>
|
||||
<References>
|
||||
</References>
|
||||
@ -1648,6 +1911,22 @@
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</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
|
||||
RelativePath="..\Database.cpp"
|
||||
@ -1999,6 +2278,10 @@
|
||||
RelativePath="..\sm_stringutil.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sm_symtable.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sm_trie.h"
|
||||
>
|
||||
|
@ -324,14 +324,14 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand &
|
||||
{
|
||||
ConsolePrint(" SourceMod was developed by AlliedModders, LLC.");
|
||||
ConsolePrint(" Development would not have been possible without the following people:");
|
||||
ConsolePrint(" David \"BAILOPAN\" Anderson, lead developer");
|
||||
ConsolePrint(" Borja \"faluco\" Ferrer, core developer");
|
||||
ConsolePrint(" Scott \"Damaged Soul\" Ehlert, core developer");
|
||||
ConsolePrint(" Matt \"pRED\" Woodrow, core developer");
|
||||
ConsolePrint(" Michael \"ferret\" McKoy, plugin developer");
|
||||
ConsolePrint(" Pavol \"PM OnoTo\" Marko, SourceHook developer");
|
||||
ConsolePrint(" Special thanks to Viper of GameConnect");
|
||||
ConsolePrint(" Special thanks to Mani of Mani-Admin-Plugin");
|
||||
ConsolePrint(" David \"BAILOPAN\" Anderson");
|
||||
ConsolePrint(" Matt \"pRED\" Woodrow");
|
||||
ConsolePrint(" Scott \"DS\" Ehlert");
|
||||
ConsolePrint(" Fyren");
|
||||
ConsolePrint(" Borja \"faluco\" Ferrer");
|
||||
ConsolePrint(" Pavol \"PM OnoTo\" Marko");
|
||||
ConsolePrint(" Special thanks to Liam, psychonic, ferret, and Mani");
|
||||
ConsolePrint(" Special thanks to Viper and SteamFriends");
|
||||
ConsolePrint(" http://www.sourcemod.net/");
|
||||
}
|
||||
else if (strcmp(cmdname, "version") == 0)
|
||||
|
231
core/sm_symtable.h
Normal file
231
core/sm_symtable.h
Normal 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_
|
@ -505,6 +505,22 @@ static cell_t FindFlagByChar(IPluginContext *pContext, const cell_t *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell_t FindFlagChar(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
cell_t *addr;
|
||||
pContext->LocalToPhysAddr(params[2], &addr);
|
||||
|
||||
char flagchar;
|
||||
if (!g_Admins.FindFlagChar((AdminFlag)params[1], &flagchar))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
*addr = (cell_t)flagchar;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell_t ReadFlagString(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char *flag;
|
||||
@ -561,6 +577,7 @@ REGISTER_NATIVES(adminNatives)
|
||||
{"CreateAuthMethod", CreateAuthMethod},
|
||||
{"FindFlagByName", FindFlagByName},
|
||||
{"FindFlagByChar", FindFlagByChar},
|
||||
{"FindFlagChar", FindFlagChar},
|
||||
{"ReadFlagString", ReadFlagString},
|
||||
{"GetAdmGroupImmunityLevel",GetAdmGroupImmunityLevel},
|
||||
{"SetAdmGroupImmunityLevel",SetAdmGroupImmunityLevel},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* vim: set ts=4 :
|
||||
* =============================================================================
|
||||
* SourceMod
|
||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
||||
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
|
||||
* =============================================================================
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
@ -46,7 +46,13 @@
|
||||
#include "Logger.h"
|
||||
#include "ConsoleDetours.h"
|
||||
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOXVALVE
|
||||
#define NETMSG_BITS 6
|
||||
#else
|
||||
#define NETMSG_BITS 5
|
||||
#endif
|
||||
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
#define NET_SETCONVAR 6
|
||||
#else
|
||||
#define NET_SETCONVAR 5
|
||||
@ -69,7 +75,7 @@ struct GlobCmdIter
|
||||
|
||||
struct ConCmdIter
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
ICvarIteratorInternal *pLast;
|
||||
#else
|
||||
const ConCommandBase *pLast;
|
||||
@ -103,7 +109,7 @@ public:
|
||||
else if (type == htConCmdIter)
|
||||
{
|
||||
ConCmdIter *iter = (ConCmdIter * )object;
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
// ICvarIteratorInternal has no virtual destructor
|
||||
g_pMemAlloc->Free(iter->pLast);
|
||||
#endif
|
||||
@ -181,7 +187,7 @@ private:
|
||||
KTrie<ConCommandBase *> m_CmdFlags;
|
||||
} s_CommandFlagsHelper;
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||
static void ReplicateConVar(ConVar *pConVar)
|
||||
{
|
||||
int maxClients = g_Players.GetMaxClients();
|
||||
@ -189,7 +195,7 @@ static void ReplicateConVar(ConVar *pConVar)
|
||||
char data[256];
|
||||
bf_write buffer(data, sizeof(data));
|
||||
|
||||
buffer.WriteUBitLong(NET_SETCONVAR, 5);
|
||||
buffer.WriteUBitLong(NET_SETCONVAR, NETMSG_BITS);
|
||||
buffer.WriteByte(1);
|
||||
buffer.WriteString(pConVar->GetName());
|
||||
buffer.WriteString(pConVar->GetString());
|
||||
@ -200,8 +206,8 @@ static void ReplicateConVar(ConVar *pConVar)
|
||||
|
||||
if (pPlayer && pPlayer->IsInGame() && !pPlayer->IsFakeClient())
|
||||
{
|
||||
INetChannel *netchan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(i));
|
||||
netchan->SendData(buffer);
|
||||
if (INetChannel *netchan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(i)))
|
||||
netchan->SendData(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -355,7 +361,7 @@ static cell_t sm_SetConVarNum(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
pConVar->SetValue(params[2]);
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||
/* Should we replicate it? */
|
||||
if (params[3] && IsFlagSet(pConVar, FCVAR_REPLICATED))
|
||||
{
|
||||
@ -404,7 +410,7 @@ static cell_t sm_SetConVarFloat(IPluginContext *pContext, const cell_t *params)
|
||||
float value = sp_ctof(params[2]);
|
||||
pConVar->SetValue(value);
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||
/* Should we replicate it? */
|
||||
if (params[3] && IsFlagSet(pConVar, FCVAR_REPLICATED))
|
||||
{
|
||||
@ -455,7 +461,7 @@ static cell_t sm_SetConVarString(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
pConVar->SetValue(value);
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||
/* Should we replicate it? */
|
||||
if (params[3] && IsFlagSet(pConVar, FCVAR_REPLICATED))
|
||||
{
|
||||
@ -486,7 +492,7 @@ static cell_t sm_ResetConVar(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
pConVar->Revert();
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||
/* Should we replicate it? */
|
||||
if (params[3] && IsFlagSet(pConVar, FCVAR_REPLICATED))
|
||||
{
|
||||
@ -503,6 +509,24 @@ static cell_t sm_ResetConVar(IPluginContext *pContext, const cell_t *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell_t GetConVarDefault(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
||||
HandleError err;
|
||||
ConVar *pConVar;
|
||||
|
||||
if ((err=g_ConVarManager.ReadConVarHandle(hndl, &pConVar))
|
||||
!= HandleError_None)
|
||||
{
|
||||
return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
size_t bytes;
|
||||
pContext->StringToLocalUTF8(params[2], params[3], pConVar->GetDefault(), &bytes);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static cell_t sm_GetConVarFlags(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
||||
@ -670,7 +694,8 @@ static cell_t sm_RegServerCmd(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
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);
|
||||
@ -698,7 +723,8 @@ static cell_t sm_RegConsoleCmd(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
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);
|
||||
@ -729,7 +755,8 @@ static cell_t sm_RegAdminCmd(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
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);
|
||||
@ -1183,7 +1210,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params
|
||||
pContext->LocalToPhysAddr(params[3], &pIsCmd);
|
||||
pContext->LocalToPhysAddr(params[4], &pFlags);
|
||||
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
ICvarIteratorInternal *cvarIter = icvar->FactoryInternalIterator();
|
||||
cvarIter->SetFirst();
|
||||
if (!cvarIter->IsValid())
|
||||
@ -1210,7 +1237,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params
|
||||
}
|
||||
|
||||
pIter = new ConCmdIter;
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
pIter->pLast = cvarIter;
|
||||
#else
|
||||
pIter->pLast = pConCmd;
|
||||
@ -1245,7 +1272,7 @@ static cell_t FindNextConCommand(IPluginContext *pContext, const cell_t *params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
ICvarIteratorInternal *cvarIter = pIter->pLast;
|
||||
cvarIter->Next();
|
||||
if (!cvarIter->IsValid())
|
||||
@ -1296,7 +1323,7 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params)
|
||||
char data[256];
|
||||
bf_write buffer(data, sizeof(data));
|
||||
|
||||
buffer.WriteUBitLong(NET_SETCONVAR, 5);
|
||||
buffer.WriteUBitLong(NET_SETCONVAR, NETMSG_BITS);
|
||||
buffer.WriteByte(1);
|
||||
buffer.WriteString(pConVar->GetName());
|
||||
buffer.WriteString(value);
|
||||
@ -1319,6 +1346,11 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannel *netchan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(params[1]));
|
||||
if (netchan == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
netchan->SendData(buffer);
|
||||
|
||||
return 1;
|
||||
@ -1395,6 +1427,7 @@ REGISTER_NATIVES(consoleNatives)
|
||||
{"GetConVarBounds", sm_GetConVarBounds},
|
||||
{"SetConVarBounds", sm_SetConVarBounds},
|
||||
{"QueryClientConVar", sm_QueryClientConVar},
|
||||
{"GetConVarDefault", GetConVarDefault},
|
||||
{"RegServerCmd", sm_RegServerCmd},
|
||||
{"RegConsoleCmd", sm_RegConsoleCmd},
|
||||
{"GetCmdArgString", sm_GetCmdArgString},
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "ForwardSys.h"
|
||||
#include "Logger.h"
|
||||
#include "ExtensionSys.h"
|
||||
#include <sm_trie_tpl.h>
|
||||
|
||||
#if defined PLATFORM_WINDOWS
|
||||
#include <windows.h>
|
||||
@ -491,6 +492,11 @@ static cell_t LibraryExists(IPluginContext *pContext, const cell_t *params)
|
||||
char *str;
|
||||
pContext->LocalToString(params[1], &str);
|
||||
|
||||
if (strcmp(str, "__CanTestFeatures__") == 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (g_PluginSys.LibraryExists(str))
|
||||
{
|
||||
return 1;
|
||||
@ -630,6 +636,43 @@ static cell_t VerifyCoreVersion(IPluginContext *pContext, const cell_t *params)
|
||||
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)
|
||||
{
|
||||
{"AutoExecConfig", AutoExecConfig},
|
||||
@ -654,6 +697,8 @@ REGISTER_NATIVES(coreNatives)
|
||||
{"GetExtensionFileStatus", GetExtensionFileStatus},
|
||||
{"FindPluginByNumber", FindPluginByNumber},
|
||||
{"VerifyCoreVersion", VerifyCoreVersion},
|
||||
{"GetFeatureStatus", GetFeatureStatus},
|
||||
{"RequireFeature", RequireFeature},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
|
@ -69,39 +69,36 @@ inline edict_t *BaseEntityToEdict(CBaseEntity *pEntity)
|
||||
|
||||
inline edict_t *GetEdict(cell_t num)
|
||||
{
|
||||
CBaseEntity *pEntity = g_HL2.ReferenceToEntity(num);
|
||||
|
||||
if (!pEntity)
|
||||
edict_t *pEdict;
|
||||
if (!IndexToAThings(num, NULL, &pEdict))
|
||||
{
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pEdict;
|
||||
}
|
||||
|
||||
edict_t *pEdict = ::BaseEntityToEdict(pEntity);
|
||||
if (!pEdict || pEdict->IsFree())
|
||||
inline CBaseEntity *GetEntity(cell_t num)
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
if (!IndexToAThings(num, &pEntity, 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 pEntity;
|
||||
}
|
||||
|
||||
edict_t *GetEntity(cell_t num, CBaseEntity **pData)
|
||||
/* 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);
|
||||
|
||||
if (!pEntity)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
int index = g_HL2.ReferenceToIndex(num);
|
||||
@ -110,20 +107,35 @@ edict_t *GetEntity(cell_t num, CBaseEntity **pData)
|
||||
CPlayer *pPlayer = g_Players.GetPlayerByIndex(index);
|
||||
if (!pPlayer || !pPlayer->IsConnected())
|
||||
{
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
*pData = pEntity;
|
||||
|
||||
edict_t *pEdict = ::BaseEntityToEdict(pEntity);
|
||||
if (!pEdict || pEdict->IsFree())
|
||||
if (pEntData)
|
||||
{
|
||||
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 {};
|
||||
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)
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
GetEntity(params[1], &pEntity);
|
||||
CBaseEntity *pEntity = GetEntity(params[1]);
|
||||
|
||||
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)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
@ -386,8 +397,7 @@ static cell_t SetEntData(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
static cell_t GetEntDataFloat(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
GetEntity(params[1], &pEntity);
|
||||
CBaseEntity *pEntity = GetEntity(params[1]);
|
||||
|
||||
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)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
@ -433,8 +443,7 @@ static cell_t SetEntDataFloat(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
static cell_t GetEntDataVector(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
GetEntity(params[1], &pEntity);
|
||||
CBaseEntity *pEntity = GetEntity(params[1]);
|
||||
|
||||
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)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
@ -495,8 +504,7 @@ static cell_t SetEntDataVector(IPluginContext *pContext, const cell_t *params)
|
||||
/* THIS GUY IS DEPRECATED. */
|
||||
static cell_t GetEntDataEnt(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
GetEntity(params[1], &pEntity);
|
||||
CBaseEntity *pEntity = GetEntity(params[1]);
|
||||
|
||||
if (!pEntity)
|
||||
{
|
||||
@ -532,7 +540,10 @@ int CheckBaseHandle(CBaseHandle &hndl)
|
||||
edict_t *pStoredEdict;
|
||||
CBaseEntity *pStoredEntity;
|
||||
|
||||
pStoredEdict = GetEntity(index, &pStoredEntity);
|
||||
if (!IndexToAThings(index, &pStoredEntity, &pStoredEdict))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pStoredEdict == NULL || pStoredEntity == NULL)
|
||||
{
|
||||
@ -556,8 +567,7 @@ int CheckBaseHandle(CBaseHandle &hndl)
|
||||
|
||||
static cell_t GetEntDataEnt2(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
GetEntity(params[1], &pEntity);
|
||||
CBaseEntity *pEntity = GetEntity(params[1]);
|
||||
|
||||
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)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
@ -599,8 +609,7 @@ static cell_t SetEntDataEnt(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
hndl.Set(NULL);
|
||||
} else {
|
||||
CBaseEntity *pOther;
|
||||
GetEntity(params[3], &pOther);
|
||||
CBaseEntity *pOther = GetEntity(params[3]);
|
||||
|
||||
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)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
@ -643,8 +652,7 @@ static cell_t SetEntDataEnt2(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
else
|
||||
{
|
||||
CBaseEntity *pOther;
|
||||
GetEntity(params[3], &pOther);
|
||||
CBaseEntity *pOther = GetEntity(params[3]);
|
||||
|
||||
if (!pOther)
|
||||
{
|
||||
@ -752,7 +760,7 @@ static cell_t FindDataMapOffs(IPluginContext *pContext, const cell_t *params)
|
||||
datamap_t *pMap;
|
||||
typedescription_t *td;
|
||||
char *offset;
|
||||
GetEntity(params[1], &pEntity);
|
||||
pEntity = GetEntity(params[1]);
|
||||
|
||||
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)
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
GetEntity(params[1], &pEntity);
|
||||
CBaseEntity *pEntity = GetEntity(params[1]);
|
||||
|
||||
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)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
@ -968,9 +975,7 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
|
||||
edict_t *pEdict;
|
||||
int bit_count;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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;
|
||||
int bit_count;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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;
|
||||
edict_t *pEdict;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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;
|
||||
edict_t *pEdict;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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;
|
||||
edict_t *pEdict;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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;
|
||||
edict_t *pEdict;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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
|
||||
{
|
||||
CBaseEntity *pOther;
|
||||
GetEntity(params[4], &pOther);
|
||||
CBaseEntity *pOther = GetEntity(params[4]);
|
||||
|
||||
if (!pOther)
|
||||
{
|
||||
@ -1459,9 +1453,7 @@ static cell_t GetEntPropVector(IPluginContext *pContext, const cell_t *params)
|
||||
const char *class_name;
|
||||
edict_t *pEdict;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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;
|
||||
edict_t *pEdict;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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;
|
||||
bool bIsStringIndex;
|
||||
|
||||
pEdict = GetEntity(params[1], &pEntity);
|
||||
|
||||
if (!pEntity)
|
||||
if (!IndexToAThings(params[1], &pEntity, &pEdict))
|
||||
{
|
||||
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;
|
||||
int offset;
|
||||
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]);
|
||||
}
|
||||
|
@ -348,6 +348,23 @@ static cell_t sm_SetEventString(IPluginContext *pContext, const cell_t *params)
|
||||
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)
|
||||
{
|
||||
{"HookEvent", sm_HookEvent},
|
||||
@ -365,5 +382,7 @@ REGISTER_NATIVES(gameEventNatives)
|
||||
{"SetEventInt", sm_SetEventInt},
|
||||
{"SetEventFloat", sm_SetEventFloat},
|
||||
{"SetEventString", sm_SetEventString},
|
||||
{"SetEventBroadcast", sm_SetEventBroadcast},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,12 @@ static cell_t IsDedicatedServer(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();
|
||||
#endif
|
||||
|
||||
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)
|
||||
{
|
||||
#if defined METAMOD_PLAPI_VERSION
|
||||
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
|
||||
int version = g_SMAPI->GetSourceEngineBuild();
|
||||
|
||||
if (version == SOURCE_ENGINE_ORIGINAL)
|
||||
switch (version)
|
||||
{
|
||||
case SOURCE_ENGINE_ORIGINAL:
|
||||
return 10;
|
||||
}
|
||||
else if (version == SOURCE_ENGINE_DARKMESSIAH)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (version == SOURCE_ENGINE_EPISODEONE)
|
||||
{
|
||||
case SOURCE_ENGINE_EPISODEONE:
|
||||
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;
|
||||
}
|
||||
else if (version == SOURCE_ENGINE_LEFT4DEAD)
|
||||
{
|
||||
case SOURCE_ENGINE_ORANGEBOXVALVE:
|
||||
return 35;
|
||||
case SOURCE_ENGINE_LEFT4DEAD:
|
||||
return 40;
|
||||
case SOURCE_ENGINE_LEFT4DEAD2:
|
||||
return 50;
|
||||
# endif
|
||||
}
|
||||
#else
|
||||
if (g_HL2.IsOriginalEngine())
|
||||
|
@ -720,6 +720,10 @@ static cell_t GetTimeConnected(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return sp_ftoc(pInfo->GetTimeConnected());
|
||||
}
|
||||
@ -739,6 +743,10 @@ static cell_t GetDataRate(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return pInfo->GetDataRate();
|
||||
}
|
||||
@ -758,6 +766,10 @@ static cell_t IsTimingOut(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return pInfo->IsTimingOut() ? 1 : 0;
|
||||
}
|
||||
@ -782,6 +794,10 @@ static cell_t GetLatency(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return sp_ftoc(-1);
|
||||
}
|
||||
|
||||
if (params[2] == MAX_FLOWS)
|
||||
{
|
||||
@ -815,6 +831,10 @@ static cell_t GetAvgLatency(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return sp_ftoc(-1);
|
||||
}
|
||||
|
||||
if (params[2] == MAX_FLOWS)
|
||||
{
|
||||
@ -848,6 +868,10 @@ static cell_t GetAvgLoss(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return sp_ftoc(-1);
|
||||
}
|
||||
|
||||
if (params[2] == MAX_FLOWS)
|
||||
{
|
||||
@ -881,6 +905,10 @@ static cell_t GetAvgChoke(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return sp_ftoc(-1);
|
||||
}
|
||||
|
||||
if (params[2] == MAX_FLOWS)
|
||||
{
|
||||
@ -914,6 +942,10 @@ static cell_t GetAvgData(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (params[2] == MAX_FLOWS)
|
||||
{
|
||||
@ -948,6 +980,11 @@ static cell_t GetAvgPackets(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
INetChannelInfo *pInfo = engine->GetPlayerNetInfo(client);
|
||||
|
||||
if (pInfo == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (params[2] == MAX_FLOWS)
|
||||
{
|
||||
value = pInfo->GetAvgPackets(FLOW_INCOMING) + pInfo->GetAvgPackets(FLOW_OUTGOING);
|
||||
|
@ -87,7 +87,7 @@ bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen
|
||||
|
||||
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)
|
||||
#endif
|
||||
{
|
||||
@ -177,7 +177,7 @@ void SourceMod_Core::OnVSPListening(IServerPluginCallbacks *iface)
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined METAMOD_PLAPI_VERSION
|
||||
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
|
||||
if (vsp_version == 0)
|
||||
{
|
||||
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)
|
||||
{
|
||||
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||
Global_OnUnlinkConCommandBase(pCommand);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -32,7 +32,7 @@
|
||||
#ifndef _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"
|
||||
#elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE)
|
||||
#include "convar_sm_ob.h"
|
||||
@ -76,7 +76,7 @@ public:
|
||||
const char *GetLogTag();
|
||||
public:
|
||||
void OnVSPListening(IServerPluginCallbacks *iface);
|
||||
#if defined METAMOD_PLAPI_VERSION
|
||||
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
|
||||
void OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand);
|
||||
#else
|
||||
void OnPluginUnload(PluginId id);
|
||||
|
@ -7,7 +7,8 @@ HL2SDK_ORIG = ../../../hl2sdk
|
||||
HL2SDK_OB = ../../../hl2sdk-ob
|
||||
HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve
|
||||
HL2SDK_L4D = ../../../hl2sdk-l4d
|
||||
MMSOURCE17 = ../../../mmsource-1.7
|
||||
HL2SDK_L4D2 = ../../../hl2sdk-l4d2
|
||||
MMSOURCE17 = ../../../mmsource-central
|
||||
|
||||
#####################################
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
@ -79,16 +80,33 @@ ifeq "$(ENGINE)" "left4dead"
|
||||
USEMETA = true
|
||||
CFLAGS += -DHOOKING_ENABLED
|
||||
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 "$(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
|
||||
endif
|
||||
|
||||
LINK += $(LINK_HL2)
|
||||
|
||||
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$(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
|
||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit \
|
||||
-I$(SMSDK)/public/jit/x86 -I$(SMSDK)/public/sourcepawn
|
||||
@ -142,8 +160,13 @@ $(BIN_DIR)/%.o: %.cpp
|
||||
all: check
|
||||
mkdir -p $(BIN_DIR)/sdk
|
||||
if [ "$(USEMETA)" = "true" ]; then \
|
||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
|
||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
||||
if [ "$(ENGINE)" = "left4dead2" ]; then \
|
||||
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
|
||||
$(MAKE) -f Makefile extension
|
||||
|
||||
|
@ -7,12 +7,14 @@ Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|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 - Old Metamod|Win32 = Debug - Old Metamod|Win32
|
||||
Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32
|
||||
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
|
||||
Release - Dark Messiah|Win32 = Release - Dark Messiah|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 - Old Metamod|Win32 = Release - Old Metamod|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 - 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 - 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.Build.0 = Debug - Left 4 Dead|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 - 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 - 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.Build.0 = Release - Left 4 Dead|Win32
|
||||
{E38F65D9-74B2-4373-B46A-DBB76F579F98}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32
|
||||
|
@ -974,6 +974,164 @@
|
||||
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=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;"$(MMSOURCE18)\core";"$(MMSOURCE18)\core\sourcehook";"$(HL2SDKL4D2)\public";"$(HL2SDKL4D2)\public\tier0";"$(HL2SDKL4D2)\public\tier1""
|
||||
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=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D2)\lib\public\tier0.lib" "$(HL2SDKL4D2)\lib\public\tier1.lib" "$(HL2SDKL4D2)\lib\public\vstdlib.lib" "$(HL2SDKL4D2)\lib\public\mathlib.lib""
|
||||
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;"$(MMSOURCE18)\core";"$(MMSOURCE18)\core\sourcehook";"$(HL2SDKL4D2)\public";"$(HL2SDKL4D2)\public\tier0";"$(HL2SDKL4D2)\public\tier1""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D2)\lib\public\tier0.lib" "$(HL2SDKL4D2)\lib\public\tier1.lib" "$(HL2SDKL4D2)\lib\public\vstdlib.lib" "$(HL2SDKL4D2)\lib\public\mathlib.lib""
|
||||
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>
|
||||
<References>
|
||||
</References>
|
||||
|
@ -313,8 +313,6 @@ void CookieManager::ClientConnectCallback(int serial, IQuery *data)
|
||||
row->GetInt(3, (int *)&access);
|
||||
|
||||
parent = CreateCookie(name, desc, access);
|
||||
cookieTrie.insert(name, parent);
|
||||
cookieList.push_back(parent);
|
||||
}
|
||||
|
||||
pData->parent = parent;
|
||||
|
@ -444,5 +444,6 @@ sp_nativeinfo_t g_ClientPrefNatives[] =
|
||||
{"ShowCookieMenu", ShowSettingsMenu},
|
||||
{"SetCookieMenuItem", AddSettingsMenuItem},
|
||||
{"SetCookiePrefabMenu", AddSettingsPrefabMenuItem},
|
||||
{"GetClientCookieTime", GetClientCookieTime},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -1,13 +1,14 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
sdk = SM.sdkInfo['ep1']
|
||||
compiler = SM.DefaultHL2Compiler('extensions/cstrike', 'ep1')
|
||||
sdk = SM.sdkInfo['ep2v']
|
||||
|
||||
compiler = SM.DefaultHL2Compiler('extensions/cstrike', 'ep2v')
|
||||
|
||||
name = 'game.cstrike.ext.' + sdk['ext']
|
||||
extension = AMBuild.AddJob(name)
|
||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
||||
SM.PreSetupHL2Job(extension, binary, 'ep1')
|
||||
SM.PreSetupHL2Job(extension, binary, 'ep2v')
|
||||
binary.AddSourceFiles('extensions/cstrike', [
|
||||
'extension.cpp',
|
||||
'natives.cpp',
|
||||
@ -15,7 +16,6 @@ binary.AddSourceFiles('extensions/cstrike', [
|
||||
'timeleft.cpp',
|
||||
'sdk/smsdk_ext.cpp'
|
||||
])
|
||||
SM.PostSetupHL2Job(extension, binary, 'ep1')
|
||||
SM.PostSetupHL2Job(extension, binary, 'ep2v')
|
||||
SM.AutoVersion('extensions/cstrike', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
binary.SendToJob()
|
@ -2,11 +2,11 @@
|
||||
# Makefile written by David "BAILOPAN" Anderson
|
||||
|
||||
SMSDK = ../..
|
||||
SRCDS_BASE = ~/srcds
|
||||
HL2SDK_ORIG = ../../../hl2sdk
|
||||
HL2SDK_OB = ../../../hl2sdk-ob
|
||||
HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve
|
||||
HL2SDK_L4D = ../../../hl2sdk-l4d
|
||||
HL2SDK_L4D2 = ../../../hl2sdk-l4d2
|
||||
MMSOURCE17 = ../../../mmsource-1.7
|
||||
|
||||
#####################################
|
||||
@ -31,75 +31,97 @@ CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
||||
CPP = gcc
|
||||
|
||||
override ENGSET = false
|
||||
ifeq "$(ENGINE)" "original"
|
||||
HL2SDK = $(HL2SDK_ORIG)
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/linux_sdk
|
||||
CFLAGS += -DSOURCE_ENGINE=1
|
||||
METAMOD = $(MMSOURCE17)/core-legacy
|
||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
||||
SRCDS = $(SRCDS_BASE)
|
||||
GAMEFIX = 1.ep1
|
||||
override ENGSET = true
|
||||
endif
|
||||
ifeq "$(ENGINE)" "orangebox"
|
||||
HL2SDK = $(HL2SDK_OB)
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/lib/linux
|
||||
CFLAGS += -DSOURCE_ENGINE=3
|
||||
METAMOD = $(MMSOURCE17)/core
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/orangebox
|
||||
GAMEFIX = 2.ep2
|
||||
override ENGSET = true
|
||||
endif
|
||||
ifeq "$(ENGINE)" "orangeboxvalve"
|
||||
HL2SDK = $(HL2SDK_OB_VALVE)
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/lib/linux
|
||||
CFLAGS += -DSOURCE_ENGINE=4
|
||||
METAMOD = $(MMSOURCE17)/core
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/orangebox
|
||||
GAMEFIX = 2.ep2v
|
||||
override ENGSET = true
|
||||
endif
|
||||
ifeq "$(ENGINE)" "left4dead"
|
||||
HL2SDK = $(HL2SDK_L4D)
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/lib/linux
|
||||
CFLAGS += -DSOURCE_ENGINE=5
|
||||
METAMOD = $(MMSOURCE17)/core
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/l4d
|
||||
GAMEFIX = 2.l4d
|
||||
|
||||
# Check for valid list of engines
|
||||
ifneq (,$(filter original orangebox orangeboxvalve left4dead left4dead2,$(ENGINE)))
|
||||
override ENGSET = true
|
||||
endif
|
||||
|
||||
ifeq "$(ENGINE)" "original"
|
||||
HL2SDK = $(HL2SDK_ORIG)
|
||||
CFLAGS += -DSOURCE_ENGINE=1
|
||||
GAMEFIX = 1.ep1
|
||||
endif
|
||||
ifeq "$(ENGINE)" "orangebox"
|
||||
HL2SDK = $(HL2SDK_OB)
|
||||
CFLAGS += -DSOURCE_ENGINE=3
|
||||
GAMEFIX = 2.ep2
|
||||
endif
|
||||
ifeq "$(ENGINE)" "orangeboxvalve"
|
||||
HL2SDK = $(HL2SDK_OB_VALVE)
|
||||
CFLAGS += -DSOURCE_ENGINE=4
|
||||
GAMEFIX = 2.ep2v
|
||||
endif
|
||||
ifeq "$(ENGINE)" "left4dead"
|
||||
HL2SDK = $(HL2SDK_L4D)
|
||||
CFLAGS += -DSOURCE_ENGINE=5
|
||||
GAMEFIX = 2.l4d
|
||||
endif
|
||||
ifeq "$(ENGINE)" "left4dead2"
|
||||
HL2SDK = $(HL2SDK_L4D2)
|
||||
CFLAGS += -DSOURCE_ENGINE=6
|
||||
GAMEFIX = 2.l4d2
|
||||
endif
|
||||
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
|
||||
ifeq "$(ENGINE)" "original"
|
||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
||||
METAMOD = $(MMSOURCE17)/core-legacy
|
||||
else
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
METAMOD = $(MMSOURCE17)/core
|
||||
endif
|
||||
|
||||
OS := $(shell uname -s)
|
||||
|
||||
ifeq "$(OS)" "Darwin"
|
||||
LIB_EXT = dylib
|
||||
HL2LIB = $(HL2SDK)/lib/mac
|
||||
else
|
||||
LIB_EXT = so
|
||||
ifeq "$(ENGINE)" "original"
|
||||
HL2LIB = $(HL2SDK)/linux_sdk
|
||||
else
|
||||
HL2LIB = $(HL2SDK)/lib/linux
|
||||
endif
|
||||
endif
|
||||
|
||||
# if ENGINE is orig, OB, or L4D
|
||||
ifneq (,$(filter original orangebox left4dead,$(ENGINE)))
|
||||
LIB_SUFFIX = _i486.$(LIB_EXT)
|
||||
else
|
||||
LIB_PREFIX = lib
|
||||
LIB_SUFFIX = .$(LIB_EXT)
|
||||
endif
|
||||
|
||||
ifeq "$(USEMETA)" "true"
|
||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a tier0_i486.so
|
||||
LINK_HL2 = $(LIB_PREFIX)vstdlib$(LIB_SUFFIX) $(LIB_PREFIX)tier0$(LIB_SUFFIX)
|
||||
|
||||
LINK += $(LINK_HL2)
|
||||
|
||||
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/extensions \
|
||||
-I$(SMSDK)/public/sourcepawn
|
||||
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
|
||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
|
||||
endif
|
||||
|
||||
LINK += -m32 -ldl -lm
|
||||
|
||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse \
|
||||
-msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
||||
CFLAGS += -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \
|
||||
-mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
||||
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
||||
|
||||
################################################
|
||||
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
||||
################################################
|
||||
|
||||
BINARY = $(PROJECT).ext.$(GAMEFIX).$(LIB_EXT)
|
||||
|
||||
ifeq "$(DEBUG)" "true"
|
||||
BIN_DIR = Debug
|
||||
CFLAGS += $(C_DEBUG_FLAGS)
|
||||
@ -112,13 +134,14 @@ ifeq "$(USEMETA)" "true"
|
||||
BIN_DIR := $(BIN_DIR).$(ENGINE)
|
||||
endif
|
||||
|
||||
OS := $(shell uname -s)
|
||||
ifeq "$(OS)" "Darwin"
|
||||
LINK += -dynamiclib
|
||||
BINARY = $(PROJECT).ext.$(GAMEFIX).dylib
|
||||
LIB_EXT = dylib
|
||||
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.5.sdk
|
||||
LINK += -dynamiclib -lstdc++ -mmacosx-version-min=10.5
|
||||
else
|
||||
LINK += -static-libgcc -shared
|
||||
BINARY = $(PROJECT).ext.$(GAMEFIX).so
|
||||
LIB_EXT = so
|
||||
CFLAGS += -D_LINUX
|
||||
LINK += -shared
|
||||
endif
|
||||
|
||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||
@ -127,7 +150,7 @@ ifeq "$(GCC_VERSION)" "4"
|
||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
||||
endif
|
||||
|
||||
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||
OBJ_BIN := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||
|
||||
$(BIN_DIR)/%.o: %.cpp
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||
@ -135,18 +158,20 @@ $(BIN_DIR)/%.o: %.cpp
|
||||
all: check
|
||||
mkdir -p $(BIN_DIR)/sdk
|
||||
if [ "$(USEMETA)" = "true" ]; then \
|
||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
||||
ln -sf $(HL2LIB)/$(LIB_PREFIX)vstdlib$(LIB_SUFFIX); \
|
||||
ln -sf $(HL2LIB)/$(LIB_PREFIX)tier0$(LIB_SUFFIX); \
|
||||
fi
|
||||
$(MAKE) -f Makefile extension
|
||||
|
||||
check:
|
||||
if [ "$(USEMETA)" = "true" ] && [ "$(ENGSET)" = "false" ]; then \
|
||||
echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \
|
||||
echo "You must supply one of the following values for ENGINE:"; \
|
||||
echo "left4dead2, left4dead, orangeboxvalve, orangebox, or original"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
extension: check $(OBJ_LINUX)
|
||||
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -o $(BIN_DIR)/$(BINARY)
|
||||
extension: check $(OBJ_BIN)
|
||||
$(CPP) $(INCLUDE) $(OBJ_BIN) $(LINK) -o $(BIN_DIR)/$(BINARY)
|
||||
|
||||
debug:
|
||||
$(MAKE) -f Makefile all DEBUG=true
|
||||
|
@ -76,11 +76,6 @@ bool CStrike::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
sharesys->AddNatives(myself, g_CSNatives);
|
||||
sharesys->RegisterLibrary(myself, "cstrike");
|
||||
|
||||
if ((g_msgHintText = usermsgs->GetMessageIndex("HintText")) != -1)
|
||||
{
|
||||
sharesys->OverrideNatives(myself, g_CS_PrintHintText);
|
||||
}
|
||||
|
||||
playerhelpers->RegisterCommandTargetProcessor(this);
|
||||
|
||||
return true;
|
||||
|
@ -130,6 +130,5 @@ public:
|
||||
extern IBinTools *g_pBinTools;
|
||||
extern IGameConfig *g_pGameConf;
|
||||
extern int g_msgHintText;
|
||||
extern sp_nativeinfo_t g_CS_PrintHintText[];
|
||||
|
||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
||||
|
@ -8,9 +8,11 @@ Global
|
||||
Debug - Episode1|Win32 = Debug - Episode1|Win32
|
||||
Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32
|
||||
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
|
||||
Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32
|
||||
Release - Episode 1|Win32 = Release - Episode 1|Win32
|
||||
Release - Old Metamod|Win32 = Release - Old Metamod|Win32
|
||||
Release - Orange Box|Win32 = Release - Orange Box|Win32
|
||||
Release - Orange Box Valve|Win32 = Release - Orange Box Valve|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Episode1|Win32.ActiveCfg = Debug - Episode1|Win32
|
||||
@ -19,12 +21,16 @@ Global
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Old Metamod|Win32.Build.0 = Debug - Old Metamod|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box Valve|Win32.ActiveCfg = Debug - Orange Box Valve|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box Valve|Win32.Build.0 = Debug - Orange Box Valve|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Old Metamod|Win32.Build.0 = Release - Old Metamod|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box Valve|Win32.ActiveCfg = Release - Orange Box Valve|Win32
|
||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box Valve|Win32.Build.0 = Release - Orange Box Valve|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -343,6 +343,169 @@
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug - Orange Box Valve|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"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDKOBVALVE)\public";"$(HL2SDKOBVALVE)\public\game\server";"$(HL2SDKOBVALVE)\public\engine";"$(HL2SDKOBVALVE)\public\tier0";"$(HL2SDKOBVALVE)\public\tier1";"$(MMSOURCE17)\core";"$(MMSOURCE17)\core\sourcehook""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKOBVALVE)\lib\public\tier0.lib" "$(HL2SDKOBVALVE)\lib\public\tier1.lib""
|
||||
OutputFile="$(OutDir)\game.cstrike.ext.2.ep2v.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 Valve|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"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDKOBVALVE)\public";"$(HL2SDKOBVALVE)\public\game\server";"$(HL2SDKOBVALVE)\public\engine";"$(HL2SDKOBVALVE)\public\tier0";"$(HL2SDKOBVALVE)\public\tier1";"$(MMSOURCE17)\core";"$(MMSOURCE17)\core\sourcehook""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||
RuntimeLibrary="0"
|
||||
EnableEnhancedInstructionSet="0"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKOBVALVE)\lib\public\tier0.lib" "$(HL2SDKOBVALVE)\lib\public\tier1.lib""
|
||||
OutputFile="$(OutDir)\game.cstrike.ext.2.ep2v.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 - Episode1|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
|
@ -71,45 +71,6 @@ inline CBaseEntity *GetCBaseEntity(int num, bool isplayer)
|
||||
return pUnk->GetBaseEntity();
|
||||
}
|
||||
|
||||
static cell_t CS_PrintHintText(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
int client = params[1];
|
||||
IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(params[1]);
|
||||
|
||||
if (!pPlayer)
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is invalid", client);
|
||||
}
|
||||
|
||||
if (!pPlayer->IsInGame())
|
||||
{
|
||||
return pContext->ThrowNativeError("Client %d is not in game", client);
|
||||
}
|
||||
|
||||
g_pSM->SetGlobalTarget(client);
|
||||
|
||||
char buffer[192];
|
||||
g_pSM->FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
||||
|
||||
/* Check for an error before printing to the client */
|
||||
if (pContext->GetLastNativeError() != SP_ERROR_NONE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bf_write *pBitBuf = usermsgs->StartMessage(g_msgHintText, ¶ms[1], 1, USERMSG_RELIABLE);
|
||||
if (pBitBuf == NULL)
|
||||
{
|
||||
return pContext->ThrowNativeError("Could not send a usermessage");
|
||||
}
|
||||
pBitBuf->WriteByte(1);
|
||||
pBitBuf->WriteString(buffer);
|
||||
usermsgs->EndMessage();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static cell_t CS_RespawnPlayer(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
@ -166,8 +127,3 @@ sp_nativeinfo_t g_CSNatives[] =
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
sp_nativeinfo_t g_CS_PrintHintText[] =
|
||||
{
|
||||
{"PrintHintText", CS_PrintHintText},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
@ -376,17 +376,17 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* VS2008 does not support Windows build targets prior to WinXP, */
|
||||
/* so, if no build target has been defined we will target WinXP. */
|
||||
/* VS2008 does not support Windows build targets prior to Windows 2000, */
|
||||
/* so, if no build target has been defined we will target Windows 2000. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0501
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
# ifndef WINVER
|
||||
# define WINVER 0x0501
|
||||
# define WINVER 0x0500
|
||||
# endif
|
||||
# if (_WIN32_WINNT < 0x0501) || (WINVER < 0x0501)
|
||||
# error VS2008 does not support Windows build targets prior to WinXP
|
||||
# if (_WIN32_WINNT < 0x0500) || (WINVER < 0x0500)
|
||||
# error VS2008 does not support Windows build targets prior to Windows 2000
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -139,6 +140,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -179,666 +181,6 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</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;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(MMSOURCE17)\core-legacy";"$(MMSOURCE17)\core-legacy\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib""
|
||||
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;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(MMSOURCE17)\core-legacy";"$(MMSOURCE17)\core-legacy\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib""
|
||||
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;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(MMSOURCE17)\core";"$(MMSOURCE17)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib""
|
||||
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;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(MMSOURCE17)\core";"$(MMSOURCE17)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib""
|
||||
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;"$(HL2SDKL4D)\public";"$(HL2SDKL4D)\public\engine";"$(HL2SDKL4D)\public\game\server";"$(HL2SDKL4D)\public\tier0";"$(HL2SDKL4D)\public\tier1";"$(MMSOURCE17)\core";"$(MMSOURCE17)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D)\lib\public\tier0.lib" "$(HL2SDKL4D)\lib\public\tier1.lib" "$(HL2SDKL4D)\lib\public\vstdlib.lib""
|
||||
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;"$(HL2SDKL4D)\public";"$(HL2SDKL4D)\public\engine";"$(HL2SDKL4D)\public\game\server";"$(HL2SDKL4D)\public\tier0";"$(HL2SDKL4D)\public\tier1";"$(MMSOURCE17)\core";"$(MMSOURCE17)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D)\lib\public\tier0.lib" "$(HL2SDKL4D)\lib\public\tier1.lib" "$(HL2SDKL4D)\lib\public\vstdlib.lib""
|
||||
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;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(MMSOURCE17)\core";"$(MMSOURCE17)\core\sourcehook";..\..\..\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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib""
|
||||
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;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(MMSOURCE17)\core";"$(MMSOURCE17)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib""
|
||||
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>
|
||||
<References>
|
||||
</References>
|
||||
|
@ -7,7 +7,8 @@ HL2SDK_ORIG = ../../../hl2sdk
|
||||
HL2SDK_OB = ../../../hl2sdk-ob
|
||||
HL2SDK_OB_VALVE = ../../../hl2sdk-ob-valve
|
||||
HL2SDK_L4D = ../../../hl2sdk-l4d
|
||||
MMSOURCE17 = ../../../mmsource-1.7
|
||||
HL2SDK_L4D2 = ../../../hl2sdk-l4d2
|
||||
MMSOURCE17 = ../../../mmsource-central
|
||||
|
||||
#####################################
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
@ -78,20 +79,31 @@ ifeq "$(ENGINE)" "left4dead"
|
||||
GAMEFIX = 2.l4d
|
||||
override ENGSET = true
|
||||
endif
|
||||
|
||||
ifeq "$(USEMETA)" "true"
|
||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so tier0_i486.so
|
||||
|
||||
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
|
||||
else
|
||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
|
||||
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 -I$(HL2SDK)/common -I$(HL2SDK)/game/shared
|
||||
SRCDS = $(SRCDS_BASE)/left4dead2
|
||||
GAMEFIX = 2.l4d2
|
||||
override ENGSET = true
|
||||
endif
|
||||
|
||||
ifeq "$(ENGINE)" "left4dead2"
|
||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a libvstdlib.so libtier0.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
|
||||
|
||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
||||
@ -137,10 +149,13 @@ $(BIN_DIR)/%.o: %.cpp
|
||||
|
||||
all: check
|
||||
mkdir -p $(BIN_DIR)/sdk
|
||||
if [ "$(USEMETA)" = "true" ]; then \
|
||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
|
||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
||||
fi
|
||||
ifeq "$(ENGINE)" "left4dead2"
|
||||
ln -sf $(SRCDS)/bin/libvstdlib.so libvstdlib.so;
|
||||
ln -sf $(SRCDS)/bin/libtier0.so libtier0.so;
|
||||
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
|
||||
|
||||
check:
|
||||
|
@ -337,50 +337,75 @@ bool SDKTools::LevelInit(char const *pMapName, char const *pMapEntities, char co
|
||||
|
||||
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;
|
||||
|
||||
/* The server can't aim, of course. */
|
||||
if (pAdmin == NULL)
|
||||
if (strcmp(info->pattern, "@aim") == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/* The server can't aim, of course. */
|
||||
if (pAdmin == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int player_index;
|
||||
if ((player_index = GetClientAimTarget(pAdmin->GetEdict(), true)) < 1)
|
||||
int player_index;
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *SDKTools::GetExtensionVerString()
|
||||
|
@ -128,6 +128,8 @@ extern ICallWrapper *g_pAcceptInput;
|
||||
extern SourceHook::CallClass<IVEngineServer> *enginePatch;
|
||||
extern SourceHook::CallClass<IEngineSound> *enginesoundPatch;
|
||||
|
||||
extern const char *tools_GetTeamName(int team);
|
||||
|
||||
#include <compat_wrappers.h>
|
||||
|
||||
#define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func)
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "extension.h"
|
||||
|
||||
CHookManager g_Hooks;
|
||||
static bool PRCH_enabled = false;
|
||||
|
||||
SH_DECL_MANUALHOOK2_void(PlayerRunCmdHook, 0, 0, 0, CUserCmd *, IMoveHelper *);
|
||||
|
||||
@ -47,6 +48,7 @@ void CHookManager::Initialize()
|
||||
if (g_pGameConf->GetOffset("PlayerRunCmd", &offset))
|
||||
{
|
||||
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);
|
||||
@ -59,6 +61,9 @@ void CHookManager::Shutdown()
|
||||
|
||||
void CHookManager::OnClientPutInServer(int client)
|
||||
{
|
||||
if (!PRCH_enabled)
|
||||
return;
|
||||
|
||||
edict_t *pEdict = PEntityOfEntIndex(client);
|
||||
if (!pEdict)
|
||||
{
|
||||
@ -82,6 +87,9 @@ void CHookManager::OnClientPutInServer(int client)
|
||||
|
||||
void CHookManager::OnClientDisconnecting(int client)
|
||||
{
|
||||
if (!PRCH_enabled)
|
||||
return;
|
||||
|
||||
edict_t *pEdict = PEntityOfEntIndex(client);
|
||||
if (!pEdict)
|
||||
{
|
||||
|
@ -7,12 +7,14 @@ Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug - Dark Messiah|Win32 = Debug - Dark Messiah|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 - Old Metamod|Win32 = Debug - Old Metamod|Win32
|
||||
Debug - Orange Box Valve|Win32 = Debug - Orange Box Valve|Win32
|
||||
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
|
||||
Release - Dark Messiah|Win32 = Release - Dark Messiah|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 - Old Metamod|Win32 = Release - Old Metamod|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 - 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 - 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.Build.0 = Debug - Left 4 Dead|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 - 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 - 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.Build.0 = Release - Left 4 Dead|Win32
|
||||
{7A740927-C751-4312-BF9D-6367F8C508F8}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32
|
||||
|
@ -60,6 +60,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="BINARY_NAME=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
@ -1007,6 +1008,172 @@
|
||||
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="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;"$(HL2SDKL4D2)\common";"$(HL2SDKL4D2)\public";"$(HL2SDKL4D2)\public\engine";"$(HL2SDKL4D2)\public\game\server";"$(HL2SDKL4D2)\public\mathlib";"$(HL2SDKL4D2)\public\tier0";"$(HL2SDKL4D2)\game\shared";"$(HL2SDKL4D2)\public\tier1";"$(MMSOURCE18)\core";"$(MMSOURCE18)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
AdditionalIncludeDirectories="..\..\..\public"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D2)\lib\public\tier0.lib" "$(HL2SDKL4D2)\lib\public\tier1.lib" "$(HL2SDKL4D2)\lib\public\vstdlib.lib" "$(HL2SDKL4D2)\lib\public\mathlib.lib""
|
||||
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;"$(HL2SDKL4D2)\common";"$(HL2SDKL4D2)\public";"$(HL2SDKL4D2)\public\engine";"$(HL2SDKL4D2)\public\game\server";"$(HL2SDKL4D2)\public\mathlib";"$(HL2SDKL4D2)\public\tier0";"$(HL2SDKL4D2)\public\tier1";"$(MMSOURCE18)\core";"$(MMSOURCE18)\core\sourcehook""
|
||||
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=\"$(TargetFileName)\""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(HL2SDKL4D2)\lib\public\tier0.lib" "$(HL2SDKL4D2)\lib\public\tier1.lib" "$(HL2SDKL4D2)\lib\public\vstdlib.lib" "$(HL2SDKL4D2)\lib\public\mathlib.lib""
|
||||
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>
|
||||
<References>
|
||||
</References>
|
||||
|
@ -199,6 +199,11 @@ void EntityOutputManager::ShutdownFireEventDetour()
|
||||
|
||||
void EntityOutputManager::FireEventDetour(void *pOutput, CBaseEntity *pActivator, CBaseEntity *pCaller, float fDelay)
|
||||
{
|
||||
if (!pCaller)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
char sOutput[20];
|
||||
Q_snprintf(sOutput, sizeof(sOutput), "%x", pOutput);
|
||||
|
||||
@ -212,6 +217,11 @@ void EntityOutputManager::FireEventDetour(void *pOutput, CBaseEntity *pActivator
|
||||
{
|
||||
const char *classname = GetEntityClassname(pCaller);
|
||||
const char *outputname = FindOutputName(pOutput, pCaller);
|
||||
|
||||
if (!outputname)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pOutputName = FindOutputPointer(classname, outputname, false);
|
||||
|
||||
|
@ -110,33 +110,39 @@ static cell_t GetTeamCount(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
int teamindex = params[1];
|
||||
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
|
||||
{
|
||||
return pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
||||
}
|
||||
|
||||
if (g_teamname_offset == 0)
|
||||
{
|
||||
return pContext->ThrowNativeError("Team names are not available on this game.");
|
||||
}
|
||||
|
||||
if (g_teamname_offset == -1)
|
||||
{
|
||||
SendProp *prop = g_pGameHelpers->FindInSendTable(g_Teams[teamindex].ClassName, "m_szTeamname");
|
||||
|
||||
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);
|
||||
const char *name = tools_GetTeamName(teamindex);
|
||||
if (name == NULL)
|
||||
return pContext->ThrowNativeError("Team names are not available on this game.");
|
||||
|
||||
pContext->StringToLocalUTF8(params[2], params[3], name, NULL);
|
||||
|
||||
|
@ -530,7 +530,7 @@ static cell_t smn_TRGetPointContents(IPluginContext *pContext, const cell_t *par
|
||||
{
|
||||
mask = enginetrace->GetPointContents(pos);
|
||||
} else {
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD
|
||||
#if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
mask = enginetrace->GetPointContents(pos, 0, &hentity);
|
||||
#else
|
||||
mask = enginetrace->GetPointContents(pos, &hentity);
|
||||
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* vim: set ts=4 sw=4 tw=99 noet :
|
||||
* =============================================================================
|
||||
* 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
|
||||
@ -25,8 +25,6 @@
|
||||
* 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>.
|
||||
*
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
#include "extension.h"
|
||||
@ -131,7 +129,11 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||
s_call_addr = memutils->ResolveSymbol(handle, &sig[1]);
|
||||
#else
|
||||
s_call_addr = dlsym(handle, &sig[1]);
|
||||
#endif
|
||||
dlclose(handle);
|
||||
|
||||
return (s_call_addr != NULL) ? 1 : 0;
|
||||
|
@ -126,7 +126,7 @@ void GetIServer()
|
||||
int offset;
|
||||
void *vfunc = NULL;
|
||||
|
||||
#if defined METAMOD_PLAPI_VERSION
|
||||
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
|
||||
/* Get the CreateFakeClient function pointer */
|
||||
if (!(vfunc=SH_GET_ORIG_VFNPTR_ENTRY(engine, &IVEngineServer::CreateFakeClient)))
|
||||
{
|
||||
|
@ -811,6 +811,11 @@ CON_COMMAND(sm_dump_datamaps, "Dumps the data map list as a text file")
|
||||
|
||||
typedescription_t *datamap = gamehelpers->FindInDataMap(pMap, "m_iEFlags");
|
||||
|
||||
if (!datamap)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int *eflags = (int *)((char *)entity->GetBaseEntity() + datamap->fieldOffset[TD_OFFSET_NORMAL]);
|
||||
*eflags |= (1<<0); // EFL_KILLME
|
||||
}
|
||||
|
@ -657,7 +657,7 @@ static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *para
|
||||
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 ValveCall *pCall = NULL;
|
||||
@ -713,6 +713,34 @@ static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
#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 ValveCall *pCall = NULL;
|
||||
@ -736,6 +764,7 @@ static cell_t DispatchSpawn(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
return (ret == -1) ? 0 : 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static cell_t DispatchKeyValue(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
|
@ -199,13 +199,13 @@ void SDKTools::OnClientDisconnecting(int client)
|
||||
g_VoiceMap[i][client] = Listen_Default;
|
||||
if (DecHookCount())
|
||||
{
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset this client's mutes, just in case */
|
||||
memset(&g_ClientMutes[client], 0, sizeof(int) * 65);
|
||||
/* Reset this client's mutes */
|
||||
memset(&g_ClientMutes[client], 0, sizeof(bool) * 65);
|
||||
|
||||
/* Reset other clients who send to this client */
|
||||
if (g_ClientOverrides[client] > 0)
|
||||
@ -213,7 +213,6 @@ void SDKTools::OnClientDisconnecting(int client)
|
||||
DecHookCount(g_ClientOverrides[client]);
|
||||
g_ClientOverrides[client] = 0;
|
||||
memset(&g_VoiceMap[client], false, sizeof(ListenOverride) * 65);
|
||||
memset(&g_ClientMutes[client], false, sizeof(bool) * 65);
|
||||
}
|
||||
|
||||
if (g_VoiceFlags[client])
|
||||
|
@ -16,6 +16,7 @@ binary.AddSourceFiles('extensions/tf2', [
|
||||
'RegNatives.cpp',
|
||||
'util.cpp',
|
||||
'criticals.cpp',
|
||||
'holiday.cpp',
|
||||
'CDetour/detours.cpp',
|
||||
'sdk/smsdk_ext.cpp',
|
||||
'asm/asm.c'
|
||||
|
@ -19,7 +19,7 @@ PROJECT = game.tf2
|
||||
USEMETA = true
|
||||
|
||||
OBJECTS = sdk/smsdk_ext.cpp extension.cpp natives.cpp RegNatives.cpp criticals.cpp \
|
||||
util.cpp CDetour/detours.cpp asm/asm.c
|
||||
holiday.cpp util.cpp CDetour/detours.cpp asm/asm.c
|
||||
|
||||
##############################################
|
||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
||||
|
@ -188,7 +188,7 @@ DETOUR_DECL_MEMBER0(CalcIsAttackCriticalHelperBow, bool)
|
||||
}
|
||||
}
|
||||
|
||||
void InitialiseDetours()
|
||||
void InitialiseCritDetours()
|
||||
{
|
||||
calcIsAttackCriticalDetour = DETOUR_CREATE_MEMBER(CalcIsAttackCriticalHelper, "CalcCritical");
|
||||
calcIsAttackCriticalMeleeDetour = DETOUR_CREATE_MEMBER(CalcIsAttackCriticalHelperMelee, "CalcCriticalMelee");
|
||||
@ -222,7 +222,7 @@ void InitialiseDetours()
|
||||
|
||||
}
|
||||
|
||||
void RemoveDetours()
|
||||
void RemoveCritDetours()
|
||||
{
|
||||
calcIsAttackCriticalDetour->Destroy();
|
||||
calcIsAttackCriticalMeleeDetour->Destroy();
|
||||
|
@ -37,8 +37,8 @@
|
||||
#include <jit/x86/x86_macros.h>
|
||||
#include "CDetour/detours.h"
|
||||
|
||||
void InitialiseDetours();
|
||||
void RemoveDetours();
|
||||
void InitialiseCritDetours();
|
||||
void RemoveCritDetours();
|
||||
|
||||
extern IForward *g_critForward;
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "iplayerinfo.h"
|
||||
#include "sm_trie_tpl.h"
|
||||
#include "criticals.h"
|
||||
#include "holiday.h"
|
||||
#include "CDetour/detours.h"
|
||||
|
||||
/**
|
||||
@ -108,10 +109,12 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
playerhelpers->RegisterCommandTargetProcessor(this);
|
||||
|
||||
g_critForward = forwards->CreateForward("TF2_CalcIsAttackCritical", ET_Hook, 4, NULL, Param_Cell, Param_Cell, Param_String, Param_CellByRef);
|
||||
g_getHolidayForward = forwards->CreateForward("TF2_OnGetHoliday", ET_Event, 1, NULL, Param_CellByRef);
|
||||
|
||||
g_pCVar = icvar;
|
||||
|
||||
m_DetoursEnabled = false;
|
||||
m_CritDetoursEnabled = false;
|
||||
m_GetHolidayDetourEnabled = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -155,6 +158,7 @@ void TF2Tools::SDK_OnUnload()
|
||||
plsys->RemovePluginsListener(this);
|
||||
|
||||
forwards->ReleaseForward(g_critForward);
|
||||
forwards->ReleaseForward(g_getHolidayForward);
|
||||
}
|
||||
|
||||
void TF2Tools::SDK_OnAllLoaded()
|
||||
@ -297,19 +301,29 @@ bool TF2Tools::ProcessCommandTarget(cmd_target_info_t *info)
|
||||
|
||||
void TF2Tools::OnPluginLoaded(IPlugin *plugin)
|
||||
{
|
||||
if (!m_DetoursEnabled && g_critForward->GetFunctionCount())
|
||||
if (!m_CritDetoursEnabled && g_critForward->GetFunctionCount())
|
||||
{
|
||||
InitialiseDetours();
|
||||
m_DetoursEnabled = true;
|
||||
InitialiseCritDetours();
|
||||
m_CritDetoursEnabled = true;
|
||||
}
|
||||
if (!m_GetHolidayDetourEnabled && g_getHolidayForward->GetFunctionCount())
|
||||
{
|
||||
InitialiseGetHolidayDetour();
|
||||
m_GetHolidayDetourEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void TF2Tools::OnPluginUnloaded(IPlugin *plugin)
|
||||
{
|
||||
if (m_DetoursEnabled && !g_critForward->GetFunctionCount())
|
||||
if (m_CritDetoursEnabled && !g_critForward->GetFunctionCount())
|
||||
{
|
||||
RemoveDetours();
|
||||
m_DetoursEnabled = false;
|
||||
RemoveCritDetours();
|
||||
m_CritDetoursEnabled = false;
|
||||
}
|
||||
if (m_GetHolidayDetourEnabled && !g_getHolidayForward->GetFunctionCount())
|
||||
{
|
||||
RemoveGetHolidayDetour();
|
||||
m_GetHolidayDetourEnabled = false;
|
||||
}
|
||||
}
|
||||
int FindResourceEntity()
|
||||
|
@ -112,7 +112,8 @@ public:
|
||||
virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late);
|
||||
#endif
|
||||
private:
|
||||
bool m_DetoursEnabled;
|
||||
bool m_CritDetoursEnabled;
|
||||
bool m_GetHolidayDetourEnabled;
|
||||
};
|
||||
|
||||
enum TFClassType
|
||||
|
46
extensions/tf2/holiday.cpp
Normal file
46
extensions/tf2/holiday.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include "holiday.h"
|
||||
|
||||
CDetour *getHolidayDetour = NULL;
|
||||
|
||||
IForward *g_getHolidayForward = NULL;
|
||||
|
||||
DETOUR_DECL_MEMBER0(GetHoliday, int)
|
||||
{
|
||||
int actualres = DETOUR_MEMBER_CALL(GetHoliday)();
|
||||
if (!g_getHolidayForward)
|
||||
{
|
||||
g_pSM->LogMessage(myself, "Invalid Forward");
|
||||
return actualres;
|
||||
}
|
||||
|
||||
cell_t result = 0;
|
||||
int newres = actualres;
|
||||
|
||||
g_getHolidayForward->PushCellByRef(&newres);
|
||||
g_getHolidayForward->Execute(&result);
|
||||
|
||||
if (result == Pl_Changed)
|
||||
{
|
||||
return newres;
|
||||
}
|
||||
|
||||
return actualres;
|
||||
}
|
||||
|
||||
void InitialiseGetHolidayDetour()
|
||||
{
|
||||
getHolidayDetour = DETOUR_CREATE_MEMBER(GetHoliday, "GetHoliday");
|
||||
|
||||
if (!getHolidayDetour)
|
||||
{
|
||||
g_pSM->LogError(myself, "GetHoliday detour failed");
|
||||
return;
|
||||
}
|
||||
|
||||
getHolidayDetour->EnableDetour();
|
||||
}
|
||||
|
||||
void RemoveGetHolidayDetour()
|
||||
{
|
||||
getHolidayDetour->Destroy();
|
||||
}
|
45
extensions/tf2/holiday.h
Normal file
45
extensions/tf2/holiday.h
Normal file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* =============================================================================
|
||||
* SourceMod Team Fortress 2 Extension
|
||||
* Copyright (C) 2004-2008 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>.
|
||||
*
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_SOURCEMOD_HOLIDAY_H_
|
||||
#define _INCLUDE_SOURCEMOD_HOLIDAY_H_
|
||||
|
||||
#include "extension.h"
|
||||
#include <jit/jit_helpers.h>
|
||||
#include <jit/x86/x86_macros.h>
|
||||
#include "CDetour/detours.h"
|
||||
|
||||
void InitialiseGetHolidayDetour();
|
||||
void RemoveGetHolidayDetour();
|
||||
|
||||
extern IForward *g_getHolidayForward;
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_HOLIDAY_H_
|
@ -194,6 +194,10 @@
|
||||
RelativePath="..\extension.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\holiday.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\natives.cpp"
|
||||
>
|
||||
@ -220,6 +224,10 @@
|
||||
RelativePath="..\extension.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\holiday.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\RegNatives.h"
|
||||
>
|
||||
|
@ -159,6 +159,177 @@ cell_t TF2_RemoveDisguise(IPluginContext *pContext, const cell_t *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
cell_t TF2_AddCondition(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
// CTFPlayerShared::AddCond(int, float)
|
||||
if (!pWrapper)
|
||||
{
|
||||
REGISTER_NATIVE_ADDR("AddCondition",
|
||||
PassInfo pass[2]; \
|
||||
pass[0].flags = PASSFLAG_BYVAL; \
|
||||
pass[0].size = sizeof(int); \
|
||||
pass[0].type = PassType_Basic; \
|
||||
pass[1].flags = PASSFLAG_BYVAL; \
|
||||
pass[1].size = sizeof(float); \
|
||||
pass[1].type = PassType_Basic; \
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 2))
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
if (!(pEntity = UTIL_GetCBaseEntity(params[1], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||
}
|
||||
|
||||
void *obj = (void *)((uint8_t *)pEntity + playerSharedOffset->actual_offset);
|
||||
|
||||
unsigned char vstk[sizeof(void *) + sizeof(int) + sizeof(float)];
|
||||
unsigned char *vptr = vstk;
|
||||
|
||||
*(void **)vptr = obj;
|
||||
vptr += sizeof(void *);
|
||||
*(int *)vptr = params[2];
|
||||
vptr += sizeof(int);
|
||||
*(float *)vptr = *(float *)¶ms[3];
|
||||
|
||||
pWrapper->Execute(vstk, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
cell_t TF2_RemoveCondition(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
// CTFPlayerShared::RemoveCond(int)
|
||||
if (!pWrapper)
|
||||
{
|
||||
REGISTER_NATIVE_ADDR("RemoveCondition",
|
||||
PassInfo pass[1]; \
|
||||
pass[0].flags = PASSFLAG_BYVAL; \
|
||||
pass[0].size = sizeof(int); \
|
||||
pass[0].type = PassType_Basic; \
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 1))
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
if (!(pEntity = UTIL_GetCBaseEntity(params[1], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||
}
|
||||
|
||||
void *obj = (void *)((uint8_t *)pEntity + playerSharedOffset->actual_offset);
|
||||
|
||||
unsigned char vstk[sizeof(void *) + sizeof(int)];
|
||||
unsigned char *vptr = vstk;
|
||||
|
||||
*(void **)vptr = obj;
|
||||
vptr += sizeof(void *);
|
||||
*(int *)vptr = params[2];
|
||||
|
||||
pWrapper->Execute(vstk, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
cell_t TF2_StunPlayer(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
// CTFPlayerShared::StunPlayer(float, float, int, CTFPlayer *)
|
||||
if (!pWrapper)
|
||||
{
|
||||
REGISTER_NATIVE_ADDR("StunPlayer",
|
||||
PassInfo pass[4]; \
|
||||
pass[0].flags = PASSFLAG_BYVAL; \
|
||||
pass[0].size = sizeof(float); \
|
||||
pass[0].type = PassType_Basic; \
|
||||
pass[1].flags = PASSFLAG_BYVAL; \
|
||||
pass[1].size = sizeof(float); \
|
||||
pass[1].type = PassType_Basic; \
|
||||
pass[2].flags = PASSFLAG_BYVAL; \
|
||||
pass[2].size = sizeof(int); \
|
||||
pass[2].type = PassType_Basic; \
|
||||
pass[3].flags = PASSFLAG_BYVAL; \
|
||||
pass[3].size = sizeof(CBaseEntity *); \
|
||||
pass[3].type = PassType_Basic; \
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 4))
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
if (!(pEntity = UTIL_GetCBaseEntity(params[1], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||
}
|
||||
|
||||
bool bByPlayer = (params[5] != 0);
|
||||
CBaseEntity *pAttacker = NULL;
|
||||
if (bByPlayer && !(pAttacker = UTIL_GetCBaseEntity(params[5], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Attacker index %d is not valid", params[5]);
|
||||
}
|
||||
|
||||
void *obj = (void *)((uint8_t *)pEntity + playerSharedOffset->actual_offset);
|
||||
|
||||
unsigned char vstk[sizeof(void *) + 2*sizeof(float) + sizeof(int) + sizeof(CBaseEntity *)];
|
||||
unsigned char *vptr = vstk;
|
||||
|
||||
*(void **)vptr = obj;
|
||||
vptr += sizeof(void *);
|
||||
*(float *)vptr = sp_ctof(params[2]);
|
||||
vptr += sizeof(float);
|
||||
*(float *)vptr = sp_ctof(params[3]);
|
||||
vptr += sizeof(float);
|
||||
*(int *)vptr = params[4];
|
||||
vptr += sizeof(int);
|
||||
*(CBaseEntity **)vptr = pAttacker;
|
||||
|
||||
pWrapper->Execute(vstk, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
cell_t TF2_SetPowerplayEnabled(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
// CTFPlayer::SetPowerPlayEnabled(bool)
|
||||
if (!pWrapper)
|
||||
{
|
||||
REGISTER_NATIVE_ADDR("SetPowerplayEnabled",
|
||||
PassInfo pass[1]; \
|
||||
pass[0].flags = PASSFLAG_BYVAL; \
|
||||
pass[0].size = sizeof(bool); \
|
||||
pass[0].type = PassType_Basic; \
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 1))
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
if (!(pEntity = UTIL_GetCBaseEntity(params[1], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||
}
|
||||
|
||||
bool bEnablePP = false;
|
||||
if (params[2] != 0)
|
||||
{
|
||||
bEnablePP = true;
|
||||
}
|
||||
|
||||
unsigned char vstk[sizeof(void *) + sizeof(bool)];
|
||||
unsigned char *vptr = vstk;
|
||||
|
||||
*(void **)vptr = (void *)pEntity;
|
||||
vptr += sizeof(void *);
|
||||
*(bool *)vptr = bEnablePP;
|
||||
|
||||
pWrapper->Execute(vstk, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
cell_t TF2_Respawn(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
@ -201,6 +372,28 @@ cell_t TF2_Respawn(IPluginContext *pContext, const cell_t *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
cell_t TF2_Regenerate(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
//CTFPlayer::Regenerate()
|
||||
|
||||
if (!pWrapper)
|
||||
{
|
||||
REGISTER_NATIVE_ADDR("Regenerate",
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, NULL, 0));
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
if (!(pEntity = UTIL_GetCBaseEntity(params[1], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||
}
|
||||
pWrapper->Execute(&pEntity, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
cell_t TF2_GetResourceEntity(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
return g_resourceEntity;
|
||||
@ -223,5 +416,10 @@ sp_nativeinfo_t g_TFNatives[] =
|
||||
{"TF2_RemovePlayerDisguise", TF2_RemoveDisguise},
|
||||
{"TF2_GetResourceEntity", TF2_GetResourceEntity},
|
||||
{"TF2_GetClass", TF2_GetClass},
|
||||
{"TF2_RegeneratePlayer", TF2_Regenerate},
|
||||
{"TF2_AddCondition", TF2_AddCondition},
|
||||
{"TF2_RemoveCondition", TF2_RemoveCondition},
|
||||
{"TF2_SetPlayerPowerPlay", TF2_SetPowerplayEnabled},
|
||||
{"TF2_StunPlayer", TF2_StunPlayer},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -89,6 +89,7 @@
|
||||
"engine" "orangebox"
|
||||
"engine" "orangebox_valve"
|
||||
"engine" "left4dead"
|
||||
"engine" "left4dead2"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
@ -128,9 +129,17 @@
|
||||
"game" "diprip"
|
||||
"game" "synergy"
|
||||
"game" "left4dead"
|
||||
"game" "left4dead2"
|
||||
"game" "obsidian"
|
||||
"game" "empires"
|
||||
"game" "gesource"
|
||||
"game" "NeotokyoSource"
|
||||
"game" "bg2"
|
||||
"game" "cspromod"
|
||||
"game" "FortressForever"
|
||||
"game" "zps"
|
||||
"game" "gesource"
|
||||
"game" "RnLBeta"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
@ -148,6 +157,16 @@
|
||||
"game" "synergy"
|
||||
"game" "dod"
|
||||
"game" "empires"
|
||||
"game" "NeotokyoSource"
|
||||
"game" "bg2"
|
||||
"game" "cspromod"
|
||||
"game" "pvkii"
|
||||
"game" "FortressForever"
|
||||
"game" "zps"
|
||||
"game" "gesource"
|
||||
"game" "obsidian"
|
||||
"game" "cstrike"
|
||||
"game" "RnLBeta"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
@ -168,6 +187,14 @@
|
||||
"game" "tf"
|
||||
"game" "ageofchivalry"
|
||||
"game" "obsidian"
|
||||
"game" "zombie_master"
|
||||
"game" "bg2"
|
||||
"game" "insurgency"
|
||||
"game" "cspromod"
|
||||
"game" "pvkii"
|
||||
"game" "zps"
|
||||
"game" "gesource"
|
||||
"game" "RnLBeta"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
@ -176,12 +203,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
"cstrike"
|
||||
"#default"
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "cstrike"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
{
|
||||
"HintTextPreByte" "yes"
|
||||
"GameExtension" "game.cstrike"
|
||||
"GameExtension" "game.cstrike"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,18 +16,17 @@
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "cstrike"
|
||||
"game" "garrysmod"
|
||||
"game" "hl2mp"
|
||||
"game" "ship"
|
||||
"game" "insurgency"
|
||||
"game" "pvkii"
|
||||
"game" "sourceforts"
|
||||
"game" "FortressForever"
|
||||
"game" "empires"
|
||||
"game" "synergy"
|
||||
"game" "hidden"
|
||||
"game" "zombie_master"
|
||||
"game" "NeotokyoSource"
|
||||
"game" "cspromod"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
|
@ -18,6 +18,12 @@
|
||||
{
|
||||
"game" "ageofchivalry"
|
||||
"game" "zps"
|
||||
"game" "bg2"
|
||||
"game" "pvkii"
|
||||
"game" "gesource"
|
||||
"game" "empires"
|
||||
"game" "RnLBeta"
|
||||
"game" "obsidian"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
|
@ -18,6 +18,8 @@
|
||||
{
|
||||
"game" "dod"
|
||||
"game" "tf"
|
||||
"game" "cstrike"
|
||||
"game" "garrysmod"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
|
51
gamedata/core.games/engine.l4d2.txt
Normal file
51
gamedata/core.games/engine.l4d2.txt
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -20,6 +20,11 @@
|
||||
"engine" "left4dead"
|
||||
}
|
||||
|
||||
"engine.l4d2.txt"
|
||||
{
|
||||
"engine" "left4dead2"
|
||||
}
|
||||
|
||||
"engine.ep2.txt"
|
||||
{
|
||||
"engine" "orangebox"
|
||||
|
@ -16,17 +16,17 @@
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "cstrike"
|
||||
"game" "hl2mp"
|
||||
"game" "ship"
|
||||
"game" "!Dystopia"
|
||||
"game" "insurgency"
|
||||
"game" "pvkii"
|
||||
"game" "sourceforts"
|
||||
"game" "FortressForever"
|
||||
"game" "synergy"
|
||||
"game" "hidden"
|
||||
"game" "zombie_master"
|
||||
"game" "NeotokyoSource"
|
||||
"game" "cspromod"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
@ -73,17 +73,15 @@
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "cstrike"
|
||||
"game" "garrysmod"
|
||||
"game" "hl2mp"
|
||||
"game" "ship"
|
||||
"game" "!Dystopia"
|
||||
"game" "insurgency"
|
||||
"game" "pvkii"
|
||||
"game" "sourceforts"
|
||||
"game" "FortressForever"
|
||||
"game" "synergy"
|
||||
"game" "hidden"
|
||||
"game" "NeotokyoSource"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
@ -123,17 +121,15 @@
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "cstrike"
|
||||
"game" "garrysmod"
|
||||
"game" "hl2mp"
|
||||
"game" "ship"
|
||||
"game" "insurgency"
|
||||
"game" "pvkii"
|
||||
"game" "sourceforts"
|
||||
"game" "FortressForever"
|
||||
"game" "synergy"
|
||||
"game" "hidden"
|
||||
"game" "zombie_master"
|
||||
"game" "NeotokyoSource"
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
@ -153,14 +149,12 @@
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "cstrike"
|
||||
"game" "hl2mp"
|
||||
"game" "insurgency"
|
||||
"game" "pvkii"
|
||||
"game" "sourceforts"
|
||||
"game" "synergy"
|
||||
"game" "hidden"
|
||||
"game" "FortressForever"
|
||||
"game" "NeotokyoSource"
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
@ -234,8 +228,9 @@
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "cstrike"
|
||||
"game" "hl2mp"
|
||||
"game" "NeotokyoSource"
|
||||
"game" "zombie_master"
|
||||
}
|
||||
"Signatures"
|
||||
{
|
||||
|
@ -20,6 +20,9 @@
|
||||
"game" "zps"
|
||||
"game" "empires"
|
||||
"game" "synergy"
|
||||
"game" "bg2"
|
||||
"game" "pvkii"
|
||||
"game" "gesource"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
@ -68,7 +71,7 @@
|
||||
{
|
||||
"game" "ageofchivalry"
|
||||
"game" "zps"
|
||||
"game" "empires"
|
||||
"game" "pvkii"
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
@ -95,8 +98,7 @@
|
||||
{
|
||||
"game" "ageofchivalry"
|
||||
"game" "zps"
|
||||
"game" "empires"
|
||||
"game" "synergy"
|
||||
"game" "pvkii"
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
@ -120,6 +122,11 @@
|
||||
"game" "zps"
|
||||
"game" "empires"
|
||||
"game" "synergy"
|
||||
"game" "bg2"
|
||||
"game" "pvkii"
|
||||
"game" "gesource"
|
||||
"game" "RnLBeta"
|
||||
"game" "obsidian"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
|
@ -18,6 +18,8 @@
|
||||
{
|
||||
"game" "dod"
|
||||
"game" "tf"
|
||||
"game" "cstrike"
|
||||
"game" "garrysmod"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
@ -66,6 +68,7 @@
|
||||
{
|
||||
"game" "dod"
|
||||
"game" "tf"
|
||||
"game" "cstrike"
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
@ -92,6 +95,7 @@
|
||||
{
|
||||
"game" "dod"
|
||||
"game" "tf"
|
||||
"game" "cstrike"
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
@ -113,6 +117,8 @@
|
||||
{
|
||||
"game" "dod"
|
||||
"game" "tf"
|
||||
"game" "cstrike"
|
||||
"game" "garrysmod"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
@ -204,6 +210,7 @@
|
||||
{
|
||||
"game" "dod"
|
||||
"game" "tf"
|
||||
"game" "cstrike"
|
||||
}
|
||||
"Signatures"
|
||||
{
|
||||
@ -219,7 +226,7 @@
|
||||
"FireOutputBackup"
|
||||
{
|
||||
"windows" "6"
|
||||
"linux" "10"
|
||||
"linux" "12"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,7 +245,7 @@
|
||||
"SetUserCvar"
|
||||
{
|
||||
"windows" "17"
|
||||
"linux" "55"
|
||||
"linux" "56"
|
||||
}
|
||||
/**
|
||||
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
|
||||
|
358
gamedata/sdktools.games/engine.l4d2.txt
Normal file
358
gamedata/sdktools.games/engine.l4d2.txt
Normal 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" "12"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 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" "17"
|
||||
"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" "506"
|
||||
"linux" "507"
|
||||
}
|
||||
"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" "474"
|
||||
"linux" "474"
|
||||
}
|
||||
"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" "452"
|
||||
"linux" "453"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
138
gamedata/sdktools.games/game.bg2.txt
Normal file
138
gamedata/sdktools.games/game.bg2.txt
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
141
gamedata/sdktools.games/game.cspromod.txt
Normal file
141
gamedata/sdktools.games/game.cspromod.txt
Normal file
@ -0,0 +1,141 @@
|
||||
"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"
|
||||
}
|
||||
"g_pGameRules"
|
||||
{
|
||||
"windows" "2"
|
||||
}
|
||||
}
|
||||
"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"
|
||||
}
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -26,88 +26,88 @@
|
||||
{
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "329"
|
||||
"linux" "330"
|
||||
"windows" "386"
|
||||
"linux" "387"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "226"
|
||||
"linux" "227"
|
||||
"windows" "259"
|
||||
"linux" "260"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows" "224"
|
||||
"linux" "225"
|
||||
"windows" "257"
|
||||
"linux" "258"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "188"
|
||||
"linux" "189"
|
||||
"windows" "202"
|
||||
"linux" "203"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "189"
|
||||
"linux" "190"
|
||||
"windows" "206"
|
||||
"linux" "207"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
"windows" "98"
|
||||
"linux" "99"
|
||||
"windows" "105"
|
||||
"linux" "106"
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "357"
|
||||
"linux" "358"
|
||||
"windows" "426"
|
||||
"linux" "426"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
"windows" "126"
|
||||
"linux" "127"
|
||||
"windows" "137"
|
||||
"linux" "138"
|
||||
}
|
||||
"EyeAngles"
|
||||
{
|
||||
"windows" "118"
|
||||
"linux" "119"
|
||||
"windows" "128"
|
||||
"linux" "129"
|
||||
}
|
||||
"AcceptInput"
|
||||
{
|
||||
"windows" "35"
|
||||
"linux" "36"
|
||||
"windows" "34"
|
||||
"linux" "35"
|
||||
}
|
||||
"DispatchKeyValue"
|
||||
{
|
||||
"windows" "31"
|
||||
"linux" "30"
|
||||
"windows" "29"
|
||||
"linux" "28"
|
||||
}
|
||||
"DispatchKeyValueFloat"
|
||||
{
|
||||
"windows" "30"
|
||||
"linux" "31"
|
||||
"windows" "28"
|
||||
"linux" "29"
|
||||
}
|
||||
"DispatchKeyValueVector"
|
||||
{
|
||||
"windows" "29"
|
||||
"linux" "32"
|
||||
"windows" "27"
|
||||
"linux" "30"
|
||||
}
|
||||
"SetEntityModel"
|
||||
{
|
||||
"windows" "25"
|
||||
"linux" "26"
|
||||
"windows" "23"
|
||||
"linux" "24"
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows" "217"
|
||||
"linux" "218"
|
||||
"windows" "250"
|
||||
"linux" "251"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
"windows" "32"
|
||||
"linux" "33"
|
||||
"windows" "31"
|
||||
"linux" "32"
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "347"
|
||||
"linux" "348"
|
||||
"windows" "404"
|
||||
"linux" "405"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,28 +18,28 @@
|
||||
{
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "357"
|
||||
"linux" "358"
|
||||
"windows" "385"
|
||||
"linux" "386"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "244"
|
||||
"linux" "245"
|
||||
"windows" "259"
|
||||
"linux" "260"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows" "242"
|
||||
"linux" "243"
|
||||
"windows" "257"
|
||||
"linux" "258"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "199"
|
||||
"linux" "200"
|
||||
"windows" "202"
|
||||
"linux" "203"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "203"
|
||||
"linux" "204"
|
||||
"windows" "206"
|
||||
"linux" "207"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
@ -48,18 +48,18 @@
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "396"
|
||||
"linux" "396"
|
||||
"windows" "422"
|
||||
"linux" "423"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
"windows" "136"
|
||||
"linux" "137"
|
||||
"windows" "137"
|
||||
"linux" "138"
|
||||
}
|
||||
"EyeAngles"
|
||||
{
|
||||
"windows" "127"
|
||||
"linux" "128"
|
||||
"windows" "128"
|
||||
"linux" "129"
|
||||
}
|
||||
"AcceptInput"
|
||||
{
|
||||
@ -88,14 +88,19 @@
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows" "235"
|
||||
"linux" "236"
|
||||
"windows" "250"
|
||||
"linux" "251"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
"windows" "31"
|
||||
"linux" "32"
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "403"
|
||||
"linux" "404"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
"Games"
|
||||
{
|
||||
/* Empires 2.24 */
|
||||
/* Empires 2.25b */
|
||||
"empires"
|
||||
{
|
||||
|
||||
@ -19,48 +19,48 @@
|
||||
{
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "354"
|
||||
"linux" "355"
|
||||
"windows" "353"
|
||||
"linux" "354"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "241"
|
||||
"linux" "242"
|
||||
"windows" "240"
|
||||
"linux" "241"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows" "239"
|
||||
"linux" "240"
|
||||
"windows" "238"
|
||||
"linux" "239"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "196"
|
||||
"linux" "197"
|
||||
"windows" "195"
|
||||
"linux" "196"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "200"
|
||||
"linux" "201"
|
||||
"windows" "199"
|
||||
"linux" "200"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
"windows" "104"
|
||||
"linux" "105"
|
||||
"windows" "103"
|
||||
"linux" "104"
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "401"
|
||||
"linux" "402"
|
||||
"windows" "392"
|
||||
"linux" "392"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
"windows" "133"
|
||||
"linux" "134"
|
||||
"windows" "132"
|
||||
"linux" "133"
|
||||
}
|
||||
"EyeAngles"
|
||||
{
|
||||
"windows" "125"
|
||||
"linux" "126"
|
||||
"windows" "124"
|
||||
"linux" "125"
|
||||
}
|
||||
"DispatchKeyValue"
|
||||
{
|
||||
@ -79,29 +79,61 @@
|
||||
}
|
||||
"AcceptInput"
|
||||
{
|
||||
"windows" "35"
|
||||
"linux" "36"
|
||||
"windows" "34"
|
||||
"linux" "35"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
"windows" "31"
|
||||
"linux" "32"
|
||||
}
|
||||
"TakeHealth"
|
||||
{
|
||||
"windows" "62"
|
||||
"linux" "63"
|
||||
}
|
||||
"ChangeTeam"
|
||||
{
|
||||
"windows" "87"
|
||||
"linux" "88"
|
||||
}
|
||||
"SetEntityModel"
|
||||
{
|
||||
"windows" "23"
|
||||
"linux" "24"
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows" "231"
|
||||
"linux" "232"
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "372"
|
||||
"linux" "373"
|
||||
}
|
||||
"FireOutputBackup"
|
||||
{
|
||||
"windows" "6"
|
||||
"linux" "10"
|
||||
}
|
||||
}
|
||||
"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"
|
||||
"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"
|
||||
}
|
||||
"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"
|
||||
}
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x83\x2A\x2A\x81\xEC\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x57\x89"
|
||||
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,6 +96,11 @@
|
||||
"windows" "36"
|
||||
"linux" "37"
|
||||
}
|
||||
"FireOutputBackup"
|
||||
{
|
||||
"windows" "6"
|
||||
"linux" "6"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
@ -120,6 +125,12 @@
|
||||
"library" "server"
|
||||
"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\x54\x56\xFF\xD2"
|
||||
}
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x81\xEC\x2A\x2A\x2A\x2A\x53\x55\x56\x8B\x2A\x2A\x85\xF6\x57"
|
||||
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user