Compare commits
246
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ecdfae3ed | ||
|
|
af6350176d | ||
|
|
ca2e8e4675 | ||
|
|
50ace321d1 | ||
|
|
d3d700cfdc | ||
|
|
d3277ce11a | ||
|
|
9f40261c69 | ||
|
|
3b4e73cdd7 | ||
|
|
ccca0a91eb | ||
|
|
fa8bf950ac | ||
|
|
eee2108efb | ||
|
|
406b72e0a6 | ||
|
|
6c658b4f8e | ||
|
|
8a51bc6dbf | ||
|
|
3fffcdb931 | ||
|
|
5630fa67fc | ||
|
|
1a87eeead0 | ||
|
|
d1ac171e72 | ||
|
|
c6899a86f1 | ||
|
|
a2e2355101 | ||
|
|
7ca786168f | ||
|
|
d1ec331ada | ||
|
|
37658183bc | ||
|
|
aef08d1f19 | ||
|
|
b83e8e6c29 | ||
|
|
f328aecc62 | ||
|
|
4620f4cf7a | ||
|
|
80e3198b7b | ||
|
|
064aa83991 | ||
|
|
d359e5eef3 | ||
|
|
0425527b83 | ||
|
|
4f3399ae91 | ||
|
|
9223c714b3 | ||
|
|
c546e59c80 | ||
|
|
fe2383e061 | ||
|
|
cc9c5e227d | ||
|
|
53f53c64fc | ||
|
|
cd58e16d9c | ||
|
|
df6ca9b246 | ||
|
|
defa74660b | ||
|
|
3b9962f05a | ||
|
|
6151a39b7f | ||
|
|
eb0d2efa48 | ||
|
|
fb4ad7ae81 | ||
|
|
5916709430 | ||
|
|
6e40168f79 | ||
|
|
f457362f18 | ||
|
|
f801ce9542 | ||
|
|
cb489af757 | ||
|
|
dd4a02bf1f | ||
|
|
95de3a64d8 | ||
|
|
d3144079e9 | ||
|
|
fc331ad4e0 | ||
|
|
269c4c56ee | ||
|
|
965aaeb543 | ||
|
|
69c00d69dc | ||
|
|
ec5968d5aa | ||
|
|
80bfd9557e | ||
|
|
b52489f723 | ||
|
|
bada4c82eb | ||
|
|
5e3419836c | ||
|
|
e1f91a768c | ||
|
|
467d796d7a | ||
|
|
b92ad41d6d | ||
|
|
010da757da | ||
|
|
1030c9b1b3 | ||
|
|
de8157302d | ||
|
|
4d1893df4d | ||
|
|
a2baac7f5e | ||
|
|
ac4a381295 | ||
|
|
9831316aff | ||
|
|
7ec2f45708 | ||
|
|
3fd3f99c89 | ||
|
|
520a5b1bea | ||
|
|
1afc603bdf | ||
|
|
d8907b332d | ||
|
|
27b6a190f0 | ||
|
|
de9ff287a1 | ||
|
|
32fb29582e | ||
|
|
b635dace11 | ||
|
|
d990f956f9 | ||
|
|
955f1e0d3a | ||
|
|
b4cd559186 | ||
|
|
46e89891e1 | ||
|
|
080e2563c3 | ||
|
|
e1e0c33f2c | ||
|
|
0160d3cc71 | ||
|
|
81f0d82c67 | ||
|
|
b5276b435a | ||
|
|
16aecfb404 | ||
|
|
7054ef56f6 | ||
|
|
bfae78d1ec | ||
|
|
c82f2b4659 | ||
|
|
46d71790be | ||
|
|
647811f930 | ||
|
|
7ca80d1c7c | ||
|
|
8823bab3f3 | ||
|
|
b9d5b59bd1 | ||
|
|
7fc892d38b | ||
|
|
09040231a0 | ||
|
|
16541a5668 | ||
|
|
e1b3b14311 | ||
|
|
300632db86 | ||
|
|
d1776dd641 | ||
|
|
22cee6a2dd | ||
|
|
a2194df273 | ||
|
|
27e20996dd | ||
|
|
b5f16142e5 | ||
|
|
23f1f9e148 | ||
|
|
990f99af5a | ||
|
|
6ca9d86e8f | ||
|
|
fae8b4d49a | ||
|
|
7f2d9dd8eb | ||
|
|
8ae1b3e1e7 | ||
|
|
c77c853c02 | ||
|
|
2b0daba573 | ||
|
|
ba4aa4d37f | ||
|
|
e3f31af5d3 | ||
|
|
bc0bf4e270 | ||
|
|
60c5ad6324 | ||
|
|
e996a00675 | ||
|
|
0be3f0afed | ||
|
|
86bdfa2205 | ||
|
|
56c87e927f | ||
|
|
be54443918 | ||
|
|
676ea8b29c | ||
|
|
d77ff38428 | ||
|
|
d3256ef339 | ||
|
|
3d11742f91 | ||
|
|
a2aa5d1cda | ||
|
|
8860e18026 | ||
|
|
7dba540b97 | ||
|
|
0dd9a5b842 | ||
|
|
e6c3565544 | ||
|
|
8cacba922a | ||
|
|
767396d4ee | ||
|
|
07a51a0d4e | ||
|
|
9f042625d0 | ||
|
|
fc29f4249a | ||
|
|
5ca5ecee85 | ||
|
|
c79d547492 | ||
|
|
f079773195 | ||
|
|
e6ead8b5aa | ||
|
|
9eba6402eb | ||
|
|
f95be3b10c | ||
|
|
2220cc961e | ||
|
|
cfc6b2fee9 | ||
|
|
d188859fc5 | ||
|
|
96a8003448 | ||
|
|
696f702204 | ||
|
|
8b26ce73c2 | ||
|
|
ee5f488aa2 | ||
|
|
3a5cf80e2b | ||
|
|
3e4f7af96a | ||
|
|
a1a483fa27 | ||
|
|
b32f8a4803 | ||
|
|
96ee6dbf8a | ||
|
|
ac07cf95e1 | ||
|
|
8f51e33167 | ||
|
|
8366f371ad | ||
|
|
9b44dfea11 | ||
|
|
7ede8e0924 | ||
|
|
9fe2d9c1cf | ||
|
|
1836ec9d45 | ||
|
|
380d7adc09 | ||
|
|
4109d0df39 | ||
|
|
9cab1e3ab7 | ||
|
|
e9d8bfcdfc | ||
|
|
f134602991 | ||
|
|
b493532ee1 | ||
|
|
84dec75fb8 | ||
|
|
b1094f87c6 | ||
|
|
284b4bfe20 | ||
|
|
b46537ddd5 | ||
|
|
c9446c4d7d | ||
|
|
d4610ab340 | ||
|
|
0016b8ef2f | ||
|
|
72e08f7e44 | ||
|
|
b06cfa5414 | ||
|
|
a7742cae3d | ||
|
|
8a78285659 | ||
|
|
6847c8eec0 | ||
|
|
66790254ac | ||
|
|
86b8a0b16a | ||
|
|
25fced78e8 | ||
|
|
22d11160ba | ||
|
|
8d65b3e94e | ||
|
|
5518544ecd | ||
|
|
af3523bd2d | ||
|
|
8646cca538 | ||
|
|
c7cea1b40b | ||
|
|
58914f71bd | ||
|
|
3841e98c4f | ||
|
|
acd025dba2 | ||
|
|
78c2206628 | ||
|
|
5c47bf8803 | ||
|
|
8e78ee6f57 | ||
|
|
a2da4cc868 | ||
|
|
00e44ad3c3 | ||
|
|
29ba84fc5c | ||
|
|
283f1f012d | ||
|
|
fff17f8043 | ||
|
|
847eaf38f9 | ||
|
|
1d59a329eb | ||
|
|
5689888682 | ||
|
|
a01768525a | ||
|
|
e3d2ddf278 | ||
|
|
b3e48b0ad7 | ||
|
|
6d528b5c55 | ||
|
|
22daf26e3e | ||
|
|
73061969da | ||
|
|
4653530095 | ||
|
|
ef5faaaa4a | ||
|
|
f52ea98eb4 | ||
|
|
d315d4bf53 | ||
|
|
eaef2a46fb | ||
|
|
b0304a89a6 | ||
|
|
a4790f0358 | ||
|
|
d3d5cd8181 | ||
|
|
64be2bc5a0 | ||
|
|
30e476c35e | ||
|
|
88af208cdd | ||
|
|
b64751c1af | ||
|
|
2e158a72e2 | ||
|
|
c8fb05dd4b | ||
|
|
860af1e6cb | ||
|
|
5c1cadb64e | ||
|
|
bfb97a4207 | ||
|
|
7e26691b99 | ||
|
|
ca469a218a | ||
|
|
6052ddaa64 | ||
|
|
0ddc675472 | ||
|
|
9412f687cb | ||
|
|
0e865c0618 | ||
|
|
462b5213d7 | ||
|
|
f52e84730f | ||
|
|
b8873efa0d | ||
|
|
4132b9bd21 | ||
|
|
c0caa9f158 | ||
|
|
7346b0c081 | ||
|
|
6a361e3045 | ||
|
|
61d7519ef5 | ||
|
|
3e1a78703e | ||
|
|
bb195a9b2d | ||
|
|
6f095a064c | ||
|
|
eb334f5fe2 |
@@ -3,3 +3,9 @@ e6ef5ecdf8d75740ca2685a709bf321f8873bc3b sourcemod-1.1.0
|
|||||||
e877885fac80be71822641f7a9122cebc9812521 sourcemod-1.1.1
|
e877885fac80be71822641f7a9122cebc9812521 sourcemod-1.1.1
|
||||||
b3ffa8a4511c4eadaf533fc790aa6b14f7f0c6ea sourcemod-1.1.2
|
b3ffa8a4511c4eadaf533fc790aa6b14f7f0c6ea sourcemod-1.1.2
|
||||||
3a73bbf60f34befa9b66be03fa5974b394bb3411 sourcemod-1.2.0
|
3a73bbf60f34befa9b66be03fa5974b394bb3411 sourcemod-1.2.0
|
||||||
|
78a1f1b1c6fa86fd7691c70ebf48a9fb3dfb3c11 sourcemod-1.5.0
|
||||||
|
5574bfe07731b7dba171c1300f6022319d2dbc89 sourcemod-1.5.1
|
||||||
|
238c41726d73d9f0d65005ff43c1ab86adb0e163 sourcemod-1.5.2
|
||||||
|
27bf76b007d2360a9cfc7af9e14d1c9a6bddcc64 sourcemod-1.5.3
|
||||||
|
27bf76b007d2360a9cfc7af9e14d1c9a6bddcc64 sourcemod-1.5.3
|
||||||
|
0000000000000000000000000000000000000000 sourcemod-1.5.3
|
||||||
|
|||||||
+436
-385
@@ -1,359 +1,340 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os, sys
|
||||||
import sys
|
|
||||||
from ambuild.command import SymlinkCommand
|
|
||||||
|
|
||||||
class SM:
|
class SDK(object):
|
||||||
def __init__(self):
|
def __init__(self, sdk, ext, aDef, name, platform, dir):
|
||||||
self.compiler = Cpp.Compiler()
|
if dir == 'ep1':
|
||||||
|
folder = 'hl2sdk'
|
||||||
|
else:
|
||||||
|
folder = 'hl2sdk-' + dir
|
||||||
|
self.envvar = sdk
|
||||||
|
self.ext = ext
|
||||||
|
self.code = aDef
|
||||||
|
self.define = name
|
||||||
|
self.platform = platform
|
||||||
|
self.folder = folder # Default folder name.
|
||||||
|
self.name = dir
|
||||||
|
self.path = None # Actual path
|
||||||
|
|
||||||
#Build SDK info
|
WinOnly = ['windows']
|
||||||
self.possibleSdks = { }
|
WinLinux = ['windows', 'linux']
|
||||||
self.possibleSdks['ep1'] = {'sdk': 'HL2SDK', 'ext': '1.ep1', 'def': '1',
|
WinLinuxMac = ['windows', 'linux', 'mac']
|
||||||
'name': 'EPISODEONE', 'platform': ['windows', 'linux']}
|
|
||||||
self.possibleSdks['ep2'] = {'sdk': 'HL2SDKOB', 'ext': '2.ep2', 'def': '3',
|
|
||||||
'name': 'ORANGEBOX', 'platform': ['windows', 'linux']}
|
|
||||||
self.possibleSdks['css'] = {'sdk': 'HL2SDKCSS', 'ext': '2.css', 'def': '6',
|
|
||||||
'name': 'CSS', 'platform': ['windows', 'linux', 'darwin']}
|
|
||||||
self.possibleSdks['ep2v'] = {'sdk': 'HL2SDKOBVALVE', 'ext': '2.ep2v', 'def': '7',
|
|
||||||
'name': 'ORANGEBOXVALVE', 'platform': ['windows', 'linux', 'darwin']}
|
|
||||||
self.possibleSdks['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '8',
|
|
||||||
'name': 'LEFT4DEAD', 'platform': ['windows', 'linux', 'darwin']}
|
|
||||||
self.possibleSdks['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '9',
|
|
||||||
'name': 'LEFT4DEAD2', 'platform': ['windows', 'linux', 'darwin']}
|
|
||||||
self.possibleSdks['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2',
|
|
||||||
'name': 'DARKMESSIAH', 'platform': ['windows']}
|
|
||||||
self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM', 'ext': '2.swarm', 'def': '10',
|
|
||||||
'name': 'ALIENSWARM', 'platform': ['windows']}
|
|
||||||
self.possibleSdks['bgt'] = {'sdk': 'HL2SDK-BGT', 'ext': '2.bgt', 'def': '4',
|
|
||||||
'name': 'BLOODYGOODTIME', 'platform': ['windows']}
|
|
||||||
self.possibleSdks['eye'] = {'sdk': 'HL2SDK-EYE', 'ext': '2.eye', 'def': '5',
|
|
||||||
'name': 'EYE', 'platform': ['windows']}
|
|
||||||
self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '12',
|
|
||||||
'name': 'CSGO', 'platform': ['windows', 'linux', 'darwin']}
|
|
||||||
# self.possibleSdks['portal2'] = {'sdk': 'HL2SDK-PORTAL2', 'ext': '2.portal2', 'def': '11',
|
|
||||||
# 'name': 'PORTAL2', 'platform': ['windows']}
|
|
||||||
|
|
||||||
self.sdkInfo = { }
|
PossibleSDKs = {
|
||||||
|
'ep1': SDK('HL2SDK', '1.ep1', '1', 'EPISODEONE', WinLinux, 'ep1'),
|
||||||
|
'ep2': SDK('HL2SDKOB', '2.ep2', '3', 'ORANGEBOX', WinLinux, 'ob'),
|
||||||
|
'css': SDK('HL2SDKCSS', '2.css', '6', 'CSS', WinLinuxMac, 'css'),
|
||||||
|
'hl2dm': SDK('HL2SDKHL2DM', '2.hl2dm', '7', 'HL2DM', WinLinuxMac, 'hl2dm'),
|
||||||
|
'dods': SDK('HL2SDKDODS', '2.dods', '8', 'DODS', WinLinuxMac, 'dods'),
|
||||||
|
'tf2': SDK('HL2SDKTF2', '2.tf2', '10', 'TF2', WinLinuxMac, 'tf2'),
|
||||||
|
'l4d': SDK('HL2SDKL4D', '2.l4d', '11', 'LEFT4DEAD', WinLinuxMac, 'l4d'),
|
||||||
|
'nd': SDK('HL2SDKND', '2.nd', '12', 'NUCLEARDAWN', WinLinuxMac, 'nd'),
|
||||||
|
'l4d2': SDK('HL2SDKL4D2', '2.l4d2', '13', 'LEFT4DEAD2', WinLinuxMac, 'l4d2'),
|
||||||
|
'darkm': SDK('HL2SDK-DARKM', '2.darkm', '2', 'DARKMESSIAH', WinOnly, 'darkm'),
|
||||||
|
'swarm': SDK('HL2SDK-SWARM', '2.swarm', '14', 'ALIENSWARM', WinOnly, 'swarm'),
|
||||||
|
'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'),
|
||||||
|
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
|
||||||
|
'csgo': SDK('HL2SDKCSGO', '2.csgo', '18', 'CSGO', WinLinuxMac, 'csgo'),
|
||||||
|
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '15', 'PORTAL2', [], 'portal2'),
|
||||||
|
|
||||||
if AMBuild.mode == 'config':
|
# These engines are only supported on SourceMod 1.6.
|
||||||
#Detect compilers
|
# 'blade': SDK('HL2SDKBLADE', '2.blade', '16', 'BLADE', WinLinux, 'blade'),
|
||||||
self.compiler.DetectAll(AMBuild)
|
# 'dota': SDK('HL2SDKDOTA', '2.dota', '19', 'DOTA', WinOnly, 'dota'),
|
||||||
|
# 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '17', 'INSURGENCY', WinLinuxMac, 'insurgency'),
|
||||||
|
# 'sdk2013': SDK('HL2SDK2013', '2.sdk2013', '9', 'SDK2013', WinLinuxMac, '2013'),
|
||||||
|
}
|
||||||
|
|
||||||
#Detect variables
|
def ResolveEnvPath(env, folder):
|
||||||
envvars = { 'MMSOURCE19': 'mmsource-1.9',
|
if env in os.environ:
|
||||||
'HL2SDKCSS': 'hl2sdk-css',
|
path = os.environ[env]
|
||||||
'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
|
if os.path.isdir(path):
|
||||||
'HL2SDKL4D': 'hl2sdk-l4d',
|
return path
|
||||||
'HL2SDKL4D2': 'hl2sdk-l4d2',
|
|
||||||
'HL2SDKCSGO': 'hl2sdk-csgo',
|
|
||||||
'MYSQL5': 'mysql-5.0'
|
|
||||||
}
|
|
||||||
|
|
||||||
if AMBuild.target['platform'] != 'darwin':
|
|
||||||
envvars['HL2SDK'] = 'hl2sdk'
|
|
||||||
envvars['HL2SDKOB'] = 'hl2sdk-ob'
|
|
||||||
|
|
||||||
#Dark Messiah is Windows-only
|
|
||||||
if AMBuild.target['platform'] == 'windows':
|
|
||||||
envvars['HL2SDK-DARKM'] = 'hl2sdk-darkm'
|
|
||||||
envvars['HL2SDK-SWARM'] = 'hl2sdk-swarm'
|
|
||||||
envvars['HL2SDK-BGT'] = 'hl2sdk-bgt'
|
|
||||||
envvars['HL2SDK-EYE'] = 'hl2sdk-eye'
|
|
||||||
|
|
||||||
# Finds if a dict with `key` set to `value` is present on the dict of dicts `dictionary`
|
|
||||||
def findDictByKey(dictionary, key, value):
|
|
||||||
for index in dictionary:
|
|
||||||
elem = dictionary[index]
|
|
||||||
if elem[key] == value:
|
|
||||||
return (elem, index)
|
|
||||||
return None
|
|
||||||
|
|
||||||
for i in envvars:
|
|
||||||
if i in os.environ:
|
|
||||||
path = os.environ[i]
|
|
||||||
if not os.path.isdir(path):
|
|
||||||
raise Exception('Path for {0} was not found: {1}'.format(i, path))
|
|
||||||
elif i.startswith('HL2SDK'):
|
|
||||||
(info, sdk) = findDictByKey(self.possibleSdks, 'sdk', i)
|
|
||||||
self.sdkInfo[sdk] = info
|
|
||||||
else:
|
else:
|
||||||
head = os.getcwd()
|
head = os.getcwd()
|
||||||
oldhead = None
|
oldhead = None
|
||||||
while head != None and head != oldhead:
|
while head != None and head != oldhead:
|
||||||
path = os.path.join(head, envvars[i])
|
path = os.path.join(head, folder)
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
break
|
return path
|
||||||
oldhead = head
|
oldhead = head
|
||||||
head, tail = os.path.split(head)
|
head, tail = os.path.split(head)
|
||||||
if i.startswith('HL2SDK'):
|
return None
|
||||||
if head != None and head != oldhead:
|
|
||||||
(info, sdk) = findDictByKey(self.possibleSdks, 'sdk', i)
|
|
||||||
self.sdkInfo[sdk] = info
|
|
||||||
elif head == None or head == oldhead:
|
|
||||||
raise Exception('Could not find a valid path for {0}'.format(i))
|
|
||||||
AMBuild.cache.CacheVariable(i, path)
|
|
||||||
|
|
||||||
if len(self.sdkInfo) < 1:
|
class SMConfig(object):
|
||||||
raise Exception('At least one SDK must be available.')
|
def __init__(self):
|
||||||
|
self.sdks = {}
|
||||||
|
self.binaries = []
|
||||||
|
self.extensions = []
|
||||||
|
self.generated_headers = None
|
||||||
|
self.mms_root = None
|
||||||
|
self.mysql_root = None
|
||||||
|
self.spcomp = None
|
||||||
|
self.smx_files = {}
|
||||||
|
self.versionlib = None
|
||||||
|
|
||||||
AMBuild.cache.CacheVariable('sdkInfo', self.sdkInfo)
|
def detectProductVersion(self):
|
||||||
|
builder.AddConfigureFile('product.version')
|
||||||
#Set up defines
|
|
||||||
cxx = self.compiler.cxx
|
|
||||||
if isinstance(cxx, Cpp.CompatGCC):
|
|
||||||
if isinstance(cxx, Cpp.GCC):
|
|
||||||
self.vendor = 'gcc'
|
|
||||||
elif isinstance(cxx, Cpp.Clang):
|
|
||||||
self.vendor = 'clang'
|
|
||||||
self.compiler.AddToListVar('CDEFINES', 'stricmp=strcasecmp')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_stricmp=strcasecmp')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_snprintf=snprintf')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_vsnprintf=vsnprintf')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-pipe')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-fno-strict-aliasing')
|
|
||||||
if (self.vendor == 'gcc' and cxx.majorVersion >= 4) or self.vendor == 'clang':
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-fvisibility=hidden')
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-fvisibility-inlines-hidden')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-Wall')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-Werror')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-Wno-uninitialized')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-Wno-unused')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-Wno-switch')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-msse')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-m32')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-m32')
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-fno-exceptions')
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-fno-threadsafe-statics')
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-Wno-non-virtual-dtor')
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-Wno-overloaded-virtual')
|
|
||||||
if (self.vendor == 'gcc' and cxx.majorVersion >= 4 and cxx.minorVersion >= 7) or \
|
|
||||||
(self.vendor == 'clang' and cxx.majorVersion >= 3):
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-Wno-delete-non-virtual-dtor')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', 'HAVE_STDINT_H')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', 'GNUC')
|
|
||||||
if self.vendor == 'gcc':
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-mfpmath=sse')
|
|
||||||
elif isinstance(cxx, Cpp.MSVC):
|
|
||||||
self.vendor = 'msvc'
|
|
||||||
if AMBuild.options.debug == '1':
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '/MTd')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '/NODEFAULTLIB:libcmt')
|
|
||||||
else:
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '/MT')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_CRT_SECURE_NO_DEPRECATE')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_CRT_SECURE_NO_WARNINGS')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_CRT_NONSTDC_NO_DEPRECATE')
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '/EHsc')
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '/GR-')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '/W3')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '/nologo')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '/Zi')
|
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '/TP')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '/DEBUG')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '/MACHINE:X86')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '/SUBSYSTEM:WINDOWS')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'kernel32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'user32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'gdi32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'winspool.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'comdlg32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'advapi32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'shell32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'ole32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'oleaut32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'uuid.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'odbc32.lib')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', 'odbccp32.lib')
|
|
||||||
|
|
||||||
#Optimization
|
|
||||||
if AMBuild.options.opt == '1':
|
|
||||||
self.compiler.AddToListVar('CDEFINES', 'NDEBUG')
|
|
||||||
if self.vendor == 'gcc' or self.vendor == 'clang':
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-O3')
|
|
||||||
elif self.vendor == 'msvc':
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '/Ox')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '/OPT:ICF')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '/OPT:REF')
|
|
||||||
|
|
||||||
#Debugging
|
|
||||||
if AMBuild.options.debug == '1':
|
|
||||||
self.compiler.AddToListVar('CDEFINES', 'DEBUG')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_DEBUG')
|
|
||||||
if self.vendor == 'gcc' or self.vendor == 'clang':
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '-g3')
|
|
||||||
elif self.vendor == 'msvc':
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '/Od')
|
|
||||||
self.compiler.AddToListVar('CFLAGS', '/RTC1')
|
|
||||||
|
|
||||||
#Platform-specifics
|
|
||||||
if AMBuild.target['platform'] == 'linux':
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_LINUX')
|
|
||||||
if self.vendor == 'gcc':
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-static-libgcc')
|
|
||||||
if self.vendor == 'clang':
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-lgcc_eh')
|
|
||||||
elif AMBuild.target['platform'] == 'darwin':
|
|
||||||
self.compiler.AddToListVar('CDEFINES', 'OSX')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_OSX')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-mmacosx-version-min=10.5')
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', ['-arch', 'i386'])
|
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-lstdc++')
|
|
||||||
|
|
||||||
# For OS X dylib versioning
|
# For OS X dylib versioning
|
||||||
import re
|
import re
|
||||||
productFile = open(os.path.join(AMBuild.sourceFolder, 'product.version'), 'r')
|
with open(os.path.join(builder.sourcePath, 'product.version'), 'r') as fp:
|
||||||
productContents = productFile.read()
|
productContents = fp.read()
|
||||||
productFile.close()
|
|
||||||
m = re.match('(\d+)\.(\d+)\.(\d+).*', productContents)
|
m = re.match('(\d+)\.(\d+)\.(\d+).*', productContents)
|
||||||
if m == None:
|
if m == None:
|
||||||
self.version = '1.0.0'
|
self.productVersion = '1.0.0'
|
||||||
else:
|
else:
|
||||||
major, minor, release = m.groups()
|
major, minor, release = m.groups()
|
||||||
self.version = '{0}.{1}.{2}'.format(major, minor, release)
|
self.productVersion = '{0}.{1}.{2}'.format(major, minor, release)
|
||||||
AMBuild.cache.CacheVariable('version', self.version)
|
|
||||||
elif AMBuild.target['platform'] == 'windows':
|
|
||||||
self.compiler.AddToListVar('CDEFINES', 'WIN32')
|
|
||||||
self.compiler.AddToListVar('CDEFINES', '_WINDOWS')
|
|
||||||
|
|
||||||
#Finish up
|
def detectSDKs(self):
|
||||||
self.compiler.AddToListVar('CDEFINES', 'SOURCEMOD_BUILD')
|
sdk_list = builder.options.sdks.split(',')
|
||||||
self.compiler.AddToListVar('CDEFINES', 'SM_GENERATED_BUILD')
|
use_all = sdk_list[0] == 'all'
|
||||||
self.compiler.AddToListVar('CINCLUDES',
|
use_present = sdk_list[0] == 'present'
|
||||||
os.path.join(AMBuild.outputFolder, 'includes'))
|
|
||||||
self.compiler.ToConfig(AMBuild, 'compiler')
|
for sdk_name in PossibleSDKs:
|
||||||
AMBuild.cache.CacheVariable('vendor', self.vendor)
|
sdk = PossibleSDKs[sdk_name]
|
||||||
self.targetMap = { }
|
if builder.target_platform in sdk.platform:
|
||||||
AMBuild.cache.CacheVariable('targetMap', self.targetMap)
|
sdk_path = ResolveEnvPath(sdk.envvar, sdk.folder)
|
||||||
|
if sdk_path is None:
|
||||||
|
if use_all or sdk_name in sdk_list:
|
||||||
|
raise Exception('Could not find a valid path for {0}'.format(sdk.envvar))
|
||||||
|
continue
|
||||||
|
if use_all or use_present or sdk_name in sdk_list:
|
||||||
|
sdk.path = sdk_path
|
||||||
|
self.sdks[sdk_name] = sdk
|
||||||
|
|
||||||
|
if len(self.sdks) < 1:
|
||||||
|
raise Exception('At least one SDK must be available.')
|
||||||
|
|
||||||
|
self.mms_root = ResolveEnvPath('MMSOURCE110', 'mmsource-1.10')
|
||||||
|
if not self.mms_root:
|
||||||
|
self.mms_root = ResolveEnvPath('MMSOURCE_DEV', 'mmsource-central')
|
||||||
|
if not self.mms_root:
|
||||||
|
raise Exception('Could not find a source copy of Metamod:Source')
|
||||||
|
|
||||||
|
if builder.options.hasMySql:
|
||||||
|
for i in range(7):
|
||||||
|
self.mysql_root = ResolveEnvPath('MYSQL5', 'mysql-5.' + str(i))
|
||||||
|
if self.mysql_root:
|
||||||
|
break
|
||||||
|
if not self.mysql_root:
|
||||||
|
raise Exception('Could not find a path to MySQL!')
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
builder.AddConfigureFile('pushbuild.txt')
|
||||||
|
|
||||||
|
cfg = builder.DetectCompilers()
|
||||||
|
cxx = cfg.cxx
|
||||||
|
|
||||||
|
if cxx.behavior == 'gcc':
|
||||||
|
cfg.defines += [
|
||||||
|
'stricmp=strcasecmp',
|
||||||
|
'_stricmp=strcasecmp',
|
||||||
|
'_snprintf=snprintf',
|
||||||
|
'_vsnprintf=vsnprintf',
|
||||||
|
'HAVE_STDINT_H',
|
||||||
|
'GNUC',
|
||||||
|
]
|
||||||
|
cfg.cflags += [
|
||||||
|
'-pipe',
|
||||||
|
'-fno-strict-aliasing',
|
||||||
|
'-Wall',
|
||||||
|
'-Werror',
|
||||||
|
'-Wno-uninitialized',
|
||||||
|
'-Wno-unused',
|
||||||
|
'-Wno-switch',
|
||||||
|
'-msse',
|
||||||
|
'-m32',
|
||||||
|
]
|
||||||
|
|
||||||
|
have_gcc = cxx.name == 'gcc'
|
||||||
|
have_clang = cxx.name == 'clang'
|
||||||
|
if have_clang or (have_gcc and cxx.majorVersion >= 4):
|
||||||
|
cfg.cflags += ['-fvisibility=hidden']
|
||||||
|
cfg.cxxflags += ['-fvisibility-inlines-hidden']
|
||||||
|
if have_clang or (have_gcc and cxx.minorVersion >= 6):
|
||||||
|
cfg.cflags += ['-Wno-narrowing']
|
||||||
|
if (have_gcc and cxx.minorVersion >= 7) or (have_clang and cxx.majorVersion >= 3):
|
||||||
|
cfg.cxxflags += ['-Wno-delete-non-virtual-dtor']
|
||||||
|
|
||||||
|
if have_gcc:
|
||||||
|
cfg.cflags += ['-Wno-parentheses']
|
||||||
|
elif have_clang:
|
||||||
|
cfg.cflags += ['-Wno-logical-op-parentheses']
|
||||||
|
|
||||||
|
cfg.linkflags += ['-m32']
|
||||||
|
cfg.cxxflags += [
|
||||||
|
'-fno-exceptions',
|
||||||
|
'-fno-threadsafe-statics',
|
||||||
|
'-Wno-non-virtual-dtor',
|
||||||
|
'-Wno-overloaded-virtual',
|
||||||
|
]
|
||||||
|
|
||||||
|
if have_gcc:
|
||||||
|
cfg.cflags += ['-mfpmath=sse']
|
||||||
|
elif cxx.name == 'msvc':
|
||||||
|
if builder.options.debug == '1':
|
||||||
|
cfg.cflags += ['/MTd']
|
||||||
|
cfg.linkflags += ['/NODEFAULTLIB:libcmt']
|
||||||
else:
|
else:
|
||||||
self.sdkInfo = AMBuild.cache['sdkInfo']
|
cfg.cflags += ['/MT']
|
||||||
self.compiler.FromConfig(AMBuild, 'compiler')
|
cfg.defines += [
|
||||||
self.targetMap = AMBuild.cache['targetMap']
|
'_CRT_SECURE_NO_DEPRECATE',
|
||||||
|
'_CRT_SECURE_NO_WARNINGS',
|
||||||
|
'_CRT_NONSTDC_NO_DEPRECATE',
|
||||||
|
'_ITERATOR_DEBUG_LEVEL=0',
|
||||||
|
]
|
||||||
|
cfg.cflags += [
|
||||||
|
'/W3',
|
||||||
|
]
|
||||||
|
cfg.cxxflags += [
|
||||||
|
'/EHsc',
|
||||||
|
'/GR-',
|
||||||
|
'/TP',
|
||||||
|
]
|
||||||
|
cfg.linkflags += [
|
||||||
|
'/MACHINE:X86',
|
||||||
|
'/SUBSYSTEM:WINDOWS',
|
||||||
|
'kernel32.lib',
|
||||||
|
'user32.lib',
|
||||||
|
'gdi32.lib',
|
||||||
|
'winspool.lib',
|
||||||
|
'comdlg32.lib',
|
||||||
|
'advapi32.lib',
|
||||||
|
'shell32.lib',
|
||||||
|
'ole32.lib',
|
||||||
|
'oleaut32.lib',
|
||||||
|
'uuid.lib',
|
||||||
|
'odbc32.lib',
|
||||||
|
'odbccp32.lib',
|
||||||
|
]
|
||||||
|
|
||||||
if AMBuild.target['platform'] == 'windows':
|
# Optimization
|
||||||
self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public'))
|
if builder.options.opt == '1':
|
||||||
self.compiler.AddToListVar('RCINCLUDES',
|
cfg.defines += ['NDEBUG']
|
||||||
os.path.join(AMBuild.outputFolder, 'includes'))
|
if cxx.behavior == 'gcc':
|
||||||
self.mmsPath = AMBuild.cache['MMSOURCE19']
|
cfg.cflags += ['-O3']
|
||||||
|
elif cxx.behavior == 'msvc':
|
||||||
|
cfg.cflags += ['/Ox']
|
||||||
|
cfg.linkflags += ['/OPT:ICF', '/OPT:REF']
|
||||||
|
|
||||||
def DefaultCompiler(self):
|
# Debugging
|
||||||
return self.compiler.Clone()
|
if builder.options.debug == '1':
|
||||||
|
cfg.defines += ['DEBUG', '_DEBUG']
|
||||||
|
if cxx.behavior == 'msvc':
|
||||||
|
cfg.cflags += ['/Od', '/RTC1']
|
||||||
|
if int(cxx.version) >= 1600:
|
||||||
|
cfg.cflags += ['/d2Zi+']
|
||||||
|
|
||||||
def JobMatters(self, jobname):
|
# This needs to be after our optimization flags which could otherwise disable it.
|
||||||
file = sys._getframe().f_code.co_filename
|
if cxx.name == 'msvc':
|
||||||
if AMBuild.mode == 'config':
|
# Don't omit the frame pointer.
|
||||||
self.targetMap[jobname] = file
|
cfg.cflags += ['/Oy-']
|
||||||
return True
|
|
||||||
if len(AMBuild.args) == 0:
|
|
||||||
return True
|
|
||||||
if not jobname in AMBuild.args:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def DefaultExtCompiler(self, path):
|
# Platform-specifics
|
||||||
compiler = self.DefaultCompiler()
|
if builder.target_platform == 'linux':
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, path))
|
cfg.defines += ['_LINUX', 'POSIX']
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, path, 'sdk'))
|
if cxx.name == 'gcc':
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public'))
|
cfg.linkflags += ['-static-libgcc']
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'extensions'))
|
elif cxx.name == 'clang':
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'sourcepawn'))
|
cfg.linkflags += ['-lgcc_eh']
|
||||||
|
elif builder.target_platform == 'mac':
|
||||||
|
cfg.defines += ['OSX', '_OSX', 'POSIX']
|
||||||
|
cfg.cflags += ['-mmacosx-version-min=10.5']
|
||||||
|
cfg.linkflags += [
|
||||||
|
'-mmacosx-version-min=10.5',
|
||||||
|
'-arch', 'i386',
|
||||||
|
'-lstdc++',
|
||||||
|
'-stdlib=libstdc++',
|
||||||
|
]
|
||||||
|
cfg.cxxflags += ['-stdlib=libstdc++']
|
||||||
|
elif builder.target_platform == 'windows':
|
||||||
|
cfg.defines += ['WIN32', '_WINDOWS']
|
||||||
|
|
||||||
|
# Finish up.
|
||||||
|
cfg.defines += [
|
||||||
|
'SOURCEMOD_BUILD',
|
||||||
|
'SM_GENERATED_BUILD',
|
||||||
|
'SM_USE_VERSIONLIB',
|
||||||
|
]
|
||||||
|
cfg.includes += [os.path.join(builder.buildPath, 'includes')]
|
||||||
|
cfg.includes += [os.path.join(builder.sourcePath, 'versionlib')]
|
||||||
|
|
||||||
|
def LibraryBuilder(self, compiler, name):
|
||||||
|
binary = compiler.Library(name)
|
||||||
|
if builder.target_platform == 'windows':
|
||||||
|
binary.sources += ['version.rc']
|
||||||
|
binary.compiler.rcdefines += [
|
||||||
|
'BINARY_NAME="{0}"'.format(binary.outputFile),
|
||||||
|
'SM_GENERATED_BUILD',
|
||||||
|
'RC_COMPILE',
|
||||||
|
]
|
||||||
|
elif builder.target_platform == 'mac':
|
||||||
|
binary.compiler.postlink += [
|
||||||
|
'-compatibility_version', '1.0.0',
|
||||||
|
'-current_version', self.productVersion
|
||||||
|
]
|
||||||
|
binary.compiler.linkflags += [self.versionlib]
|
||||||
|
binary.compiler.sourcedeps += SM.generated_headers
|
||||||
|
return binary
|
||||||
|
|
||||||
|
def ProgramBuilder(self, compiler, name):
|
||||||
|
binary = compiler.Program(name)
|
||||||
|
if builder.target_platform == 'windows':
|
||||||
|
binary.sources += ['version.rc']
|
||||||
|
binary.compiler.rcdefines += [
|
||||||
|
'BINARY_NAME="{0}"'.format(binary.outputFile),
|
||||||
|
'SM_GENERATED_BUILD',
|
||||||
|
'RC_COMPILE',
|
||||||
|
]
|
||||||
|
binary.compiler.linkflags += [self.versionlib]
|
||||||
|
binary.compiler.sourcedeps += SM.generated_headers
|
||||||
|
return binary
|
||||||
|
|
||||||
|
def Library(self, context, name):
|
||||||
|
compiler = context.compiler.clone()
|
||||||
|
return self.LibraryBuilder(compiler, name)
|
||||||
|
|
||||||
|
def Program(self, context, name):
|
||||||
|
compiler = context.compiler.clone()
|
||||||
|
return self.ProgramBuilder(compiler, name)
|
||||||
|
|
||||||
|
def ExtCompiler(self, context):
|
||||||
|
compiler = context.compiler.clone()
|
||||||
|
compiler.cxxincludes += [
|
||||||
|
os.path.join(context.currentSourcePath),
|
||||||
|
os.path.join(context.currentSourcePath, 'sdk'),
|
||||||
|
os.path.join(builder.sourcePath, 'public'),
|
||||||
|
os.path.join(builder.sourcePath, 'public', 'extensions'),
|
||||||
|
os.path.join(builder.sourcePath, 'public', 'sourcepawn'),
|
||||||
|
os.path.join(builder.sourcePath, 'public', 'amtl'),
|
||||||
|
]
|
||||||
return compiler
|
return compiler
|
||||||
|
|
||||||
def AutoVersion(self, folder, binary):
|
def HL2Compiler(self, context, sdk):
|
||||||
if AMBuild.target['platform'] == 'windows':
|
compiler = self.ExtCompiler(context)
|
||||||
env = {'RCDEFINES': ['BINARY_NAME="' + binary.binaryFile + '"', 'SM_GENERATED_BUILD']}
|
|
||||||
binary.AddResourceFile(os.path.join(folder, 'version.rc' ), env)
|
if sdk.name == 'ep1':
|
||||||
elif AMBuild.target['platform'] == 'darwin' and isinstance(binary, Cpp.LibraryBuilder):
|
mms_path = os.path.join(self.mms_root, 'core-legacy')
|
||||||
binary.compiler['POSTLINKFLAGS'].extend(['-compatibility_version', '1.0.0'])
|
|
||||||
binary.compiler['POSTLINKFLAGS'].extend(['-current_version', AMBuild.cache['version']])
|
|
||||||
else:
|
else:
|
||||||
return
|
mms_path = os.path.join(self.mms_root, 'core')
|
||||||
|
|
||||||
def PreSetupHL2Job(self, job, builder, sdk):
|
compiler.cxxincludes += [
|
||||||
info = self.sdkInfo[sdk]
|
os.path.join(mms_path),
|
||||||
sdkPath = AMBuild.cache[info['sdk']]
|
os.path.join(mms_path, 'sourcehook'),
|
||||||
if AMBuild.target['platform'] == 'linux':
|
]
|
||||||
if sdk == 'ep1':
|
|
||||||
staticLibs = os.path.join(sdkPath, 'linux_sdk')
|
|
||||||
else:
|
|
||||||
staticLibs = os.path.join(sdkPath, 'lib', 'linux')
|
|
||||||
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
|
|
||||||
if sdk in ['ep2v', 'css']:
|
|
||||||
libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib_srv.so', 'libtier0_srv.so']
|
|
||||||
for lib in libs:
|
|
||||||
link = os.path.join(workFolder, lib)
|
|
||||||
target = os.path.join(staticLibs, lib)
|
|
||||||
try:
|
|
||||||
os.lstat(link)
|
|
||||||
except:
|
|
||||||
job.AddCommand(SymlinkCommand(link, target))
|
|
||||||
elif sdk in ['l4d', 'l4d2', 'csgo']:
|
|
||||||
libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so']
|
|
||||||
if sdk == 'csgo':
|
|
||||||
libs.append('interfaces_i486.a')
|
|
||||||
for lib in libs:
|
|
||||||
link = os.path.join(workFolder, lib)
|
|
||||||
target = os.path.join(staticLibs, lib)
|
|
||||||
try:
|
|
||||||
os.lstat(link)
|
|
||||||
except:
|
|
||||||
job.AddCommand(SymlinkCommand(link, target))
|
|
||||||
else:
|
|
||||||
libs = ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']
|
|
||||||
for lib in libs:
|
|
||||||
link = os.path.join(workFolder, lib)
|
|
||||||
target = os.path.join(staticLibs, lib)
|
|
||||||
try:
|
|
||||||
os.lstat(link)
|
|
||||||
except:
|
|
||||||
job.AddCommand(SymlinkCommand(link, target))
|
|
||||||
elif AMBuild.target['platform'] == 'darwin':
|
|
||||||
staticLibs = os.path.join(sdkPath, 'lib', 'mac')
|
|
||||||
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
|
|
||||||
libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']
|
|
||||||
if sdk == 'csgo':
|
|
||||||
libs.append('interfaces_i486.a')
|
|
||||||
for lib in libs:
|
|
||||||
link = os.path.join(workFolder, lib)
|
|
||||||
target = os.path.join(staticLibs, lib)
|
|
||||||
try:
|
|
||||||
os.lstat(link)
|
|
||||||
except:
|
|
||||||
job.AddCommand(SymlinkCommand(link, target))
|
|
||||||
elif AMBuild.target['platform'] == 'windows':
|
|
||||||
libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
|
|
||||||
if sdk in ['swarm', 'csgo']:
|
|
||||||
libs.append('interfaces')
|
|
||||||
for lib in libs:
|
|
||||||
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
|
|
||||||
builder.RebuildIfNewer(libPath)
|
|
||||||
builder['POSTLINKFLAGS'].append(libPath)
|
|
||||||
|
|
||||||
def PostSetupHL2Job(self, job, builder, sdk):
|
defines = ['SE_' + PossibleSDKs[i].define + '=' + PossibleSDKs[i].code for i in PossibleSDKs]
|
||||||
if AMBuild.target['platform'] in ['linux', 'darwin']:
|
compiler.defines += defines
|
||||||
builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a'])
|
paths = [
|
||||||
if sdk == 'csgo':
|
['public'],
|
||||||
builder.AddObjectFiles(['interfaces_i486.a'])
|
['public', 'engine'],
|
||||||
|
['public', 'mathlib'],
|
||||||
def DefaultHL2Compiler(self, path, sdk, noLink = False, oldMms = '-legacy'):
|
['public', 'vstdlib'],
|
||||||
compiler = self.DefaultExtCompiler(path)
|
['public', 'tier0'],
|
||||||
|
['public', 'tier1']
|
||||||
mms = 'core'
|
]
|
||||||
if sdk == 'ep1':
|
if sdk.name == 'ep1' or sdk.name == 'darkm':
|
||||||
mms += oldMms
|
|
||||||
|
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(self.mmsPath, mms))
|
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(self.mmsPath, mms, 'sourcehook'))
|
|
||||||
|
|
||||||
info = self.possibleSdks
|
|
||||||
compiler['CDEFINES'].extend(['SE_' + info[i]['name'] + '=' + info[i]['def'] for i in info])
|
|
||||||
|
|
||||||
# We don't build for Portal 2 (yet?, ever?), but using this define in code as
|
|
||||||
# it saves trouble if we ever need to
|
|
||||||
compiler['CDEFINES'].append('SE_PORTAL2=11')
|
|
||||||
|
|
||||||
paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'],
|
|
||||||
['public', 'tier0'], ['public', 'tier1']]
|
|
||||||
if sdk == 'ep1' or sdk == 'darkm':
|
|
||||||
paths.append(['public', 'dlls'])
|
paths.append(['public', 'dlls'])
|
||||||
paths.append(['game_shared'])
|
paths.append(['game_shared'])
|
||||||
else:
|
else:
|
||||||
@@ -362,78 +343,148 @@ class SM:
|
|||||||
paths.append(['game', 'shared'])
|
paths.append(['game', 'shared'])
|
||||||
paths.append(['common'])
|
paths.append(['common'])
|
||||||
|
|
||||||
info = self.sdkInfo[sdk]
|
compiler.defines += ['SOURCE_ENGINE=' + sdk.code]
|
||||||
sdkPath = AMBuild.cache[info['sdk']]
|
|
||||||
|
|
||||||
compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def'])
|
if sdk.name == '2013' and compiler.cxx.behavior == 'gcc':
|
||||||
|
# The 2013 SDK already has these in public/tier0/basetypes.h
|
||||||
|
compiler.defines.remove('stricmp=strcasecmp')
|
||||||
|
compiler.defines.remove('_stricmp=strcasecmp')
|
||||||
|
compiler.defines.remove('_snprintf=snprintf')
|
||||||
|
compiler.defines.remove('_vsnprintf=vsnprintf')
|
||||||
|
|
||||||
if sdk in ['swarm','csgo']:
|
if sdk.name in ['swarm', 'blade', 'insurgency', 'csgo', 'dota']:
|
||||||
if AMBuild.target['platform'] == 'windows':
|
if compiler.cc.behavior == 'msvc':
|
||||||
compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
|
compiler.defines += ['COMPILER_MSVC', 'COMPILER_MSVC32']
|
||||||
else:
|
else:
|
||||||
compiler['CDEFINES'].extend(['COMPILER_GCC', 'POSIX'])
|
compiler.defines += ['COMPILER_GCC']
|
||||||
|
|
||||||
if sdk == 'ep1':
|
# For everything after Swarm, this needs to be defined for entity networking
|
||||||
if AMBuild.target['platform'] == 'linux':
|
# to work properly with sendprop value changes.
|
||||||
staticLibs = os.path.join(sdkPath, 'linux_sdk')
|
if sdk.name in ['blade', 'insurgency', 'csgo', 'dota']:
|
||||||
else:
|
compiler.defines += ['NETWORK_VARS_ENABLED']
|
||||||
if AMBuild.target['platform'] == 'linux':
|
|
||||||
staticLibs = os.path.join(sdkPath, 'lib', 'linux')
|
|
||||||
elif AMBuild.target['platform'] == 'darwin':
|
|
||||||
staticLibs = os.path.join(sdkPath, 'lib', 'mac')
|
|
||||||
|
|
||||||
for i in paths:
|
if sdk.name in ['css', 'hl2dm', 'dods', '2013', 'tf2', 'l4d2']:
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(sdkPath, *i))
|
if builder.target_platform in ['linux', 'mac']:
|
||||||
|
compiler.defines += ['NO_MALLOC_OVERRIDE']
|
||||||
|
|
||||||
if not noLink:
|
for path in paths:
|
||||||
if AMBuild.target['platform'] == 'linux':
|
compiler.cxxincludes += [os.path.join(sdk.path, *path)]
|
||||||
compiler['POSTLINKFLAGS'][0:0] = ['-lm']
|
|
||||||
if sdk in ['ep2v', 'css']:
|
|
||||||
compiler['POSTLINKFLAGS'][0:0] = ['libtier0_srv.so']
|
|
||||||
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib_srv.so']
|
|
||||||
elif sdk in ['l4d', 'l4d2', 'csgo']:
|
|
||||||
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']
|
|
||||||
elif AMBuild.target['platform'] == 'darwin':
|
|
||||||
compiler['POSTLINKFLAGS'][0:0] = ['libtier0.dylib']
|
|
||||||
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.dylib']
|
|
||||||
|
|
||||||
return compiler
|
return compiler
|
||||||
|
|
||||||
sm = SM()
|
def ExtLibrary(self, context, name):
|
||||||
globals = {
|
compiler = self.ExtCompiler(context)
|
||||||
'SM': sm
|
return self.LibraryBuilder(compiler, name)
|
||||||
}
|
|
||||||
|
|
||||||
AMBuild.Include(os.path.join('tools', 'buildbot', 'Versioning'), globals)
|
def HL2Library(self, context, name, sdk):
|
||||||
|
compiler = self.HL2Compiler(context, sdk)
|
||||||
|
|
||||||
FileList = [
|
if builder.target_platform == 'linux':
|
||||||
['loader', 'AMBuilder'],
|
if sdk.name == 'ep1':
|
||||||
['core', 'AMBuilder'],
|
lib_folder = os.path.join(sdk.path, 'linux_sdk')
|
||||||
['core', 'logic', 'AMBuilder'],
|
elif sdk.name == '2013':
|
||||||
['extensions', 'bintools', 'AMBuilder'],
|
lib_folder = os.path.join(sdk.path, 'lib', 'public', 'linux32')
|
||||||
['extensions', 'clientprefs', 'AMBuilder'],
|
else:
|
||||||
['extensions', 'cstrike', 'AMBuilder'],
|
lib_folder = os.path.join(sdk.path, 'lib', 'linux')
|
||||||
['extensions', 'curl', 'AMBuilder'],
|
elif builder.target_platform == 'mac':
|
||||||
['extensions', 'geoip', 'AMBuilder'],
|
if sdk.name == '2013':
|
||||||
['extensions', 'mysql', 'AMBuilder'],
|
lib_folder = os.path.join(sdk.path, 'lib', 'public', 'osx32')
|
||||||
['extensions', 'sdkhooks', 'AMBuilder'],
|
else:
|
||||||
['extensions', 'sdktools', 'AMBuilder'],
|
lib_folder = os.path.join(sdk.path, 'lib', 'mac')
|
||||||
['extensions', 'topmenus', 'AMBuilder'],
|
|
||||||
['extensions', 'updater', 'AMBuilder'],
|
if builder.target_platform in ['linux', 'mac']:
|
||||||
['extensions', 'sqlite', 'AMBuilder'],
|
if sdk.name == '2013':
|
||||||
['extensions', 'regex', 'AMBuilder'],
|
compiler.postlink += [
|
||||||
['extensions', 'tf2', 'AMBuilder'],
|
compiler.Dep(os.path.join(lib_folder, 'tier1.a')),
|
||||||
['sourcepawn', 'jit', 'AMBuilder'],
|
compiler.Dep(os.path.join(lib_folder, 'mathlib.a'))
|
||||||
['sourcepawn', 'compiler', 'AMBuilder'],
|
]
|
||||||
['plugins', 'AMBuilder'],
|
else:
|
||||||
['tools', 'buildbot', 'PackageScript'],
|
compiler.postlink += [
|
||||||
['tools', 'buildbot', 'BreakpadSymbols']
|
compiler.Dep(os.path.join(lib_folder, 'tier1_i486.a')),
|
||||||
|
compiler.Dep(os.path.join(lib_folder, 'mathlib_i486.a'))
|
||||||
]
|
]
|
||||||
|
|
||||||
for parts in FileList:
|
if sdk.name in ['blade', 'insurgency', 'csgo', 'dota']:
|
||||||
AMBuild.Include(os.path.join(*parts), globals)
|
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces_i486.a'))]
|
||||||
|
|
||||||
|
binary = self.LibraryBuilder(compiler, name)
|
||||||
|
|
||||||
|
dynamic_libs = []
|
||||||
|
if builder.target_platform == 'linux':
|
||||||
|
compiler.linkflags[0:0] = ['-lm']
|
||||||
|
if sdk.name in ['css', 'hl2dm', 'dods', 'tf2', '2013', 'l4d2']:
|
||||||
|
dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so']
|
||||||
|
elif sdk.name in ['l4d', 'nd', 'blade', 'insurgency', 'csgo']:
|
||||||
|
dynamic_libs = ['libtier0.so', 'libvstdlib.so']
|
||||||
|
else:
|
||||||
|
dynamic_libs = ['tier0_i486.so', 'vstdlib_i486.so']
|
||||||
|
elif builder.target_platform == 'mac':
|
||||||
|
binary.compiler.linkflags.append('-liconv')
|
||||||
|
dynamic_libs = ['libtier0.dylib', 'libvstdlib.dylib']
|
||||||
|
elif builder.target_platform == 'windows':
|
||||||
|
libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
|
||||||
|
if sdk.name in ['swarm', 'blade', 'insurgency', 'csgo', 'dota']:
|
||||||
|
libs.append('interfaces')
|
||||||
|
for lib in libs:
|
||||||
|
lib_path = os.path.join(sdk.path, 'lib', 'public', lib) + '.lib'
|
||||||
|
binary.compiler.linkflags.append(binary.Dep(lib_path))
|
||||||
|
|
||||||
|
for library in dynamic_libs:
|
||||||
|
source_path = os.path.join(lib_folder, library)
|
||||||
|
output_path = os.path.join(binary.localFolder, library)
|
||||||
|
|
||||||
|
def make_linker(source_path, output_path):
|
||||||
|
def link(context, binary):
|
||||||
|
cmd_node, (output,) = context.AddSymlink(source_path, output_path)
|
||||||
|
return output
|
||||||
|
return link
|
||||||
|
|
||||||
|
linker = make_linker(source_path, output_path)
|
||||||
|
binary.compiler.linkflags[0:0] = [binary.Dep(library, linker)]
|
||||||
|
|
||||||
|
return binary
|
||||||
|
|
||||||
|
SM = SMConfig()
|
||||||
|
SM.detectProductVersion()
|
||||||
|
SM.detectSDKs()
|
||||||
|
SM.configure()
|
||||||
|
|
||||||
|
SM.generated_headers = builder.RunScript(
|
||||||
|
'tools/buildbot/Versioning',
|
||||||
|
{ 'SM': SM }
|
||||||
|
)
|
||||||
|
SM.versionlib = builder.RunScript(
|
||||||
|
'versionlib/AMBuilder',
|
||||||
|
{ 'SM': SM }
|
||||||
|
)
|
||||||
|
|
||||||
|
builder.RunBuildScripts(
|
||||||
|
[
|
||||||
|
'loader/AMBuilder',
|
||||||
|
'core/AMBuilder',
|
||||||
|
'core/logic/AMBuilder',
|
||||||
|
'extensions/bintools/AMBuilder',
|
||||||
|
'extensions/clientprefs/AMBuilder',
|
||||||
|
'extensions/curl/AMBuilder',
|
||||||
|
'extensions/cstrike/AMBuilder',
|
||||||
|
'extensions/geoip/AMBuilder',
|
||||||
|
'extensions/mysql/AMBuilder',
|
||||||
|
'extensions/regex/AMBuilder',
|
||||||
|
'extensions/sdkhooks/AMBuilder',
|
||||||
|
'extensions/sdktools/AMBuilder',
|
||||||
|
'extensions/sqlite/AMBuilder',
|
||||||
|
'extensions/tf2/AMBuilder',
|
||||||
|
'extensions/topmenus/AMBuilder',
|
||||||
|
'extensions/updater/AMBuilder',
|
||||||
|
'sourcepawn/compiler/AMBuilder',
|
||||||
|
'sourcepawn/jit/AMBuilder',
|
||||||
|
'plugins/AMBuilder',
|
||||||
|
'tools/buildbot/PackageScript',
|
||||||
|
],
|
||||||
|
{
|
||||||
|
'SM': SM
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if builder.options.breakpad_dump:
|
||||||
|
builder.RunScript('tools/buildbot/BreakpadSymbols', { 'SM': SM })
|
||||||
|
|||||||
+450
@@ -1,5 +1,455 @@
|
|||||||
SourceMod Changelog
|
SourceMod Changelog
|
||||||
|
|
||||||
|
SourceMod 1.5.3 [2014-03-22]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.5.3_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
- Updated support for CS:GO after multiple breaking game updates.
|
||||||
|
- Updated gamedata support for GoldenEye: Source (Peace-Maker).
|
||||||
|
- Fixed crash on SDKHooks extension load in Alien Swarm (bug 6059).
|
||||||
|
- Fixed memory leak from unmanaged forwards never being freed (bug 6025).
|
||||||
|
- Fixed possible crash when unloading the CStrike extension.
|
||||||
|
- Fixed crash in SDKHooks Reload post-hook (Peace-Maker).
|
||||||
|
- Fixed FakeClientCommandEx always leaking memory (bug 5678).
|
||||||
|
- Fixed extra entity networking occuring with SetEntProp natives on some games.
|
||||||
|
- Fixed being able to nominate same map multiple times (bug 5109).
|
||||||
|
- Fixed spurious FindEntityByClassname error being logged on some games and platforms.
|
||||||
|
- Fixed an Anti-Flood bypass exploit (bug 5394).
|
||||||
|
- Removed part of Addresses gamedata error handling which could cause false errors to be logged (bug 6044).
|
||||||
|
- Fixed mapchooser not resetting nominations count when clearing nominations list (bug 5359).
|
||||||
|
- Improved performances of client convar query handling (bug 6003).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
- Added GiveAmmo native to SDKTools (bug 6039) (Peace-Maker).
|
||||||
|
- Added SQL_SetCharset native to (re)set charset even after reconnect (bug 5786) (Peace-Maker).
|
||||||
|
- Added support for entity references in SDKHooks natives (bug 6069).
|
||||||
|
- Added support for server passwords to DisplayAskConnectBox stock (bug 5984) (FlaminSarge).
|
||||||
|
- Renamed SortFunc2D parameters to match documentation (bug 6014) (Peace-Maker).
|
||||||
|
- Fixed param order in AddToTopMenu function doc (bug 6035) (Peace-Maker).
|
||||||
|
- Added |any| tag to WritePackCell and ReadPackCell native param/return values (bug 6001).
|
||||||
|
- Updated SDKHook_TakeDamage native for game updates.
|
||||||
|
- Added default infinite value for TF2_AddCondition duration.
|
||||||
|
- Added support for conditions >= 64 in TF2_OnConditionAdded/Removed (bug 5565, bug 5976) (FlaminSarge).
|
||||||
|
- Updated TFCond and TF customkill enum values (bug 6012) (FlaminSarge).
|
||||||
|
- Fixed regression causing incorrect return and inability to block in TF2_OnCalcIsAttackCritical forward.
|
||||||
|
- Fixed TE_* natives operating on incorrect data for some tempents (bug 6072).
|
||||||
|
- Fixed CS_AliasToWeaponID not returning a valid weaponID for cz75a.
|
||||||
|
- Fixed CS_GetWeaponPrice returning incorrect value for M4A1 in CS:GO (bug 6045).
|
||||||
|
- Increased max gamedata byte signature length.
|
||||||
|
- Ported SM build scripts to AMBuild2 (bug 5997).
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
SourceMod 1.5.2 [2013-10-29]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.5.2_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
- Updated gamedata support for TF2, CS:S, CS:GO, and HL2:DM.
|
||||||
|
- Fixed crash from regression in SDKTools SetClientListening hook refcounting (bug 5956) (KyleS).
|
||||||
|
- Fixed potential crash when having maps with format characters in name.
|
||||||
|
- Fixed some nextmap issues with long map names.
|
||||||
|
- SDKTools no longer requires gamedata for sm_dump_datamaps on TF2, CS:S, HL2:DM, and DoD:S (bug 5968).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
- Updated TFCond and TF custom dmg enums.
|
||||||
|
- Updated TF2 critical hit detection logic in TF2_OnCalcIsAttackCritical to handle more cases, including when criticals are disabled (bug 5894).
|
||||||
|
- Fixed GetEngineVersion native returning a bad value when running on MM:S 1.9.x or earlier (bug 5697).
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
SourceMod 1.5.1 [2013-09-10]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.5.1_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
- Updated gamedata support for TF2.
|
||||||
|
- Added missing DispatchKeyValue gamedata for HL2 CTF (bug 5114) (peace-maker).
|
||||||
|
- Fixed translations not being loaded if identifier was not two or three characters (fixes Portuguese) (bug 5888).
|
||||||
|
- Fixed runoff voting occurring when receiving the exact number of required votes (bug 5890).
|
||||||
|
- Fixed reserve slot plugin hiding too many slots on Orangebox gamesif SourceTV and/or Replay are present (bug 5499).
|
||||||
|
- Fixed some crashes in TF2 and unexpected behavior in all games with SDKHook_TakeDamage due to uninitialized var.
|
||||||
|
- Fixed attempted triggers from gagged users displaying in chat (bug 5918).
|
||||||
|
- Fixed errors in Italian translation (Oktober).
|
||||||
|
- Added Norwegian translation (checkster).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
- Added CS_UpdateClientModel native to CStrike extension for CS:S and CS:GO (bug 5905) (Drifter).
|
||||||
|
- Fixed setting weapon param in SDKHook_TakeDamage overwriting attacker instead of setting weapon (bug 5911) (KyleS)
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
SourceMod 1.5.0 [2013-08-25]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.5.0_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Added support for Counter-Strike: Global Offensive (bug 5299, bug 5579).
|
||||||
|
- Split CS:S, TF2, DoD:S, HL2:DM, and ND to separate binaries (bug 5370, bug 5813).
|
||||||
|
- Added support for runoff voting in mapchooser (bug 4218).
|
||||||
|
- Added option to require Steam validation before granting admin access (bug 4837) (VoiDeD).
|
||||||
|
- Added localization support for many more core and base plugin messages (bug 5120, bug 5146).
|
||||||
|
- Added the ability to override RegConsoleCommand-created commands (bug 5199).
|
||||||
|
- Added support for "fuzzy" (partial) map names in map-related natives and cmds for L4D and later (bug 5599).
|
||||||
|
- Updated Reserved Slots to use max humans as max count (bug 5444).
|
||||||
|
- Added support for custom maxitems on radio menus (bug 5371).
|
||||||
|
- Improved console config editing (bug 5470).
|
||||||
|
- Increased map name buffer sizes in mapchooser to better account for nested maps (bug 5609) (Peace-Maker).
|
||||||
|
- Fixed JIT conflicts with SELinux (bug 5581).
|
||||||
|
- Added logged error when PlayerRunCommand offset lookup fails (bug 5535) (GoD-Tony).
|
||||||
|
- Fixed double print when sending psay to self (bug 5649) (Peace-Maker).
|
||||||
|
- Fixed check against uninitialized string in extension loader (bug 5546) (KyleS).
|
||||||
|
- Fixed possible runtime errors in basetriggers for not-ingame clients (bug 5191) (Peace-Maker).
|
||||||
|
- Check all possible mapcycle paths on newer orangebox games (bug 5719).
|
||||||
|
- Fixed ReadMapList not seeing maps in all valve search paths (bug 5715) (VoiDeD).
|
||||||
|
- Fixed typo in too-many-params native error message (Peace-Maker).
|
||||||
|
- Fixed various issues in clientprefs (bug 5538) (KyleS).
|
||||||
|
- Removed debug printout from PerformGravity (bug 5679) (KyleS).
|
||||||
|
- Fixed broken translating in some plugins and natives (bug 5612) (KyleS).
|
||||||
|
- Fixed issues with COMMAND_FILTER_NO_BOTS and @bots multi-target.
|
||||||
|
- Fixed crash in SDKHooks when throwing bad ent type error on logical ent (KyleS).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
|
||||||
|
- Added support for CS:GO to the CStrike extension (bug 5299) (Drifter).
|
||||||
|
- Added support for new protobuf usermessages used in newer games (bug 5579, bug 5588, bug 5590, bug 5633).
|
||||||
|
- Added latest SDKHooks version as first-party extension.
|
||||||
|
- Updated SQLite to version 3.7.15.1 (bug 5235).
|
||||||
|
- Added natives for changing team score and mvp stars on CSS/CSGO (bug 5295) (Drifter).
|
||||||
|
- Added global pre and post forwards for client chat (bug 5394) (KyleS).
|
||||||
|
- Added TF2_CanPlayerTeleport forward to the TF2 game extension (bug 5283) (VoiDeD).
|
||||||
|
- Added GetEntityAddress native (bug 5269) (ProdigySim).
|
||||||
|
- Added more parameters to PlayerRunCommand forward (bug 5346) (GoD-Tony).
|
||||||
|
- Added forwards to basecomm plugin (bug 5466) (Drifter).
|
||||||
|
- Added symbol lookup support to gamedata on Windows (bug 5511) (GoD-Tony).
|
||||||
|
- Exposed GetLanguageInfo in ITranslator interface (bug 5249) (VoiDeD).
|
||||||
|
- Increase maximum .sp line length to 4095 characters. (bug 5347) (theY4Kman).
|
||||||
|
- Improved netprop dump output (bug 5471).
|
||||||
|
- Added int64 typename to netprop dumps (bug 5655).
|
||||||
|
- Added GetMaxHumanPlayers native exposing IServerGameClients func (bug 5551).
|
||||||
|
- Added WeaponIDToAlias native to CStrike extension (bug 5460) (KyleS).
|
||||||
|
- Fixed OnLibraryAdded/Removed not being called in all plugins (bug 5431).
|
||||||
|
- Made thread worker processing limits configurable at runtime (bug 5326).
|
||||||
|
- Added support in TF2 ext for detection of player conds >= 64 (bug 5565).
|
||||||
|
- Updated button defines in entity_prop_stocks (bug 5564).
|
||||||
|
- Added GetPlayerResourceEntity to SDKTools to replace old, semi-broken TF2-only version (bug 5491).
|
||||||
|
- Exposed third parameter of TF2's AddCond in TF2_AddCondition (bug 5641) (FlaminSarge).
|
||||||
|
- Added GetSteamAccountID function to IPlayerHelpers and native for sp (bug 5548) (KyleS).
|
||||||
|
- Added ISDKHooks interface with entity listeners (bug 5602) (GoD-Tony).
|
||||||
|
- Added file upload support to webternet extension.
|
||||||
|
- Added more alternative names for TFClass_Heavy (bug 5338) (Afronanny).
|
||||||
|
- Throw error instead of crash when calling SetTeamScore between maps (bug 5718) (KyleS).
|
||||||
|
- Fixed clients not being marked as in kick queue in some cases (bug 5746) (SystematicMania).
|
||||||
|
- Made compile.sh set working dir to own dir (bug 5710) (KyleS).
|
||||||
|
- Added CS_IsValidWeaponID native and validity checks to other natives (bug 5566) (Drifter).
|
||||||
|
- Numerous code documentation fixups (bug 5720) (Tsunami).
|
||||||
|
- Fixed cmd listener callback return behavior to match func doc (bug 5882).
|
||||||
|
|
||||||
|
Internal Changes:
|
||||||
|
|
||||||
|
- Fixed handle misuse in clientprefs plugin (bug 5805) (KyleS).
|
||||||
|
- Removed call to getchar() in debug build of compiler (bug 5626) (KyleS).
|
||||||
|
- Fixed instability issues with cloned handles (bug 5245, bug 5240) (KyleS).
|
||||||
|
- Changed extension unload order to avoid exposing finalization window (bug 5556) (KyleS).
|
||||||
|
- Call OnPluginEnd before finalizer hooks have run (bug 4519).
|
||||||
|
- Fixed potential for reading out of library bounds in MemoryUtils::FindPattern.
|
||||||
|
- Fixed typo in TF2 ext asm.c causing accidental assignment instead of compare.
|
||||||
|
- Overhauled versioning information (bug 5453).
|
||||||
|
- Changed from RemoveEdict to using the Kill input for TF2_RemoveWeapon.
|
||||||
|
- Fixed accidental assignment in each of SDKTools and sp compiler (bug 5745) (KyleS).
|
||||||
|
- Fixed potential deadlock in HandleSystem::TryAndFreeSomeHandles (bug 5665) (KyleS).
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
SourceMod 1.4.7 [2013-02-06]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.4.7_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Updated support for latest Source 2009 engine changes (CS:S, DoD:S, TF2, HL2DM).
|
||||||
|
- Updated gamedata for Left 4 Dead 2, Nuclear Dawn, No More Room in Hell, Zombie Panic Source, CSPromod, GoldenEye Source, Synergy, The Hidden, and PVKII.
|
||||||
|
- Added system to block malware or illegal plugins (bug 5289).
|
||||||
|
- Fixed a potential crash when a bad entity index is passed to certain functions (bug 5539) (KyleS).
|
||||||
|
- Added an error message for when auto plugin configs fail to be created due to write error (bug 5465) (Drifter).
|
||||||
|
- Fixed an issue where a malformed plugin could cause crashes (bug 5478).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
|
||||||
|
- Added new values to the TFCond TF2 conditions enum (bug 5537) (FlaminSarge).
|
||||||
|
- Updated TFHoliday TF2 holidays enum (bug 5526) (Powerlord).
|
||||||
|
- Fixed regression in SourceMod 1.3.0 causing GetEntPropEnt, GetEntDataEnt2, and GameRules_GetPropEnt to possibly return stale (incorrect) entity indexes in place of -1.
|
||||||
|
- Added support for < 32-bit unsigned sign extension to GameRules_GetProp lookup (already in GetEntProp since SM 1.4.0).
|
||||||
|
- Fixed < 32-bit unsigned sign extension in GetEntProp not being applied for array prop elements (bug 5591).
|
||||||
|
- Fixed value size auto-detection in GetEntProp and GameRules_GetProp for ep2v's new SPROP_VARINT sendprops.
|
||||||
|
- Fixed Sort_Random sort type not including first value in array sorting functions (bug 4292) (Peace-Maker).
|
||||||
|
- Fixed GameRules_SetPropVector writing data to unexpected addresses instead of to the gamerules proxy entity (bug 5592) (ProdigySim).
|
||||||
|
- Fixed VoteMenuToAll stock adding bots to list (bug 5253 (VoiDeD).
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
SourceMod 1.4.6 [2012-09-04]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.4.6_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Fixed extraneous errors resulting from a bug in 1.4.5.
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
SourceMod 1.4.5 [2012-09-03]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.4.5_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Updated support for latest Source 2009 engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
|
||||||
|
- Updated Nuclear Dawn, Dino D-Day, and Zombie Panic gamedata.
|
||||||
|
- Added compatibility for running on Metamod:Source 1.9.0.
|
||||||
|
- Fixed very minor memory leaks in CStrike extension (bug 5456) (KyleS).
|
||||||
|
- Fixed crash from plugins accessing netprops too early (bug 5297) (KyleS).
|
||||||
|
- Fixed crash from plugins trying to access nested datadesc members (bug 5446).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
|
||||||
|
- Added new TF2 weapon and custom dmg defines.
|
||||||
|
- Added new TF2 TFHoliday value (bug 5436) (Powerlord).
|
||||||
|
- Fixed IClientListener::InterceptClientConnect not being able to properly block connections (bug 5461) (PimpinJuice).
|
||||||
|
- Fixed PrepSDKCall_SetSignature native not working with symbol names on L4D2 linux (bug 5440).
|
||||||
|
- Fixed resolution of GetProfilerTime native on non-Windows platforms.
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
SourceMod 1.4.4 [2012-07-03]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.4.4_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Updated support for latest Source 2009 engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
|
||||||
|
- Updated Nuclear Dawn gamedata.
|
||||||
|
- Fixed a crash that could occur when selecting an option on a clientprefs prefab menu (bug 5374).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
|
||||||
|
- Added new TF2 weapon and custom dmg defines.
|
||||||
|
- Added new TF2 TFHoliday value (bug 5364) (Powerlord).
|
||||||
|
- Updated sample extension to properly fill ninvoke with INativeInvoker ptr (bug 5340) (Afronanny).
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
SourceMod 1.4.3 [2012-06-09]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.4.3_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
|
||||||
|
- Made clientprefs attempt to reconnect to the database on map change (bug 4745).
|
||||||
|
- Log functions now respect sv_logecho (bug 5135).
|
||||||
|
- Fixed client console vote output (bug 5290, bug 5205) (FlaminSarge).
|
||||||
|
- Fixed error when reloading dependant plugins using aliased natives (bug 5302).
|
||||||
|
- Fixed intermittent crash when looking for an invalid signature (bug 5301).
|
||||||
|
- Fixed possible crash when reloading a plugin with an invalid binary (bug 5288).
|
||||||
|
- Exposed extensions list to clients (bug 5221) (VoiDeD).
|
||||||
|
- Fixed intermittent crashes in clientprefs (bug 4660).
|
||||||
|
- Fixed crash when passing an invalid entity reference to ReferenceToEntity (bug 5330).
|
||||||
|
- Fixed cstrike extension crash on shutdown (bug 5328).
|
||||||
|
- Lowered threading API think time to 20ms, making threaded MySQL queries complete faster (bug 4733).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
|
||||||
|
- Fixed client serials not being unique on Windows (bug 5285).
|
||||||
|
- Fixed broken SourceTV detection on L4D1 (bug 5216).
|
||||||
|
- Fixed Float negation operator (bug 5292).
|
||||||
|
- Updated TF2 condition defines (bug 5259) (FlaminSarge).
|
||||||
|
- Adding missing SetMenuNoVoteButton native declaration (bug 4522) (GoD-Tony).
|
||||||
|
- Fixed erroneous const-qualification of name param of GetAdminUsername (bug 5267).
|
||||||
|
- Added GetGameTickCount native (bug 5209) (GoD-Tony).
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
SourceMod 1.4.2 [2011-04-13]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.4.2_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
|
||||||
|
- Fixed regression in SourceMod 1.4.0 causing SM to cause load errors on The Ship (bug 5216).
|
||||||
|
- Fixed toggling and player lag issues with sm_drug command (bugs 5217, 5218) (FlaminSarge).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
- Updated TF2-specific defines and enums (bug 5194).
|
||||||
|
- Fixed StoreToAddress always writing 32 bits and throwing an error (bug 5248) (ProdigySim).
|
||||||
|
- Fixed crash with StoreToAddress if memory wasn't writable (bug 5252) (Dr!fter).
|
||||||
|
- Fixed return value of VoteMenuToAll (bug 5254) (VoiDeD).
|
||||||
|
- Fixed bug in command lower-casing API guarantee
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
SourceMod 1.4.1 [2011-12-07]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.4.1_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
|
||||||
|
- Added gamedata for Adrenaline Gamer 2 and No More Room in Hell.
|
||||||
|
- Fixed "not connected" error in reserve slots plugin (bug 5158) (ostrel).
|
||||||
|
- Fixed ff trigger output printing to all in triggerer's language (rather than viewer's language) (bug 5161).
|
||||||
|
- Fixed typo in one of basebans ban reasons (bug 5188).
|
||||||
|
- Fixed formatting error in Swedish "Vote Count" phrase (bug 5174).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
|
||||||
|
- Fixed sp MaxClients not being updated on map changes after load (bug 5160).
|
||||||
|
- Removed GLIBC_2.7 dependency from spcomp.
|
||||||
|
- Increased buffer for sm_rcon command to fit larger responses (bug 5169).
|
||||||
|
- BaseComm now properly registers a library allowing it to be required by other plugins (bug 5156).
|
||||||
|
- Fixed TFHoliday enum values (bug 5155).
|
||||||
|
- Updated TF2_OnIsHolidayActive ret behavior to match doc (bug 5155).
|
||||||
|
- Added new TF2 deathflag and dmg custom defines (bug 5157).
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
SourceMod 1.4.0 [2011-10-28]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.4.0_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Added support for Max OS X (bug 4392).
|
||||||
|
- Added support for Bloody Good Time (bug 4780).
|
||||||
|
- Added support for E.Y.E Divine Cybermancy (bug 5035).
|
||||||
|
- Added gamedata for Nuclear Dawn.
|
||||||
|
- Added gamedata for International Online Soccer: Source (bug 5019).
|
||||||
|
- Added gamedata for Half-Life 2 Capture the Flag (bug 5114).
|
||||||
|
- Updated mapchooser and other base plugins with Nuclear Dawn specific fixes (bug 5117).
|
||||||
|
- Fixed ServerLang value not being read properly on startup (bug 4675).
|
||||||
|
- Added support for aliases in languages.cfg (bug 4858).
|
||||||
|
- Added output display to sm_rcon command (bug 5018).
|
||||||
|
- Flood protection bypass access can now be overridden with command name sm_flood_access (bug 4584).
|
||||||
|
- Added a reset argument to sm cvars command to revset cvar values to default (bug 5043).
|
||||||
|
- Fixed incorrect language identifiers for Chinese (both Trad. and Simplified) and Brazilian Portuguese not matching cl_language values (bug 5067).
|
||||||
|
- Added translation support for Bulgarian (bg).
|
||||||
|
- Fixed incorrect number of slots being hidden for reserve with sm_hideslots on Source 2009 with SourceTV or replay (bug 5094).
|
||||||
|
- sm_hideslots changes now take effect immediately instead of waiting until a client joins or leaves (bug 5094).
|
||||||
|
- Fixed sv_visiblemaxplayers getting stuck at previous max clients in some cases with reserves and SourceTV or replay (bug 5094).
|
||||||
|
- Removed error logging if an optional extension is not found (bug 5112).
|
||||||
|
- Fixed bots with semicolon in name being unkickable (bug 5120).
|
||||||
|
- Changed strings in ice-related funcommands to be translatable (bug 4540).
|
||||||
|
- Changed Bintools extension to use a single build for every engine (bug 4548).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
- Provided native interface for basecomm (bug 2594).
|
||||||
|
- Client language detection is too late. (bug 3714) (Tony A. "GoD-Tony").
|
||||||
|
- Added ServerCommandEx native to execute server command and retrieve output (bug 3873).
|
||||||
|
- Added ability to update clientprefs cookies values on clients not currently connected (bug 3882) (databomb).
|
||||||
|
- Added library "matchmaking_ds" support to gamedata lookups (bug 4158).
|
||||||
|
- Rooted menu handles to callbacks (bug 4353).
|
||||||
|
- Fixed corner cases with ExplodeString (bug 4629). (Michael "LumiStance").
|
||||||
|
- Fixed return omission with else-after-return (bug 4852).
|
||||||
|
- Added OnConditionAdded and OnConditionRemoved forwards to TF2 extension (bug 4851).
|
||||||
|
- Added new natives and forward to the cstrike extension (bug 4732, bug 4985) (Dr!fter).
|
||||||
|
- Added WaitingForPlayers forwards to the TF2 extension (bug 4704) (CrimsonGT).
|
||||||
|
- Updated and added more TF2 condition, weapon, and damagecustom defines (multiple bug#s).
|
||||||
|
- Fixed TF2_RemoveCondition not always removing conditions (bug 4981).
|
||||||
|
- Fixed MaxClients not being updated correctly in some places with SourceTV or replay active (bug 4986).
|
||||||
|
- Fixed some vars not being marked for init on first compile pass (bug 4643).
|
||||||
|
- Increased symbol name limit to 63 characters (bug 4564) (javalia).
|
||||||
|
- Fixed crash when dynamic arrays run out of memory (bug 4632).
|
||||||
|
- Fixed a crash that could happen from looking up out-of-bounds edict or entity indexes (bug 5080).
|
||||||
|
- Fixed client serials not getting cleared on disconnect (bug 5121).
|
||||||
|
- Added error on declaring arrays that the compiler is too buggy to handle (bug 4977).
|
||||||
|
- Removed reliance on gamedata for multiple SDKTools functions in ep2 and later (bug 4899).
|
||||||
|
- Added InvalidateClient and ReconnectClient natives to SDKTools (bug 4931) (Brian "Afronanny" Simon).
|
||||||
|
- Added ability to lookup and set values on the gamerules class (bug 4983.
|
||||||
|
- BaseComm now uses AddCommandListener for chat hooks (bug 4991).
|
||||||
|
- Fixed shutdown bug in SDKTools (bug 5063).
|
||||||
|
- Fixed MM-enabled extensions continuing to load after failing MM attach (bug 5042).
|
||||||
|
- Added GetDistGainFromSoundLevel native to SDKTools (bug 5066) (javalia).
|
||||||
|
- Added CheckAccess native to check an AdminId's command access (bug 5083).
|
||||||
|
- Fixed GetEntProp not sign-extending unsigned values less than 32 bits (bug 5105).
|
||||||
|
- Fixed crashing when calling CreateEntityByName or CreateFakeClient when no map is running (now errors) (bug 5119).
|
||||||
|
- Fixed erring in kick function (e. bad translation) causing client to become unkickable until disconnect (bug 5120).
|
||||||
|
- Fixed KickClientEx not immediately kicking client if client was in kick queue (bug 5120).
|
||||||
|
- Added IsClientSourceTV and IsClientReplay natives (bug 5124).
|
||||||
|
- Added support for getting and setting individual array elements with Get/Set EntProp functions (bug 4160).
|
||||||
|
- Added support for threaded query handles to SQL_GetInsertId and SQL_GetAffectedRows (bug 4699) (Nephyrin).
|
||||||
|
- Added a GetGameRules function to ISDKTools for extensions to easily get the GameRules class pointer (bug 4707).
|
||||||
|
- Added GetMessageName to IUserMessages (bug 4573) (Zach "theY4Kman" Kanzler)
|
||||||
|
- Added HintTextMsg to IGameHelpers (bug 4950).
|
||||||
|
- Added ProcessTargetString simple filter API (bug 4404).
|
||||||
|
- Moved much functionality from core bins to logic bin (bug 4406, bug 4402).
|
||||||
|
- Fixed bogus asserts in sp compiler (bug 4486, bug 4487).
|
||||||
|
- Greatly improved sp compiler performance (~5x overall speedup) (bug 3820, bug 4493, bug 4495).
|
||||||
|
- Changed entity output detours to use CDetour (bug 4416).
|
||||||
|
- Enhanced nominations API (bug 4677) (CrimsonGT).
|
||||||
|
- Added Linux support for profiling natives (bug 4927).
|
||||||
|
- Added a new ValveCallType that allows for arbitrary |this| parameters, as well as associated features in gamedata and for reading/writing memory (bug 3520) (Downtown1).
|
||||||
|
- Updated TF2 extension to handle Valve's changes to the "holiday" system (bug 5150).
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
SourceMod 1.3.8 [2011-06-23]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.3.8_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
|
||||||
|
- Updated support for various games, including Garry's Mod, Zombie Panic, and Dino D-Day.
|
||||||
|
- Added gamedata for Eternal Silence.
|
||||||
|
- Fixed libgcc_s.so.1 load error present on some systems (bug 4876).
|
||||||
|
- Handle leak notices now print to error log (in addition fatal log) (bug 4929).
|
||||||
|
- Translator now properly falls back on bad server language (bug 4861).
|
||||||
|
- Fixed invalid client errors from bad MaxClients value when SourceTV is late-loaded (bug 4881).
|
||||||
|
- Fixed crash on plugin unload when two commands exist with same name, different casing (bug 4698).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
|
||||||
|
- Updated TF2 condition defines (bug 4916).
|
||||||
|
- Fixed var names and docs for TF2_MakeBleed native (bug 4928).
|
||||||
|
- Removed compiler double include check (bug 4863).
|
||||||
|
- Fixed plugin compile errors when using GetEntityClassname (bug 4798).
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
SourceMod 1.3.7 [2011-04-15]
|
||||||
|
|
||||||
|
URL: http://wiki.alliedmods.net/SourceMod_1.3.7_Release_Notes
|
||||||
|
|
||||||
|
User Changes:
|
||||||
|
|
||||||
|
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
|
||||||
|
- Updated support for various games, including Zombie Panic, CS ProMod, Empires, and GoldenEye: Source.
|
||||||
|
- Added gamedata for Dino D-Day.
|
||||||
|
- Fix precedence of voice mute flag versus specific client overrides (bug 4826).
|
||||||
|
- Fix mistaken unhooking of voice hooks (bug 4804).
|
||||||
|
- Fixed graphical glitches with funcommands effects in L4D1 (bug 3486).
|
||||||
|
- Fixed bug in nominations that could cause "Unknown command" error (bug 4797).
|
||||||
|
- Removed tv_enable hook to fix rare max client count issue (bug 4791).
|
||||||
|
- Added missing unhooking of ClientConnect in PlayerManager (bug 4749).
|
||||||
|
- Fixed sm_rtv printing "unknown command" (bug 4730).
|
||||||
|
- Fixed voting crash when client console, chat, and SourceTV are enabled (bug 4676).
|
||||||
|
- Fixed CDetour crash in TF2 extension when last plugin using forward is unloaded (bug 4713).
|
||||||
|
|
||||||
|
Developer Changes:
|
||||||
|
|
||||||
|
- SetEntProp now marks edict state as changed (bug 4855).
|
||||||
|
- Added GetEntityClassname stock (bug 4798).
|
||||||
|
- Fix compiler hanging when #including a directory (bug 4822).
|
||||||
|
- Added GetEntityFlags and SetEntityFlags natives for better cross-engine compatibility. (bug 4809).
|
||||||
|
- Fixed ClientPrefs natives not being marked optional when REQUIRE_EXTENSIONS not defined (bug 4839).
|
||||||
|
- Changed some instances of LogMessage to LogAction (bug 4649).
|
||||||
|
- Added some new language natives (bug 4613).
|
||||||
|
- Fixed SetTeamScore not updating score on client (bug 2736).
|
||||||
|
- Raised MAXPLAYERS from 64 to 65 (bug 4490).
|
||||||
|
- Added and updated many TF2-specific defines in tf2.inc and tf2_stocks.inc.
|
||||||
|
- Fixed TF2_GetPlayerConditionFlags no longer necessarily returning all set flags (bug 4726).
|
||||||
|
- Fixed profiler flush not clearing, added 'report' and 'clear' (bug 4674).
|
||||||
|
- Fixed GetPlayerDecalFile crash on L4D and L4D2 (bug 4729).
|
||||||
|
- Fixed TF2_OnGetHoliday detour no longer firing under all circumstances (bug 4700).
|
||||||
|
- Added TF2_IsPlayerInDuel native to TF2 extension (bug 4695).
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
SourceMod 1.3.6 [2010-10-31]
|
SourceMod 1.3.6 [2010-10-31]
|
||||||
|
|||||||
+2
-2
@@ -112,9 +112,9 @@
|
|||||||
* If set to yes, SourceMod will validate steamid auth strings with the Steam backend before giving out admin access.
|
* If set to yes, SourceMod will validate steamid auth strings with the Steam backend before giving out admin access.
|
||||||
* This can prevent malicious users from impersonating admins with stolen Steam apptickets.
|
* This can prevent malicious users from impersonating admins with stolen Steam apptickets.
|
||||||
* If Steam is down, admins will not be authenticated until Steam comes back up.
|
* If Steam is down, admins will not be authenticated until Steam comes back up.
|
||||||
* In general, this option should be set to "yes" to increase the security of your server.
|
* This option increases the security of your server, but is still experimental.
|
||||||
*/
|
*/
|
||||||
"SteamAuthstringValidation" "yes"
|
"SteamAuthstringValidation" "no"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables or disables whether SourceMod blocks known or potentially malicious plugins from loading.
|
* Enables or disables whether SourceMod blocks known or potentially malicious plugins from loading.
|
||||||
|
|||||||
+21
-3
@@ -1,10 +1,28 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet:
|
# vim: set ts=2 sw=2 tw=99 noet:
|
||||||
import sys
|
import sys
|
||||||
import ambuild.runner as runner
|
try:
|
||||||
|
from ambuild2 import run
|
||||||
|
except:
|
||||||
|
try:
|
||||||
|
import ambuild
|
||||||
|
sys.stderr.write('It looks like you have AMBuild 1 installed, but this project uses AMBuild 2.\n')
|
||||||
|
sys.stderr.write('Upgrade to the latest version of AMBuild to continue.\n')
|
||||||
|
except:
|
||||||
|
sys.stderr.write('AMBuild must be installed to build this project.\n')
|
||||||
|
sys.stderr.write('http://www.alliedmods.net/ambuild\n')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
run = runner.Runner()
|
run = run.PrepareBuild(sourcePath=sys.path[0])
|
||||||
|
run.default_build_folder = 'obj-' + run.target_platform
|
||||||
run.options.add_option('--enable-debug', action='store_const', const='1', dest='debug',
|
run.options.add_option('--enable-debug', action='store_const', const='1', dest='debug',
|
||||||
help='Enable debugging symbols')
|
help='Enable debugging symbols')
|
||||||
run.options.add_option('--enable-optimize', action='store_const', const='1', dest='opt',
|
run.options.add_option('--enable-optimize', action='store_const', const='1', dest='opt',
|
||||||
help='Enable optimization')
|
help='Enable optimization')
|
||||||
run.Configure(sys.path[0])
|
run.options.add_option('--no-mysql', action='store_false', default=True, dest='hasMySql',
|
||||||
|
help='Disable building MySQL extension')
|
||||||
|
run.options.add_option('-s', '--sdks', default='all', dest='sdks',
|
||||||
|
help='Build against specified SDKs; valid args are "all", "present", or '
|
||||||
|
'comma-delimited list of engine names (default: %default)')
|
||||||
|
run.options.add_option('--breakpad-dump', action='store_true', dest='breakpad_dump',
|
||||||
|
default=False, help='Dump and upload breakpad symbols')
|
||||||
|
run.Configure()
|
||||||
|
|||||||
+69
-72
@@ -1,127 +1,124 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
from ambuild.command import SymlinkCommand
|
|
||||||
|
|
||||||
for i in SM.sdkInfo:
|
for sdk_name in SM.sdks:
|
||||||
sdk = SM.sdkInfo[i]
|
sdk = SM.sdks[sdk_name]
|
||||||
if AMBuild.target['platform'] not in sdk['platform']:
|
binary_name = 'sourcemod.' + sdk.ext
|
||||||
continue
|
|
||||||
|
|
||||||
name = 'sourcemod.' + sdk['ext']
|
binary = SM.HL2Library(builder, binary_name, sdk)
|
||||||
|
compiler = binary.compiler
|
||||||
|
|
||||||
compiler = SM.DefaultHL2Compiler('core', i)
|
if sdk.name == 'csgo':
|
||||||
|
|
||||||
if i == 'csgo':
|
|
||||||
# Protobuf 2.3 headers have some signed/unsigned compares. I believe that it's fixed in later versions, but Valve.
|
# Protobuf 2.3 headers have some signed/unsigned compares. I believe that it's fixed in later versions, but Valve.
|
||||||
if isinstance(compiler.cxx, Cpp.CompatGCC):
|
if compiler.cxx.behavior == 'gcc':
|
||||||
compiler.AddToListVar('CFLAGS', '-Wno-sign-compare')
|
compiler.cflags += ['-Wno-sign-compare']
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'common', 'protobuf-2.3.0', 'src'))
|
compiler.cxxincludes += [
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'engine', 'protobuf'))
|
os.path.join(sdk.path, 'common', 'protobuf-2.3.0', 'src'),
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'csgo', 'protobuf'))
|
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
|
||||||
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf')
|
||||||
|
]
|
||||||
|
elif sdk.name == 'dota':
|
||||||
|
compiler.cxxincludes += [
|
||||||
|
os.path.join(sdk.path, 'common', 'protobuf-2.4.1', 'src'),
|
||||||
|
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
|
||||||
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf'),
|
||||||
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf')
|
||||||
|
]
|
||||||
|
|
||||||
extension = AMBuild.AddJob(name)
|
if builder.target_platform == 'linux':
|
||||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
compiler.postlink += ['-lpthread', '-lrt']
|
||||||
SM.PreSetupHL2Job(extension, binary, i)
|
|
||||||
|
|
||||||
if i == 'csgo':
|
if sdk.name == 'csgo' or sdk.name == 'dota':
|
||||||
if AMBuild.target['platform'] == 'linux':
|
if builder.target_platform == 'linux':
|
||||||
link = os.path.join(os.path.join(AMBuild.outputFolder, extension.workFolder), 'libprotobuf.a')
|
lib_path = os.path.join(sdk.path, 'lib', 'linux32', 'release', 'libprotobuf.a')
|
||||||
target = os.path.join(os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'linux32', 'release'), 'libprotobuf.a')
|
elif builder.target_platform == 'mac':
|
||||||
try:
|
lib_path = os.path.join(sdk.path, 'lib', 'osx32', 'release', 'libprotobuf.a')
|
||||||
os.lstat(link)
|
elif builder.target_platform == 'windows':
|
||||||
except:
|
if 'DEBUG' in compiler.defines:
|
||||||
extension.AddCommand(SymlinkCommand(link, target))
|
lib_path = os.path.join(sdk.path, 'lib', 'win32', 'debug', 'vs2010', 'libprotobuf.lib')
|
||||||
elif AMBuild.target['platform'] == 'darwin':
|
else:
|
||||||
link = os.path.join(os.path.join(AMBuild.outputFolder, extension.workFolder), 'libprotobuf.a')
|
lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs2010', 'libprotobuf.lib')
|
||||||
target = os.path.join(os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'osx32', 'release'), 'libprotobuf.a')
|
compiler.linkflags.insert(0, binary.Dep(lib_path))
|
||||||
try:
|
|
||||||
os.lstat(link)
|
|
||||||
except:
|
|
||||||
extension.AddCommand(SymlinkCommand(link, target))
|
|
||||||
elif AMBuild.target['platform'] == 'windows':
|
|
||||||
libPath = os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'win32', 'release', 'vs2010', 'libprotobuf.lib')
|
|
||||||
binary.RebuildIfNewer(libPath)
|
|
||||||
binary['POSTLINKFLAGS'].append(libPath)
|
|
||||||
|
|
||||||
files = [
|
binary.sources += [
|
||||||
'AdminCache.cpp',
|
'AdminCache.cpp',
|
||||||
'ExtensionSys.cpp',
|
|
||||||
'MenuStyle_Valve.cpp',
|
'MenuStyle_Valve.cpp',
|
||||||
'logic_bridge.cpp',
|
'logic_bridge.cpp',
|
||||||
'smn_entities.cpp',
|
'smn_entities.cpp',
|
||||||
'sm_stringutil.cpp',
|
'sm_stringutil.cpp',
|
||||||
'ADTFactory.cpp',
|
|
||||||
'ForwardSys.cpp',
|
|
||||||
'MenuVoting.cpp',
|
'MenuVoting.cpp',
|
||||||
'smn_events.cpp',
|
'smn_events.cpp',
|
||||||
'smn_menus.cpp',
|
'smn_menus.cpp',
|
||||||
'sm_trie.cpp',
|
'sm_trie.cpp',
|
||||||
'CDataPack.cpp',
|
'CDataPack.cpp',
|
||||||
'frame_hooks.cpp',
|
'frame_hooks.cpp',
|
||||||
'NativeInvoker.cpp',
|
|
||||||
'smn_fakenatives.cpp',
|
|
||||||
'smn_nextmap.cpp',
|
'smn_nextmap.cpp',
|
||||||
'sourcemm_api.cpp',
|
'sourcemm_api.cpp',
|
||||||
'ChatTriggers.cpp',
|
'ChatTriggers.cpp',
|
||||||
'NativeOwner.cpp',
|
|
||||||
'smn_filesystem.cpp',
|
|
||||||
'smn_player.cpp',
|
'smn_player.cpp',
|
||||||
'sourcemod.cpp',
|
'sourcemod.cpp',
|
||||||
'concmd_cleaner.cpp',
|
'concmd_cleaner.cpp',
|
||||||
'HalfLife2.cpp',
|
'HalfLife2.cpp',
|
||||||
'NextMap.cpp',
|
'NextMap.cpp',
|
||||||
'ConCmdManager.cpp',
|
'ConCmdManager.cpp',
|
||||||
'HandleSys.cpp',
|
|
||||||
'ConVarManager.cpp',
|
'ConVarManager.cpp',
|
||||||
'LibrarySys.cpp',
|
'LibrarySys.cpp',
|
||||||
'PlayerManager.cpp',
|
'PlayerManager.cpp',
|
||||||
'TimerSys.cpp',
|
'TimerSys.cpp',
|
||||||
'CoreConfig.cpp',
|
'CoreConfig.cpp',
|
||||||
'Logger.cpp',
|
'Logger.cpp',
|
||||||
'PluginInfoDatabase.cpp',
|
|
||||||
'smn_halflife.cpp',
|
'smn_halflife.cpp',
|
||||||
'PluginSys.cpp',
|
|
||||||
'smn_console.cpp',
|
'smn_console.cpp',
|
||||||
'UserMessages.cpp',
|
'UserMessages.cpp',
|
||||||
'Database.cpp',
|
|
||||||
'MenuManager.cpp',
|
'MenuManager.cpp',
|
||||||
'smn_core.cpp',
|
'smn_core.cpp',
|
||||||
'smn_hudtext.cpp',
|
'smn_hudtext.cpp',
|
||||||
'smn_usermsgs.cpp',
|
'smn_usermsgs.cpp',
|
||||||
'DebugReporter.cpp',
|
|
||||||
'MenuStyle_Base.cpp',
|
'MenuStyle_Base.cpp',
|
||||||
'ShareSys.cpp',
|
|
||||||
'smn_database.cpp',
|
|
||||||
'smn_keyvalues.cpp',
|
'smn_keyvalues.cpp',
|
||||||
'smn_vector.cpp',
|
'smn_vector.cpp',
|
||||||
'EventManager.cpp',
|
'EventManager.cpp',
|
||||||
'MenuStyle_Radio.cpp',
|
'MenuStyle_Radio.cpp',
|
||||||
'sm_autonatives.cpp',
|
'sm_autonatives.cpp',
|
||||||
'sm_srvcmds.cpp',
|
'sm_srvcmds.cpp',
|
||||||
'ConsoleDetours.cpp'
|
'ConsoleDetours.cpp',
|
||||||
|
'NativeInvoker.cpp',
|
||||||
|
'smn_database.cpp',
|
||||||
|
'ForwardSys.cpp',
|
||||||
|
'Database.cpp',
|
||||||
|
'DebugReporter.cpp',
|
||||||
|
'ShareSys.cpp',
|
||||||
|
'PluginSys.cpp',
|
||||||
|
'HandleSys.cpp',
|
||||||
|
'NativeOwner.cpp',
|
||||||
|
'ExtensionSys.cpp',
|
||||||
|
'smn_fakenatives.cpp',
|
||||||
|
'smn_filesystem.cpp',
|
||||||
|
'ADTFactory.cpp',
|
||||||
|
'PluginInfoDatabase.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
if i == 'csgo':
|
if sdk.name in ['csgo', 'dota']:
|
||||||
files.append('smn_protobuf.cpp')
|
binary.sources += ['smn_protobuf.cpp']
|
||||||
else:
|
else:
|
||||||
files.append('smn_bitbuffer.cpp')
|
binary.sources += ['smn_bitbuffer.cpp']
|
||||||
|
|
||||||
binary.AddSourceFiles('core', files)
|
if sdk.name == 'csgo':
|
||||||
|
binary.sources += [
|
||||||
if i == 'csgo':
|
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
|
||||||
files = [
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
|
||||||
os.path.join('public', 'engine', 'protobuf', 'netmessages.pb.cc'),
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
|
||||||
os.path.join('public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
|
]
|
||||||
os.path.join('public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
|
elif sdk.name == 'dota':
|
||||||
|
binary.sources += [
|
||||||
|
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'networkbasetypes.pb.cc'),
|
||||||
|
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
|
||||||
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf', 'ai_activity.pb.cc'),
|
||||||
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf', 'usermessages.pb.cc'),
|
||||||
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_commonmessages.pb.cc'),
|
||||||
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessages.pb.cc'),
|
||||||
|
os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessage_helpers.cpp'),
|
||||||
]
|
]
|
||||||
binary.AddSourceFiles(AMBuild.cache[sdk['sdk']], files)
|
|
||||||
|
|
||||||
SM.PostSetupHL2Job(extension, binary, i)
|
SM.binaries += [builder.Add(binary)]
|
||||||
|
|
||||||
if i == 'csgo':
|
|
||||||
if AMBuild.target['platform'] in ['linux', 'darwin']:
|
|
||||||
binary.AddObjectFiles(['libprotobuf.a'])
|
|
||||||
|
|
||||||
SM.AutoVersion('core', binary)
|
|
||||||
binary.SendToJob()
|
|
||||||
|
|
||||||
|
|||||||
+126
-46
@@ -59,13 +59,17 @@ ChatTriggers g_ChatTriggers;
|
|||||||
bool g_bSupressSilentFails = false;
|
bool g_bSupressSilentFails = false;
|
||||||
|
|
||||||
ChatTriggers::ChatTriggers() : m_pSayCmd(NULL), m_bWillProcessInPost(false),
|
ChatTriggers::ChatTriggers() : m_pSayCmd(NULL), m_bWillProcessInPost(false),
|
||||||
m_bTriggerWasSilent(false), m_ReplyTo(SM_REPLY_CONSOLE)
|
m_ReplyTo(SM_REPLY_CONSOLE)
|
||||||
{
|
{
|
||||||
m_PubTrigger = sm_strdup("!");
|
m_PubTrigger = sm_strdup("!");
|
||||||
m_PrivTrigger = sm_strdup("/");
|
m_PrivTrigger = sm_strdup("/");
|
||||||
m_PubTriggerSize = 1;
|
m_PubTriggerSize = 1;
|
||||||
m_PrivTriggerSize = 1;
|
m_PrivTriggerSize = 1;
|
||||||
m_bIsChatTrigger = false;
|
m_bIsChatTrigger = false;
|
||||||
|
m_bPluginIgnored = false;
|
||||||
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
||||||
|
m_bIsINS = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatTriggers::~ChatTriggers()
|
ChatTriggers::~ChatTriggers()
|
||||||
@@ -109,6 +113,8 @@ void ChatTriggers::OnSourceModAllInitialized()
|
|||||||
{
|
{
|
||||||
m_pShouldFloodBlock = g_Forwards.CreateForward("OnClientFloodCheck", ET_Event, 1, NULL, Param_Cell);
|
m_pShouldFloodBlock = g_Forwards.CreateForward("OnClientFloodCheck", ET_Event, 1, NULL, Param_Cell);
|
||||||
m_pDidFloodBlock = g_Forwards.CreateForward("OnClientFloodResult", ET_Event, 2, NULL, Param_Cell, Param_Cell);
|
m_pDidFloodBlock = g_Forwards.CreateForward("OnClientFloodResult", ET_Event, 2, NULL, Param_Cell, Param_Cell);
|
||||||
|
m_pOnClientSayCmd = g_Forwards.CreateForward("OnClientSayCommand", ET_Event, 3, NULL, Param_Cell, Param_String, Param_String);
|
||||||
|
m_pOnClientSayCmd_Post = g_Forwards.CreateForward("OnClientSayCommand_Post", ET_Ignore, 3, NULL, Param_Cell, Param_String, Param_String);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatTriggers::OnSourceModAllInitialized_Post()
|
void ChatTriggers::OnSourceModAllInitialized_Post()
|
||||||
@@ -131,23 +137,62 @@ void ChatTriggers::OnSourceModGameInitialized()
|
|||||||
SH_ADD_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayTeamCmd, this, &ChatTriggers::OnSayCommand_Pre, false);
|
SH_ADD_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayTeamCmd, this, &ChatTriggers::OnSayCommand_Pre, false);
|
||||||
SH_ADD_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayTeamCmd, this, &ChatTriggers::OnSayCommand_Post, true);
|
SH_ADD_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayTeamCmd, this, &ChatTriggers::OnSayCommand_Post, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
||||||
|
m_bIsINS = (strcmp(g_SourceMod.GetGameFolderName(), "insurgency") == 0);
|
||||||
|
|
||||||
|
if (m_bIsINS)
|
||||||
|
{
|
||||||
|
m_pSay2Cmd = FindCommand("say2");
|
||||||
|
if (m_pSay2Cmd)
|
||||||
|
{
|
||||||
|
SH_ADD_HOOK(ConCommand, Dispatch, m_pSay2Cmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Pre), false);
|
||||||
|
SH_ADD_HOOK(ConCommand, Dispatch, m_pSay2Cmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Post), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif SOURCE_ENGINE == SE_NUCLEARDAWN
|
||||||
|
m_pSaySquadCmd = FindCommand("say_squad");
|
||||||
|
|
||||||
|
if (m_pSaySquadCmd)
|
||||||
|
{
|
||||||
|
SH_ADD_HOOK(ConCommand, Dispatch, m_pSaySquadCmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Pre), false);
|
||||||
|
SH_ADD_HOOK(ConCommand, Dispatch, m_pSaySquadCmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Post), true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatTriggers::OnSourceModShutdown()
|
void ChatTriggers::OnSourceModShutdown()
|
||||||
{
|
{
|
||||||
if (m_pSayTeamCmd)
|
|
||||||
{
|
|
||||||
SH_REMOVE_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayTeamCmd, this, &ChatTriggers::OnSayCommand_Post, true);
|
|
||||||
SH_REMOVE_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayTeamCmd, this, &ChatTriggers::OnSayCommand_Pre, false);
|
|
||||||
}
|
|
||||||
if (m_pSayCmd)
|
if (m_pSayCmd)
|
||||||
{
|
{
|
||||||
SH_REMOVE_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayCmd, this, &ChatTriggers::OnSayCommand_Post, true);
|
SH_REMOVE_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayCmd, this, &ChatTriggers::OnSayCommand_Post, true);
|
||||||
SH_REMOVE_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayCmd, this, &ChatTriggers::OnSayCommand_Pre, false);
|
SH_REMOVE_HOOK_MEMFUNC(ConCommand, Dispatch, m_pSayCmd, this, &ChatTriggers::OnSayCommand_Pre, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_pSayTeamCmd)
|
||||||
|
{
|
||||||
|
SH_REMOVE_HOOK(ConCommand, Dispatch, m_pSayTeamCmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Post), true);
|
||||||
|
SH_REMOVE_HOOK(ConCommand, Dispatch, m_pSayTeamCmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Pre), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
||||||
|
if (m_bIsINS && m_pSay2Cmd)
|
||||||
|
{
|
||||||
|
SH_REMOVE_HOOK(ConCommand, Dispatch, m_pSay2Cmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Pre), false);
|
||||||
|
SH_REMOVE_HOOK(ConCommand, Dispatch, m_pSay2Cmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Post), true);
|
||||||
|
}
|
||||||
|
#elif SOURCE_ENGINE == SE_NUCLEARDAWN
|
||||||
|
if (m_pSaySquadCmd)
|
||||||
|
{
|
||||||
|
SH_REMOVE_HOOK(ConCommand, Dispatch, m_pSaySquadCmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Pre), false);
|
||||||
|
SH_REMOVE_HOOK(ConCommand, Dispatch, m_pSaySquadCmd, SH_MEMBER(this, &ChatTriggers::OnSayCommand_Post), true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
g_Forwards.ReleaseForward(m_pShouldFloodBlock);
|
g_Forwards.ReleaseForward(m_pShouldFloodBlock);
|
||||||
g_Forwards.ReleaseForward(m_pDidFloodBlock);
|
g_Forwards.ReleaseForward(m_pDidFloodBlock);
|
||||||
|
g_Forwards.ReleaseForward(m_pOnClientSayCmd);
|
||||||
|
g_Forwards.ReleaseForward(m_pOnClientSayCmd_Post);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
@@ -158,24 +203,10 @@ void ChatTriggers::OnSayCommand_Pre()
|
|||||||
{
|
{
|
||||||
CCommand command;
|
CCommand command;
|
||||||
#endif
|
#endif
|
||||||
int client;
|
int client = g_ConCmds.GetCommandClient();
|
||||||
CPlayer *pPlayer;
|
|
||||||
|
|
||||||
client = g_ConCmds.GetCommandClient();
|
|
||||||
m_bIsChatTrigger = false;
|
m_bIsChatTrigger = false;
|
||||||
m_bWasFloodedMessage = false;
|
m_bWasFloodedMessage = false;
|
||||||
|
m_bPluginIgnored = false;
|
||||||
/* The server console cannot do this */
|
|
||||||
if (client == 0 || (pPlayer = g_Players.GetPlayerByIndex(client)) == NULL)
|
|
||||||
{
|
|
||||||
RETURN_META(MRES_IGNORED);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We guarantee the client is connected */
|
|
||||||
if (!pPlayer->IsConnected())
|
|
||||||
{
|
|
||||||
RETURN_META(MRES_IGNORED);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *args = command.ArgS();
|
const char *args = command.ArgS();
|
||||||
|
|
||||||
@@ -184,6 +215,31 @@ void ChatTriggers::OnSayCommand_Pre()
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Save these off for post hook as the command data returned from the engine in older engine versions
|
||||||
|
* can be NULL, despite the data still being there and valid. */
|
||||||
|
m_Arg0Backup = command.Arg(0);
|
||||||
|
m_ArgSBackup = command.ArgS();
|
||||||
|
|
||||||
|
/* The server console cannot do this */
|
||||||
|
if (client == 0)
|
||||||
|
{
|
||||||
|
cell_t res = CallOnClientSayCommand(client);
|
||||||
|
if (res >= Pl_Handled)
|
||||||
|
{
|
||||||
|
m_bPluginIgnored = (res >= Pl_Stop);
|
||||||
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
|
}
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);
|
||||||
|
|
||||||
|
/* We guarantee the client is connected */
|
||||||
|
if (!pPlayer || !pPlayer->IsConnected())
|
||||||
|
{
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if we need to block this message from being sent */
|
/* Check if we need to block this message from being sent */
|
||||||
if (ClientIsFlooding(client))
|
if (ClientIsFlooding(client))
|
||||||
{
|
{
|
||||||
@@ -211,6 +267,13 @@ void ChatTriggers::OnSayCommand_Pre()
|
|||||||
is_quoted = true;
|
is_quoted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
||||||
|
if (m_bIsINS && strcmp(m_Arg0Backup, "say2") == 0 && strlen(args) >= 4)
|
||||||
|
{
|
||||||
|
args += 4;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool is_trigger = false;
|
bool is_trigger = false;
|
||||||
bool is_silent = false;
|
bool is_silent = false;
|
||||||
|
|
||||||
@@ -227,38 +290,28 @@ void ChatTriggers::OnSayCommand_Pre()
|
|||||||
args = &args[m_PrivTriggerSize];
|
args = &args[m_PrivTriggerSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_trigger)
|
|
||||||
{
|
|
||||||
RETURN_META(MRES_IGNORED);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if this is actually a command!
|
* Test if this is actually a command!
|
||||||
*/
|
*/
|
||||||
if (!PreProcessTrigger(PEntityOfEntIndex(client), args, is_quoted))
|
if (is_trigger && PreProcessTrigger(PEntityOfEntIndex(client), args, is_quoted))
|
||||||
{
|
{
|
||||||
CPlayer *pPlayer;
|
|
||||||
if (is_silent
|
|
||||||
&& g_bSupressSilentFails
|
|
||||||
&& client != 0
|
|
||||||
&& (pPlayer = g_Players.GetPlayerByIndex(client)) != NULL
|
|
||||||
&& pPlayer->GetAdminId() != INVALID_ADMIN_ID)
|
|
||||||
{
|
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
|
||||||
}
|
|
||||||
RETURN_META(MRES_IGNORED);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_bIsChatTrigger = true;
|
m_bIsChatTrigger = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We'll execute it in post.
|
* We'll execute it in post.
|
||||||
*/
|
*/
|
||||||
m_bWillProcessInPost = true;
|
m_bWillProcessInPost = true;
|
||||||
m_bTriggerWasSilent = is_silent;
|
}
|
||||||
|
|
||||||
/* If we're silent, block */
|
cell_t res = CallOnClientSayCommand(client);
|
||||||
if (is_silent)
|
|
||||||
|
if (res >= Pl_Handled)
|
||||||
|
{
|
||||||
|
m_bPluginIgnored = (res >= Pl_Stop);
|
||||||
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_silent && (m_bIsChatTrigger || (g_bSupressSilentFails && pPlayer->GetAdminId() != INVALID_ADMIN_ID)))
|
||||||
{
|
{
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
}
|
}
|
||||||
@@ -273,19 +326,33 @@ void ChatTriggers::OnSayCommand_Post(const CCommand &command)
|
|||||||
void ChatTriggers::OnSayCommand_Post()
|
void ChatTriggers::OnSayCommand_Post()
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
m_bIsChatTrigger = false;
|
int client = g_ConCmds.GetCommandClient();
|
||||||
m_bWasFloodedMessage = false;
|
|
||||||
if (m_bWillProcessInPost)
|
if (m_bWillProcessInPost)
|
||||||
{
|
{
|
||||||
/* Reset this for re-entrancy */
|
/* Reset this for re-entrancy */
|
||||||
m_bWillProcessInPost = false;
|
m_bWillProcessInPost = false;
|
||||||
|
|
||||||
/* Execute the cached command */
|
/* Execute the cached command */
|
||||||
int client = g_ConCmds.GetCommandClient();
|
|
||||||
unsigned int old = SetReplyTo(SM_REPLY_CHAT);
|
unsigned int old = SetReplyTo(SM_REPLY_CHAT);
|
||||||
serverpluginhelpers->ClientCommand(PEntityOfEntIndex(client), m_ToExecute);
|
serverpluginhelpers->ClientCommand(PEntityOfEntIndex(client), m_ToExecute);
|
||||||
SetReplyTo(old);
|
SetReplyTo(old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_bPluginIgnored)
|
||||||
|
{
|
||||||
|
m_bPluginIgnored = false;
|
||||||
|
}
|
||||||
|
else if (!m_bWasFloodedMessage && !m_bIsChatTrigger && m_pOnClientSayCmd_Post->GetFunctionCount() != 0)
|
||||||
|
{
|
||||||
|
m_pOnClientSayCmd_Post->PushCell(client);
|
||||||
|
m_pOnClientSayCmd_Post->PushString(m_Arg0Backup);
|
||||||
|
m_pOnClientSayCmd_Post->PushString(m_ArgSBackup);
|
||||||
|
m_pOnClientSayCmd_Post->Execute(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_bIsChatTrigger = false;
|
||||||
|
m_bWasFloodedMessage = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatTriggers::PreProcessTrigger(edict_t *pEdict, const char *args, bool is_quoted)
|
bool ChatTriggers::PreProcessTrigger(edict_t *pEdict, const char *args, bool is_quoted)
|
||||||
@@ -362,6 +429,19 @@ bool ChatTriggers::PreProcessTrigger(edict_t *pEdict, const char *args, bool is_
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cell_t ChatTriggers::CallOnClientSayCommand(int client)
|
||||||
|
{
|
||||||
|
cell_t res = Pl_Continue;
|
||||||
|
if (!m_bIsChatTrigger && m_pOnClientSayCmd->GetFunctionCount() != 0)
|
||||||
|
{
|
||||||
|
m_pOnClientSayCmd->PushCell(client);
|
||||||
|
m_pOnClientSayCmd->PushString(m_Arg0Backup);
|
||||||
|
m_pOnClientSayCmd->PushString(m_ArgSBackup);
|
||||||
|
m_pOnClientSayCmd->Execute(&res);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int ChatTriggers::SetReplyTo(unsigned int reply)
|
unsigned int ChatTriggers::SetReplyTo(unsigned int reply)
|
||||||
{
|
{
|
||||||
unsigned int old = m_ReplyTo;
|
unsigned int old = m_ReplyTo;
|
||||||
|
|||||||
+14
-1
@@ -69,21 +69,34 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool PreProcessTrigger(edict_t *pEdict, const char *args, bool is_quoted);
|
bool PreProcessTrigger(edict_t *pEdict, const char *args, bool is_quoted);
|
||||||
bool ClientIsFlooding(int client);
|
bool ClientIsFlooding(int client);
|
||||||
|
cell_t CallOnClientSayCommand(int client);
|
||||||
private:
|
private:
|
||||||
ConCommand *m_pSayCmd;
|
ConCommand *m_pSayCmd;
|
||||||
ConCommand *m_pSayTeamCmd;
|
ConCommand *m_pSayTeamCmd;
|
||||||
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
||||||
|
ConCommand *m_pSay2Cmd;
|
||||||
|
#elif SOURCE_ENGINE == SE_NUCLEARDAWN
|
||||||
|
ConCommand *m_pSaySquadCmd;
|
||||||
|
#endif
|
||||||
char *m_PubTrigger;
|
char *m_PubTrigger;
|
||||||
size_t m_PubTriggerSize;
|
size_t m_PubTriggerSize;
|
||||||
char *m_PrivTrigger;
|
char *m_PrivTrigger;
|
||||||
size_t m_PrivTriggerSize;
|
size_t m_PrivTriggerSize;
|
||||||
bool m_bWillProcessInPost;
|
bool m_bWillProcessInPost;
|
||||||
bool m_bTriggerWasSilent;
|
|
||||||
bool m_bIsChatTrigger;
|
bool m_bIsChatTrigger;
|
||||||
bool m_bWasFloodedMessage;
|
bool m_bWasFloodedMessage;
|
||||||
|
bool m_bPluginIgnored;
|
||||||
unsigned int m_ReplyTo;
|
unsigned int m_ReplyTo;
|
||||||
char m_ToExecute[300];
|
char m_ToExecute[300];
|
||||||
|
const char *m_Arg0Backup;
|
||||||
|
const char *m_ArgSBackup;
|
||||||
IForward *m_pShouldFloodBlock;
|
IForward *m_pShouldFloodBlock;
|
||||||
IForward *m_pDidFloodBlock;
|
IForward *m_pDidFloodBlock;
|
||||||
|
IForward *m_pOnClientSayCmd;
|
||||||
|
IForward *m_pOnClientSayCmd_Post;
|
||||||
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
||||||
|
bool m_bIsINS;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ChatTriggers g_ChatTriggers;
|
extern ChatTriggers g_ChatTriggers;
|
||||||
|
|||||||
+21
-1
@@ -126,6 +126,8 @@ void ConVarManager::OnSourceModAllInitialized()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_Players.AddClientListener(this);
|
||||||
|
|
||||||
SH_ADD_HOOK_STATICFUNC(ICvar, CallGlobalChangeCallbacks, icvar, OnConVarChanged, false);
|
SH_ADD_HOOK_STATICFUNC(ICvar, CallGlobalChangeCallbacks, icvar, OnConVarChanged, false);
|
||||||
|
|
||||||
g_PluginSys.AddPluginsListener(this);
|
g_PluginSys.AddPluginsListener(this);
|
||||||
@@ -191,6 +193,8 @@ void ConVarManager::OnSourceModShutdown()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_Players.RemoveClientListener(this);
|
||||||
|
|
||||||
SH_REMOVE_HOOK_STATICFUNC(ICvar, CallGlobalChangeCallbacks, icvar, OnConVarChanged, false);
|
SH_REMOVE_HOOK_STATICFUNC(ICvar, CallGlobalChangeCallbacks, icvar, OnConVarChanged, false);
|
||||||
|
|
||||||
/* Remove the 'convars' option from the 'sm' console command */
|
/* Remove the 'convars' option from the 'sm' console command */
|
||||||
@@ -307,6 +311,22 @@ void ConVarManager::OnPluginUnloaded(IPlugin *plugin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConVarManager::OnClientDisconnected(int client)
|
||||||
|
{
|
||||||
|
/* Remove convar queries for this client that haven't returned results yet */
|
||||||
|
for (List<ConVarQuery>::iterator iter = m_ConVarQueries.begin(); iter != m_ConVarQueries.end();)
|
||||||
|
{
|
||||||
|
ConVarQuery &query = (*iter);
|
||||||
|
if (query.client == client)
|
||||||
|
{
|
||||||
|
iter = m_ConVarQueries.erase(iter);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ConVarManager::OnHandleDestroy(HandleType_t type, void *object)
|
void ConVarManager::OnHandleDestroy(HandleType_t type, void *object)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -619,7 +639,7 @@ QueryCvarCookie_t ConVarManager::QueryClientConVar(edict_t *pPlayer, const char
|
|||||||
return InvalidQueryCvarCookie;
|
return InvalidQueryCvarCookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConVarQuery query = {cookie, pCallback, hndl};
|
ConVarQuery query = {cookie, pCallback, (cell_t)hndl, IndexOfEdict(pPlayer)};
|
||||||
m_ConVarQueries.push_back(query);
|
m_ConVarQueries.push_back(query);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,10 @@
|
|||||||
#include <IForwardSys.h>
|
#include <IForwardSys.h>
|
||||||
#include <IHandleSys.h>
|
#include <IHandleSys.h>
|
||||||
#include <IRootConsoleMenu.h>
|
#include <IRootConsoleMenu.h>
|
||||||
|
#include <IPlayerHelpers.h>
|
||||||
#include <compat_wrappers.h>
|
#include <compat_wrappers.h>
|
||||||
#include "concmd_cleaner.h"
|
#include "concmd_cleaner.h"
|
||||||
|
#include "PlayerManager.h"
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DARKMESSIAH
|
#if SOURCE_ENGINE == SE_DARKMESSIAH
|
||||||
class EQueryCvarValueStatus;
|
class EQueryCvarValueStatus;
|
||||||
@@ -75,6 +77,7 @@ struct ConVarQuery
|
|||||||
QueryCvarCookie_t cookie; /**< Cookie that identifies query */
|
QueryCvarCookie_t cookie; /**< Cookie that identifies query */
|
||||||
IPluginFunction *pCallback; /**< Function that will be called when query is finished */
|
IPluginFunction *pCallback; /**< Function that will be called when query is finished */
|
||||||
cell_t value; /**< Optional value passed to query function */
|
cell_t value; /**< Optional value passed to query function */
|
||||||
|
cell_t client; /**< Only used for cleaning up on client disconnection */
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConVarManager :
|
class ConVarManager :
|
||||||
@@ -82,7 +85,8 @@ class ConVarManager :
|
|||||||
public IHandleTypeDispatch,
|
public IHandleTypeDispatch,
|
||||||
public IPluginsListener,
|
public IPluginsListener,
|
||||||
public IRootConsoleCommand,
|
public IRootConsoleCommand,
|
||||||
public IConCommandTracker
|
public IConCommandTracker,
|
||||||
|
public IClientListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConVarManager();
|
ConVarManager();
|
||||||
@@ -101,6 +105,8 @@ public: //IRootConsoleCommand
|
|||||||
void OnRootConsoleCommand(const char *cmdname, const CCommand &command);
|
void OnRootConsoleCommand(const char *cmdname, const CCommand &command);
|
||||||
public: //IConCommandTracker
|
public: //IConCommandTracker
|
||||||
void OnUnlinkConCommandBase(ConCommandBase *pBase, const char *name, bool is_read_safe);
|
void OnUnlinkConCommandBase(ConCommandBase *pBase, const char *name, bool is_read_safe);
|
||||||
|
public: //IClientListener
|
||||||
|
void OnClientDisconnected(int client);
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Create a convar and return a handle to it.
|
* Create a convar and return a handle to it.
|
||||||
|
|||||||
@@ -688,7 +688,7 @@ cell_t ConsoleDetours::InternalDispatch(int client, const CCommand& args)
|
|||||||
if (strcmp(name, "sm") == 0)
|
if (strcmp(name, "sm") == 0)
|
||||||
result = Pl_Continue;
|
result = Pl_Continue;
|
||||||
|
|
||||||
if (result >= Pl_Stop)
|
if (result >= Pl_Handled)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
Listener **plistener = m_CmdLookup.retrieve(name);
|
Listener **plistener = m_CmdLookup.retrieve(name);
|
||||||
|
|||||||
+1
-1
@@ -408,7 +408,7 @@ bool SM_ExecuteConfig(CPlugin *pl, AutoConfig *cfg, bool can_create)
|
|||||||
FILE *fp = fopen(file, "wt");
|
FILE *fp = fopen(file, "wt");
|
||||||
if (fp)
|
if (fp)
|
||||||
{
|
{
|
||||||
fprintf(fp, "// This file was auto-generated by SourceMod (v%s)\n", SM_VERSION_STRING);
|
fprintf(fp, "// This file was auto-generated by SourceMod (v%s)\n", SOURCEMOD_VERSION);
|
||||||
fprintf(fp, "// ConVars for plugin \"%s\"\n", pl->GetFilename());
|
fprintf(fp, "// ConVars for plugin \"%s\"\n", pl->GetFilename());
|
||||||
fprintf(fp, "\n\n");
|
fprintf(fp, "\n\n");
|
||||||
|
|
||||||
|
|||||||
+41
-10
@@ -66,6 +66,8 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena
|
|||||||
#define GAMEFIX "2.l4d"
|
#define GAMEFIX "2.l4d"
|
||||||
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
|
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
|
||||||
#define GAMEFIX "2.l4d2"
|
#define GAMEFIX "2.l4d2"
|
||||||
|
#elif SOURCE_ENGINE == SE_NUCLEARDAWN
|
||||||
|
#define GAMEFIX "2.nd"
|
||||||
#elif SOURCE_ENGINE == SE_ALIENSWARM
|
#elif SOURCE_ENGINE == SE_ALIENSWARM
|
||||||
#define GAMEFIX "2.swarm"
|
#define GAMEFIX "2.swarm"
|
||||||
#elif SOURCE_ENGINE == SE_ORANGEBOX
|
#elif SOURCE_ENGINE == SE_ORANGEBOX
|
||||||
@@ -76,8 +78,12 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena
|
|||||||
#define GAMEFIX "2.eye"
|
#define GAMEFIX "2.eye"
|
||||||
#elif SOURCE_ENGINE == SE_CSS
|
#elif SOURCE_ENGINE == SE_CSS
|
||||||
#define GAMEFIX "2.css"
|
#define GAMEFIX "2.css"
|
||||||
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#elif SOURCE_ENGINE == SE_HL2DM
|
||||||
#define GAMEFIX "2.ep2v"
|
#define GAMEFIX "2.hl2dm"
|
||||||
|
#elif SOURCE_ENGINE == SE_DODS
|
||||||
|
#define GAMEFIX "2.dods"
|
||||||
|
#elif SOURCE_ENGINE == SE_TF2
|
||||||
|
#define GAMEFIX "2.tf2"
|
||||||
#elif SOURCE_ENGINE == SE_DARKMESSIAH
|
#elif SOURCE_ENGINE == SE_DARKMESSIAH
|
||||||
#define GAMEFIX "2.darkm"
|
#define GAMEFIX "2.darkm"
|
||||||
#elif SOURCE_ENGINE == SE_PORTAL2
|
#elif SOURCE_ENGINE == SE_PORTAL2
|
||||||
@@ -116,6 +122,31 @@ CLocalExtension::CLocalExtension(const char *filename)
|
|||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM
|
||||||
|
/* COMPAT HACK: One-halfth, if ep2v, see if there is an engine specific build in the new place with old naming */
|
||||||
|
g_SourceMod.BuildPath(Path_SM,
|
||||||
|
path,
|
||||||
|
PLATFORM_MAX_PATH,
|
||||||
|
"extensions/%s.2.ep2v." PLATFORM_LIB_EXT,
|
||||||
|
filename);
|
||||||
|
|
||||||
|
if (g_LibSys.IsPathFile(path))
|
||||||
|
{
|
||||||
|
goto found;
|
||||||
|
}
|
||||||
|
#elif SOURCE_ENGINE == SE_NUCLEARDAWN
|
||||||
|
g_SourceMod.BuildPath(Path_SM,
|
||||||
|
path,
|
||||||
|
PLATFORM_MAX_PATH,
|
||||||
|
"extensions/%s.2.l4d2." PLATFORM_LIB_EXT,
|
||||||
|
filename);
|
||||||
|
|
||||||
|
if (g_LibSys.IsPathFile(path))
|
||||||
|
{
|
||||||
|
goto found;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* First see if there is an engine specific build! */
|
/* First see if there is an engine specific build! */
|
||||||
g_SourceMod.BuildPath(Path_SM,
|
g_SourceMod.BuildPath(Path_SM,
|
||||||
path,
|
path,
|
||||||
@@ -123,10 +154,10 @@ CLocalExtension::CLocalExtension(const char *filename)
|
|||||||
"extensions/auto." GAMEFIX "/%s." PLATFORM_LIB_EXT,
|
"extensions/auto." GAMEFIX "/%s." PLATFORM_LIB_EXT,
|
||||||
filename);
|
filename);
|
||||||
|
|
||||||
normal:
|
|
||||||
/* Try the "normal" version */
|
/* Try the "normal" version */
|
||||||
if (!g_LibSys.IsPathFile(path))
|
if (!g_LibSys.IsPathFile(path))
|
||||||
{
|
{
|
||||||
|
normal:
|
||||||
g_SourceMod.BuildPath(Path_SM,
|
g_SourceMod.BuildPath(Path_SM,
|
||||||
path,
|
path,
|
||||||
PLATFORM_MAX_PATH,
|
PLATFORM_MAX_PATH,
|
||||||
@@ -805,6 +836,13 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tell it to unload */
|
||||||
|
if (pExt->IsLoaded())
|
||||||
|
{
|
||||||
|
IExtensionInterface *pAPI = pExt->GetAPI();
|
||||||
|
pAPI->OnExtensionUnload();
|
||||||
|
}
|
||||||
|
|
||||||
/* First remove us from internal lists */
|
/* First remove us from internal lists */
|
||||||
g_ShareSys.RemoveInterfaces(_pExt);
|
g_ShareSys.RemoveInterfaces(_pExt);
|
||||||
m_Libs.remove(pExt);
|
m_Libs.remove(pExt);
|
||||||
@@ -899,13 +937,6 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tell it to unload */
|
|
||||||
if (pExt->IsLoaded())
|
|
||||||
{
|
|
||||||
IExtensionInterface *pAPI = pExt->GetAPI();
|
|
||||||
pAPI->OnExtensionUnload();
|
|
||||||
}
|
|
||||||
|
|
||||||
pExt->Unload();
|
pExt->Unload();
|
||||||
delete pExt;
|
delete pExt;
|
||||||
|
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ void CForwardManager::ForwardFree(CForward *fwd)
|
|||||||
|
|
||||||
m_FreeForwards.push(fwd);
|
m_FreeForwards.push(fwd);
|
||||||
m_managed.remove(fwd);
|
m_managed.remove(fwd);
|
||||||
|
m_unmanaged.remove(fwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
CForward *CForwardManager::ForwardMake()
|
CForward *CForwardManager::ForwardMake()
|
||||||
|
|||||||
+112
-23
@@ -56,7 +56,7 @@ typedef ICommandLine *(*FakeGetCommandLine)();
|
|||||||
#define TIER0_NAME "libtier0.dylib"
|
#define TIER0_NAME "libtier0.dylib"
|
||||||
#define VSTDLIB_NAME "libvstdlib.dylib"
|
#define VSTDLIB_NAME "libvstdlib.dylib"
|
||||||
#elif defined __linux__
|
#elif defined __linux__
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_LEFT4DEAD2
|
||||||
#define TIER0_NAME "libtier0_srv.so"
|
#define TIER0_NAME "libtier0_srv.so"
|
||||||
#define VSTDLIB_NAME "libvstdlib_srv.so"
|
#define VSTDLIB_NAME "libvstdlib_srv.so"
|
||||||
#elif SOURCE_ENGINE >= SE_LEFT4DEAD
|
#elif SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||||
@@ -72,8 +72,23 @@ CHalfLife2 g_HL2;
|
|||||||
ConVar *sv_lan = NULL;
|
ConVar *sv_lan = NULL;
|
||||||
|
|
||||||
static void *g_EntList = NULL;
|
static void *g_EntList = NULL;
|
||||||
|
static void **g_pEntInfoList = NULL;
|
||||||
static int entInfoOffset = -1;
|
static int entInfoOffset = -1;
|
||||||
|
|
||||||
|
static CEntInfo *EntInfoArray()
|
||||||
|
{
|
||||||
|
if (g_EntList != NULL)
|
||||||
|
{
|
||||||
|
return (CEntInfo *)((intp)g_EntList + entInfoOffset);
|
||||||
|
}
|
||||||
|
else if (g_pEntInfoList)
|
||||||
|
{
|
||||||
|
return *(CEntInfo **)g_pEntInfoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
namespace SourceHook
|
namespace SourceHook
|
||||||
{
|
{
|
||||||
template<>
|
template<>
|
||||||
@@ -192,21 +207,10 @@ void CHalfLife2::InitLogicalEntData()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!g_EntList)
|
if (!g_EntList)
|
||||||
{
|
{
|
||||||
if (!g_pGameConf->GetMemSig("LevelShutdown", (void **)&addr))
|
if (g_pGameConf->GetMemSig("LevelShutdown", (void **) &addr) && addr)
|
||||||
{
|
{
|
||||||
g_Logger.LogError("Logical Entities not supported by this mod (LevelShutdown) - Reverting to networkable entities only");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!addr)
|
|
||||||
{
|
|
||||||
g_Logger.LogError("Failed lookup of LevelShutdown - Reverting to networkable entities only");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int offset;
|
int offset;
|
||||||
if (!g_pGameConf->GetOffset("gEntList", &offset))
|
if (!g_pGameConf->GetOffset("gEntList", &offset))
|
||||||
{
|
{
|
||||||
@@ -215,17 +219,27 @@ void CHalfLife2::InitLogicalEntData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_EntList = *reinterpret_cast<void **>(addr + offset);
|
g_EntList = *reinterpret_cast<void **>(addr + offset);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_EntList)
|
// If we have g_EntList from either of the above methods, make sure we can get the offset from it to EntInfo as well
|
||||||
|
if (g_EntList && !g_pGameConf->GetOffset("EntInfo", &entInfoOffset))
|
||||||
{
|
{
|
||||||
g_Logger.LogError("Failed lookup of gEntList - Reverting to networkable entities only");
|
g_Logger.LogError("Logical Entities not supported by this mod (EntInfo) - Reverting to networkable entities only");
|
||||||
|
g_EntList = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_pGameConf->GetOffset("EntInfo", &entInfoOffset))
|
// If we don't have g_EntList or have it but don't know where EntInfo is on it, use fallback.
|
||||||
|
if (!g_EntList || entInfoOffset == -1)
|
||||||
{
|
{
|
||||||
g_Logger.LogError("Logical Entities not supported by this mod (EntInfo) - Reverting to networkable entities only");
|
g_pGameConf->GetAddress("EntInfosPtr", (void **)&g_pEntInfoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!g_EntList && !g_pEntInfoList)
|
||||||
|
{
|
||||||
|
g_Logger.LogError("Failed lookup of gEntList - Reverting to networkable entities only");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -337,8 +351,13 @@ bool UTIL_FindInSendTable(SendTable *pTable,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedescription_t *UTIL_FindInDataMap(datamap_t *pMap, const char *name)
|
typedescription_t *UTIL_FindInDataMap(datamap_t *pMap, const char *name, bool *isNested)
|
||||||
{
|
{
|
||||||
|
if (isNested)
|
||||||
|
{
|
||||||
|
*isNested = false;
|
||||||
|
}
|
||||||
|
|
||||||
while (pMap)
|
while (pMap)
|
||||||
{
|
{
|
||||||
for (int i=0; i<pMap->dataNumFields; i++)
|
for (int i=0; i<pMap->dataNumFields; i++)
|
||||||
@@ -353,13 +372,24 @@ typedescription_t *UTIL_FindInDataMap(datamap_t *pMap, const char *name)
|
|||||||
}
|
}
|
||||||
if (pMap->dataDesc[i].td)
|
if (pMap->dataDesc[i].td)
|
||||||
{
|
{
|
||||||
|
if (isNested)
|
||||||
|
{
|
||||||
|
*isNested = (UTIL_FindInDataMap(pMap->dataDesc[i].td, name, NULL) != NULL);
|
||||||
|
if (*isNested)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} else { // Use the old behaviour, we dont want to spring this on extensions - even if they're doing bad things.
|
||||||
typedescription_t *_td;
|
typedescription_t *_td;
|
||||||
if ((_td=UTIL_FindInDataMap(pMap->dataDesc[i].td, name)) != NULL)
|
if ((_td=UTIL_FindInDataMap(pMap->dataDesc[i].td, name, NULL)) != NULL)
|
||||||
{
|
{
|
||||||
return _td;
|
return _td;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pMap = pMap->baseMap;
|
pMap = pMap->baseMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,6 +479,11 @@ SendProp *CHalfLife2::FindInSendTable(const char *classname, const char *offset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
typedescription_t *CHalfLife2::FindInDataMap(datamap_t *pMap, const char *offset)
|
typedescription_t *CHalfLife2::FindInDataMap(datamap_t *pMap, const char *offset)
|
||||||
|
{
|
||||||
|
return this->FindInDataMap(pMap, offset, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
typedescription_t *CHalfLife2::FindInDataMap(datamap_t *pMap, const char *offset, bool *isNested)
|
||||||
{
|
{
|
||||||
typedescription_t *td = NULL;
|
typedescription_t *td = NULL;
|
||||||
DataMapTrie &val = m_Maps[pMap];
|
DataMapTrie &val = m_Maps[pMap];
|
||||||
@@ -459,7 +494,7 @@ typedescription_t *CHalfLife2::FindInDataMap(datamap_t *pMap, const char *offset
|
|||||||
}
|
}
|
||||||
if (!sm_trie_retrieve(val.trie, offset, (void **)&td))
|
if (!sm_trie_retrieve(val.trie, offset, (void **)&td))
|
||||||
{
|
{
|
||||||
if ((td = UTIL_FindInDataMap(pMap, offset)) != NULL)
|
if ((td = UTIL_FindInDataMap(pMap, offset, isNested)) != NULL)
|
||||||
{
|
{
|
||||||
sm_trie_insert(val.trie, offset, td);
|
sm_trie_insert(val.trie, offset, td);
|
||||||
}
|
}
|
||||||
@@ -716,6 +751,7 @@ void CHalfLife2::ProcessFakeCliCmdQueue()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_CmdQueue.pop();
|
m_CmdQueue.pop();
|
||||||
|
m_FreeCmds.push(pFake);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -810,6 +846,14 @@ const char *CHalfLife2::CurrentCommandName()
|
|||||||
|
|
||||||
void CHalfLife2::AddDelayedKick(int client, int userid, const char *msg)
|
void CHalfLife2::AddDelayedKick(int client, int userid, const char *msg)
|
||||||
{
|
{
|
||||||
|
CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);
|
||||||
|
if (!pPlayer || !pPlayer->IsConnected() || pPlayer->IsInKickQueue())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pPlayer->MarkAsBeingKicked();
|
||||||
|
|
||||||
DelayedKickInfo kick;
|
DelayedKickInfo kick;
|
||||||
|
|
||||||
kick.client = client;
|
kick.client = client;
|
||||||
@@ -964,7 +1008,9 @@ CEntInfo *CHalfLife2::LookupEntity(int entIndex)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_EntList || entInfoOffset == -1)
|
CEntInfo *entInfos = EntInfoArray();
|
||||||
|
|
||||||
|
if (!entInfos)
|
||||||
{
|
{
|
||||||
/* Attempt to use engine interface instead */
|
/* Attempt to use engine interface instead */
|
||||||
static CEntInfo tempInfo;
|
static CEntInfo tempInfo;
|
||||||
@@ -991,8 +1037,7 @@ CEntInfo *CHalfLife2::LookupEntity(int entIndex)
|
|||||||
return &tempInfo;
|
return &tempInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
CEntInfo *pArray = (CEntInfo *)(((unsigned char *)g_EntList) + entInfoOffset);
|
return &entInfos[entIndex];
|
||||||
return &pArray[entIndex];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1131,3 +1176,47 @@ const char *CHalfLife2::GetEntityClassname(CBaseEntity *pEntity)
|
|||||||
|
|
||||||
return *(const char **)(((unsigned char *)pEntity) + offset);
|
return *(const char **)(((unsigned char *)pEntity) + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||||
|
static bool ResolveFuzzyMapName(const char *fuzzyName, char *outFullname, int size)
|
||||||
|
{
|
||||||
|
static ConCommand *pHelperCmd = g_pCVar->FindCommand("changelevel");
|
||||||
|
if (!pHelperCmd || !pHelperCmd->CanAutoComplete())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
static size_t helperCmdLen = strlen(pHelperCmd->GetName());
|
||||||
|
|
||||||
|
CUtlVector<CUtlString> results;
|
||||||
|
pHelperCmd->AutoCompleteSuggest(fuzzyName, results);
|
||||||
|
if (results.Count() == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Results come back as you'd see in autocomplete. (ie. "changelevel fullmapnamehere"),
|
||||||
|
// so skip ahead to start of map path/name
|
||||||
|
|
||||||
|
// Like the engine, we're only going to deal with the first match.
|
||||||
|
|
||||||
|
strncopy(outFullname, &results[0][helperCmdLen + 1], size);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool CHalfLife2::IsMapValid(const char *map)
|
||||||
|
{
|
||||||
|
if (!map || !map[0])
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool ret = engine->IsMapValid(map);
|
||||||
|
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||||
|
if (!ret)
|
||||||
|
{
|
||||||
|
static char szFuzzyName[PLATFORM_MAX_PATH];
|
||||||
|
if (ResolveFuzzyMapName(map, szFuzzyName, sizeof(szFuzzyName)))
|
||||||
|
{
|
||||||
|
ret = engine->IsMapValid(szFuzzyName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ public: //IGameHelpers
|
|||||||
datamap_t *GetDataMap(CBaseEntity *pEntity);
|
datamap_t *GetDataMap(CBaseEntity *pEntity);
|
||||||
ServerClass *FindServerClass(const char *classname);
|
ServerClass *FindServerClass(const char *classname);
|
||||||
typedescription_t *FindInDataMap(datamap_t *pMap, const char *offset);
|
typedescription_t *FindInDataMap(datamap_t *pMap, const char *offset);
|
||||||
|
typedescription_t *FindInDataMap(datamap_t *pMap, const char *offset, bool *isNested);
|
||||||
void SetEdictStateChanged(edict_t *pEdict, unsigned short offset);
|
void SetEdictStateChanged(edict_t *pEdict, unsigned short offset);
|
||||||
bool TextMsg(int client, int dest, const char *msg);
|
bool TextMsg(int client, int dest, const char *msg);
|
||||||
bool HintTextMsg(int client, const char *msg);
|
bool HintTextMsg(int client, const char *msg);
|
||||||
@@ -148,6 +149,7 @@ public: //IGameHelpers
|
|||||||
ICommandLine *GetValveCommandLine();
|
ICommandLine *GetValveCommandLine();
|
||||||
const char *GetEntityClassname(edict_t *pEdict);
|
const char *GetEntityClassname(edict_t *pEdict);
|
||||||
const char *GetEntityClassname(CBaseEntity *pEntity);
|
const char *GetEntityClassname(CBaseEntity *pEntity);
|
||||||
|
bool IsMapValid(const char *map);
|
||||||
public:
|
public:
|
||||||
void AddToFakeCliCmdQueue(int client, int userid, const char *cmd);
|
void AddToFakeCliCmdQueue(int client, int userid, const char *cmd);
|
||||||
void ProcessFakeCliCmdQueue();
|
void ProcessFakeCliCmdQueue();
|
||||||
|
|||||||
+45
-36
@@ -579,6 +579,7 @@ HandleError HandleSystem::CloneHandle(QHandle *pHandle, unsigned int index, Hand
|
|||||||
}
|
}
|
||||||
|
|
||||||
pNewHandle->clone = index;
|
pNewHandle->clone = index;
|
||||||
|
pNewHandle->object = NULL;
|
||||||
pHandle->refcount++;
|
pHandle->refcount++;
|
||||||
|
|
||||||
*newhandle = new_handle;
|
*newhandle = new_handle;
|
||||||
@@ -659,6 +660,14 @@ void HandleSystem::GetHandleUnchecked(Handle_t hndl, QHandle *& pHandle, unsigne
|
|||||||
|
|
||||||
HandleError HandleSystem::FreeHandle(QHandle *pHandle, unsigned int index)
|
HandleError HandleSystem::FreeHandle(QHandle *pHandle, unsigned int index)
|
||||||
{
|
{
|
||||||
|
if (pHandle->is_destroying)
|
||||||
|
{
|
||||||
|
/* Someone tried to free this recursively.
|
||||||
|
* We'll just ignore this safely.
|
||||||
|
*/
|
||||||
|
return HandleError_None;
|
||||||
|
}
|
||||||
|
|
||||||
QHandleType *pType = &m_Types[pHandle->type];
|
QHandleType *pType = &m_Types[pHandle->type];
|
||||||
|
|
||||||
if (pHandle->clone)
|
if (pHandle->clone)
|
||||||
@@ -673,6 +682,7 @@ HandleError HandleSystem::FreeHandle(QHandle *pHandle, unsigned int index)
|
|||||||
pMaster = &m_Handles[master];
|
pMaster = &m_Handles[master];
|
||||||
|
|
||||||
/* Release the clone now */
|
/* Release the clone now */
|
||||||
|
pHandle->is_destroying = true;
|
||||||
ReleasePrimHandle(index);
|
ReleasePrimHandle(index);
|
||||||
|
|
||||||
/* Decrement the master's reference count */
|
/* Decrement the master's reference count */
|
||||||
@@ -681,20 +691,27 @@ HandleError HandleSystem::FreeHandle(QHandle *pHandle, unsigned int index)
|
|||||||
/* Type should be the same but do this anyway... */
|
/* Type should be the same but do this anyway... */
|
||||||
pType = &m_Types[pMaster->type];
|
pType = &m_Types[pMaster->type];
|
||||||
pMaster->is_destroying = true;
|
pMaster->is_destroying = true;
|
||||||
|
if (pMaster->object)
|
||||||
|
{
|
||||||
pType->dispatch->OnHandleDestroy(pMaster->type, pMaster->object);
|
pType->dispatch->OnHandleDestroy(pMaster->type, pMaster->object);
|
||||||
|
}
|
||||||
ReleasePrimHandle(master);
|
ReleasePrimHandle(master);
|
||||||
}
|
}
|
||||||
} else if (pHandle->set == HandleSet_Identity) {
|
} else if (pHandle->set == HandleSet_Identity) {
|
||||||
/* If we're an identity, skip all this stuff!
|
/* If we're an identity, skip all this stuff!
|
||||||
* NOTE: SHARESYS DOES NOT CARE ABOUT THE DESTRUCTOR
|
* NOTE: SHARESYS DOES NOT CARE ABOUT THE DESTRUCTOR
|
||||||
*/
|
*/
|
||||||
|
pHandle->is_destroying = true;
|
||||||
ReleasePrimHandle(index);
|
ReleasePrimHandle(index);
|
||||||
} else {
|
} else {
|
||||||
/* Decrement, free if necessary */
|
/* Decrement, free if necessary */
|
||||||
if (--pHandle->refcount == 0)
|
if (--pHandle->refcount == 0)
|
||||||
{
|
{
|
||||||
pHandle->is_destroying = true;
|
pHandle->is_destroying = true;
|
||||||
|
if (pHandle->object)
|
||||||
|
{
|
||||||
pType->dispatch->OnHandleDestroy(pHandle->type, pHandle->object);
|
pType->dispatch->OnHandleDestroy(pHandle->type, pHandle->object);
|
||||||
|
}
|
||||||
ReleasePrimHandle(index);
|
ReleasePrimHandle(index);
|
||||||
} else {
|
} else {
|
||||||
/* We must be cloned, so mark ourselves as freed */
|
/* We must be cloned, so mark ourselves as freed */
|
||||||
@@ -727,14 +744,6 @@ HandleError HandleSystem::FreeHandle(Handle_t handle, const HandleSecurity *pSec
|
|||||||
return HandleError_Access;
|
return HandleError_Access;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pHandle->is_destroying)
|
|
||||||
{
|
|
||||||
/* Someone tried to free this recursively.
|
|
||||||
* We'll just ignore this safely.
|
|
||||||
*/
|
|
||||||
return HandleError_None;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FreeHandle(pHandle, index);
|
return FreeHandle(pHandle, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -793,6 +802,9 @@ void HandleSystem::UnlinkHandleFromOwner(QHandle *pHandle, unsigned int index)
|
|||||||
assert(pHandle->owner == 0);
|
assert(pHandle->owner == 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pHandle->owner = NULL;
|
||||||
|
|
||||||
/* Note that since 0 is an invalid handle, if any of these links are 0,
|
/* Note that since 0 is an invalid handle, if any of these links are 0,
|
||||||
* the data can still be set.
|
* the data can still be set.
|
||||||
*/
|
*/
|
||||||
@@ -917,29 +929,9 @@ bool HandleSystem::RemoveType(HandleType_t type, IdentityToken_t *ident)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (pHandle->clone)
|
|
||||||
{
|
FreeHandle(pHandle, i);
|
||||||
/* Get parent */
|
|
||||||
QHandle *pOther = &m_Handles[pHandle->clone];
|
|
||||||
if (--pOther->refcount == 0)
|
|
||||||
{
|
|
||||||
/* Free! */
|
|
||||||
dispatch->OnHandleDestroy(type, pOther->object);
|
|
||||||
ReleasePrimHandle(pHandle->clone);
|
|
||||||
}
|
|
||||||
/* Unlink ourselves since we don't have a reference count */
|
|
||||||
ReleasePrimHandle(i);
|
|
||||||
} else {
|
|
||||||
/* If it's not a clone, we still have to check the reference count.
|
|
||||||
* Either way, we'll be destroyed eventually because the handle types do not change.
|
|
||||||
*/
|
|
||||||
if (--pHandle->refcount == 0)
|
|
||||||
{
|
|
||||||
/* Free! */
|
|
||||||
dispatch->OnHandleDestroy(type, pHandle->object);
|
|
||||||
ReleasePrimHandle(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pType->opened == 0)
|
if (pType->opened == 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@@ -993,12 +985,11 @@ bool HandleSystem::InitAccessDefaults(TypeAccess *pTypeAccess, HandleAccess *pHa
|
|||||||
|
|
||||||
bool HandleSystem::TryAndFreeSomeHandles()
|
bool HandleSystem::TryAndFreeSomeHandles()
|
||||||
{
|
{
|
||||||
IPluginIterator *pl_iter = g_PluginSys.GetPluginIterator();
|
|
||||||
IPlugin *highest_owner = NULL;
|
IPlugin *highest_owner = NULL;
|
||||||
unsigned int highest_handle_count = 0;
|
unsigned int highest_handle_count = 0;
|
||||||
|
|
||||||
/* Search all plugins */
|
/* Search all plugins */
|
||||||
while (pl_iter->MorePlugins())
|
for (IPluginIterator *pl_iter = g_PluginSys.GetPluginIterator(); pl_iter->MorePlugins(); pl_iter->NextPlugin())
|
||||||
{
|
{
|
||||||
IPlugin *plugin = pl_iter->GetPlugin();
|
IPlugin *plugin = pl_iter->GetPlugin();
|
||||||
IdentityToken_t *identity = plugin->GetIdentity();
|
IdentityToken_t *identity = plugin->GetIdentity();
|
||||||
@@ -1027,8 +1018,6 @@ bool HandleSystem::TryAndFreeSomeHandles()
|
|||||||
highest_owner = plugin;
|
highest_owner = plugin;
|
||||||
highest_handle_count = handle_count;
|
highest_handle_count = handle_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
pl_iter->NextPlugin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highest_owner == NULL || highest_handle_count == 0)
|
if (highest_owner == NULL || highest_handle_count == 0)
|
||||||
@@ -1095,12 +1084,32 @@ void HandleSystem::Dump(HANDLE_REPORTER rep)
|
|||||||
const char *type = "ANON";
|
const char *type = "ANON";
|
||||||
QHandleType *pType = &m_Types[m_Handles[i].type];
|
QHandleType *pType = &m_Types[m_Handles[i].type];
|
||||||
unsigned int size = 0;
|
unsigned int size = 0;
|
||||||
|
unsigned int parentIdx;
|
||||||
|
bool bresult;
|
||||||
if (pType->nameIdx != -1)
|
if (pType->nameIdx != -1)
|
||||||
{
|
{
|
||||||
type = m_strtab->GetString(pType->nameIdx);
|
type = m_strtab->GetString(pType->nameIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((parentIdx = m_Handles[i].clone) != 0)
|
||||||
|
{
|
||||||
|
if (m_Handles[parentIdx].refcount > 0)
|
||||||
|
{
|
||||||
|
size = 0;
|
||||||
|
bresult = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bresult = pType->dispatch->GetHandleApproxSize(m_Handles[parentIdx].type, m_Handles[parentIdx].object, &size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bresult = pType->dispatch->GetHandleApproxSize(m_Handles[i].type, m_Handles[i].object, &size);
|
||||||
|
}
|
||||||
|
|
||||||
if (pType->dispatch->GetDispatchVersion() < HANDLESYS_MEMUSAGE_MIN_VERSION
|
if (pType->dispatch->GetDispatchVersion() < HANDLESYS_MEMUSAGE_MIN_VERSION
|
||||||
|| !pType->dispatch->GetHandleApproxSize(m_Handles[i].type, m_Handles[i].object, &size))
|
|| !bresult)
|
||||||
{
|
{
|
||||||
rep("0x%08x\t%-20.20s\t%-20.20s\t%-10.10s", index, owner, type, "-1");
|
rep("0x%08x\t%-20.20s\t%-20.20s\t%-10.10s", index, owner, type, "-1");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -149,7 +149,7 @@ void Logger::_NewMapFile()
|
|||||||
} else {
|
} else {
|
||||||
char date[32];
|
char date[32];
|
||||||
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
|
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
|
||||||
fprintf(fp, "L %s: SourceMod log file started (file \"L%02d%02d%03d.log\") (Version \"%s\")\n", date, curtime->tm_mon + 1, curtime->tm_mday, i, SM_VERSION_STRING);
|
fprintf(fp, "L %s: SourceMod log file started (file \"L%02d%02d%03d.log\") (Version \"%s\")\n", date, curtime->tm_mon + 1, curtime->tm_mday, i, SOURCEMOD_VERSION);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -362,7 +362,7 @@ void Logger::LogMessage(const char *vafmt, ...)
|
|||||||
char date[32];
|
char date[32];
|
||||||
m_DailyPrintHdr = false;
|
m_DailyPrintHdr = false;
|
||||||
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
|
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
|
||||||
fprintf(fp, "L %s: SourceMod log file session started (file \"L%04d%02d%02d.log\") (Version \"%s\")\n", date, curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday, SM_VERSION_STRING);
|
fprintf(fp, "L %s: SourceMod log file session started (file \"L%04d%02d%02d.log\") (Version \"%s\")\n", date, curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday, SOURCEMOD_VERSION);
|
||||||
}
|
}
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, vafmt);
|
va_start(ap, vafmt);
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press)
|
|||||||
#endif
|
#endif
|
||||||
0,
|
0,
|
||||||
PITCH_NORM,
|
PITCH_NORM,
|
||||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
|
||||||
0,
|
0,
|
||||||
#endif
|
#endif
|
||||||
&pos);
|
&pos);
|
||||||
|
|||||||
+6
-5
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "NextMap.h"
|
#include "NextMap.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
#include "HalfLife2.h"
|
||||||
#include "sourcemm_api.h"
|
#include "sourcemm_api.h"
|
||||||
#include "sm_stringutil.h"
|
#include "sm_stringutil.h"
|
||||||
#include "sourcehook.h"
|
#include "sourcehook.h"
|
||||||
@@ -109,7 +110,7 @@ const char *NextMapManager::GetNextMap()
|
|||||||
|
|
||||||
bool NextMapManager::SetNextMap(const char *map)
|
bool NextMapManager::SetNextMap(const char *map)
|
||||||
{
|
{
|
||||||
if (!engine->IsMapValid(map))
|
if (!g_HL2.IsMapValid(map))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -133,7 +134,7 @@ void NextMapManager::HookChangeLevel(const char *map, const char *unknown, const
|
|||||||
|
|
||||||
const char *newmap = sm_nextmap.GetString();
|
const char *newmap = sm_nextmap.GetString();
|
||||||
|
|
||||||
if (newmap[0] == 0 || !engine->IsMapValid(newmap))
|
if (newmap[0] == 0 || !g_HL2.IsMapValid(newmap))
|
||||||
{
|
{
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
@@ -183,14 +184,14 @@ void NextMapManager::OnSourceModLevelChange( const char *mapName )
|
|||||||
m_tempChangeInfo.m_mapName[0] ='\0';
|
m_tempChangeInfo.m_mapName[0] ='\0';
|
||||||
m_tempChangeInfo.m_changeReason[0] = '\0';
|
m_tempChangeInfo.m_changeReason[0] = '\0';
|
||||||
m_tempChangeInfo.startTime = time(NULL);
|
m_tempChangeInfo.startTime = time(NULL);
|
||||||
UTIL_Format(lastMap, sizeof(lastMap), mapName);
|
UTIL_Format(lastMap, sizeof(lastMap), "%s", mapName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NextMapManager::ForceChangeLevel( const char *mapName, const char* changeReason )
|
void NextMapManager::ForceChangeLevel( const char *mapName, const char* changeReason )
|
||||||
{
|
{
|
||||||
/* Store the mapname and reason */
|
/* Store the mapname and reason */
|
||||||
UTIL_Format(m_tempChangeInfo.m_mapName, sizeof(m_tempChangeInfo.m_mapName), mapName);
|
UTIL_Format(m_tempChangeInfo.m_mapName, sizeof(m_tempChangeInfo.m_mapName), "%s", mapName);
|
||||||
UTIL_Format(m_tempChangeInfo.m_changeReason, sizeof(m_tempChangeInfo.m_changeReason), changeReason);
|
UTIL_Format(m_tempChangeInfo.m_changeReason, sizeof(m_tempChangeInfo.m_changeReason), "%s", changeReason);
|
||||||
|
|
||||||
/* Change level and skip our hook */
|
/* Change level and skip our hook */
|
||||||
g_forcedChange = true;
|
g_forcedChange = true;
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ struct MapChangeData
|
|||||||
startTime = 0;
|
startTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char m_mapName[32];
|
char m_mapName[PLATFORM_MAX_PATH];
|
||||||
char m_changeReason[100];
|
char m_changeReason[100];
|
||||||
time_t startTime;
|
time_t startTime;
|
||||||
};
|
};
|
||||||
|
|||||||
+80
-42
@@ -116,7 +116,7 @@ PlayerManager::PlayerManager()
|
|||||||
m_SourceTVUserId = -1;
|
m_SourceTVUserId = -1;
|
||||||
m_ReplayUserId = -1;
|
m_ReplayUserId = -1;
|
||||||
|
|
||||||
m_bUseSteamAdminAuth = true; // use steam auth by default
|
m_bAuthstringValidation = false; // don't use steam auth by default... yet
|
||||||
|
|
||||||
m_UserIdLookUp = new int[USHRT_MAX+1];
|
m_UserIdLookUp = new int[USHRT_MAX+1];
|
||||||
memset(m_UserIdLookUp, 0, sizeof(int) * (USHRT_MAX+1));
|
memset(m_UserIdLookUp, 0, sizeof(int) * (USHRT_MAX+1));
|
||||||
@@ -234,9 +234,9 @@ ConfigResult PlayerManager::OnSourceModConfigChanged(const char *key,
|
|||||||
} else if (strcmp( key, "SteamAuthstringValidation" ) == 0) {
|
} else if (strcmp( key, "SteamAuthstringValidation" ) == 0) {
|
||||||
if (strcasecmp(value, "yes") == 0)
|
if (strcasecmp(value, "yes") == 0)
|
||||||
{
|
{
|
||||||
m_bUseSteamAdminAuth = true;
|
m_bAuthstringValidation = true;
|
||||||
} else if ( strcasecmp(value, "no") == 0) {
|
} else if ( strcasecmp(value, "no") == 0) {
|
||||||
m_bUseSteamAdminAuth = false;
|
m_bAuthstringValidation = false;
|
||||||
} else {
|
} else {
|
||||||
UTIL_Format(error, maxlength, "Invalid value: must be \"yes\" or \"no\"");
|
UTIL_Format(error, maxlength, "Invalid value: must be \"yes\" or \"no\"");
|
||||||
return ConfigResult_Reject;
|
return ConfigResult_Reject;
|
||||||
@@ -249,7 +249,7 @@ ConfigResult PlayerManager::OnSourceModConfigChanged(const char *key,
|
|||||||
void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
||||||
{
|
{
|
||||||
static ConVar *tv_enable = icvar->FindVar("tv_enable");
|
static ConVar *tv_enable = icvar->FindVar("tv_enable");
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#if SOURCE_ENGINE == SE_TF2
|
||||||
static ConVar *replay_enable = icvar->FindVar("replay_enable");
|
static ConVar *replay_enable = icvar->FindVar("replay_enable");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
|
|||||||
ICommandLine *commandLine = g_HL2.GetValveCommandLine();
|
ICommandLine *commandLine = g_HL2.GetValveCommandLine();
|
||||||
m_bIsSourceTVActive = (tv_enable && tv_enable->GetBool() && (!commandLine || commandLine->FindParm("-nohltv") == 0));
|
m_bIsSourceTVActive = (tv_enable && tv_enable->GetBool() && (!commandLine || commandLine->FindParm("-nohltv") == 0));
|
||||||
m_bIsReplayActive = false;
|
m_bIsReplayActive = false;
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#if SOURCE_ENGINE == SE_TF2
|
||||||
m_bIsReplayActive = (replay_enable && replay_enable->GetBool());
|
m_bIsReplayActive = (replay_enable && replay_enable->GetBool());
|
||||||
#endif
|
#endif
|
||||||
m_PlayersSinceActive = 0;
|
m_PlayersSinceActive = 0;
|
||||||
@@ -367,23 +367,18 @@ void PlayerManager::RunAuthChecks()
|
|||||||
{
|
{
|
||||||
pPlayer = &m_Players[m_AuthQueue[i]];
|
pPlayer = &m_Players[m_AuthQueue[i]];
|
||||||
authstr = engine->GetPlayerNetworkIDString(pPlayer->m_pEdict);
|
authstr = engine->GetPlayerNetworkIDString(pPlayer->m_pEdict);
|
||||||
|
pPlayer->SetAuthString(authstr);
|
||||||
|
|
||||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
if (!pPlayer->IsAuthStringValidated())
|
||||||
// we can only easily check if the client is fully authed if we're on a recent engine
|
|
||||||
if (m_bUseSteamAdminAuth && !g_HL2.IsLANServer())
|
|
||||||
{
|
|
||||||
if (!pPlayer->IsAuthedBySteam())
|
|
||||||
{
|
{
|
||||||
continue; // we're using steam auth, and steam doesn't know about this player yet so we can't do anything about them for now
|
continue; // we're using steam auth, and steam doesn't know about this player yet so we can't do anything about them for now
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (authstr && authstr[0] != '\0'
|
if (authstr && authstr[0] != '\0'
|
||||||
&& (strcmp(authstr, "STEAM_ID_PENDING") != 0))
|
&& (strcmp(authstr, "STEAM_ID_PENDING") != 0))
|
||||||
{
|
{
|
||||||
/* Set authorization */
|
/* Set authorization */
|
||||||
pPlayer->Authorize(authstr);
|
pPlayer->Authorize();
|
||||||
|
|
||||||
/* Mark as removed from queue */
|
/* Mark as removed from queue */
|
||||||
unsigned int client = m_AuthQueue[i];
|
unsigned int client = m_AuthQueue[i];
|
||||||
@@ -558,7 +553,8 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
|||||||
/* Run manual connection routines */
|
/* Run manual connection routines */
|
||||||
char error[255];
|
char error[255];
|
||||||
const char *authid = engine->GetPlayerNetworkIDString(pEntity);
|
const char *authid = engine->GetPlayerNetworkIDString(pEntity);
|
||||||
pPlayer->Authorize(authid);
|
pPlayer->SetAuthString(authid);
|
||||||
|
pPlayer->Authorize();
|
||||||
pPlayer->m_bFakeClient = true;
|
pPlayer->m_bFakeClient = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -584,17 +580,14 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
|||||||
int newCount = m_PlayersSinceActive + 1;
|
int newCount = m_PlayersSinceActive + 1;
|
||||||
|
|
||||||
int userId = engine->GetPlayerUserId(pEntity);
|
int userId = engine->GetPlayerUserId(pEntity);
|
||||||
#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_LEFT4DEAD2)
|
#if (SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_LEFT4DEAD2)
|
||||||
static ConVar *tv_name = icvar->FindVar("tv_name");
|
static ConVar *tv_name = icvar->FindVar("tv_name");
|
||||||
#endif
|
#endif
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#if SOURCE_ENGINE == SE_TF2
|
||||||
static ConVar *replay_name = icvar->FindVar("replay_name");
|
static ConVar *replay_name = icvar->FindVar("replay_name");
|
||||||
#endif
|
#endif
|
||||||
#if SOURCE_ENGINE == SE_LEFT4DEAD2
|
|
||||||
static bool bIsNuclearDawn = (strcmp(g_SourceMod.GetGameFolderName(), "nucleardawn") == 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#if SOURCE_ENGINE == SE_TF2
|
||||||
if (m_bIsReplayActive && newCount == 1
|
if (m_bIsReplayActive && newCount == 1
|
||||||
&& (m_ReplayUserId == userId
|
&& (m_ReplayUserId == userId
|
||||||
|| (replay_name && strcmp(playername, replay_name->GetString()) == 0) || (replay_name && replay_name->GetString()[0] == 0 && strcmp(playername, "unnamed") == 0)
|
|| (replay_name && strcmp(playername, replay_name->GetString()) == 0) || (replay_name && replay_name->GetString()[0] == 0 && strcmp(playername, "unnamed") == 0)
|
||||||
@@ -612,15 +605,8 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
|||||||
&& (m_SourceTVUserId == userId
|
&& (m_SourceTVUserId == userId
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
|| strcmp(playername, "GOTV") == 0
|
|| strcmp(playername, "GOTV") == 0
|
||||||
#elif (SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_LEFT4DEAD2)
|
#elif (SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_NUCLEARDAWN)
|
||||||
#if SOURCE_ENGINE == SE_LEFT4DEAD2
|
|
||||||
|| (bIsNuclearDawn && ( true
|
|
||||||
#endif // SE_LEFT4DEAD2
|
|
||||||
|| (tv_name && strcmp(playername, tv_name->GetString()) == 0) || (tv_name && tv_name->GetString()[0] == 0 && strcmp(playername, "unnamed") == 0)
|
|| (tv_name && strcmp(playername, tv_name->GetString()) == 0) || (tv_name && tv_name->GetString()[0] == 0 && strcmp(playername, "unnamed") == 0)
|
||||||
#if SOURCE_ENGINE == SE_LEFT4DEAD2
|
|
||||||
))
|
|
||||||
|| (!bIsNuclearDawn && strcmp(playername, "SourceTV") == 0)
|
|
||||||
#endif // SE_LEFT4DEAD2
|
|
||||||
#else
|
#else
|
||||||
|| strcmp(playername, "SourceTV") == 0
|
|| strcmp(playername, "SourceTV") == 0
|
||||||
#endif
|
#endif
|
||||||
@@ -830,7 +816,7 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClientConsolePrint(pEntity,
|
ClientConsolePrint(pEntity,
|
||||||
"SourceMod %s, by AlliedModders LLC", SM_VERSION_STRING);
|
"SourceMod %s, by AlliedModders LLC", SOURCEMOD_VERSION);
|
||||||
ClientConsolePrint(pEntity,
|
ClientConsolePrint(pEntity,
|
||||||
"To see running plugins, type \"sm plugins\"");
|
"To see running plugins, type \"sm plugins\"");
|
||||||
ClientConsolePrint(pEntity,
|
ClientConsolePrint(pEntity,
|
||||||
@@ -927,8 +913,7 @@ void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)
|
|||||||
const char *networkid_force;
|
const char *networkid_force;
|
||||||
if ((networkid_force = engine->GetClientConVarValue(client, "networkid_force")) && networkid_force[0] != '\0')
|
if ((networkid_force = engine->GetClientConVarValue(client, "networkid_force")) && networkid_force[0] != '\0')
|
||||||
{
|
{
|
||||||
unsigned long long *steamId = (unsigned long long *)engine->GetClientSteamID(pEntity);
|
unsigned int accountId = pPlayer->GetSteamAccountID();
|
||||||
unsigned int accountId = steamId ? (*steamId & 0xFFFFFFFF) : 0;
|
|
||||||
g_Logger.LogMessage("\"%s<%d><STEAM_1:%d:%d><>\" has bad networkid (id \"%s\") (ip \"%s\")",
|
g_Logger.LogMessage("\"%s<%d><STEAM_1:%d:%d><>\" has bad networkid (id \"%s\") (ip \"%s\")",
|
||||||
new_name, pPlayer->GetUserId(), accountId & 1, accountId >> 1, networkid_force, pPlayer->GetIPAddress());
|
new_name, pPlayer->GetUserId(), accountId & 1, accountId >> 1, networkid_force, pPlayer->GetIPAddress());
|
||||||
|
|
||||||
@@ -944,7 +929,9 @@ void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)
|
|||||||
{
|
{
|
||||||
if (!CheckSetAdminName(client, pPlayer, id))
|
if (!CheckSetAdminName(client, pPlayer, id))
|
||||||
{
|
{
|
||||||
pPlayer->Kick("Your name is reserved by SourceMod; set your password to use it.");
|
char kickMsg[128];
|
||||||
|
logicore.CoreTranslate(kickMsg, sizeof(kickMsg), "%T", 2, NULL, "Name Reserved", &client);
|
||||||
|
pPlayer->Kick(kickMsg);
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
} else if ((id = g_Admins.FindAdminByIdentity("name", old_name)) != INVALID_ADMIN_ID) {
|
} else if ((id = g_Admins.FindAdminByIdentity("name", old_name)) != INVALID_ADMIN_ID) {
|
||||||
@@ -1272,11 +1259,12 @@ void PlayerManager::ProcessCommandTarget(cmd_target_info_t *info)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!pTarget->IsConnected() || !pTarget->IsAuthorized())
|
if (!pTarget->IsConnected())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(pTarget->GetAuthString(), new_pattern) == 0)
|
const char *authstr = pTarget->GetAuthString(false); // We want to make it easy for people to be kicked/banned, so don't require validation for command targets.
|
||||||
|
if (authstr && strcmp(authstr, new_pattern) == 0)
|
||||||
{
|
{
|
||||||
if ((info->reason = FilterCommandTarget(pAdmin, pTarget, info->flags))
|
if ((info->reason = FilterCommandTarget(pAdmin, pTarget, info->flags))
|
||||||
== COMMAND_TARGET_VALID)
|
== COMMAND_TARGET_VALID)
|
||||||
@@ -1386,7 +1374,7 @@ void PlayerManager::ProcessCommandTarget(cmd_target_info_t *info)
|
|||||||
if ((info->flags & COMMAND_FILTER_NO_BOTS) == COMMAND_FILTER_NO_BOTS)
|
if ((info->flags & COMMAND_FILTER_NO_BOTS) == COMMAND_FILTER_NO_BOTS)
|
||||||
{
|
{
|
||||||
info->num_targets = 0;
|
info->num_targets = 0;
|
||||||
info->reason = COMMAND_FILTER_NO_BOTS;
|
info->reason = COMMAND_TARGET_NOT_HUMAN;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
strncopy(info->target_name, "all bots", info->target_name_maxlength);
|
strncopy(info->target_name, "all bots", info->target_name_maxlength);
|
||||||
@@ -1589,6 +1577,7 @@ CPlayer::CPlayer()
|
|||||||
m_bIsSourceTV = false;
|
m_bIsSourceTV = false;
|
||||||
m_bIsReplay = false;
|
m_bIsReplay = false;
|
||||||
m_Serial.value = -1;
|
m_Serial.value = -1;
|
||||||
|
m_SteamAccountID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
|
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
|
||||||
@@ -1634,17 +1623,22 @@ void CPlayer::Connect()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayer::Authorize(const char *steamid)
|
void CPlayer::SetAuthString(const char *steamid)
|
||||||
{
|
{
|
||||||
if (m_IsAuthorized)
|
if (m_IsAuthorized)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_IsAuthorized = true;
|
|
||||||
m_AuthID.assign(steamid);
|
m_AuthID.assign(steamid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure a valid AuthString is set before calling.
|
||||||
|
void CPlayer::Authorize()
|
||||||
|
{
|
||||||
|
m_IsAuthorized = true;
|
||||||
|
}
|
||||||
|
|
||||||
void CPlayer::Disconnect()
|
void CPlayer::Disconnect()
|
||||||
{
|
{
|
||||||
DumpAdmin(false);
|
DumpAdmin(false);
|
||||||
@@ -1663,6 +1657,7 @@ void CPlayer::Disconnect()
|
|||||||
m_bIsSourceTV = false;
|
m_bIsSourceTV = false;
|
||||||
m_bIsReplay = false;
|
m_bIsReplay = false;
|
||||||
m_Serial.value = -1;
|
m_Serial.value = -1;
|
||||||
|
m_SteamAccountID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayer::SetName(const char *name)
|
void CPlayer::SetName(const char *name)
|
||||||
@@ -1685,11 +1680,45 @@ const char *CPlayer::GetIPAddress()
|
|||||||
return m_Ip.c_str();
|
return m_Ip.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *CPlayer::GetAuthString()
|
const char *CPlayer::GetAuthString(bool validated)
|
||||||
{
|
{
|
||||||
|
if (validated && !IsAuthStringValidated())
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return m_AuthID.c_str();
|
return m_AuthID.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int CPlayer::GetSteamAccountID(bool validated)
|
||||||
|
{
|
||||||
|
if (IsFakeClient() || (validated && !IsAuthStringValidated()))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_SteamAccountID != 0)
|
||||||
|
{
|
||||||
|
return m_SteamAccountID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||||
|
const char * pAuth = GetAuthString();
|
||||||
|
/* STEAM_0:1:123123 | STEAM_ID_LAN | STEAM_ID_PENDING */
|
||||||
|
if (pAuth && (strlen(pAuth) > 10) && pAuth[8] != '_')
|
||||||
|
{
|
||||||
|
m_SteamAccountID = (atoi(&pAuth[8]) | (atoi(&pAuth[10]) << 1));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
unsigned long long *steamId = (unsigned long long *)engine->GetClientSteamID(m_pEdict);
|
||||||
|
if (steamId)
|
||||||
|
{
|
||||||
|
m_SteamAccountID = (*steamId & 0xFFFFFFFF);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return m_SteamAccountID;
|
||||||
|
}
|
||||||
|
|
||||||
edict_t *CPlayer::GetEdict()
|
edict_t *CPlayer::GetEdict()
|
||||||
{
|
{
|
||||||
return m_pEdict;
|
return m_pEdict;
|
||||||
@@ -1715,13 +1744,18 @@ bool CPlayer::IsAuthorized()
|
|||||||
return m_IsAuthorized;
|
return m_IsAuthorized;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
bool CPlayer::IsAuthStringValidated()
|
||||||
bool CPlayer::IsAuthedBySteam()
|
|
||||||
{
|
{
|
||||||
return engine->IsClientFullyAuthenticated( m_pEdict );
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
}
|
if (g_Players.m_bAuthstringValidation && !g_HL2.IsLANServer())
|
||||||
|
{
|
||||||
|
return engine->IsClientFullyAuthenticated(m_pEdict);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
IPlayerInfo *CPlayer::GetPlayerInfo()
|
IPlayerInfo *CPlayer::GetPlayerInfo()
|
||||||
{
|
{
|
||||||
if (m_pEdict->GetUnknown())
|
if (m_pEdict->GetUnknown())
|
||||||
@@ -1796,7 +1830,11 @@ void CPlayer::Kick(const char *str)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
|
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
|
||||||
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
|
pClient->Disconnect(str);
|
||||||
|
#else
|
||||||
pClient->Disconnect("%s", str);
|
pClient->Disconnect("%s", str);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,15 +69,13 @@ public:
|
|||||||
public:
|
public:
|
||||||
const char *GetName();
|
const char *GetName();
|
||||||
const char *GetIPAddress();
|
const char *GetIPAddress();
|
||||||
const char *GetAuthString();
|
const char *GetAuthString(bool validated = true);
|
||||||
|
unsigned int GetSteamAccountID(bool validated = true);
|
||||||
edict_t *GetEdict();
|
edict_t *GetEdict();
|
||||||
bool IsInGame();
|
bool IsInGame();
|
||||||
bool WasCountedAsInGame();
|
bool WasCountedAsInGame();
|
||||||
bool IsConnected();
|
bool IsConnected();
|
||||||
bool IsAuthorized();
|
bool IsAuthorized();
|
||||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
|
||||||
bool IsAuthedBySteam();
|
|
||||||
#endif
|
|
||||||
bool IsFakeClient();
|
bool IsFakeClient();
|
||||||
bool IsSourceTV() const;
|
bool IsSourceTV() const;
|
||||||
bool IsReplay() const;
|
bool IsReplay() const;
|
||||||
@@ -102,9 +100,11 @@ private:
|
|||||||
void Disconnect();
|
void Disconnect();
|
||||||
void SetName(const char *name);
|
void SetName(const char *name);
|
||||||
void DumpAdmin(bool deleting);
|
void DumpAdmin(bool deleting);
|
||||||
void Authorize(const char *auth);
|
void SetAuthString(const char *auth);
|
||||||
|
void Authorize();
|
||||||
void Authorize_Post();
|
void Authorize_Post();
|
||||||
void DoPostConnectAuthorization();
|
void DoPostConnectAuthorization();
|
||||||
|
bool IsAuthStringValidated();
|
||||||
private:
|
private:
|
||||||
bool m_IsConnected;
|
bool m_IsConnected;
|
||||||
bool m_IsInGame;
|
bool m_IsInGame;
|
||||||
@@ -127,6 +127,7 @@ private:
|
|||||||
bool m_bIsSourceTV;
|
bool m_bIsSourceTV;
|
||||||
bool m_bIsReplay;
|
bool m_bIsReplay;
|
||||||
serial_t m_Serial;
|
serial_t m_Serial;
|
||||||
|
unsigned int m_SteamAccountID;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PlayerManager :
|
class PlayerManager :
|
||||||
@@ -220,7 +221,7 @@ private:
|
|||||||
unsigned int *m_AuthQueue;
|
unsigned int *m_AuthQueue;
|
||||||
String m_PassInfoVar;
|
String m_PassInfoVar;
|
||||||
bool m_QueryLang;
|
bool m_QueryLang;
|
||||||
bool m_bUseSteamAdminAuth; // are we validating admins with steam before authorizing?
|
bool m_bAuthstringValidation; // are we validating admins with steam before authorizing?
|
||||||
bool m_bIsListenServer;
|
bool m_bIsListenServer;
|
||||||
int m_ListenClient;
|
int m_ListenClient;
|
||||||
bool m_bIsSourceTVActive;
|
bool m_bIsSourceTVActive;
|
||||||
|
|||||||
@@ -139,6 +139,17 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedInt32(const char *pszFieldName, int index, int32 value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(INT32);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
msg->GetReflection()->SetRepeatedInt32(msg, field, index, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddInt32(const char *pszFieldName, int32 value)
|
inline bool AddInt32(const char *pszFieldName, int32 value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -180,6 +191,17 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedInt64(const char *pszFieldName, int index, int64 value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(INT64);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
msg->GetReflection()->SetRepeatedInt64(msg, field, index, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddInt64(const char *pszFieldName, int64 value)
|
inline bool AddInt64(const char *pszFieldName, int64 value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -221,6 +243,17 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedUInt32(const char *pszFieldName, int index, uint32 value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(UINT32);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
msg->GetReflection()->SetRepeatedUInt32(msg, field, index, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddUInt32(const char *pszFieldName, uint32 value)
|
inline bool AddUInt32(const char *pszFieldName, uint32 value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -262,6 +295,17 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedUInt64(const char *pszFieldName, int index, uint64 value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(UINT64);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
msg->GetReflection()->SetRepeatedUInt64(msg, field, index, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddUInt64(const char *pszFieldName, uint64 value)
|
inline bool AddUInt64(const char *pszFieldName, uint64 value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -315,6 +359,21 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedInt32OrUnsigned(const char *pszFieldName, int index, int32 value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE2(INT32, UINT32);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
if (fieldType == protobuf::FieldDescriptor::CPPTYPE_UINT32)
|
||||||
|
msg->GetReflection()->SetRepeatedUInt32(msg, field, index, (uint32)value);
|
||||||
|
else
|
||||||
|
msg->GetReflection()->SetRepeatedInt32(msg, field, index, value);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddInt32OrUnsigned(const char *pszFieldName, int32 value)
|
inline bool AddInt32OrUnsigned(const char *pszFieldName, int32 value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -360,6 +419,17 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedBool(const char *pszFieldName, int index, bool value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(BOOL);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
msg->GetReflection()->SetRepeatedBool(msg, field, index, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddBool(const char *pszFieldName, bool value)
|
inline bool AddBool(const char *pszFieldName, bool value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -401,6 +471,17 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedFloat(const char *pszFieldName, int index, float value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(FLOAT);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
msg->GetReflection()->SetRepeatedFloat(msg, field, index, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddFloat(const char *pszFieldName, float value)
|
inline bool AddFloat(const char *pszFieldName, float value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -442,6 +523,17 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedDouble(const char *pszFieldName, int index, double value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(DOUBLE);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
msg->GetReflection()->SetRepeatedDouble(msg, field, index, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddDouble(const char *pszFieldName, double value)
|
inline bool AddDouble(const char *pszFieldName, double value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -495,6 +587,21 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedFloatOrDouble(const char *pszFieldName, int index, float value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE2(FLOAT, DOUBLE);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
if (fieldType == protobuf::FieldDescriptor::CPPTYPE_DOUBLE)
|
||||||
|
msg->GetReflection()->SetRepeatedDouble(msg, field, index, (double)value);
|
||||||
|
else
|
||||||
|
msg->GetReflection()->SetRepeatedFloat(msg, field, index, value);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddFloatOrDouble(const char *pszFieldName, float value)
|
inline bool AddFloatOrDouble(const char *pszFieldName, float value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -544,6 +651,18 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedString(const char *pszFieldName, int index, const char *value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(STRING);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
msg->GetReflection()->SetRepeatedString(msg, field, index, value);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddString(const char *pszFieldName, const char *value)
|
inline bool AddString(const char *pszFieldName, const char *value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -604,6 +723,22 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedColor(const char *pszFieldName, int index, const Color &value)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(MESSAGE);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
CMsgRGBA *msgRGBA = (CMsgRGBA *)msg->GetReflection()->MutableRepeatedMessage(msg, field, index);
|
||||||
|
msgRGBA->set_r(value.r());
|
||||||
|
msgRGBA->set_g(value.g());
|
||||||
|
msgRGBA->set_b(value.b());
|
||||||
|
msgRGBA->set_a(value.a());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddColor(const char *pszFieldName, const Color &value)
|
inline bool AddColor(const char *pszFieldName, const Color &value)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -663,6 +798,20 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedVector2D(const char *pszFieldName, int index, Vector2D &vec)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(MESSAGE);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
CMsgVector2D *msgVec2d = (CMsgVector2D *)msg->GetReflection()->MutableRepeatedMessage(msg, field, index);
|
||||||
|
msgVec2d->set_x(vec.x);
|
||||||
|
msgVec2d->set_y(vec.y);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddVector2D(const char *pszFieldName, Vector2D &vec)
|
inline bool AddVector2D(const char *pszFieldName, Vector2D &vec)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -723,6 +872,21 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedVector(const char *pszFieldName, int index, Vector &vec)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(MESSAGE);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
CMsgVector *msgVec = (CMsgVector *)msg->GetReflection()->MutableRepeatedMessage(msg, field, index);
|
||||||
|
msgVec->set_x(vec.x);
|
||||||
|
msgVec->set_y(vec.y);
|
||||||
|
msgVec->set_z(vec.z);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddVector(const char *pszFieldName, Vector &vec)
|
inline bool AddVector(const char *pszFieldName, Vector &vec)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
@@ -784,6 +948,21 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool SetRepeatedQAngle(const char *pszFieldName, int index, QAngle &vec)
|
||||||
|
{
|
||||||
|
GETCHECK_FIELD();
|
||||||
|
CHECK_FIELD_TYPE(MESSAGE);
|
||||||
|
CHECK_FIELD_REPEATED();
|
||||||
|
CHECK_REPEATED_ELEMENT(index);
|
||||||
|
|
||||||
|
CMsgQAngle *msgAng = (CMsgQAngle *)msg->GetReflection()->MutableRepeatedMessage(msg, field, index);
|
||||||
|
msgAng->set_x(vec.x);
|
||||||
|
msgAng->set_y(vec.y);
|
||||||
|
msgAng->set_z(vec.z);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool AddQAngle(const char *pszFieldName, QAngle &vec)
|
inline bool AddQAngle(const char *pszFieldName, QAngle &vec)
|
||||||
{
|
{
|
||||||
GETCHECK_FIELD();
|
GETCHECK_FIELD();
|
||||||
|
|||||||
@@ -502,14 +502,15 @@ void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type,
|
|||||||
int size = msg.ByteSize();
|
int size = msg.ByteSize();
|
||||||
uint8 *data = (uint8 *)stackalloc(size);
|
uint8 *data = (uint8 *)stackalloc(size);
|
||||||
msg.SerializePartialToArray(data, size);
|
msg.SerializePartialToArray(data, size);
|
||||||
m_InterceptBuffer->ParseFromArray(data, size);
|
m_InterceptBuffer->ParsePartialFromArray(data, size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_FakeEngineBuffer = &const_cast<protobuf::Message &>(msg);
|
m_FakeEngineBuffer = &const_cast<protobuf::Message &>(msg);
|
||||||
OnStartMessage_Post(&filter, msg_type, g_Cstrike15UsermessageHelpers.GetName(msg_type));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnStartMessage_Post(&filter, msg_type, g_Cstrike15UsermessageHelpers.GetName(msg_type));
|
||||||
|
|
||||||
OnMessageEnd_Pre();
|
OnMessageEnd_Pre();
|
||||||
if (m_FakeMetaRes == MRES_SUPERCEDE)
|
if (m_FakeMetaRes == MRES_SUPERCEDE)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
@@ -593,6 +594,9 @@ bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_ty
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_PROTOBUF_USERMESSAGES
|
#ifdef USE_PROTOBUF_USERMESSAGES
|
||||||
|
if (m_FakeMetaRes == MRES_SUPERCEDE)
|
||||||
|
m_OrigBuffer = m_InterceptBuffer;
|
||||||
|
else
|
||||||
m_OrigBuffer = m_FakeEngineBuffer;
|
m_OrigBuffer = m_FakeEngineBuffer;
|
||||||
#else
|
#else
|
||||||
m_OrigBuffer = META_RESULT_ORIG_RET(bf_write *);
|
m_OrigBuffer = META_RESULT_ORIG_RET(bf_write *);
|
||||||
@@ -743,8 +747,6 @@ void UserMessages::OnMessageEnd_Pre()
|
|||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(*m_CurRecFilter), m_CurId, *m_InterceptBuffer);
|
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(*m_CurRecFilter), m_CurId, *m_InterceptBuffer);
|
||||||
delete m_InterceptBuffer;
|
|
||||||
m_InterceptBuffer = NULL;
|
|
||||||
#else
|
#else
|
||||||
bf_write *engine_bfw;
|
bf_write *engine_bfw;
|
||||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||||
@@ -764,7 +766,7 @@ void UserMessages::OnMessageEnd_Pre()
|
|||||||
uint8 *data = (uint8 *)stackalloc(size);
|
uint8 *data = (uint8 *)stackalloc(size);
|
||||||
m_OrigBuffer->SerializePartialToArray(data, size);
|
m_OrigBuffer->SerializePartialToArray(data, size);
|
||||||
protobuf::Message *pTempMsg = g_Cstrike15UsermessageHelpers.GetPrototype(m_CurId)->New();
|
protobuf::Message *pTempMsg = g_Cstrike15UsermessageHelpers.GetPrototype(m_CurId)->New();
|
||||||
pTempMsg->ParseFromArray(data, size);
|
pTempMsg->ParsePartialFromArray(data, size);
|
||||||
#else
|
#else
|
||||||
bf_write *pTempMsg = m_OrigBuffer;
|
bf_write *pTempMsg = m_OrigBuffer;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -130,9 +130,9 @@ private:
|
|||||||
List<ListenerInfo *> m_msgHooks[255];
|
List<ListenerInfo *> m_msgHooks[255];
|
||||||
List<ListenerInfo *> m_msgIntercepts[255];
|
List<ListenerInfo *> m_msgIntercepts[255];
|
||||||
CStack<ListenerInfo *> m_FreeListeners;
|
CStack<ListenerInfo *> m_FreeListeners;
|
||||||
unsigned char m_pBase[2500];
|
|
||||||
IRecipientFilter *m_CurRecFilter;
|
IRecipientFilter *m_CurRecFilter;
|
||||||
#ifndef USE_PROTOBUF_USERMESSAGES
|
#ifndef USE_PROTOBUF_USERMESSAGES
|
||||||
|
unsigned char m_pBase[2500];
|
||||||
bf_write m_InterceptBuffer;
|
bf_write m_InterceptBuffer;
|
||||||
bf_write *m_OrigBuffer;
|
bf_write *m_OrigBuffer;
|
||||||
bf_read m_ReadBuffer;
|
bf_read m_ReadBuffer;
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ public:
|
|||||||
virtual void SetValue( const char *value );
|
virtual void SetValue( const char *value );
|
||||||
virtual void SetValue( float value );
|
virtual void SetValue( float value );
|
||||||
virtual void SetValue( int value );
|
virtual void SetValue( int value );
|
||||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD2
|
#if SOURCE_ENGINE >= SE_NUCLEARDAWN
|
||||||
virtual void SetValue( Color value );
|
virtual void SetValue( Color value );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+25
-26
@@ -1,24 +1,25 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
compiler = SM.DefaultCompiler()
|
binary = SM.Library(builder, 'sourcemod.logic')
|
||||||
base = AMBuild.sourceFolder
|
binary.compiler.cxxincludes += [
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
os.path.join(builder.sourcePath, 'core', 'logic'),
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(base, 'core', 'logic'))
|
os.path.join(builder.sourcePath, 'public'),
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(base, 'public'))
|
os.path.join(builder.sourcePath, 'public', 'sourcepawn'),
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(base, 'public', 'sourcepawn'))
|
os.path.join(builder.sourcePath, 'public', 'amtl'),
|
||||||
compiler['CDEFINES'].append('SM_DEFAULT_THREADER')
|
os.path.join(SM.mms_root, 'core', 'sourcehook')
|
||||||
compiler['CDEFINES'].append('SM_LOGIC')
|
]
|
||||||
|
binary.compiler.defines += [
|
||||||
|
'SM_DEFAULT_THREADER',
|
||||||
|
'SM_LOGIC'
|
||||||
|
]
|
||||||
|
|
||||||
if AMBuild.target['platform'] == 'linux':
|
if builder.target_platform == 'linux':
|
||||||
compiler['POSTLINKFLAGS'].append('-lpthread')
|
binary.compiler.postlink += ['-lpthread', '-lrt']
|
||||||
if AMBuild.target['platform'] == 'darwin':
|
elif builder.target_platform == 'mac':
|
||||||
compiler['CFLAGS'].extend(['-Wno-deprecated-declarations'])
|
binary.compiler.cflags += ['-Wno-deprecated-declarations']
|
||||||
compiler['POSTLINKFLAGS'].extend(['-framework', 'CoreServices'])
|
binary.compiler.postlink += ['-framework', 'CoreServices']
|
||||||
|
binary.sources += [
|
||||||
extension = AMBuild.AddJob('sourcemod.logic')
|
|
||||||
binary = Cpp.LibraryBuilder('sourcemod.logic', AMBuild, extension, compiler)
|
|
||||||
files = [
|
|
||||||
'common_logic.cpp',
|
'common_logic.cpp',
|
||||||
'smn_adt_array.cpp',
|
'smn_adt_array.cpp',
|
||||||
'smn_sorting.cpp',
|
'smn_sorting.cpp',
|
||||||
@@ -48,13 +49,11 @@ files = [
|
|||||||
'smn_gameconfigs.cpp',
|
'smn_gameconfigs.cpp',
|
||||||
'GameConfigs.cpp',
|
'GameConfigs.cpp',
|
||||||
'sm_crc32.cpp',
|
'sm_crc32.cpp',
|
||||||
'smn_profiler.cpp'
|
'smn_profiler.cpp',
|
||||||
]
|
]
|
||||||
if AMBuild.target['platform'] == 'windows':
|
if builder.target_platform == 'windows':
|
||||||
files.append('thread/WinThreads.cpp')
|
binary.sources += ['thread/WinThreads.cpp']
|
||||||
else:
|
else:
|
||||||
files.append('thread/PosixThreads.cpp')
|
binary.sources += ['thread/PosixThreads.cpp']
|
||||||
binary.AddSourceFiles('core/logic', files)
|
|
||||||
SM.AutoVersion('core/logic', binary)
|
|
||||||
binary.SendToJob()
|
|
||||||
|
|
||||||
|
SM.binaries += [builder.Add(binary)]
|
||||||
|
|||||||
+49
-16
@@ -54,6 +54,7 @@ IGameConfig *g_pGameConf = NULL;
|
|||||||
static char g_Game[256];
|
static char g_Game[256];
|
||||||
static char g_GameDesc[256] = {'!', '\0'};
|
static char g_GameDesc[256] = {'!', '\0'};
|
||||||
static char g_GameName[256] = {'$', '\0'};
|
static char g_GameName[256] = {'$', '\0'};
|
||||||
|
static const char *g_pParseEngine = NULL;
|
||||||
|
|
||||||
#define PSTATE_NONE 0
|
#define PSTATE_NONE 0
|
||||||
#define PSTATE_GAMES 1
|
#define PSTATE_GAMES 1
|
||||||
@@ -89,7 +90,7 @@ struct TempSigInfo
|
|||||||
library[0] = '\0';
|
library[0] = '\0';
|
||||||
sig[0] = '\0';
|
sig[0] = '\0';
|
||||||
}
|
}
|
||||||
char sig[512];
|
char sig[1024];
|
||||||
char library[64];
|
char library[64];
|
||||||
} s_TempSig;
|
} s_TempSig;
|
||||||
unsigned int s_ServerBinCRC;
|
unsigned int s_ServerBinCRC;
|
||||||
@@ -112,10 +113,10 @@ static bool DoesGameMatch(const char *value)
|
|||||||
|
|
||||||
static bool DoesEngineMatch(const char *value)
|
static bool DoesEngineMatch(const char *value)
|
||||||
{
|
{
|
||||||
return strcmp(value, smcore.GetSourceEngineName()) == 0;
|
return strcmp(value, g_pParseEngine) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGameConfig::CGameConfig(const char *file)
|
CGameConfig::CGameConfig(const char *file, const char *engine)
|
||||||
{
|
{
|
||||||
strncopy(m_File, file, sizeof(m_File));
|
strncopy(m_File, file, sizeof(m_File));
|
||||||
m_pAddresses = new KTrie<AddressConf>();
|
m_pAddresses = new KTrie<AddressConf>();
|
||||||
@@ -124,6 +125,18 @@ CGameConfig::CGameConfig(const char *file)
|
|||||||
|
|
||||||
m_CustomLevel = 0;
|
m_CustomLevel = 0;
|
||||||
m_CustomHandler = NULL;
|
m_CustomHandler = NULL;
|
||||||
|
|
||||||
|
if (!engine)
|
||||||
|
m_pEngine = smcore.GetSourceEngineName();
|
||||||
|
else
|
||||||
|
m_pEngine = engine;
|
||||||
|
|
||||||
|
if (strcmp(m_pEngine, "css") == 0 || strcmp(m_pEngine, "dods") == 0 || strcmp(m_pEngine, "hl2dm") == 0 || strcmp(m_pEngine, "tf2") == 0)
|
||||||
|
this->SetBaseEngine("orangebox_valve");
|
||||||
|
else if (strcmp(m_pEngine, "nucleardawn") == 0)
|
||||||
|
this->SetBaseEngine("left4dead2");
|
||||||
|
else
|
||||||
|
this->SetBaseEngine(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGameConfig::~CGameConfig()
|
CGameConfig::~CGameConfig()
|
||||||
@@ -594,19 +607,11 @@ skip_find:
|
|||||||
{
|
{
|
||||||
m_ParseState = PSTATE_GAMEDEFS_ADDRESSES;
|
m_ParseState = PSTATE_GAMEDEFS_ADDRESSES;
|
||||||
|
|
||||||
if (m_Address[0] == '\0')
|
if (m_Address[0] != '\0' && m_AddressSignature[0] != '\0')
|
||||||
{
|
{
|
||||||
smcore.LogError("[SM] Address sections must have names (gameconf \"%s\")", m_CurFile);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (m_AddressSignature[0] == '\0')
|
|
||||||
{
|
|
||||||
smcore.LogError("[SM] Address section for \"%s\" did not specify a signature (gameconf \"%s\")", m_Address, m_CurFile);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
AddressConf addrConf(m_AddressSignature, sizeof(m_AddressSignature), m_AddressReadCount, m_AddressRead);
|
AddressConf addrConf(m_AddressSignature, sizeof(m_AddressSignature), m_AddressReadCount, m_AddressRead);
|
||||||
m_pAddresses->replace(m_Address, addrConf);
|
m_pAddresses->replace(m_Address, addrConf);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -772,7 +777,16 @@ bool CGameConfig::Reparse(char *error, size_t maxlength)
|
|||||||
SMCStates state = {0, 0};
|
SMCStates state = {0, 0};
|
||||||
List<String> fileList;
|
List<String> fileList;
|
||||||
master_reader.fileList = &fileList;
|
master_reader.fileList = &fileList;
|
||||||
|
const char *pEngine[2] = { m_pBaseEngine, m_pEngine };
|
||||||
|
|
||||||
|
for (unsigned char iter = 0; iter < SM_ARRAYSIZE(pEngine); ++iter)
|
||||||
|
{
|
||||||
|
if (pEngine[iter] == NULL)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->SetParseEngine(pEngine[iter]);
|
||||||
err = textparsers->ParseSMCFile(path, &master_reader, &state, error, maxlength);
|
err = textparsers->ParseSMCFile(path, &master_reader, &state, error, maxlength);
|
||||||
if (err != SMCError_Okay)
|
if (err != SMCError_Okay)
|
||||||
{
|
{
|
||||||
@@ -786,6 +800,7 @@ bool CGameConfig::Reparse(char *error, size_t maxlength)
|
|||||||
msg ? msg : "Unknown error");
|
msg ? msg : "Unknown error");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Go through each file we found and parse it. */
|
/* Go through each file we found and parse it. */
|
||||||
List<String>::iterator iter;
|
List<String>::iterator iter;
|
||||||
@@ -850,13 +865,20 @@ bool CGameConfig::EnterFile(const char *file, char *error, size_t maxlength)
|
|||||||
m_IgnoreLevel = 0;
|
m_IgnoreLevel = 0;
|
||||||
bShouldBeReadingDefault = true;
|
bShouldBeReadingDefault = true;
|
||||||
m_ParseState = PSTATE_NONE;
|
m_ParseState = PSTATE_NONE;
|
||||||
|
const char *pEngine[2] = { m_pBaseEngine, m_pEngine };
|
||||||
|
|
||||||
|
for (unsigned char iter = 0; iter < SM_ARRAYSIZE(pEngine); ++iter)
|
||||||
|
{
|
||||||
|
if (pEngine[iter] == NULL)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->SetParseEngine(pEngine[iter]);
|
||||||
if ((err=textparsers->ParseSMCFile(m_CurFile, this, &state, error, maxlength))
|
if ((err=textparsers->ParseSMCFile(m_CurFile, this, &state, error, maxlength))
|
||||||
!= SMCError_Okay)
|
!= SMCError_Okay)
|
||||||
{
|
{
|
||||||
const char *msg;
|
const char *msg = textparsers->GetSMCErrorString(err);
|
||||||
|
|
||||||
msg = textparsers->GetSMCErrorString(err);
|
|
||||||
|
|
||||||
smcore.LogError("[SM] Error parsing gameconfig file \"%s\":", m_CurFile);
|
smcore.LogError("[SM] Error parsing gameconfig file \"%s\":", m_CurFile);
|
||||||
smcore.LogError("[SM] Error %d on line %d, col %d: %s",
|
smcore.LogError("[SM] Error %d on line %d, col %d: %s",
|
||||||
@@ -875,10 +897,21 @@ bool CGameConfig::EnterFile(const char *file, char *error, size_t maxlength)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGameConfig::SetBaseEngine(const char *engine)
|
||||||
|
{
|
||||||
|
m_pBaseEngine = engine;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGameConfig::SetParseEngine(const char *engine)
|
||||||
|
{
|
||||||
|
g_pParseEngine = engine;
|
||||||
|
}
|
||||||
|
|
||||||
bool CGameConfig::GetOffset(const char *key, int *value)
|
bool CGameConfig::GetOffset(const char *key, int *value)
|
||||||
{
|
{
|
||||||
int *pvalue;
|
int *pvalue;
|
||||||
|
|||||||
@@ -50,11 +50,13 @@ class CGameConfig :
|
|||||||
{
|
{
|
||||||
friend class GameConfigManager;
|
friend class GameConfigManager;
|
||||||
public:
|
public:
|
||||||
CGameConfig(const char *file);
|
CGameConfig(const char *file, const char *engine = NULL);
|
||||||
~CGameConfig();
|
~CGameConfig();
|
||||||
public:
|
public:
|
||||||
bool Reparse(char *error, size_t maxlength);
|
bool Reparse(char *error, size_t maxlength);
|
||||||
bool EnterFile(const char *file, char *error, size_t maxlength);
|
bool EnterFile(const char *file, char *error, size_t maxlength);
|
||||||
|
void SetBaseEngine(const char *engine);
|
||||||
|
void SetParseEngine(const char *engine);
|
||||||
public: //ITextListener_SMC
|
public: //ITextListener_SMC
|
||||||
SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
|
SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
|
||||||
SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value);
|
SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value);
|
||||||
@@ -111,6 +113,8 @@ private:
|
|||||||
int m_AddressReadCount;
|
int m_AddressReadCount;
|
||||||
int m_AddressRead[8];
|
int m_AddressRead[8];
|
||||||
KTrie<AddressConf> *m_pAddresses;
|
KTrie<AddressConf> *m_pAddresses;
|
||||||
|
const char *m_pEngine;
|
||||||
|
const char *m_pBaseEngine;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GameConfigManager :
|
class GameConfigManager :
|
||||||
|
|||||||
@@ -479,13 +479,6 @@ SMCResult CPhraseFile::ReadSMC_KeyValue(const SMCStates *states, const char *key
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t len = strlen(key);
|
|
||||||
if (len < 2 || len > 3)
|
|
||||||
{
|
|
||||||
ParseWarning("Ignoring translation to invalid language \"%s\" on line %d.", key, states->line);
|
|
||||||
return SMCResult_Continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int lang;
|
unsigned int lang;
|
||||||
if (!m_pTranslator->GetLanguageByCode(key, &lang))
|
if (!m_pTranslator->GetLanguageByCode(key, &lang))
|
||||||
{
|
{
|
||||||
@@ -498,7 +491,7 @@ SMCResult CPhraseFile::ReadSMC_KeyValue(const SMCStates *states, const char *key
|
|||||||
/* See how many bytes we need for this string, then allocate.
|
/* See how many bytes we need for this string, then allocate.
|
||||||
* NOTE: THIS SHOULD GUARANTEE THAT WE DO NOT NEED TO NEED TO SIZE CHECK
|
* NOTE: THIS SHOULD GUARANTEE THAT WE DO NOT NEED TO NEED TO SIZE CHECK
|
||||||
*/
|
*/
|
||||||
len = strlen(value) + pPhrase->fmt_bytes + 1;
|
size_t len = strlen(value) + pPhrase->fmt_bytes + 1;
|
||||||
char *out_buf;
|
char *out_buf;
|
||||||
int out_idx;
|
int out_idx;
|
||||||
|
|
||||||
@@ -921,14 +914,6 @@ SMCResult Translator::ReadSMC_LeavingSection(const SMCStates *states)
|
|||||||
|
|
||||||
SMCResult Translator::ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
|
SMCResult Translator::ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
|
||||||
{
|
{
|
||||||
size_t len = strlen(key);
|
|
||||||
|
|
||||||
if (len < 2 || len > 3)
|
|
||||||
{
|
|
||||||
smcore.LogError("[SM] Warning encountered parsing languages.cfg file.");
|
|
||||||
smcore.LogError("[SM] Invalid language code \"%s\" is being ignored.", key);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddLanguage(key, value);
|
AddLanguage(key, value);
|
||||||
|
|
||||||
return SMCResult_Continue;
|
return SMCResult_Continue;
|
||||||
|
|||||||
+17
-1
@@ -42,7 +42,7 @@ using namespace SourceMod;
|
|||||||
* Add 1 to the RHS of this expression to bump the intercom file
|
* Add 1 to the RHS of this expression to bump the intercom file
|
||||||
* This is to prevent mismatching core/logic binaries
|
* This is to prevent mismatching core/logic binaries
|
||||||
*/
|
*/
|
||||||
#define SM_LOGIC_MAGIC (0x0F47C0DE - 17)
|
#define SM_LOGIC_MAGIC (0x0F47C0DE - 18)
|
||||||
|
|
||||||
#if defined SM_LOGIC
|
#if defined SM_LOGIC
|
||||||
class IVEngineServer
|
class IVEngineServer
|
||||||
@@ -55,6 +55,20 @@ public:
|
|||||||
virtual void ServerCommand(const char *cmd) = 0;
|
virtual void ServerCommand(const char *cmd) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef int FileFindHandle_t;
|
||||||
|
|
||||||
|
#if defined SM_LOGIC
|
||||||
|
class IFileSystem
|
||||||
|
#else
|
||||||
|
class IFileSystem_Logic
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual const char *FindFirstEx(const char *pWildCard, const char *pPathID, FileFindHandle_t *pHandle) = 0;
|
||||||
|
virtual const char *FindNext(FileFindHandle_t handle) = 0;
|
||||||
|
virtual void FindClose(FileFindHandle_t handle) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
namespace SourceMod
|
namespace SourceMod
|
||||||
{
|
{
|
||||||
class ISourceMod;
|
class ISourceMod;
|
||||||
@@ -74,6 +88,7 @@ namespace SourceMod
|
|||||||
}
|
}
|
||||||
|
|
||||||
class IVEngineServer;
|
class IVEngineServer;
|
||||||
|
class IFileSystem;
|
||||||
class ConVar;
|
class ConVar;
|
||||||
|
|
||||||
struct ServerGlobals
|
struct ServerGlobals
|
||||||
@@ -91,6 +106,7 @@ struct sm_core_t
|
|||||||
ISourceMod *sm;
|
ISourceMod *sm;
|
||||||
ILibrarySys *libsys;
|
ILibrarySys *libsys;
|
||||||
IVEngineServer *engine;
|
IVEngineServer *engine;
|
||||||
|
IFileSystem *filesystem;
|
||||||
IShareSys *sharesys;
|
IShareSys *sharesys;
|
||||||
IRootConsole *rootmenu;
|
IRootConsole *rootmenu;
|
||||||
IPluginManager *pluginsys;
|
IPluginManager *pluginsys;
|
||||||
|
|||||||
+64
-39
@@ -33,9 +33,11 @@
|
|||||||
#include <sm_trie_tpl.h>
|
#include <sm_trie_tpl.h>
|
||||||
#include "common_logic.h"
|
#include "common_logic.h"
|
||||||
#include "CellArray.h"
|
#include "CellArray.h"
|
||||||
|
#include <IGameHelpers.h>
|
||||||
#include <ILibrarySys.h>
|
#include <ILibrarySys.h>
|
||||||
#include <ITextParsers.h>
|
#include <ITextParsers.h>
|
||||||
#include <ISourceMod.h>
|
#include <ISourceMod.h>
|
||||||
|
#include "stringutil.h"
|
||||||
|
|
||||||
using namespace SourceHook;
|
using namespace SourceHook;
|
||||||
|
|
||||||
@@ -78,6 +80,47 @@ public:
|
|||||||
{
|
{
|
||||||
DumpCache(NULL);
|
DumpCache(NULL);
|
||||||
}
|
}
|
||||||
|
void GetMapCycleFilePath(char *pBuffer, int maxlen)
|
||||||
|
{
|
||||||
|
const char *pEngineName = smcore.GetSourceEngineName();
|
||||||
|
const char *pMapCycleFileName = m_pMapCycleFile ? smcore.GetCvarString(m_pMapCycleFile) : "mapcycle.txt";
|
||||||
|
|
||||||
|
if (strcmp(pEngineName, "tf2") == 0 || strcmp(pEngineName, "css") == 0
|
||||||
|
|| strcmp(pEngineName, "dods") == 0 || strcmp(pEngineName, "hl2dm") == 0)
|
||||||
|
{
|
||||||
|
// These four games and Source SDK 2013 do a lookup in this order; so shall we.
|
||||||
|
g_pSM->BuildPath(Path_Game,
|
||||||
|
pBuffer,
|
||||||
|
maxlen,
|
||||||
|
"cfg/%s",
|
||||||
|
pMapCycleFileName);
|
||||||
|
|
||||||
|
if (!libsys->PathExists(pBuffer))
|
||||||
|
{
|
||||||
|
g_pSM->BuildPath(Path_Game,
|
||||||
|
pBuffer,
|
||||||
|
maxlen,
|
||||||
|
"%s",
|
||||||
|
pMapCycleFileName);
|
||||||
|
|
||||||
|
if (!libsys->PathExists(pBuffer))
|
||||||
|
{
|
||||||
|
g_pSM->BuildPath(Path_Game,
|
||||||
|
pBuffer,
|
||||||
|
maxlen,
|
||||||
|
"cfg/mapcycle_default.txt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_pSM->BuildPath(Path_Game,
|
||||||
|
pBuffer,
|
||||||
|
maxlen,
|
||||||
|
"%s",
|
||||||
|
pMapCycleFileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
void AddOrUpdateDefault(const char *name, const char *file)
|
void AddOrUpdateDefault(const char *name, const char *file)
|
||||||
{
|
{
|
||||||
char path[PLATFORM_MAX_PATH];
|
char path[PLATFORM_MAX_PATH];
|
||||||
@@ -154,11 +197,9 @@ public:
|
|||||||
|
|
||||||
pDefList->bIsPath = true;
|
pDefList->bIsPath = true;
|
||||||
smcore.strncopy(pDefList->name, "mapcyclefile", sizeof(pDefList->name));
|
smcore.strncopy(pDefList->name, "mapcyclefile", sizeof(pDefList->name));
|
||||||
g_pSM->BuildPath(Path_Game,
|
|
||||||
pDefList->path,
|
GetMapCycleFilePath(pDefList->path, sizeof(pDefList->path));
|
||||||
sizeof(pDefList->path),
|
|
||||||
"%s",
|
|
||||||
m_pMapCycleFile ? smcore.GetCvarString(m_pMapCycleFile) : "mapcycle.txt");
|
|
||||||
pDefList->last_modified_time = 0;
|
pDefList->last_modified_time = 0;
|
||||||
pDefList->pArray = NULL;
|
pDefList->pArray = NULL;
|
||||||
pDefList->serial = 0;
|
pDefList->serial = 0;
|
||||||
@@ -348,51 +389,39 @@ public:
|
|||||||
if ((success && pNewArray == NULL)
|
if ((success && pNewArray == NULL)
|
||||||
|| (!success && ((flags & MAPLIST_FLAG_MAPSFOLDER) == MAPLIST_FLAG_MAPSFOLDER)))
|
|| (!success && ((flags & MAPLIST_FLAG_MAPSFOLDER) == MAPLIST_FLAG_MAPSFOLDER)))
|
||||||
{
|
{
|
||||||
char path[255];
|
|
||||||
IDirectory *pDir;
|
|
||||||
|
|
||||||
pNewArray = new CellArray(64);
|
pNewArray = new CellArray(64);
|
||||||
free_new_array = true;
|
free_new_array = true;
|
||||||
g_pSM->BuildPath(Path_Game, path, sizeof(path), "maps");
|
|
||||||
|
|
||||||
if ((pDir = libsys->OpenDirectory(path)) != NULL)
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
cell_t *blk;
|
cell_t *blk;
|
||||||
|
|
||||||
|
FileFindHandle_t findHandle;
|
||||||
|
const char *fileName = smcore.filesystem->FindFirstEx("maps/*.bsp", "GAME", &findHandle);
|
||||||
|
|
||||||
|
while (fileName)
|
||||||
|
{
|
||||||
char buffer[PLATFORM_MAX_PATH];
|
char buffer[PLATFORM_MAX_PATH];
|
||||||
|
|
||||||
while (pDir->MoreFiles())
|
UTIL_StripExtension(fileName, buffer, sizeof(buffer));
|
||||||
{
|
|
||||||
if (!pDir->IsEntryFile()
|
|
||||||
|| strcmp(pDir->GetEntryName(), ".") == 0
|
|
||||||
|| strcmp(pDir->GetEntryName(), "..") == 0)
|
|
||||||
{
|
|
||||||
pDir->NextEntry();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
smcore.strncopy(buffer, pDir->GetEntryName(), sizeof(buffer));
|
|
||||||
if ((ptr = strstr(buffer, ".bsp")) == NULL || ptr[4] != '\0')
|
|
||||||
{
|
|
||||||
pDir->NextEntry();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
*ptr = '\0';
|
|
||||||
if (!engine->IsMapValid(buffer))
|
if (!engine->IsMapValid(buffer))
|
||||||
{
|
{
|
||||||
pDir->NextEntry();
|
fileName = smcore.filesystem->FindNext(findHandle);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((blk = pNewArray->push()) == NULL)
|
if ((blk = pNewArray->push()) == NULL)
|
||||||
{
|
{
|
||||||
pDir->NextEntry();
|
fileName = smcore.filesystem->FindNext(findHandle);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
smcore.strncopy((char *)blk, buffer, 255);
|
smcore.strncopy((char *)blk, buffer, 255);
|
||||||
pDir->NextEntry();
|
|
||||||
}
|
fileName = smcore.filesystem->FindNext(findHandle);
|
||||||
libsys->CloseDirectory(pDir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
smcore.filesystem->FindClose(findHandle);
|
||||||
|
|
||||||
/* Remove the array if there were no items. */
|
/* Remove the array if there were no items. */
|
||||||
if (pNewArray->size() == 0)
|
if (pNewArray->size() == 0)
|
||||||
{
|
{
|
||||||
@@ -485,11 +514,7 @@ private:
|
|||||||
if (m_pMapCycleFile != NULL && strcmp(name, "mapcyclefile") == 0)
|
if (m_pMapCycleFile != NULL && strcmp(name, "mapcyclefile") == 0)
|
||||||
{
|
{
|
||||||
char path[PLATFORM_MAX_PATH];
|
char path[PLATFORM_MAX_PATH];
|
||||||
g_pSM->BuildPath(Path_Game,
|
GetMapCycleFilePath(path, sizeof(path));
|
||||||
path,
|
|
||||||
sizeof(path),
|
|
||||||
"%s",
|
|
||||||
m_pMapCycleFile ? smcore.GetCvarString(m_pMapCycleFile) : "mapcycle.txt");
|
|
||||||
|
|
||||||
if (strcmp(path, pMapList->path) != 0)
|
if (strcmp(path, pMapList->path) != 0)
|
||||||
{
|
{
|
||||||
@@ -524,7 +549,7 @@ private:
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!engine->IsMapValid(ptr))
|
if (!gamehelpers->IsMapValid(ptr))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,11 @@
|
|||||||
#include <sm_platform.h>
|
#include <sm_platform.h>
|
||||||
#include "stringutil.h"
|
#include "stringutil.h"
|
||||||
|
|
||||||
|
// We're in logic so we don't have this from the SDK.
|
||||||
|
#ifndef MIN
|
||||||
|
#define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *stristr(const char *str, const char *substr)
|
const char *stristr(const char *str, const char *substr)
|
||||||
{
|
{
|
||||||
if (!*substr)
|
if (!*substr)
|
||||||
@@ -303,3 +308,35 @@ size_t UTIL_DecodeHexString(unsigned char *buffer, size_t maxlength, const char
|
|||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define PATHSEPARATOR(c) ((c) == '\\' || (c) == '/')
|
||||||
|
|
||||||
|
void UTIL_StripExtension(const char *in, char *out, int outSize)
|
||||||
|
{
|
||||||
|
// Find the last dot. If it's followed by a dot or a slash, then it's part of a
|
||||||
|
// directory specifier like ../../somedir/./blah.
|
||||||
|
|
||||||
|
// scan backward for '.'
|
||||||
|
int end = strlen(in) - 1;
|
||||||
|
while (end > 0 && in[end] != '.' && !PATHSEPARATOR(in[end]))
|
||||||
|
{
|
||||||
|
--end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (end > 0 && !PATHSEPARATOR(in[end]) && end < outSize)
|
||||||
|
{
|
||||||
|
int nChars = MIN(end, outSize-1);
|
||||||
|
if (out != in)
|
||||||
|
{
|
||||||
|
memcpy(out, in, nChars);
|
||||||
|
}
|
||||||
|
out[nChars] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// nothing found
|
||||||
|
if (out != in)
|
||||||
|
{
|
||||||
|
strncopy(out, in, outSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,5 +40,7 @@ char *UTIL_ReplaceEx(char *subject, size_t maxLen, const char *search, size_t se
|
|||||||
const char *replace, size_t replaceLen, bool caseSensitive = true);
|
const char *replace, size_t replaceLen, bool caseSensitive = true);
|
||||||
size_t UTIL_DecodeHexString(unsigned char *buffer, size_t maxlength, const char *hexstr);
|
size_t UTIL_DecodeHexString(unsigned char *buffer, size_t maxlength, const char *hexstr);
|
||||||
|
|
||||||
|
void UTIL_StripExtension(const char *in, char *out, int outSize);
|
||||||
|
|
||||||
#endif /* _INCLUDE_SOURCEMOD_COMMON_STRINGUTIL_H_ */
|
#endif /* _INCLUDE_SOURCEMOD_COMMON_STRINGUTIL_H_ */
|
||||||
|
|
||||||
|
|||||||
+29
-3
@@ -90,6 +90,25 @@ public:
|
|||||||
|
|
||||||
static VEngineServer_Logic logic_engine;
|
static VEngineServer_Logic logic_engine;
|
||||||
|
|
||||||
|
class VFileSystem_Logic : public IFileSystem_Logic
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
const char *FindFirstEx(const char *pWildCard, const char *pPathID, FileFindHandle_t *pHandle)
|
||||||
|
{
|
||||||
|
return filesystem->FindFirstEx(pWildCard, pPathID, pHandle);
|
||||||
|
}
|
||||||
|
const char *FindNext(FileFindHandle_t handle)
|
||||||
|
{
|
||||||
|
return filesystem->FindNext(handle);
|
||||||
|
}
|
||||||
|
void FindClose(FileFindHandle_t handle)
|
||||||
|
{
|
||||||
|
filesystem->FindClose(handle);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static VFileSystem_Logic logic_filesystem;
|
||||||
|
|
||||||
static void add_natives(sp_nativeinfo_t *natives)
|
static void add_natives(sp_nativeinfo_t *natives)
|
||||||
{
|
{
|
||||||
g_pCoreNatives->AddNatives(natives);
|
g_pCoreNatives->AddNatives(natives);
|
||||||
@@ -161,10 +180,16 @@ static const char *get_source_engine_name()
|
|||||||
return "eye";
|
return "eye";
|
||||||
#elif SOURCE_ENGINE == SE_CSS
|
#elif SOURCE_ENGINE == SE_CSS
|
||||||
return "css";
|
return "css";
|
||||||
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#elif SOURCE_ENGINE == SE_HL2DM
|
||||||
return "orangebox_valve";
|
return "hl2dm";
|
||||||
|
#elif SOURCE_ENGINE == SE_DODS
|
||||||
|
return "dods";
|
||||||
|
#elif SOURCE_ENGINE == SE_TF2
|
||||||
|
return "tf2";
|
||||||
#elif SOURCE_ENGINE == SE_LEFT4DEAD
|
#elif SOURCE_ENGINE == SE_LEFT4DEAD
|
||||||
return "left4dead";
|
return "left4dead";
|
||||||
|
#elif SOURCE_ENGINE == SE_NUCLEARDAWN
|
||||||
|
return "nucleardawn";
|
||||||
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
|
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
|
||||||
return "left4dead2";
|
return "left4dead2";
|
||||||
#elif SOURCE_ENGINE == SE_ALIENSWARM
|
#elif SOURCE_ENGINE == SE_ALIENSWARM
|
||||||
@@ -178,7 +203,7 @@ static const char *get_source_engine_name()
|
|||||||
|
|
||||||
static bool symbols_are_hidden()
|
static bool symbols_are_hidden()
|
||||||
{
|
{
|
||||||
#if (SOURCE_ENGINE == SE_CSS) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_CSGO)
|
#if (SOURCE_ENGINE == SE_CSS) || (SOURCE_ENGINE == SE_HL2DM) || (SOURCE_ENGINE == SE_DODS) || (SOURCE_ENGINE == SE_TF2) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_NUCLEARDAWN) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_CSGO)
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
@@ -200,6 +225,7 @@ static sm_core_t core_bridge =
|
|||||||
&g_SourceMod,
|
&g_SourceMod,
|
||||||
&g_LibSys,
|
&g_LibSys,
|
||||||
reinterpret_cast<IVEngineServer*>(&logic_engine),
|
reinterpret_cast<IVEngineServer*>(&logic_engine),
|
||||||
|
reinterpret_cast<IFileSystem*>(&logic_filesystem),
|
||||||
&g_ShareSys,
|
&g_ShareSys,
|
||||||
&g_RootMenu,
|
&g_RootMenu,
|
||||||
&g_PluginSys,
|
&g_PluginSys,
|
||||||
|
|||||||
@@ -2119,6 +2119,41 @@
|
|||||||
<ClCompile Include="..\PluginInfoDatabase.cpp" />
|
<ClCompile Include="..\PluginInfoDatabase.cpp" />
|
||||||
<ClCompile Include="..\PluginSys.cpp" />
|
<ClCompile Include="..\PluginSys.cpp" />
|
||||||
<ClCompile Include="..\ShareSys.cpp" />
|
<ClCompile Include="..\ShareSys.cpp" />
|
||||||
|
<ClCompile Include="..\smn_protobuf.cpp">
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Alien Swarm|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Bloody Good Time|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - CSS|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Dark Messiah|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - EYE|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Episode 1|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Left 4 Dead|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Left 4 Dead 2|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Old Metamod|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Orange Box|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - Orange Box Valve|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Alien Swarm|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Bloody Good Time|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - CSS|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Dark Messiah|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - EYE|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Episode 1|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Left 4 Dead 2|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Old Metamod|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Orange Box|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - Orange Box Valve|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Alien Swarm|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Bloody Good Time|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - CSS|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Dark Messiah|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - EYE|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Episode 1|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Left 4 Dead 2|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Old Metamod|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Orange Box|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - Orange Box Valve|Win32'">true</ExcludedFromBuild>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\sm_autonatives.cpp" />
|
<ClCompile Include="..\sm_autonatives.cpp" />
|
||||||
<ClCompile Include="..\sm_srvcmds.cpp" />
|
<ClCompile Include="..\sm_srvcmds.cpp" />
|
||||||
<ClCompile Include="..\sm_stringutil.cpp" />
|
<ClCompile Include="..\sm_stringutil.cpp" />
|
||||||
@@ -2127,7 +2162,11 @@
|
|||||||
<ClCompile Include="..\sourcemod.cpp" />
|
<ClCompile Include="..\sourcemod.cpp" />
|
||||||
<ClCompile Include="..\TimerSys.cpp" />
|
<ClCompile Include="..\TimerSys.cpp" />
|
||||||
<ClCompile Include="..\UserMessages.cpp" />
|
<ClCompile Include="..\UserMessages.cpp" />
|
||||||
<ClCompile Include="..\smn_bitbuffer.cpp" />
|
<ClCompile Include="..\smn_bitbuffer.cpp">
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - CS GO|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CrazyDebug - CS GO|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - CS GO|Win32'">true</ExcludedFromBuild>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\smn_console.cpp" />
|
<ClCompile Include="..\smn_console.cpp" />
|
||||||
<ClCompile Include="..\smn_core.cpp" />
|
<ClCompile Include="..\smn_core.cpp" />
|
||||||
<ClCompile Include="..\smn_database.cpp" />
|
<ClCompile Include="..\smn_database.cpp" />
|
||||||
|
|||||||
@@ -213,6 +213,9 @@
|
|||||||
<ClCompile Include="..\..\..\hl2sdks\hl2sdk-csgo\public\engine\protobuf\netmessages.pb.cc">
|
<ClCompile Include="..\..\..\hl2sdks\hl2sdk-csgo\public\engine\protobuf\netmessages.pb.cc">
|
||||||
<Filter>HL2SDK\Protobuf</Filter>
|
<Filter>HL2SDK\Protobuf</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\smn_protobuf.cpp">
|
||||||
|
<Filter>Natives</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\AdminCache.h">
|
<ClInclude Include="..\AdminCache.h">
|
||||||
|
|||||||
+3
-3
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
RootConsoleMenu g_RootMenu;
|
RootConsoleMenu g_RootMenu;
|
||||||
|
|
||||||
ConVar sourcemod_version("sourcemod_version", SM_VERSION_STRING, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY, "SourceMod Version");
|
ConVar sourcemod_version("sourcemod_version", SOURCEMOD_VERSION, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY, "SourceMod Version");
|
||||||
|
|
||||||
RootConsoleMenu::RootConsoleMenu()
|
RootConsoleMenu::RootConsoleMenu()
|
||||||
{
|
{
|
||||||
@@ -339,11 +339,11 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand &
|
|||||||
else if (strcmp(cmdname, "version") == 0)
|
else if (strcmp(cmdname, "version") == 0)
|
||||||
{
|
{
|
||||||
ConsolePrint(" SourceMod Version Information:");
|
ConsolePrint(" SourceMod Version Information:");
|
||||||
ConsolePrint(" SourceMod Version: %s", SM_VERSION_STRING);
|
ConsolePrint(" SourceMod Version: %s", SOURCEMOD_VERSION);
|
||||||
ConsolePrint(" SourcePawn Engine: %s (build %s)", g_pSourcePawn2->GetEngineName(), g_pSourcePawn2->GetVersionString());
|
ConsolePrint(" SourcePawn Engine: %s (build %s)", g_pSourcePawn2->GetEngineName(), g_pSourcePawn2->GetVersionString());
|
||||||
ConsolePrint(" SourcePawn API: v1 = %d, v2 = %d", g_pSourcePawn->GetEngineAPIVersion(), g_pSourcePawn2->GetAPIVersion());
|
ConsolePrint(" SourcePawn API: v1 = %d, v2 = %d", g_pSourcePawn->GetEngineAPIVersion(), g_pSourcePawn2->GetAPIVersion());
|
||||||
ConsolePrint(" Compiled on: %s %s", __DATE__, __TIME__);
|
ConsolePrint(" Compiled on: %s %s", __DATE__, __TIME__);
|
||||||
ConsolePrint(" Build ID: %s", SM_BUILD_UNIQUEID);
|
ConsolePrint(" Build ID: %s", SOURCEMOD_BUILD_ID);
|
||||||
ConsolePrint(" http://www.sourcemod.net/");
|
ConsolePrint(" http://www.sourcemod.net/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-6
@@ -913,7 +913,7 @@ cell_t g_ServerCommandBufferLength;
|
|||||||
|
|
||||||
bool g_ShouldCatchSpew = false;
|
bool g_ShouldCatchSpew = false;
|
||||||
|
|
||||||
#if SOURCE_ENGINE < SE_LEFT4DEAD2
|
#if SOURCE_ENGINE < SE_NUCLEARDAWN
|
||||||
SpewOutputFunc_t g_OriginalSpewOutputFunc = NULL;
|
SpewOutputFunc_t g_OriginalSpewOutputFunc = NULL;
|
||||||
|
|
||||||
SpewRetval_t SourcemodSpewOutputFunc(SpewType_t spewType, tchar const *pMsg)
|
SpewRetval_t SourcemodSpewOutputFunc(SpewType_t spewType, tchar const *pMsg)
|
||||||
@@ -952,7 +952,7 @@ CON_COMMAND(sm_conhook_start, "")
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE < SE_LEFT4DEAD2
|
#if SOURCE_ENGINE < SE_NUCLEARDAWN
|
||||||
g_OriginalSpewOutputFunc = GetSpewOutputFunc();
|
g_OriginalSpewOutputFunc = GetSpewOutputFunc();
|
||||||
SpewOutputFunc(SourcemodSpewOutputFunc);
|
SpewOutputFunc(SourcemodSpewOutputFunc);
|
||||||
#else
|
#else
|
||||||
@@ -973,7 +973,7 @@ CON_COMMAND(sm_conhook_stop, "")
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE < SE_LEFT4DEAD2
|
#if SOURCE_ENGINE < SE_NUCLEARDAWN
|
||||||
SpewOutputFunc(g_OriginalSpewOutputFunc);
|
SpewOutputFunc(g_OriginalSpewOutputFunc);
|
||||||
#else
|
#else
|
||||||
LoggingSystem_PopLoggingState(false);
|
LoggingSystem_PopLoggingState(false);
|
||||||
@@ -1097,6 +1097,8 @@ static cell_t FakeClientCommand(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
|
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_SourceMod.SetGlobalTarget(params[1]);
|
||||||
|
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
||||||
|
|
||||||
@@ -1124,6 +1126,8 @@ static cell_t FakeClientCommandEx(IPluginContext *pContext, const cell_t *params
|
|||||||
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
|
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_SourceMod.SetGlobalTarget(params[1]);
|
||||||
|
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
||||||
|
|
||||||
@@ -1172,8 +1176,6 @@ static cell_t ReplyToCommand(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
|
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_SourceMod.SetGlobalTarget(params[1]);
|
|
||||||
|
|
||||||
unsigned int replyto = g_ChatTriggers.GetReplyTo();
|
unsigned int replyto = g_ChatTriggers.GetReplyTo();
|
||||||
if (replyto == SM_REPLY_CONSOLE)
|
if (replyto == SM_REPLY_CONSOLE)
|
||||||
{
|
{
|
||||||
@@ -1438,9 +1440,12 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params)
|
|||||||
cvar->set_name(pConVar->GetName());
|
cvar->set_name(pConVar->GetName());
|
||||||
cvar->set_value(value);
|
cvar->set_value(value);
|
||||||
|
|
||||||
|
int msgsize = msg.ByteSize();
|
||||||
|
|
||||||
buffer.WriteVarInt32(net_SetConVar);
|
buffer.WriteVarInt32(net_SetConVar);
|
||||||
buffer.WriteVarInt32(msg.ByteSize());
|
buffer.WriteVarInt32(msgsize);
|
||||||
msg.SerializeWithCachedSizesToArray( (uint8 *)( buffer.GetBasePointer() + buffer.GetNumBytesWritten() ) );
|
msg.SerializeWithCachedSizesToArray( (uint8 *)( buffer.GetBasePointer() + buffer.GetNumBytesWritten() ) );
|
||||||
|
buffer.SeekToBit( ( buffer.GetNumBytesWritten() + msgsize ) * 8 );
|
||||||
#else
|
#else
|
||||||
buffer.WriteUBitLong(NET_SETCONVAR, NETMSG_BITS);
|
buffer.WriteUBitLong(NET_SETCONVAR, NETMSG_BITS);
|
||||||
buffer.WriteByte(1);
|
buffer.WriteByte(1);
|
||||||
|
|||||||
@@ -1407,6 +1407,23 @@ static cell_t SQL_ConnectCustom(IPluginContext *pContext, const cell_t *params)
|
|||||||
return hndl;
|
return hndl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell_t SQL_SetCharset(IPluginContext *pContext, const cell_t *params)
|
||||||
|
{
|
||||||
|
IDatabase *db = NULL;
|
||||||
|
HandleError err;
|
||||||
|
|
||||||
|
if ((err = g_DBMan.ReadHandle(params[1], DBHandle_Database, (void **)&db))
|
||||||
|
!= HandleError_None)
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Invalid database Handle %x (error: %d)", params[1], err);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *characterset;
|
||||||
|
pContext->LocalToString(params[2], &characterset);
|
||||||
|
|
||||||
|
return db->SetCharacterSet(characterset);
|
||||||
|
}
|
||||||
|
|
||||||
REGISTER_NATIVES(dbNatives)
|
REGISTER_NATIVES(dbNatives)
|
||||||
{
|
{
|
||||||
{"SQL_BindParamInt", SQL_BindParamInt},
|
{"SQL_BindParamInt", SQL_BindParamInt},
|
||||||
@@ -1448,6 +1465,7 @@ REGISTER_NATIVES(dbNatives)
|
|||||||
{"SQL_TQuery", SQL_TQuery},
|
{"SQL_TQuery", SQL_TQuery},
|
||||||
{"SQL_UnlockDatabase", SQL_UnlockDatabase},
|
{"SQL_UnlockDatabase", SQL_UnlockDatabase},
|
||||||
{"SQL_ConnectCustom", SQL_ConnectCustom},
|
{"SQL_ConnectCustom", SQL_ConnectCustom},
|
||||||
|
{"SQL_SetCharset", SQL_SetCharset},
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+24
-7
@@ -815,8 +815,12 @@ static cell_t FindDataMapOffs(IPluginContext *pContext, const cell_t *params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pContext->LocalToString(params[2], &offset);
|
pContext->LocalToString(params[2], &offset);
|
||||||
if ((td=g_HL2.FindInDataMap(pMap, offset)) == NULL)
|
bool isNested = false;
|
||||||
|
if ((td=g_HL2.FindInDataMap(pMap, offset, &isNested)) == NULL)
|
||||||
{
|
{
|
||||||
|
if (isNested)
|
||||||
|
return pContext->ThrowNativeError("Property \"%s\" is not safe to access for entity %d", offset, params[1]);
|
||||||
|
else
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -962,13 +966,22 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
|
|||||||
{ \
|
{ \
|
||||||
return pContext->ThrowNativeError("Could not retrieve datamap"); \
|
return pContext->ThrowNativeError("Could not retrieve datamap"); \
|
||||||
} \
|
} \
|
||||||
if ((td = g_HL2.FindInDataMap(pMap, prop)) == NULL) \
|
bool isNested = false; \
|
||||||
|
if ((td = g_HL2.FindInDataMap(pMap, prop, &isNested)) == NULL) \
|
||||||
{ \
|
{ \
|
||||||
const char *class_name = g_HL2.GetEntityClassname(pEntity); \
|
const char *class_name = g_HL2.GetEntityClassname(pEntity); \
|
||||||
|
if (isNested) \
|
||||||
|
{ \
|
||||||
|
return pContext->ThrowNativeError("Property \"%s\" not safe to access (entity %d/%s)", \
|
||||||
|
prop, \
|
||||||
|
params[1], \
|
||||||
|
((class_name) ? class_name : "")); \
|
||||||
|
} else { \
|
||||||
return pContext->ThrowNativeError("Property \"%s\" not found (entity %d/%s)", \
|
return pContext->ThrowNativeError("Property \"%s\" not found (entity %d/%s)", \
|
||||||
prop, \
|
prop, \
|
||||||
params[1], \
|
params[1], \
|
||||||
((class_name) ? class_name : "")); \
|
((class_name) ? class_name : "")); \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_SET_PROP_DATA_OFFSET() \
|
#define CHECK_SET_PROP_DATA_OFFSET() \
|
||||||
@@ -1195,7 +1208,7 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
|
|||||||
is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
|
is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
|
||||||
|
|
||||||
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
||||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
|
||||||
if (pProp->GetFlags() & SPROP_VARINT)
|
if (pProp->GetFlags() & SPROP_VARINT)
|
||||||
{
|
{
|
||||||
bit_count = sizeof(int) * 8;
|
bit_count = sizeof(int) * 8;
|
||||||
@@ -1293,7 +1306,7 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
|
|||||||
FIND_PROP_SEND(DPT_Int, "integer");
|
FIND_PROP_SEND(DPT_Int, "integer");
|
||||||
|
|
||||||
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
||||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
|
||||||
if (pProp->GetFlags() & SPROP_VARINT)
|
if (pProp->GetFlags() & SPROP_VARINT)
|
||||||
{
|
{
|
||||||
bit_count = sizeof(int) * 8;
|
bit_count = sizeof(int) * 8;
|
||||||
@@ -1889,8 +1902,12 @@ static cell_t SetEntPropString(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Unable to retrieve GetDataDescMap offset");
|
return pContext->ThrowNativeError("Unable to retrieve GetDataDescMap offset");
|
||||||
}
|
}
|
||||||
pContext->LocalToString(params[3], &prop);
|
pContext->LocalToString(params[3], &prop);
|
||||||
if ((td=g_HL2.FindInDataMap(pMap, prop)) == NULL)
|
bool isNested = false;
|
||||||
|
if ((td=g_HL2.FindInDataMap(pMap, prop, &isNested)) == NULL)
|
||||||
{
|
{
|
||||||
|
if (isNested)
|
||||||
|
return pContext->ThrowNativeError("Property \"%s\" is not safe to access for entity %d", prop, params[1]);
|
||||||
|
else
|
||||||
return pContext->ThrowNativeError("Property \"%s\" not found for entity %d", prop, params[1]);
|
return pContext->ThrowNativeError("Property \"%s\" not found for entity %d", prop, params[1]);
|
||||||
}
|
}
|
||||||
if (td->fieldType != FIELD_CHARACTER)
|
if (td->fieldType != FIELD_CHARACTER)
|
||||||
@@ -2013,7 +2030,7 @@ static int32_t SDKEntFlagToSMEntFlag(int flag)
|
|||||||
#if SOURCE_ENGINE == SE_ALIENSWARM
|
#if SOURCE_ENGINE == SE_ALIENSWARM
|
||||||
case FL_FREEZING:
|
case FL_FREEZING:
|
||||||
return ENTFLAG_FREEZING;
|
return ENTFLAG_FREEZING;
|
||||||
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
#elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
|
||||||
case FL_EP2V_UNKNOWN:
|
case FL_EP2V_UNKNOWN:
|
||||||
return ENTFLAG_EP2V_UNKNOWN1;
|
return ENTFLAG_EP2V_UNKNOWN1;
|
||||||
#endif
|
#endif
|
||||||
@@ -2091,7 +2108,7 @@ static int32_t SMEntFlagToSDKEntFlag(int32_t flag)
|
|||||||
#if SOURCE_ENGINE == SE_ALIENSWARM
|
#if SOURCE_ENGINE == SE_ALIENSWARM
|
||||||
case ENTFLAG_FREEZING:
|
case ENTFLAG_FREEZING:
|
||||||
return FL_FREEZING;
|
return FL_FREEZING;
|
||||||
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
#elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
|
||||||
case ENTFLAG_EP2V_UNKNOWN1:
|
case ENTFLAG_EP2V_UNKNOWN1:
|
||||||
return FL_EP2V_UNKNOWN;
|
return FL_EP2V_UNKNOWN;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ cell_t FakeNativeRouter(IPluginContext *pContext, const cell_t *params, void *pD
|
|||||||
/* Check if too many parameters were passed */
|
/* Check if too many parameters were passed */
|
||||||
if (params[0] > SP_MAX_EXEC_PARAMS)
|
if (params[0] > SP_MAX_EXEC_PARAMS)
|
||||||
{
|
{
|
||||||
return pContext->ThrowNativeError("Called native with too many parameters (%d>%d)", params[9], SP_MAX_EXEC_PARAMS);
|
return pContext->ThrowNativeError("Called native with too many parameters (%d>%d)", params[0], SP_MAX_EXEC_PARAMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the native is paused */
|
/* Check if the native is paused */
|
||||||
|
|||||||
+29
-3
@@ -63,7 +63,7 @@ static cell_t IsMapValid(IPluginContext *pContext, const cell_t *params)
|
|||||||
char *map;
|
char *map;
|
||||||
pContext->LocalToString(params[1], &map);
|
pContext->LocalToString(params[1], &map);
|
||||||
|
|
||||||
return engine->IsMapValid(map);
|
return g_HL2.IsMapValid(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t IsDedicatedServer(IPluginContext *pContext, const cell_t *params)
|
static cell_t IsDedicatedServer(IPluginContext *pContext, const cell_t *params)
|
||||||
@@ -73,7 +73,7 @@ static cell_t IsDedicatedServer(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
static cell_t GetEngineTime(IPluginContext *pContext, const cell_t *params)
|
static cell_t GetEngineTime(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD2
|
#if SOURCE_ENGINE >= SE_NUCLEARDAWN
|
||||||
float fTime = Plat_FloatTime();
|
float fTime = Plat_FloatTime();
|
||||||
#else
|
#else
|
||||||
float fTime = engine->Time();
|
float fTime = engine->Time();
|
||||||
@@ -475,10 +475,14 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
|
|||||||
return 33;
|
return 33;
|
||||||
case SOURCE_ENGINE_CSS:
|
case SOURCE_ENGINE_CSS:
|
||||||
return 34;
|
return 34;
|
||||||
case SOURCE_ENGINE_ORANGEBOXVALVE:
|
case SOURCE_ENGINE_ORANGEBOXVALVE_DEPRECATED:
|
||||||
|
case SOURCE_ENGINE_HL2DM:
|
||||||
|
case SOURCE_ENGINE_DODS:
|
||||||
|
case SOURCE_ENGINE_TF2:
|
||||||
return 35;
|
return 35;
|
||||||
case SOURCE_ENGINE_LEFT4DEAD:
|
case SOURCE_ENGINE_LEFT4DEAD:
|
||||||
return 40;
|
return 40;
|
||||||
|
case SOURCE_ENGINE_NUCLEARDAWN:
|
||||||
case SOURCE_ENGINE_LEFT4DEAD2:
|
case SOURCE_ENGINE_LEFT4DEAD2:
|
||||||
return 50;
|
return 50;
|
||||||
case SOURCE_ENGINE_ALIENSWARM:
|
case SOURCE_ENGINE_ALIENSWARM:
|
||||||
@@ -503,6 +507,27 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell_t GetEngineVersion(IPluginContext *pContext, const cell_t *params)
|
||||||
|
{
|
||||||
|
int engineVer = g_SMAPI->GetSourceEngineBuild();
|
||||||
|
#if defined METAMOD_PLAPI_VERSION
|
||||||
|
if (engineVer == SOURCE_ENGINE_ORANGEBOXVALVE_DEPRECATED)
|
||||||
|
{
|
||||||
|
const char *gamedir = g_SourceMod.GetGameFolderName();
|
||||||
|
if (strcmp(gamedir, "tf") == 0)
|
||||||
|
return SOURCE_ENGINE_TF2;
|
||||||
|
else if (strcmp(gamedir, "cstrike") == 0)
|
||||||
|
return SOURCE_ENGINE_CSS;
|
||||||
|
else if (strcmp(gamedir, "dod") == 0)
|
||||||
|
return SOURCE_ENGINE_DODS;
|
||||||
|
else if (strcmp(gamedir, "hl2mp") == 0)
|
||||||
|
return SOURCE_ENGINE_HL2DM;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return engineVer;
|
||||||
|
}
|
||||||
|
|
||||||
static cell_t IndexToReference(IPluginContext *pContext, const cell_t *params)
|
static cell_t IndexToReference(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
if (params[1] >= NUM_ENT_ENTRIES || params[1] < 0)
|
if (params[1] >= NUM_ENT_ENTRIES || params[1] < 0)
|
||||||
@@ -554,6 +579,7 @@ REGISTER_NATIVES(halflifeNatives)
|
|||||||
{"ShowVGUIPanel", ShowVGUIPanel},
|
{"ShowVGUIPanel", ShowVGUIPanel},
|
||||||
{"IsPlayerAlive", smn_IsPlayerAlive},
|
{"IsPlayerAlive", smn_IsPlayerAlive},
|
||||||
{"GuessSDKVersion", GuessSDKVersion},
|
{"GuessSDKVersion", GuessSDKVersion},
|
||||||
|
{"GetEngineVersion", GetEngineVersion},
|
||||||
{"EntIndexToEntRef", IndexToReference},
|
{"EntIndexToEntRef", IndexToReference},
|
||||||
{"EntRefToEntIndex", ReferenceToIndex},
|
{"EntRefToEntIndex", ReferenceToIndex},
|
||||||
{"MakeCompatEntRef", ReferenceToBCompatRef},
|
{"MakeCompatEntRef", ReferenceToBCompatRef},
|
||||||
|
|||||||
@@ -394,6 +394,7 @@ static cell_t ShowSyncHudText(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Client %d is not in-game", client);
|
return pContext->ThrowNativeError("Client %d is not in-game", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_SourceMod.SetGlobalTarget(client);
|
||||||
g_SourceMod.FormatString(message_buffer, sizeof(message_buffer), pContext, params, 3);
|
g_SourceMod.FormatString(message_buffer, sizeof(message_buffer), pContext, params, 3);
|
||||||
if (pContext->GetLastNativeError() != SP_ERROR_NONE)
|
if (pContext->GetLastNativeError() != SP_ERROR_NONE)
|
||||||
{
|
{
|
||||||
@@ -466,6 +467,7 @@ static cell_t ShowHudText(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Client %d is not in-game", client);
|
return pContext->ThrowNativeError("Client %d is not in-game", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_SourceMod.SetGlobalTarget(client);
|
||||||
g_SourceMod.FormatString(message_buffer, sizeof(message_buffer), pContext, params, 3);
|
g_SourceMod.FormatString(message_buffer, sizeof(message_buffer), pContext, params, 3);
|
||||||
if (pContext->GetLastNativeError() != SP_ERROR_NONE)
|
if (pContext->GetLastNativeError() != SP_ERROR_NONE)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -844,8 +844,6 @@ static cell_t SetMenuTitle(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Menu handle %x is invalid (error %d)", hndl, err);
|
return pContext->ThrowNativeError("Menu handle %x is invalid (error %d)", hndl, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_SourceMod.SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE);
|
|
||||||
|
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
||||||
|
|
||||||
|
|||||||
+28
-3
@@ -156,16 +156,41 @@ static cell_t sm_GetClientAuthStr(IPluginContext *pCtx, const cell_t *params)
|
|||||||
return pCtx->ThrowNativeError("Client %d is not connected", index);
|
return pCtx->ThrowNativeError("Client %d is not connected", index);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pPlayer->IsAuthorized())
|
bool validate = true;
|
||||||
|
if (params[0] > 3)
|
||||||
|
{
|
||||||
|
validate = !!params[4];
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *authstr = pPlayer->GetAuthString(validate);
|
||||||
|
|
||||||
|
if (!authstr || authstr[0] == '\0')
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pCtx->StringToLocal(params[2], static_cast<size_t>(params[3]), pPlayer->GetAuthString());
|
pCtx->StringToLocal(params[2], static_cast<size_t>(params[3]), authstr);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell_t sm_GetSteamAccountID(IPluginContext *pCtx, const cell_t *params)
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
if ((index < 1) || (index > g_Players.GetMaxClients()))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Client index %d is invalid", index);
|
||||||
|
}
|
||||||
|
|
||||||
|
CPlayer *pPlayer = g_Players.GetPlayerByIndex(index);
|
||||||
|
if (!pPlayer->IsConnected())
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Client %d is not connected", index);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pPlayer->GetSteamAccountID(!!params[2]);
|
||||||
|
}
|
||||||
|
|
||||||
static cell_t sm_IsClientConnected(IPluginContext *pCtx, const cell_t *params)
|
static cell_t sm_IsClientConnected(IPluginContext *pCtx, const cell_t *params)
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
@@ -1375,7 +1400,6 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPlayer->MarkAsBeingKicked();
|
|
||||||
g_HL2.AddDelayedKick(client, pPlayer->GetUserId(), buffer);
|
g_HL2.AddDelayedKick(client, pPlayer->GetUserId(), buffer);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@@ -1643,6 +1667,7 @@ REGISTER_NATIVES(playernatives)
|
|||||||
{"CanUserTarget", CanUserTarget},
|
{"CanUserTarget", CanUserTarget},
|
||||||
{"ChangeClientTeam", ChangeClientTeam},
|
{"ChangeClientTeam", ChangeClientTeam},
|
||||||
{"GetClientAuthString", sm_GetClientAuthStr},
|
{"GetClientAuthString", sm_GetClientAuthStr},
|
||||||
|
{"GetSteamAccountID", sm_GetSteamAccountID},
|
||||||
{"GetClientCount", sm_GetClientCount},
|
{"GetClientCount", sm_GetClientCount},
|
||||||
{"GetClientInfo", sm_GetClientInfo},
|
{"GetClientInfo", sm_GetClientInfo},
|
||||||
{"GetClientIP", sm_GetClientIP},
|
{"GetClientIP", sm_GetClientIP},
|
||||||
|
|||||||
@@ -69,10 +69,22 @@ static cell_t smn_PbReadInt(IPluginContext *pCtx, const cell_t *params)
|
|||||||
GET_FIELD_NAME_OR_ERR();
|
GET_FIELD_NAME_OR_ERR();
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
int index = params[0] >= 3 ? params[3] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->GetInt32OrUnsigned(strField, &ret))
|
if (!msg->GetInt32OrUnsigned(strField, &ret))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->GetRepeatedInt32OrUnsigned(strField, index, &ret))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -83,10 +95,22 @@ static cell_t smn_PbReadFloat(IPluginContext *pCtx, const cell_t *params)
|
|||||||
GET_FIELD_NAME_OR_ERR();
|
GET_FIELD_NAME_OR_ERR();
|
||||||
|
|
||||||
float ret;
|
float ret;
|
||||||
|
|
||||||
|
int index = params[0] >= 3 ? params[3] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->GetFloatOrDouble(strField, &ret))
|
if (!msg->GetFloatOrDouble(strField, &ret))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->GetRepeatedFloatOrDouble(strField, index, &ret))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return sp_ftoc(ret);
|
return sp_ftoc(ret);
|
||||||
}
|
}
|
||||||
@@ -97,10 +121,22 @@ static cell_t smn_PbReadBool(IPluginContext *pCtx, const cell_t *params)
|
|||||||
GET_FIELD_NAME_OR_ERR();
|
GET_FIELD_NAME_OR_ERR();
|
||||||
|
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
|
int index = params[0] >= 3 ? params[3] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->GetBool(strField, &ret))
|
if (!msg->GetBool(strField, &ret))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->GetRepeatedBool(strField, index, &ret))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret ? 1 : 0;
|
return ret ? 1 : 0;
|
||||||
}
|
}
|
||||||
@@ -113,10 +149,22 @@ static cell_t smn_PbReadString(IPluginContext *pCtx, const cell_t *params)
|
|||||||
char *buf;
|
char *buf;
|
||||||
pCtx->LocalToPhysAddr(params[3], (cell_t **)&buf);
|
pCtx->LocalToPhysAddr(params[3], (cell_t **)&buf);
|
||||||
|
|
||||||
|
int index = params[0] >= 5 ? params[5] : -1;
|
||||||
|
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->GetString(strField, buf, params[4]))
|
if (!msg->GetString(strField, buf, params[4]))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->GetRepeatedString(strField, index, buf, params[4]))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -130,10 +178,21 @@ static cell_t smn_PbReadColor(IPluginContext *pCtx, const cell_t *params)
|
|||||||
pCtx->LocalToPhysAddr(params[3], &out);
|
pCtx->LocalToPhysAddr(params[3], &out);
|
||||||
|
|
||||||
Color clr;
|
Color clr;
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->GetColor(strField, &clr))
|
if (!msg->GetColor(strField, &clr))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->GetRepeatedColor(strField, index, &clr))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out[0] = clr.r();
|
out[0] = clr.r();
|
||||||
out[1] = clr.g();
|
out[1] = clr.g();
|
||||||
@@ -152,10 +211,21 @@ static cell_t smn_PbReadAngle(IPluginContext *pCtx, const cell_t *params)
|
|||||||
pCtx->LocalToPhysAddr(params[3], &out);
|
pCtx->LocalToPhysAddr(params[3], &out);
|
||||||
|
|
||||||
QAngle ang;
|
QAngle ang;
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->GetQAngle(strField, &ang))
|
if (!msg->GetQAngle(strField, &ang))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->GetRepeatedQAngle(strField, index, &ang))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out[0] = sp_ftoc(ang.x);
|
out[0] = sp_ftoc(ang.x);
|
||||||
out[1] = sp_ftoc(ang.y);
|
out[1] = sp_ftoc(ang.y);
|
||||||
@@ -173,10 +243,21 @@ static cell_t smn_PbReadVector(IPluginContext *pCtx, const cell_t *params)
|
|||||||
pCtx->LocalToPhysAddr(params[3], &out);
|
pCtx->LocalToPhysAddr(params[3], &out);
|
||||||
|
|
||||||
Vector vec;
|
Vector vec;
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->GetVector(strField, &vec))
|
if (!msg->GetVector(strField, &vec))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->GetRepeatedVector(strField, index, &vec))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out[0] = sp_ftoc(vec.x);
|
out[0] = sp_ftoc(vec.x);
|
||||||
out[1] = sp_ftoc(vec.y);
|
out[1] = sp_ftoc(vec.y);
|
||||||
@@ -194,10 +275,21 @@ static cell_t smn_PbReadVector2D(IPluginContext *pCtx, const cell_t *params)
|
|||||||
pCtx->LocalToPhysAddr(params[3], &out);
|
pCtx->LocalToPhysAddr(params[3], &out);
|
||||||
|
|
||||||
Vector2D vec;
|
Vector2D vec;
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->GetVector2D(strField, &vec))
|
if (!msg->GetVector2D(strField, &vec))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->GetRepeatedVector2D(strField, index, &vec))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out[0] = sp_ftoc(vec.x);
|
out[0] = sp_ftoc(vec.x);
|
||||||
out[1] = sp_ftoc(vec.y);
|
out[1] = sp_ftoc(vec.y);
|
||||||
@@ -366,10 +458,21 @@ static cell_t smn_PbSetInt(IPluginContext *pCtx, const cell_t *params)
|
|||||||
GET_MSG_FROM_HANDLE_OR_ERR();
|
GET_MSG_FROM_HANDLE_OR_ERR();
|
||||||
GET_FIELD_NAME_OR_ERR();
|
GET_FIELD_NAME_OR_ERR();
|
||||||
|
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->SetInt32OrUnsigned(strField, params[3]))
|
if (!msg->SetInt32OrUnsigned(strField, params[3]))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->SetRepeatedInt32OrUnsigned(strField, index, params[3]))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -379,10 +482,21 @@ static cell_t smn_PbSetFloat(IPluginContext *pCtx, const cell_t *params)
|
|||||||
GET_MSG_FROM_HANDLE_OR_ERR();
|
GET_MSG_FROM_HANDLE_OR_ERR();
|
||||||
GET_FIELD_NAME_OR_ERR();
|
GET_FIELD_NAME_OR_ERR();
|
||||||
|
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->SetFloatOrDouble(strField, sp_ctof(params[3])))
|
if (!msg->SetFloatOrDouble(strField, sp_ctof(params[3])))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->SetRepeatedFloatOrDouble(strField, index, sp_ctof(params[3])))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -393,10 +507,21 @@ static cell_t smn_PbSetBool(IPluginContext *pCtx, const cell_t *params)
|
|||||||
GET_FIELD_NAME_OR_ERR();
|
GET_FIELD_NAME_OR_ERR();
|
||||||
|
|
||||||
bool value = (params[3] == 0 ? false : true);
|
bool value = (params[3] == 0 ? false : true);
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->SetBool(strField, value))
|
if (!msg->SetBool(strField, value))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->SetRepeatedBool(strField, index, value))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -413,10 +538,21 @@ static cell_t smn_PbSetString(IPluginContext *pCtx, const cell_t *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->SetString(strField, strValue))
|
if (!msg->SetString(strField, strValue))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->SetRepeatedString(strField, index, strValue))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -439,10 +575,21 @@ static cell_t smn_PbSetColor(IPluginContext *pCtx, const cell_t *params)
|
|||||||
clrParams[2],
|
clrParams[2],
|
||||||
clrParams[3]);
|
clrParams[3]);
|
||||||
|
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->SetColor(strField, clr))
|
if (!msg->SetColor(strField, clr))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->SetRepeatedColor(strField, index, clr))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -464,10 +611,21 @@ static cell_t smn_PbSetAngle(IPluginContext *pCtx, const cell_t *params)
|
|||||||
sp_ctof(angParams[1]),
|
sp_ctof(angParams[1]),
|
||||||
sp_ctof(angParams[2]));
|
sp_ctof(angParams[2]));
|
||||||
|
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->SetQAngle(strField, ang))
|
if (!msg->SetQAngle(strField, ang))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->SetRepeatedQAngle(strField, index, ang))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -489,10 +647,21 @@ static cell_t smn_PbSetVector(IPluginContext *pCtx, const cell_t *params)
|
|||||||
sp_ctof(vecParams[1]),
|
sp_ctof(vecParams[1]),
|
||||||
sp_ctof(vecParams[2]));
|
sp_ctof(vecParams[2]));
|
||||||
|
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->SetVector(strField, vec))
|
if (!msg->SetVector(strField, vec))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->SetRepeatedVector(strField, index, vec))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -513,10 +682,21 @@ static cell_t smn_PbSetVector2D(IPluginContext *pCtx, const cell_t *params)
|
|||||||
sp_ctof(vecParams[0]),
|
sp_ctof(vecParams[0]),
|
||||||
sp_ctof(vecParams[1]));
|
sp_ctof(vecParams[1]));
|
||||||
|
|
||||||
|
int index = params[0] >= 4 ? params[4] : -1;
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
if (!msg->SetVector2D(strField, vec))
|
if (!msg->SetVector2D(strField, vec))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
return pCtx->ThrowNativeError("Invalid field \"%s\" for message \"%s\"", strField, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!msg->SetRepeatedVector2D(strField, index, vec))
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid field \"%s\"[%d] for message \"%s\"", strField, index, msg->GetProtobufMessage()->GetTypeName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ CallClass<IVEngineServer> *enginePatch = NULL;
|
|||||||
CallClass<IServerGameDLL> *gamedllPatch = NULL;
|
CallClass<IServerGameDLL> *gamedllPatch = NULL;
|
||||||
IPlayerInfoManager *playerinfo = NULL;
|
IPlayerInfoManager *playerinfo = NULL;
|
||||||
IBaseFileSystem *basefilesystem = NULL;
|
IBaseFileSystem *basefilesystem = NULL;
|
||||||
|
IFileSystem *filesystem = NULL;
|
||||||
IEngineSound *enginesound = NULL;
|
IEngineSound *enginesound = NULL;
|
||||||
IServerPluginHelpers *serverpluginhelpers = NULL;
|
IServerPluginHelpers *serverpluginhelpers = NULL;
|
||||||
IServerPluginCallbacks *vsp_interface = NULL;
|
IServerPluginCallbacks *vsp_interface = NULL;
|
||||||
@@ -68,6 +69,7 @@ bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen
|
|||||||
GET_V_IFACE_CURRENT(GetEngineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
|
GET_V_IFACE_CURRENT(GetEngineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
|
||||||
GET_V_IFACE_CURRENT(GetEngineFactory, engrandom, IUniformRandomStream, VENGINE_SERVER_RANDOM_INTERFACE_VERSION);
|
GET_V_IFACE_CURRENT(GetEngineFactory, engrandom, IUniformRandomStream, VENGINE_SERVER_RANDOM_INTERFACE_VERSION);
|
||||||
GET_V_IFACE_CURRENT(GetFileSystemFactory, basefilesystem, IBaseFileSystem, BASEFILESYSTEM_INTERFACE_VERSION);
|
GET_V_IFACE_CURRENT(GetFileSystemFactory, basefilesystem, IBaseFileSystem, BASEFILESYSTEM_INTERFACE_VERSION);
|
||||||
|
GET_V_IFACE_CURRENT(GetFileSystemFactory, filesystem, IFileSystem, FILESYSTEM_INTERFACE_VERSION);
|
||||||
GET_V_IFACE_CURRENT(GetEngineFactory, enginesound, IEngineSound, IENGINESOUND_SERVER_INTERFACE_VERSION);
|
GET_V_IFACE_CURRENT(GetEngineFactory, enginesound, IEngineSound, IENGINESOUND_SERVER_INTERFACE_VERSION);
|
||||||
GET_V_IFACE_CURRENT(GetEngineFactory, serverpluginhelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS);
|
GET_V_IFACE_CURRENT(GetEngineFactory, serverpluginhelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS);
|
||||||
|
|
||||||
@@ -145,7 +147,7 @@ const char *SourceMod_Core::GetLicense()
|
|||||||
|
|
||||||
const char *SourceMod_Core::GetVersion()
|
const char *SourceMod_Core::GetVersion()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *SourceMod_Core::GetDate()
|
const char *SourceMod_Core::GetDate()
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ extern SourceHook::CallClass<IServerGameDLL> *gamedllPatch;
|
|||||||
extern IUniformRandomStream *engrandom;
|
extern IUniformRandomStream *engrandom;
|
||||||
extern IPlayerInfoManager *playerinfo;
|
extern IPlayerInfoManager *playerinfo;
|
||||||
extern IBaseFileSystem *basefilesystem;
|
extern IBaseFileSystem *basefilesystem;
|
||||||
|
extern IFileSystem *filesystem;
|
||||||
extern IEngineSound *enginesound;
|
extern IEngineSound *enginesound;
|
||||||
extern IServerPluginHelpers *serverpluginhelpers;
|
extern IServerPluginHelpers *serverpluginhelpers;
|
||||||
extern IServerPluginCallbacks *vsp_interface;
|
extern IServerPluginCallbacks *vsp_interface;
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
compiler = SM.DefaultExtCompiler('extensions/bintools')
|
binary = SM.ExtLibrary(builder, 'bintools.ext')
|
||||||
compiler['CDEFINES'].append('HOOKING_ENABLED')
|
binary.compiler.defines += ['HOOKING_ENABLED']
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
binary.compiler.cxxincludes += [
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit'))
|
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit', 'x86'))
|
os.path.join(builder.sourcePath, 'public', 'jit'),
|
||||||
|
os.path.join(builder.sourcePath, 'public', 'jit', 'x86'),
|
||||||
|
]
|
||||||
|
|
||||||
extension = AMBuild.AddJob('bintools.ext')
|
binary.sources += [
|
||||||
binary = Cpp.LibraryBuilder('bintools.ext', AMBuild, extension, compiler)
|
|
||||||
binary.AddSourceFiles('extensions/bintools', [
|
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
'CallMaker.cpp',
|
'CallMaker.cpp',
|
||||||
'CallWrapper.cpp',
|
'CallWrapper.cpp',
|
||||||
@@ -17,8 +17,7 @@ binary.AddSourceFiles('extensions/bintools', [
|
|||||||
'jit_call.cpp',
|
'jit_call.cpp',
|
||||||
'jit_hook.cpp',
|
'jit_hook.cpp',
|
||||||
'sdk/smsdk_ext.cpp'
|
'sdk/smsdk_ext.cpp'
|
||||||
])
|
]
|
||||||
SM.AutoVersion('extensions/bintools', binary)
|
|
||||||
binary.SendToJob()
|
|
||||||
|
|
||||||
|
SM.extensions += [builder.Add(binary)]
|
||||||
|
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ bool BinTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
|
|
||||||
const char *BinTools::GetExtensionVerString()
|
const char *BinTools::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *BinTools::GetExtensionDateString()
|
const char *BinTools::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
compiler = SM.DefaultExtCompiler('extensions/clientprefs')
|
binary = SM.ExtLibrary(builder, 'clientprefs.ext')
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
binary.compiler.cxxincludes += [
|
||||||
|
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||||
|
]
|
||||||
|
|
||||||
extension = AMBuild.AddJob('clientprefs.ext')
|
binary.sources += [
|
||||||
binary = Cpp.LibraryBuilder('clientprefs.ext', AMBuild, extension, compiler)
|
|
||||||
binary.AddSourceFiles('extensions/clientprefs', [
|
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
'cookie.cpp',
|
'cookie.cpp',
|
||||||
'menus.cpp',
|
'menus.cpp',
|
||||||
'natives.cpp',
|
'natives.cpp',
|
||||||
'query.cpp',
|
'query.cpp',
|
||||||
'sdk/smsdk_ext.cpp'
|
'sdk/smsdk_ext.cpp'
|
||||||
])
|
]
|
||||||
SM.AutoVersion('extensions/clientprefs', binary)
|
|
||||||
binary.SendToJob()
|
SM.extensions += [builder.Add(binary)]
|
||||||
|
|
||||||
|
|||||||
@@ -216,52 +216,34 @@ void CookieManager::OnClientDisconnecting(int client)
|
|||||||
|
|
||||||
CookieData *current;
|
CookieData *current;
|
||||||
|
|
||||||
_iter = clientData[client].begin();
|
IGamePlayer *player = playerhelpers->GetGamePlayer(client);
|
||||||
|
const char *pAuth = player ? player->GetAuthString() : NULL;
|
||||||
|
int dbId;
|
||||||
|
|
||||||
while (_iter != clientData[client].end())
|
for (SourceHook::List<CookieData *>::iterator _iter = clientData[client].begin(); _iter != clientData[client].end(); _iter++)
|
||||||
{
|
{
|
||||||
current = (CookieData *)*_iter;
|
current = (CookieData *)*_iter;
|
||||||
|
dbId = current->parent->dbid;
|
||||||
|
|
||||||
if (!current->changed)
|
if (player == NULL || pAuth == NULL || !current->changed || dbId == -1)
|
||||||
{
|
{
|
||||||
current->parent->data[client] = NULL;
|
current->parent->data[client] = NULL;
|
||||||
delete current;
|
delete current;
|
||||||
_iter = clientData[client].erase(_iter);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save this cookie to the database */
|
|
||||||
IGamePlayer *player = playerhelpers->GetGamePlayer(client);
|
|
||||||
|
|
||||||
if (player == NULL)
|
|
||||||
{
|
|
||||||
/* panic! */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int dbId = current->parent->dbid;
|
|
||||||
|
|
||||||
if (dbId == -1)
|
|
||||||
{
|
|
||||||
/* Insert/Find Query must be still running or failed. */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TQueryOp *op = new TQueryOp(Query_InsertData, client);
|
TQueryOp *op = new TQueryOp(Query_InsertData, client);
|
||||||
|
|
||||||
strcpy(op->m_params.steamId, player->GetAuthString());
|
strcpy(op->m_params.steamId, pAuth);
|
||||||
op->m_params.cookieId = dbId;
|
op->m_params.cookieId = dbId;
|
||||||
op->m_params.data = current;
|
op->m_params.data = current;
|
||||||
|
|
||||||
g_ClientPrefs.AddQueryToQueue(op);
|
g_ClientPrefs.AddQueryToQueue(op);
|
||||||
|
|
||||||
current->parent->data[client] = NULL;
|
current->parent->data[client] = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* We don't delete here, it will be removed when the query is completed */
|
|
||||||
|
|
||||||
_iter = clientData[client].erase(_iter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clientData[client].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CookieManager::ClientConnectCallback(int serial, IQuery *data)
|
void CookieManager::ClientConnectCallback(int serial, IQuery *data)
|
||||||
|
|||||||
@@ -201,8 +201,6 @@ void ClientPrefs::SDK_OnUnload()
|
|||||||
|
|
||||||
phrases->Destroy();
|
phrases->Destroy();
|
||||||
|
|
||||||
sharesys->DestroyIdentity( identity );
|
|
||||||
|
|
||||||
plsys->RemovePluginsListener(&g_CookieManager);
|
plsys->RemovePluginsListener(&g_CookieManager);
|
||||||
playerhelpers->RemoveClientListener(&g_CookieManager);
|
playerhelpers->RemoveClientListener(&g_CookieManager);
|
||||||
|
|
||||||
@@ -485,11 +483,11 @@ IdentityToken_t *ClientPrefs::GetIdentity() const
|
|||||||
|
|
||||||
const char *ClientPrefs::GetExtensionVerString()
|
const char *ClientPrefs::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *ClientPrefs::GetExtensionDateString()
|
const char *ClientPrefs::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
for i in SM.sdkInfo:
|
for sdk_name in ['css', 'csgo']:
|
||||||
if i != 'css' and i != 'csgo':
|
if sdk_name not in SM.sdks:
|
||||||
continue
|
continue
|
||||||
|
sdk = SM.sdks[sdk_name]
|
||||||
|
|
||||||
sdk = SM.sdkInfo[i]
|
binary = SM.HL2Library(builder, 'game.cstrike.ext.' + sdk.ext, sdk)
|
||||||
|
binary.sources += [
|
||||||
if AMBuild.target['platform'] not in sdk['platform']:
|
|
||||||
continue
|
|
||||||
|
|
||||||
compiler = SM.DefaultHL2Compiler('extensions/cstrike', i)
|
|
||||||
|
|
||||||
name = 'game.cstrike.ext.' + sdk['ext']
|
|
||||||
extension = AMBuild.AddJob(name)
|
|
||||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
|
||||||
SM.PreSetupHL2Job(extension, binary, i)
|
|
||||||
binary.AddSourceFiles('extensions/cstrike', [
|
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
'natives.cpp',
|
'natives.cpp',
|
||||||
'RegNatives.cpp',
|
'RegNatives.cpp',
|
||||||
@@ -26,7 +17,5 @@ for i in SM.sdkInfo:
|
|||||||
'sdk/smsdk_ext.cpp',
|
'sdk/smsdk_ext.cpp',
|
||||||
'CDetour/detours.cpp',
|
'CDetour/detours.cpp',
|
||||||
'asm/asm.c'
|
'asm/asm.c'
|
||||||
])
|
]
|
||||||
SM.PostSetupHL2Job(extension, binary, i)
|
SM.extensions += [builder.Add(binary)]
|
||||||
SM.AutoVersion('extensions/cstrike', binary)
|
|
||||||
binary.SendToJob()
|
|
||||||
|
|||||||
@@ -283,12 +283,12 @@ bool CStrike::ProcessCommandTarget(cmd_target_info_t *info)
|
|||||||
|
|
||||||
const char *CStrike::GetExtensionVerString()
|
const char *CStrike::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *CStrike::GetExtensionDateString()
|
const char *CStrike::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStrike::OnPluginLoaded(IPlugin *plugin)
|
void CStrike::OnPluginLoaded(IPlugin *plugin)
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ int CallPriceForward(int client, const char *weapon_name, int price);
|
|||||||
#define WEAPON_ASSAULTSUIT 51
|
#define WEAPON_ASSAULTSUIT 51
|
||||||
#define WEAPON_NIGHTVISION 52
|
#define WEAPON_NIGHTVISION 52
|
||||||
#define WEAPON_DEFUSER 53
|
#define WEAPON_DEFUSER 53
|
||||||
|
#define WEAPON_M4 16
|
||||||
#else
|
#else
|
||||||
#define WEAPON_C4 6
|
#define WEAPON_C4 6
|
||||||
#define WEAPON_KNIFE 28
|
#define WEAPON_KNIFE 28
|
||||||
|
|||||||
+64
-119
@@ -21,8 +21,15 @@ CDetour *DCSWeaponDrop = NULL;
|
|||||||
|
|
||||||
int weaponNameOffset = -1;
|
int weaponNameOffset = -1;
|
||||||
|
|
||||||
|
//Windows CS:GO
|
||||||
|
// int __userpurge HandleCommand_Buy_Internal<eax>(int a1<ecx>, float a2<xmm0>, int a3, int a4, char a5)
|
||||||
|
// a1 - this
|
||||||
|
// a2 - CCSGameRules::GetWarmupPeriodEndTime(g_pGameRules)
|
||||||
|
// a3 - weapon
|
||||||
|
// a4 - unknown
|
||||||
|
// a5 - bRebuy
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
DETOUR_DECL_MEMBER2(DetourHandleBuy, int, const char *, weapon, bool, bRebuy)
|
DETOUR_DECL_MEMBER3(DetourHandleBuy, int, const char *, weapon, int, iUnknown, bool, bRebuy)
|
||||||
#else
|
#else
|
||||||
DETOUR_DECL_MEMBER1(DetourHandleBuy, int, const char *, weapon)
|
DETOUR_DECL_MEMBER1(DetourHandleBuy, int, const char *, weapon)
|
||||||
#endif
|
#endif
|
||||||
@@ -44,23 +51,10 @@ DETOUR_DECL_MEMBER1(DetourHandleBuy, int, const char *, weapon)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
int defaultprice = -1;
|
int val = DETOUR_MEMBER_CALL(DetourHandleBuy)(weapon, iUnknown, bRebuy);
|
||||||
if (g_iPriceOffset != -1 && g_PriceDetoured)
|
|
||||||
{
|
|
||||||
defaultprice = CallPriceForwardCSGO(client, weapon);
|
|
||||||
}
|
|
||||||
|
|
||||||
int val = DETOUR_MEMBER_CALL(DetourHandleBuy)(weapon, bRebuy);
|
|
||||||
#else
|
#else
|
||||||
int val = DETOUR_MEMBER_CALL(DetourHandleBuy)(weapon);
|
int val = DETOUR_MEMBER_CALL(DetourHandleBuy)(weapon);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
|
||||||
if (defaultprice != -1)
|
|
||||||
SetWeaponPrice(weapon, defaultprice);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lastclient = -1;
|
lastclient = -1;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@@ -77,8 +71,21 @@ DETOUR_DECL_MEMBER0(DetourWeaponPrice, int)
|
|||||||
|
|
||||||
return CallPriceForward(lastclient, weapon_name, price);
|
return CallPriceForward(lastclient, weapon_name, price);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
DETOUR_DECL_MEMBER2(DetourWeaponPrice, int, const char *, szAttribute, CEconItemView *, pEconItem)
|
||||||
|
{
|
||||||
|
int price = DETOUR_MEMBER_CALL(DetourWeaponPrice)(szAttribute, pEconItem);
|
||||||
|
|
||||||
|
if(lastclient == -1 || strcmp(szAttribute, "in game price") != 0)
|
||||||
|
return price;
|
||||||
|
|
||||||
|
const char *weapon_name = reinterpret_cast<char *>(this+weaponNameOffset);
|
||||||
|
|
||||||
|
return CallPriceForward(lastclient, weapon_name, price);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE != SE_CSGO || !defined(WIN32)
|
||||||
DETOUR_DECL_MEMBER2(DetourTerminateRound, void, float, delay, int, reason)
|
DETOUR_DECL_MEMBER2(DetourTerminateRound, void, float, delay, int, reason)
|
||||||
{
|
{
|
||||||
if (g_pIgnoreTerminateDetour)
|
if (g_pIgnoreTerminateDetour)
|
||||||
@@ -87,6 +94,30 @@ DETOUR_DECL_MEMBER2(DetourTerminateRound, void, float, delay, int, reason)
|
|||||||
DETOUR_MEMBER_CALL(DetourTerminateRound)(delay, reason);
|
DETOUR_MEMBER_CALL(DetourTerminateRound)(delay, reason);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
//Windows CSGO
|
||||||
|
//char __userpurge TerminateRound<al>(unsigned int a1<ecx>, signed int a2<edi>, unsigned int a3<xmm1>, int a4)
|
||||||
|
// a1 - this
|
||||||
|
// a2 - unknown
|
||||||
|
// a3 - delay
|
||||||
|
// a4 - reason
|
||||||
|
DETOUR_DECL_MEMBER1(DetourTerminateRound, void, int, reason)
|
||||||
|
{
|
||||||
|
float delay;
|
||||||
|
|
||||||
|
if (g_pIgnoreTerminateDetour)
|
||||||
|
{
|
||||||
|
g_pIgnoreTerminateDetour = false;
|
||||||
|
return DETOUR_MEMBER_CALL(DetourTerminateRound)(reason);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Save the delay
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
movss delay, xmm1
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
float orgdelay = delay;
|
float orgdelay = delay;
|
||||||
int orgreason = reason;
|
int orgreason = reason;
|
||||||
|
|
||||||
@@ -99,10 +130,26 @@ DETOUR_DECL_MEMBER2(DetourTerminateRound, void, float, delay, int, reason)
|
|||||||
if (result >= Pl_Handled)
|
if (result >= Pl_Handled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE != SE_CSGO || !defined(WIN32)
|
||||||
if (result == Pl_Changed)
|
if (result == Pl_Changed)
|
||||||
return DETOUR_MEMBER_CALL(DetourTerminateRound)(delay, reason);
|
return DETOUR_MEMBER_CALL(DetourTerminateRound)(delay, reason);
|
||||||
|
|
||||||
return DETOUR_MEMBER_CALL(DetourTerminateRound)(orgdelay, orgreason);
|
return DETOUR_MEMBER_CALL(DetourTerminateRound)(orgdelay, orgreason);
|
||||||
|
#else
|
||||||
|
if (result == Pl_Changed)
|
||||||
|
{
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
movss xmm1, delay
|
||||||
|
}
|
||||||
|
return DETOUR_MEMBER_CALL(DetourTerminateRound)(reason);
|
||||||
|
}
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
movss xmm1, orgdelay
|
||||||
|
}
|
||||||
|
return DETOUR_MEMBER_CALL(DetourTerminateRound)(orgreason);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, something, bool, toss)
|
DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, something, bool, toss)
|
||||||
@@ -141,29 +188,10 @@ bool CreateWeaponPriceDetour()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
if (g_iPriceOffset == -1)
|
DWeaponPrice = DETOUR_CREATE_MEMBER(DetourWeaponPrice, "GetAttributeInt");
|
||||||
{
|
|
||||||
if (!g_pGameConf->GetOffset("WeaponPrice", &g_iPriceOffset))
|
|
||||||
{
|
|
||||||
g_iPriceOffset = -1;
|
|
||||||
g_pSM->LogError(myself, "Failed to get WeaponPrice offset - Disabled OnGetWeaponPrice forward");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!CreateHandleBuyDetour())
|
|
||||||
{
|
|
||||||
g_pSM->LogError(myself, "HandleCommand_Buy_Internal failed to detour, disabled OnGetWeaponPrice forward.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_PriceDetoured = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
DWeaponPrice = DETOUR_CREATE_MEMBER(DetourWeaponPrice, "GetWeaponPrice");
|
DWeaponPrice = DETOUR_CREATE_MEMBER(DetourWeaponPrice, "GetWeaponPrice");
|
||||||
|
#endif
|
||||||
if (DWeaponPrice != NULL)
|
if (DWeaponPrice != NULL)
|
||||||
{
|
{
|
||||||
if (!CreateHandleBuyDetour())
|
if (!CreateHandleBuyDetour())
|
||||||
@@ -179,7 +207,6 @@ bool CreateWeaponPriceDetour()
|
|||||||
g_pSM->LogError(myself, "GetWeaponPrice detour could not be initialized - Disabled OnGetWeaponPrice forward.");
|
g_pSM->LogError(myself, "GetWeaponPrice detour could not be initialized - Disabled OnGetWeaponPrice forward.");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreateTerminateRoundDetour()
|
bool CreateTerminateRoundDetour()
|
||||||
@@ -230,14 +257,12 @@ bool CreateCSWeaponDropDetour()
|
|||||||
|
|
||||||
void RemoveWeaponPriceDetour()
|
void RemoveWeaponPriceDetour()
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE != SE_CSGO
|
|
||||||
if (DWeaponPrice != NULL)
|
if (DWeaponPrice != NULL)
|
||||||
{
|
{
|
||||||
DWeaponPrice->Destroy();
|
DWeaponPrice->Destroy();
|
||||||
DWeaponPrice = NULL;
|
DWeaponPrice = NULL;
|
||||||
}
|
}
|
||||||
g_PriceDetoured = false;
|
g_PriceDetoured = false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveHandleBuyDetour()
|
void RemoveHandleBuyDetour()
|
||||||
@@ -272,85 +297,6 @@ void RemoveCSWeaponDropDetour()
|
|||||||
}
|
}
|
||||||
g_pCSWeaponDropDetoured = false;
|
g_pCSWeaponDropDetoured = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
|
||||||
bool SetWeaponPrice(int weaponID, int price)
|
|
||||||
{
|
|
||||||
void *info = GetWeaponInfo(weaponID);
|
|
||||||
if (!info)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
*(int *)((intptr_t)info+g_iPriceOffset) = price;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SetWeaponPrice(const char *weapon, int price)
|
|
||||||
{
|
|
||||||
const char *weaponalias = GetTranslatedWeaponAlias(weapon);
|
|
||||||
int weaponID = AliasToWeaponID(weaponalias);
|
|
||||||
if (weaponID <= 0)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
void *info = GetWeaponInfo(weaponID);
|
|
||||||
if (!info)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
*(int *)((intptr_t)info+g_iPriceOffset) = price;
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int CallPriceForwardCSGO(int client, const char *weapon, int price)
|
|
||||||
{
|
|
||||||
int changedprice = price;
|
|
||||||
cell_t result = Pl_Continue;
|
|
||||||
|
|
||||||
g_pPriceForward->PushCell(client);
|
|
||||||
g_pPriceForward->PushString(weapon);
|
|
||||||
g_pPriceForward->PushCellByRef(&changedprice);
|
|
||||||
g_pPriceForward->Execute(&result);
|
|
||||||
|
|
||||||
if (result == Pl_Continue)
|
|
||||||
return price;
|
|
||||||
|
|
||||||
return changedprice;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CallPriceForwardCSGO(int client, const char *weapon)
|
|
||||||
{
|
|
||||||
const char *weaponalias = GetTranslatedWeaponAlias(weapon);
|
|
||||||
int weaponID = AliasToWeaponID(weaponalias);
|
|
||||||
if (weaponID <= 0)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
void *info = GetWeaponInfo(weaponID);
|
|
||||||
if (!info)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
const char *weapon_name = (const char *)((intptr_t)info + weaponNameOffset);
|
|
||||||
int price = *(int *)((intptr_t)info + g_iPriceOffset);
|
|
||||||
int changedprice = price;
|
|
||||||
cell_t result = Pl_Continue;
|
|
||||||
|
|
||||||
g_pPriceForward->PushCell(client);
|
|
||||||
g_pPriceForward->PushString(weapon_name);
|
|
||||||
g_pPriceForward->PushCellByRef(&changedprice);
|
|
||||||
g_pPriceForward->Execute(&result);
|
|
||||||
|
|
||||||
if (result == Pl_Continue)
|
|
||||||
return -1;
|
|
||||||
if (SetWeaponPrice(weaponID, changedprice))
|
|
||||||
return price;
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
|
|
||||||
int CallPriceForward(int client, const char *weapon_name, int price)
|
int CallPriceForward(int client, const char *weapon_name, int price)
|
||||||
{
|
{
|
||||||
int changedprice = price;
|
int changedprice = price;
|
||||||
@@ -367,4 +313,3 @@ int CallPriceForward(int client, const char *weapon_name, int price)
|
|||||||
|
|
||||||
return changedprice;
|
return changedprice;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -9,17 +9,9 @@ void RemoveHandleBuyDetour();
|
|||||||
void RemoveTerminateRoundDetour();
|
void RemoveTerminateRoundDetour();
|
||||||
void RemoveCSWeaponDropDetour();
|
void RemoveCSWeaponDropDetour();
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
|
||||||
bool SetWeaponPrice(int weaponID, int price);
|
|
||||||
bool SetWeaponPrice(const char *weapon, int price);
|
|
||||||
int CallPriceForwardCSGO(int client, const char *weapon);
|
|
||||||
int CallPriceForwardCSGO(int client, const char *weapon, int price);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern IServerGameEnts *gameents;
|
extern IServerGameEnts *gameents;
|
||||||
extern IForward *g_pHandleBuyForward;
|
extern IForward *g_pHandleBuyForward;
|
||||||
extern IForward *g_pPriceForward;
|
extern IForward *g_pPriceForward;
|
||||||
extern IForward *g_pTerminateRoundForward;
|
extern IForward *g_pTerminateRoundForward;
|
||||||
extern IForward *g_pCSWeaponDropForward;
|
extern IForward *g_pCSWeaponDropForward;
|
||||||
extern int g_iPriceOffset;
|
|
||||||
#endif //_INCLUDE_CSTRIKE_FORWARDS_H_
|
#endif //_INCLUDE_CSTRIKE_FORWARDS_H_
|
||||||
|
|||||||
+254
-31
@@ -34,6 +34,7 @@
|
|||||||
#include "forwards.h"
|
#include "forwards.h"
|
||||||
#include "util_cstrike.h"
|
#include "util_cstrike.h"
|
||||||
#include <server_class.h>
|
#include <server_class.h>
|
||||||
|
#include <iplayerinfo.h>
|
||||||
|
|
||||||
int g_iPriceOffset = -1;
|
int g_iPriceOffset = -1;
|
||||||
|
|
||||||
@@ -46,6 +47,12 @@ int g_iPriceOffset = -1;
|
|||||||
code; \
|
code; \
|
||||||
g_RegNatives.Register(pWrapper);
|
g_RegNatives.Register(pWrapper);
|
||||||
|
|
||||||
|
#define GET_MEMSIG(name) \
|
||||||
|
if (!g_pGameConf->GetMemSig(name, &addr) || !addr) \
|
||||||
|
{ \
|
||||||
|
return pContext->ThrowNativeError("Failed to locate function"); \
|
||||||
|
}
|
||||||
|
|
||||||
inline CBaseEntity *GetCBaseEntity(int num, bool isplayer)
|
inline CBaseEntity *GetCBaseEntity(int num, bool isplayer)
|
||||||
{
|
{
|
||||||
edict_t *pEdict = gamehelpers->EdictOfIndex(num);
|
edict_t *pEdict = gamehelpers->EdictOfIndex(num);
|
||||||
@@ -150,6 +157,7 @@ static cell_t CS_RespawnPlayer(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
static cell_t CS_SwitchTeam(IPluginContext *pContext, const cell_t *params)
|
static cell_t CS_SwitchTeam(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
|
#if SOURCE_ENGINE != SE_CSGO || !defined(WIN32)
|
||||||
static ICallWrapper *pWrapper = NULL;
|
static ICallWrapper *pWrapper = NULL;
|
||||||
if (!pWrapper)
|
if (!pWrapper)
|
||||||
{
|
{
|
||||||
@@ -174,6 +182,41 @@ static cell_t CS_SwitchTeam(IPluginContext *pContext, const cell_t *params)
|
|||||||
vptr += sizeof(CBaseEntity *);
|
vptr += sizeof(CBaseEntity *);
|
||||||
*(int *)vptr = params[2];
|
*(int *)vptr = params[2];
|
||||||
pWrapper->Execute(vstk, NULL);
|
pWrapper->Execute(vstk, NULL);
|
||||||
|
#else
|
||||||
|
if (g_pSDKTools == NULL)
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("SDKTools interface not found. SwitchTeam native disabled.");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *addr = NULL;
|
||||||
|
if(!addr)
|
||||||
|
{
|
||||||
|
GET_MEMSIG("SwitchTeam");
|
||||||
|
}
|
||||||
|
|
||||||
|
void *gamerules = g_pSDKTools->GetGameRules();
|
||||||
|
if (gamerules == NULL)
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("GameRules not available. SwitchTeam native disabled.");
|
||||||
|
}
|
||||||
|
|
||||||
|
CBaseEntity *pEntity;
|
||||||
|
if (!(pEntity=GetCBaseEntity(params[1], true)))
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
int team = params[2];
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push team
|
||||||
|
mov ecx, pEntity
|
||||||
|
mov ebx, gamerules
|
||||||
|
|
||||||
|
call addr
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -248,7 +291,7 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params)
|
|||||||
{
|
{
|
||||||
if (g_pSDKTools == NULL)
|
if (g_pSDKTools == NULL)
|
||||||
{
|
{
|
||||||
smutils->LogError(myself, "SDKTools interface not found. TerminateRound native disabled.");
|
return pContext->ThrowNativeError("SDKTools interface not found. TerminateRound native disabled.");
|
||||||
}
|
}
|
||||||
else if (g_pSDKTools->GetInterfaceVersion() < 2)
|
else if (g_pSDKTools->GetInterfaceVersion() < 2)
|
||||||
{
|
{
|
||||||
@@ -256,6 +299,13 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("SDKTools interface is outdated. TerminateRound native disabled.");
|
return pContext->ThrowNativeError("SDKTools interface is outdated. TerminateRound native disabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *gamerules = g_pSDKTools->GetGameRules();
|
||||||
|
if (gamerules == NULL)
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("GameRules not available. TerminateRound native disabled.");
|
||||||
|
}
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE != SE_CSGO || !defined(WIN32)
|
||||||
static ICallWrapper *pWrapper = NULL;
|
static ICallWrapper *pWrapper = NULL;
|
||||||
|
|
||||||
if (!pWrapper)
|
if (!pWrapper)
|
||||||
@@ -271,12 +321,6 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params)
|
|||||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 2))
|
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 2))
|
||||||
}
|
}
|
||||||
|
|
||||||
void *gamerules = g_pSDKTools->GetGameRules();
|
|
||||||
if (gamerules == NULL)
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("GameRules not available. TerminateRound native disabled.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params[3] == 1 && g_pTerminateRoundDetoured)
|
if (params[3] == 1 && g_pTerminateRoundDetoured)
|
||||||
g_pIgnoreTerminateDetour = true;
|
g_pIgnoreTerminateDetour = true;
|
||||||
|
|
||||||
@@ -290,12 +334,38 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params)
|
|||||||
*(int*)vptr = params[2];
|
*(int*)vptr = params[2];
|
||||||
|
|
||||||
pWrapper->Execute(vstk, NULL);
|
pWrapper->Execute(vstk, NULL);
|
||||||
|
#else
|
||||||
|
static void *addr = NULL;
|
||||||
|
|
||||||
|
if(!addr)
|
||||||
|
{
|
||||||
|
GET_MEMSIG("TerminateRound");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params[3] == 1 && g_pTerminateRoundDetoured)
|
||||||
|
g_pIgnoreTerminateDetour = true;
|
||||||
|
|
||||||
|
float delay = sp_ctof(params[1]);
|
||||||
|
int reason = params[2];
|
||||||
|
signed int unknown = 1;//We might want to find what this is?
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push reason
|
||||||
|
movss xmm1, delay
|
||||||
|
mov edi, unknown
|
||||||
|
mov ecx, gamerules
|
||||||
|
call addr
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t CS_WeaponIDToAlias(IPluginContext *pContext, const cell_t *params)
|
static cell_t CS_WeaponIDToAlias(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
|
if (!IsValidWeaponID(params[1]))
|
||||||
|
return pContext->ThrowNativeError("Invalid WeaponID passed for this game");
|
||||||
|
|
||||||
char *dest;
|
char *dest;
|
||||||
|
|
||||||
pContext->LocalToString(params[2], &dest);
|
pContext->LocalToString(params[2], &dest);
|
||||||
@@ -326,27 +396,151 @@ static cell_t CS_GetTranslatedWeaponAlias(IPluginContext *pContext, const cell_t
|
|||||||
|
|
||||||
static cell_t CS_GetWeaponPrice(IPluginContext *pContext, const cell_t *params)
|
static cell_t CS_GetWeaponPrice(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
//Hard code return values for weapons that dont call GetWeaponPrice and always use default value.
|
if (!IsValidWeaponID(params[2]))
|
||||||
|
return pContext->ThrowNativeError("Invalid WeaponID passed for this game");
|
||||||
|
|
||||||
int id = GetRealWeaponID(params[2]);
|
int id = GetRealWeaponID(params[2]);
|
||||||
|
|
||||||
|
//Hard code return values for weapons that dont call GetWeaponPrice and always use default value.
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
if (id == WEAPON_C4 || id == WEAPON_KNIFE || id == WEAPON_KNIFE_GG)
|
if (id == WEAPON_C4 || id == WEAPON_KNIFE || id == WEAPON_KNIFE_GG)
|
||||||
|
return 0;
|
||||||
#else
|
#else
|
||||||
if (id == WEAPON_C4 || id == WEAPON_KNIFE || id == WEAPON_SHIELD)
|
if (id == WEAPON_C4 || id == WEAPON_KNIFE || id == WEAPON_SHIELD)
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
if (id == WEAPON_KEVLAR)
|
else if (id == WEAPON_KEVLAR)
|
||||||
return 650;
|
return 650;
|
||||||
if (id == WEAPON_ASSAULTSUIT)
|
else if (id == WEAPON_ASSAULTSUIT)
|
||||||
return 1000;
|
return 1000;
|
||||||
if (id == WEAPON_NIGHTVISION)
|
#endif
|
||||||
|
else if (id == WEAPON_NIGHTVISION)
|
||||||
return 1250;
|
return 1250;
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
if (id == WEAPON_DEFUSER)
|
else if (id == WEAPON_DEFUSER)
|
||||||
return 200;
|
return 400;
|
||||||
#endif
|
#endif
|
||||||
if (id == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
|
void *info = GetWeaponInfo(id);
|
||||||
|
|
||||||
|
if (!info)
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Failed to get weaponinfo");
|
||||||
|
}
|
||||||
|
|
||||||
|
CBaseEntity *pEntity;
|
||||||
|
if (!(pEntity = GetCBaseEntity(params[1], true)))
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||||
|
}
|
||||||
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
|
static ICallWrapper *pWrapper = NULL;
|
||||||
|
|
||||||
|
if (!pWrapper)
|
||||||
|
{
|
||||||
|
REGISTER_NATIVE_ADDR("GetAttributeInt",
|
||||||
|
PassInfo pass[2]; \
|
||||||
|
PassInfo ret; \
|
||||||
|
pass[0].flags = PASSFLAG_BYVAL; \
|
||||||
|
pass[0].type = PassType_Basic; \
|
||||||
|
pass[0].size = sizeof(char *); \
|
||||||
|
pass[1].flags = PASSFLAG_BYVAL; \
|
||||||
|
pass[1].type = PassType_Basic; \
|
||||||
|
pass[1].size = sizeof(CEconItemView *); \
|
||||||
|
ret.flags = PASSFLAG_BYVAL; \
|
||||||
|
ret.type = PassType_Basic; \
|
||||||
|
ret.size = sizeof(int); \
|
||||||
|
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, &ret, pass, 2))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a CEconItemView for the m4
|
||||||
|
// Found in CCSPlayer::HandleCommand_Buy_Internal
|
||||||
|
// Linux a1 - CCSPlayer *pEntity, v5 - Player Team, a3 - ItemLoadoutSlot -1 use default loadoutslot:
|
||||||
|
// v4 = *(int (__cdecl **)(_DWORD, _DWORD, _DWORD))(*(_DWORD *)(a1 + 9492) + 36); // offset 9
|
||||||
|
// v6 = v4(a1 + 9492, v5, a3);
|
||||||
|
// Windows v5 - CCSPlayer *pEntity a4 - ItemLoadoutSlot -1 use default loadoutslot:
|
||||||
|
// v8 = (*(int (__stdcall **)(_DWORD, int))(*(_DWORD *)(v5 + 9472) + 32))(*(_DWORD *)(v5 + 760), a4); // offset 8
|
||||||
|
// The function is CCSPlayerInventory::GetItemInLoadout(int, int)
|
||||||
|
// We can pass NULL view to the GetAttribute to use default loadoutslot.
|
||||||
|
// We only really care about m4a1/m4a4 as price differs between them
|
||||||
|
// thisPtrOffset = 9472/9492
|
||||||
|
|
||||||
|
static ICallWrapper *pGetView = NULL;
|
||||||
|
static int thisPtrOffset = -1;
|
||||||
|
CEconItemView *view = NULL;
|
||||||
|
|
||||||
|
if(!pGetView)
|
||||||
|
{
|
||||||
|
int offset = -1;
|
||||||
|
int byteOffset = -1;
|
||||||
|
void *pHandleCommandBuy = NULL;
|
||||||
|
if (!g_pGameConf->GetOffset("GetItemInLoadout", &offset) || offset == -1)
|
||||||
|
{
|
||||||
|
smutils->LogError(myself, "Failed to get GetItemInLoadout offset. Reverting to NULL ItemView");
|
||||||
|
}
|
||||||
|
else if (!g_pGameConf->GetOffset("CCSPlayerInventoryOffset", &byteOffset) || byteOffset == -1)
|
||||||
|
{
|
||||||
|
smutils->LogError(myself, "Failed to get CCSPlayerInventoryOffset offset. Reverting to NULL ItemView");
|
||||||
|
}
|
||||||
|
else if (!g_pGameConf->GetMemSig("HandleCommand_Buy_Internal", &pHandleCommandBuy) || !pHandleCommandBuy)
|
||||||
|
{
|
||||||
|
smutils->LogError(myself, "Failed to get HandleCommand_Buy_Internal function. Reverting to NULL ItemView");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thisPtrOffset = *(int *)((intptr_t)pHandleCommandBuy + byteOffset);
|
||||||
|
|
||||||
|
PassInfo pass[2];
|
||||||
|
PassInfo ret;
|
||||||
|
pass[0].flags = PASSFLAG_BYVAL;
|
||||||
|
pass[0].type = PassType_Basic;
|
||||||
|
pass[0].size = sizeof(int);
|
||||||
|
pass[1].flags = PASSFLAG_BYVAL;
|
||||||
|
pass[1].type = PassType_Basic;
|
||||||
|
pass[1].size = sizeof(int);
|
||||||
|
|
||||||
|
ret.flags = PASSFLAG_BYVAL;
|
||||||
|
ret.type = PassType_Basic;
|
||||||
|
ret.size = sizeof(void *);
|
||||||
|
|
||||||
|
pGetView = g_pBinTools->CreateVCall(offset, 0, 0, &ret, pass, 2);
|
||||||
|
g_RegNatives.Register(pGetView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IPlayerInfo *playerinfo = playerhelpers->GetGamePlayer(params[1])->GetPlayerInfo();
|
||||||
|
if(pGetView && thisPtrOffset != -1 && playerinfo)
|
||||||
|
{
|
||||||
|
//If the gun isnt an M4 we ignore this as M4 is the only one that differs in price based on Loadout item.
|
||||||
|
int iLoadoutSlot = -1;
|
||||||
|
if(id == WEAPON_M4)
|
||||||
|
{
|
||||||
|
iLoadoutSlot = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char vstk_view[sizeof(void *) + sizeof(int) * 2];
|
||||||
|
unsigned char *vptr_view = vstk_view;
|
||||||
|
|
||||||
|
*(void **)vptr_view = (void *)((intptr_t)pEntity + thisPtrOffset);
|
||||||
|
vptr_view += sizeof(void *);
|
||||||
|
*(int *)vptr_view = playerinfo->GetTeamIndex();
|
||||||
|
vptr_view += sizeof(int);
|
||||||
|
*(int *)vptr_view = iLoadoutSlot;
|
||||||
|
|
||||||
|
pGetView->Execute(vstk_view, &view);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char vstk[sizeof(void *) * 2 + sizeof(char *)];
|
||||||
|
unsigned char *vptr = vstk;
|
||||||
|
|
||||||
|
*(void **)vptr = info;
|
||||||
|
vptr += sizeof(void *);
|
||||||
|
*(const char **)vptr = "in game price";
|
||||||
|
vptr += sizeof(const char *);
|
||||||
|
*(CEconItemView **)vptr = view;
|
||||||
|
|
||||||
|
int price = 0;
|
||||||
|
pWrapper->Execute(vstk, &price);
|
||||||
|
#else
|
||||||
if (g_iPriceOffset == -1)
|
if (g_iPriceOffset == -1)
|
||||||
{
|
{
|
||||||
if (!g_pGameConf->GetOffset("WeaponPrice", &g_iPriceOffset))
|
if (!g_pGameConf->GetOffset("WeaponPrice", &g_iPriceOffset))
|
||||||
@@ -356,28 +550,15 @@ static cell_t CS_GetWeaponPrice(IPluginContext *pContext, const cell_t *params)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CBaseEntity *pEntity;
|
|
||||||
if (!(pEntity = GetCBaseEntity(params[1], true)))
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *info = GetWeaponInfo(id);
|
|
||||||
if (!info)
|
|
||||||
return pContext->ThrowNativeError("Failed to get weaponinfo");
|
|
||||||
|
|
||||||
int price = *(int *)((intptr_t)info + g_iPriceOffset);
|
int price = *(int *)((intptr_t)info + g_iPriceOffset);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (params[3] || weaponNameOffset == -1)
|
if (params[3] || weaponNameOffset == -1)
|
||||||
return price;
|
return price;
|
||||||
|
|
||||||
const char *weapon_name = (const char *)((intptr_t)info + weaponNameOffset);
|
const char *weapon_name = (const char *)((intptr_t)info + weaponNameOffset);
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
|
||||||
return CallPriceForwardCSGO(params[1], weapon_name, price);
|
|
||||||
#else
|
|
||||||
return CallPriceForward(params[1], weapon_name, price);
|
return CallPriceForward(params[1], weapon_name, price);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t CS_GetClientClanTag(IPluginContext *pContext, const cell_t *params)
|
static cell_t CS_GetClientClanTag(IPluginContext *pContext, const cell_t *params)
|
||||||
@@ -463,7 +644,23 @@ static cell_t CS_AliasToWeaponID(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
pContext->LocalToString(params[1], &weapon);
|
pContext->LocalToString(params[1], &weapon);
|
||||||
|
|
||||||
return GetFakeWeaponID(AliasToWeaponID(weapon));
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
|
if (strstr(weapon, "usp_silencer") != NULL)
|
||||||
|
{
|
||||||
|
return SMCSWeapon_HKP2000;
|
||||||
|
}
|
||||||
|
else if(strstr(weapon, "cz75a") != NULL)
|
||||||
|
{
|
||||||
|
return SMCSWeapon_P250;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int id = GetFakeWeaponID(AliasToWeaponID(weapon));
|
||||||
|
|
||||||
|
if (!IsValidWeaponID(id))
|
||||||
|
return SMCSWeapon_NONE;
|
||||||
|
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t CS_SetTeamScore(IPluginContext *pContext, const cell_t *params)
|
static cell_t CS_SetTeamScore(IPluginContext *pContext, const cell_t *params)
|
||||||
@@ -600,6 +797,11 @@ static cell_t CS_GetTeamScore(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Invalid team index passed (%i).", params[1]);
|
return pContext->ThrowNativeError("Invalid team index passed (%i).", params[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell_t CS_IsValidWeaponID(IPluginContext *pContext, const cell_t *params)
|
||||||
|
{
|
||||||
|
return IsValidWeaponID(params[1]) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static inline T *GetPlayerVarAddressOrError(const char *pszGamedataName, IPluginContext *pContext, CBaseEntity *pPlayerEntity)
|
static inline T *GetPlayerVarAddressOrError(const char *pszGamedataName, IPluginContext *pContext, CBaseEntity *pPlayerEntity)
|
||||||
{
|
{
|
||||||
@@ -732,6 +934,25 @@ static cell_t CS_GetClientAssists(IPluginContext *pContext, const cell_t *params
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell_t CS_UpdateClientModel(IPluginContext *pContext, const cell_t *params)
|
||||||
|
{
|
||||||
|
static ICallWrapper *pWrapper = NULL;
|
||||||
|
if (!pWrapper)
|
||||||
|
{
|
||||||
|
REGISTER_NATIVE_ADDR("SetModelFromClass",
|
||||||
|
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, NULL, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
CBaseEntity *pEntity;
|
||||||
|
if (!(pEntity=GetCBaseEntity(params[1], true)))
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
pWrapper->Execute(&pEntity, NULL);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
sp_nativeinfo_t g_CSNatives[] =
|
sp_nativeinfo_t g_CSNatives[] =
|
||||||
{
|
{
|
||||||
{"CS_RespawnPlayer", CS_RespawnPlayer},
|
{"CS_RespawnPlayer", CS_RespawnPlayer},
|
||||||
@@ -752,6 +973,8 @@ sp_nativeinfo_t g_CSNatives[] =
|
|||||||
{"CS_SetClientContributionScore", CS_SetClientContributionScore},
|
{"CS_SetClientContributionScore", CS_SetClientContributionScore},
|
||||||
{"CS_GetClientAssists", CS_GetClientAssists},
|
{"CS_GetClientAssists", CS_GetClientAssists},
|
||||||
{"CS_SetClientAssists", CS_SetClientAssists},
|
{"CS_SetClientAssists", CS_SetClientAssists},
|
||||||
|
{"CS_UpdateClientModel", CS_UpdateClientModel},
|
||||||
|
{"CS_IsValidWeaponID", CS_IsValidWeaponID},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,17 @@
|
|||||||
code; \
|
code; \
|
||||||
g_RegNatives.Register(pWrapper);
|
g_RegNatives.Register(pWrapper);
|
||||||
|
|
||||||
|
#define GET_MEMSIG(name, defaultret) \
|
||||||
|
if (!g_pGameConf->GetMemSig(name, &addr) || !addr) \
|
||||||
|
{ \
|
||||||
|
g_pSM->LogError(myself, "Failed to locate function."); \
|
||||||
|
return defaultret;\
|
||||||
|
}
|
||||||
|
|
||||||
void *GetWeaponInfo(int weaponID)
|
void *GetWeaponInfo(int weaponID)
|
||||||
{
|
{
|
||||||
|
void *info;
|
||||||
|
#if SOURCE_ENGINE != SE_CSGO || !defined(WIN32)
|
||||||
static ICallWrapper *pWrapper = NULL;
|
static ICallWrapper *pWrapper = NULL;
|
||||||
if (!pWrapper)
|
if (!pWrapper)
|
||||||
{
|
{
|
||||||
@@ -61,8 +70,6 @@ void *GetWeaponInfo(int weaponID)
|
|||||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retpass, pass, 1))
|
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retpass, pass, 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
void *info;
|
|
||||||
|
|
||||||
unsigned char vstk[sizeof(int)];
|
unsigned char vstk[sizeof(int)];
|
||||||
unsigned char *vptr = vstk;
|
unsigned char *vptr = vstk;
|
||||||
|
|
||||||
@@ -70,11 +77,30 @@ void *GetWeaponInfo(int weaponID)
|
|||||||
|
|
||||||
pWrapper->Execute(vstk, &info);
|
pWrapper->Execute(vstk, &info);
|
||||||
|
|
||||||
|
|
||||||
|
#else
|
||||||
|
static void *addr = NULL;
|
||||||
|
|
||||||
|
if(!addr)
|
||||||
|
{
|
||||||
|
GET_MEMSIG("GetWeaponInfo", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov ecx, weaponID
|
||||||
|
call addr
|
||||||
|
mov info, eax
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *GetTranslatedWeaponAlias(const char *weapon)
|
const char *GetTranslatedWeaponAlias(const char *weapon)
|
||||||
{
|
{
|
||||||
|
const char *alias = NULL;
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE != SE_CSGO || !defined(WIN32)
|
||||||
static ICallWrapper *pWrapper = NULL;
|
static ICallWrapper *pWrapper = NULL;
|
||||||
|
|
||||||
if (!pWrapper)
|
if (!pWrapper)
|
||||||
@@ -90,20 +116,35 @@ const char *GetTranslatedWeaponAlias(const char *weapon)
|
|||||||
retpass.size = sizeof(const char *); \
|
retpass.size = sizeof(const char *); \
|
||||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retpass, pass, 1))
|
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retpass, pass, 1))
|
||||||
}
|
}
|
||||||
const char *ret = NULL;
|
|
||||||
|
|
||||||
unsigned char vstk[sizeof(const char *)];
|
unsigned char vstk[sizeof(const char *)];
|
||||||
unsigned char *vptr = vstk;
|
unsigned char *vptr = vstk;
|
||||||
|
|
||||||
*(const char **)vptr = weapon;
|
*(const char **)vptr = weapon;
|
||||||
|
|
||||||
pWrapper->Execute(vstk, &ret);
|
pWrapper->Execute(vstk, &alias);
|
||||||
|
#else
|
||||||
|
static void *addr = NULL;
|
||||||
|
|
||||||
return ret;
|
if(!addr)
|
||||||
|
{
|
||||||
|
GET_MEMSIG("GetTranslatedWeaponAlias", weapon);
|
||||||
|
}
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov ecx, weapon
|
||||||
|
call addr
|
||||||
|
mov alias, eax
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AliasToWeaponID(const char *weapon)
|
int AliasToWeaponID(const char *weapon)
|
||||||
{
|
{
|
||||||
|
int weaponID = 0;
|
||||||
|
#if SOURCE_ENGINE != SE_CSGO || !defined(WIN32)
|
||||||
static ICallWrapper *pWrapper = NULL;
|
static ICallWrapper *pWrapper = NULL;
|
||||||
|
|
||||||
if (!pWrapper)
|
if (!pWrapper)
|
||||||
@@ -119,7 +160,6 @@ int AliasToWeaponID(const char *weapon)
|
|||||||
retpass.size = sizeof(int); \
|
retpass.size = sizeof(int); \
|
||||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retpass, pass, 1))
|
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retpass, pass, 1))
|
||||||
}
|
}
|
||||||
int weaponID = 0;
|
|
||||||
|
|
||||||
unsigned char vstk[sizeof(const char *)];
|
unsigned char vstk[sizeof(const char *)];
|
||||||
unsigned char *vptr = vstk;
|
unsigned char *vptr = vstk;
|
||||||
@@ -127,12 +167,28 @@ int AliasToWeaponID(const char *weapon)
|
|||||||
*(const char **)vptr = weapon;
|
*(const char **)vptr = weapon;
|
||||||
|
|
||||||
pWrapper->Execute(vstk, &weaponID);
|
pWrapper->Execute(vstk, &weaponID);
|
||||||
|
#else
|
||||||
|
static void *addr = NULL;
|
||||||
|
|
||||||
|
if(!addr)
|
||||||
|
{
|
||||||
|
GET_MEMSIG("AliasToWeaponID", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov ecx, weapon
|
||||||
|
call addr
|
||||||
|
mov weaponID, eax
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return weaponID;
|
return weaponID;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *WeaponIDToAlias(int weaponID)
|
const char *WeaponIDToAlias(int weaponID)
|
||||||
{
|
{
|
||||||
|
const char *alias = NULL;
|
||||||
|
#if SOURCE_ENGINE != SE_CSGO || !defined(WIN32)
|
||||||
static ICallWrapper *pWrapper = NULL;
|
static ICallWrapper *pWrapper = NULL;
|
||||||
|
|
||||||
if (!pWrapper)
|
if (!pWrapper)
|
||||||
@@ -148,16 +204,30 @@ const char *WeaponIDToAlias(int weaponID)
|
|||||||
retpass.size = sizeof(const char *); \
|
retpass.size = sizeof(const char *); \
|
||||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retpass, pass, 1))
|
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retpass, pass, 1))
|
||||||
}
|
}
|
||||||
const char *ret = NULL;
|
|
||||||
|
|
||||||
unsigned char vstk[sizeof(int)];
|
unsigned char vstk[sizeof(int)];
|
||||||
unsigned char *vptr = vstk;
|
unsigned char *vptr = vstk;
|
||||||
|
|
||||||
*(int *)vptr = GetRealWeaponID(weaponID);
|
*(int *)vptr = GetRealWeaponID(weaponID);
|
||||||
|
|
||||||
pWrapper->Execute(vstk, &ret);
|
pWrapper->Execute(vstk, &alias);
|
||||||
|
#else
|
||||||
|
static void *addr = NULL;
|
||||||
|
|
||||||
return ret;
|
if(!addr)
|
||||||
|
{
|
||||||
|
GET_MEMSIG("WeaponIDToAlias", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int realWeaponID = GetRealWeaponID(weaponID);
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov ecx, realWeaponID
|
||||||
|
call addr
|
||||||
|
mov alias, eax
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return alias;
|
||||||
}
|
}
|
||||||
int GetRealWeaponID(int weaponId)
|
int GetRealWeaponID(int weaponId)
|
||||||
{
|
{
|
||||||
@@ -273,11 +343,11 @@ int GetRealWeaponID(int weaponId)
|
|||||||
case SMCSWeapon_DEFUSER:
|
case SMCSWeapon_DEFUSER:
|
||||||
return (int)CSGOWeapon_DEFUSER;
|
return (int)CSGOWeapon_DEFUSER;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return (int)CSGOWeapon_NONE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (weaponId > 33 || weaponId < 0)
|
if (weaponId > (int)SMCSWeapon_NIGHTVISION || weaponId < (int)SMCSWeapon_NONE)
|
||||||
return 0;
|
return (int)SMCSWeapon_NONE;
|
||||||
else
|
else
|
||||||
return weaponId;
|
return weaponId;
|
||||||
#endif
|
#endif
|
||||||
@@ -397,12 +467,27 @@ int GetFakeWeaponID(int weaponId)
|
|||||||
case CSGOWeapon_DEFUSER:
|
case CSGOWeapon_DEFUSER:
|
||||||
return (int)SMCSWeapon_DEFUSER;
|
return (int)SMCSWeapon_DEFUSER;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return (int)SMCSWeapon_NONE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (weaponId > 33 || weaponId < 0)
|
if (weaponId > (int)SMCSWeapon_NIGHTVISION || weaponId < (int)SMCSWeapon_NONE)
|
||||||
return 0;
|
return (int)SMCSWeapon_NONE;
|
||||||
else
|
else
|
||||||
return weaponId;
|
return weaponId;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
bool IsValidWeaponID(int id)
|
||||||
|
{
|
||||||
|
if (id <= (int)SMCSWeapon_NONE)
|
||||||
|
return false;
|
||||||
|
//Why are these even HERE!?! They dont exist in CS:GO but have valid ID's still
|
||||||
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
|
else if (id > (int)SMCSWeapon_DEFUSER || id == (int)SMCSWeapon_P228 || id == (int)SMCSWeapon_SCOUT || id == (int)SMCSWeapon_SG550 || id == (int)SMCSWeapon_GALIL ||
|
||||||
|
id == (int)SMCSWeapon_SCAR17 || id == (int)SMCSWeapon_USP || id == (int)SMCSWeapon_M3 || id == (int)SMCSWeapon_MP5NAVY || id == (int)SMCSWeapon_TMP || id == (int)SMCSWeapon_SG552)
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
else if (id > (int)SMCSWeapon_NIGHTVISION)
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
#define _INCLUDE_CSTRIKE_UTIL_H_
|
#define _INCLUDE_CSTRIKE_UTIL_H_
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
|
class CEconItemView;
|
||||||
|
|
||||||
enum CSGOWeapon
|
enum CSGOWeapon
|
||||||
{
|
{
|
||||||
CSGOWeapon_NONE,
|
CSGOWeapon_NONE,
|
||||||
@@ -90,6 +92,7 @@ enum CSGOWeapon
|
|||||||
CSGOWeapon_NVG,
|
CSGOWeapon_NVG,
|
||||||
CSGOWeapon_DEFUSER
|
CSGOWeapon_DEFUSER
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
enum SMCSWeapon
|
enum SMCSWeapon
|
||||||
{
|
{
|
||||||
SMCSWeapon_NONE = 0,
|
SMCSWeapon_NONE = 0,
|
||||||
@@ -148,7 +151,6 @@ enum SMCSWeapon
|
|||||||
SMCSWeapon_INCGRENADE,
|
SMCSWeapon_INCGRENADE,
|
||||||
SMCSWeapon_DEFUSER
|
SMCSWeapon_DEFUSER
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
void *GetWeaponInfo(int weaponID);
|
void *GetWeaponInfo(int weaponID);
|
||||||
|
|
||||||
const char *GetTranslatedWeaponAlias(const char *weapon);
|
const char *GetTranslatedWeaponAlias(const char *weapon);
|
||||||
@@ -161,4 +163,6 @@ int GetRealWeaponID(int weaponId);
|
|||||||
|
|
||||||
int GetFakeWeaponID(int weaponId);
|
int GetFakeWeaponID(int weaponId);
|
||||||
|
|
||||||
|
bool IsValidWeaponID(int weaponId);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+16
-78
@@ -1,86 +1,24 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python :
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python :
|
||||||
import os.path
|
import os
|
||||||
import subprocess
|
|
||||||
import ambuild.command as command
|
|
||||||
import ambuild.osutil as osutil
|
|
||||||
|
|
||||||
def BuildCURL():
|
libcurl = builder.RunScript('curl-src/lib/AMBuilder')
|
||||||
curl = AMBuild.AddJob('curl')
|
|
||||||
if AMBuild.target['platform'] in ['linux', 'darwin']:
|
|
||||||
if not osutil.FileExists(os.path.join(AMBuild.outputFolder, 'curl', 'Makefile')):
|
|
||||||
args = ['/bin/bash',
|
|
||||||
os.path.join(AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'configure'),
|
|
||||||
'--enable-static',
|
|
||||||
'--disable-shared',
|
|
||||||
'--disable-ldap',
|
|
||||||
'--without-ssl',
|
|
||||||
'--without-libidn',
|
|
||||||
'--without-libssh2',
|
|
||||||
'--without-zlib']
|
|
||||||
env = os.environ.copy()
|
|
||||||
env['CFLAGS'] = '-m32'
|
|
||||||
if AMBuild.target['platform'] == 'darwin':
|
|
||||||
env['LDFLAGS'] = '-mmacosx-version-min=10.5'
|
|
||||||
else:
|
|
||||||
env['CFLAGS'] += ' -D_GNU_SOURCE'
|
|
||||||
curl.AddCommand(command.DirectCommand(argv = args, env = env))
|
|
||||||
curl.AddCommand(command.ShellCommand('cd lib && make'))
|
|
||||||
else:
|
|
||||||
args = ''
|
|
||||||
projpath = os.path.join(AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'lib',
|
|
||||||
'build_libcurl.vcproj')
|
|
||||||
try:
|
|
||||||
subprocess.Popen('vcbuild')
|
|
||||||
except:
|
|
||||||
xprojpath = os.path.join(AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'lib',
|
|
||||||
'build_libcurl.vcxproj')
|
|
||||||
if not os.path.isfile(xprojpath):
|
|
||||||
curl.AddCommand(command.DirectCommand(['vcupgrade', projpath]))
|
|
||||||
args = ['msbuild', xprojpath, '/p:Configuration=LIB Release']
|
|
||||||
|
|
||||||
if not args:
|
binary = SM.ExtLibrary(builder, 'webternet.ext')
|
||||||
args = ['vcbuild', projpath, 'LIB Release']
|
binary.compiler.includes += [
|
||||||
|
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'include')
|
||||||
|
]
|
||||||
|
binary.compiler.defines += ['CURL_STATICLIB']
|
||||||
|
binary.compiler.postlink += [libcurl.binary]
|
||||||
|
if builder.target_platform == 'linux':
|
||||||
|
binary.compiler.postlink += ['-lrt']
|
||||||
|
elif builder.target_platform == 'windows':
|
||||||
|
binary.compiler.postlink += ['ws2_32.lib']
|
||||||
|
|
||||||
curl.AddCommand(command.DirectCommand(args))
|
binary.sources += [
|
||||||
#die "Unable to find libcurl.lib!\n" unless (-f "LIB-Release\\libcurl.lib");
|
|
||||||
|
|
||||||
BuildCURL()
|
|
||||||
|
|
||||||
compiler = SM.DefaultExtCompiler('extensions/curl')
|
|
||||||
extension = AMBuild.AddJob('webternet.ext')
|
|
||||||
binary = Cpp.LibraryBuilder('webternet.ext', AMBuild, extension, compiler)
|
|
||||||
|
|
||||||
curlPath = [AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'include']
|
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(*curlPath))
|
|
||||||
compiler['CDEFINES'].append('CURL_STATICLIB')
|
|
||||||
|
|
||||||
binary.AddSourceFiles('extensions/curl', [
|
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
'curlapi.cpp',
|
'curlapi.cpp',
|
||||||
'sdk/smsdk_ext.cpp',
|
'sdk/smsdk_ext.cpp',
|
||||||
])
|
]
|
||||||
|
|
||||||
if AMBuild.target['platform'] == 'linux' or AMBuild.target['platform'] == 'darwin':
|
SM.extensions += [builder.Add(binary)]
|
||||||
path = os.path.join(AMBuild.outputFolder,
|
|
||||||
'curl',
|
|
||||||
'lib',
|
|
||||||
'.libs',
|
|
||||||
'libcurl.a')
|
|
||||||
if AMBuild.target['platform'] == 'linux':
|
|
||||||
binary['POSTLINKFLAGS'].append('-lrt')
|
|
||||||
binary.AddObjectFiles([path])
|
|
||||||
elif AMBuild.target['platform'] == 'windows':
|
|
||||||
path = os.path.join(AMBuild.sourceFolder,
|
|
||||||
'extensions',
|
|
||||||
'curl',
|
|
||||||
'curl-src',
|
|
||||||
'lib',
|
|
||||||
'LIB-Release',
|
|
||||||
'libcurl.lib')
|
|
||||||
if os.path.isfile(path):
|
|
||||||
binary.RelinkIfNewer(path)
|
|
||||||
binary['POSTLINKFLAGS'].extend([path, 'ws2_32.lib'])
|
|
||||||
|
|
||||||
SM.AutoVersion('extensions/curl', binary)
|
|
||||||
binary.SendToJob()
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
# vim: sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
|
import os, platform
|
||||||
|
|
||||||
|
builder.SetBuildFolder('libcurl')
|
||||||
|
|
||||||
|
binary = builder.compiler.StaticLibrary('curl')
|
||||||
|
binary.compiler.includes += [
|
||||||
|
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'lib'),
|
||||||
|
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'include')
|
||||||
|
]
|
||||||
|
|
||||||
|
if builder.target_platform == 'mac':
|
||||||
|
mac_version, ignore, ignore = platform.mac_ver()
|
||||||
|
mac_tuple = mac_version.split('.')
|
||||||
|
if int(mac_tuple[0]) >= 10 and int(mac_tuple[1]) >= 9:
|
||||||
|
binary.compiler.defines += ['BUILTIN_STRLCAT']
|
||||||
|
elif builder.target_platform == 'windows':
|
||||||
|
binary.compiler.defines += [
|
||||||
|
'BUILDING_LIBCURL',
|
||||||
|
'CURL_STATICLIB',
|
||||||
|
'CURL_DISABLE_LDAP',
|
||||||
|
]
|
||||||
|
elif builder.target_platform == 'linux':
|
||||||
|
binary.compiler.defines += ['_GNU_SOURCE']
|
||||||
|
|
||||||
|
binary.sources += [
|
||||||
|
'base64.c',
|
||||||
|
'connect.c',
|
||||||
|
'content_encoding.c',
|
||||||
|
'cookie.c',
|
||||||
|
'curl_addrinfo.c',
|
||||||
|
'dict.c',
|
||||||
|
'easy.c',
|
||||||
|
'escape.c',
|
||||||
|
'file.c',
|
||||||
|
'formdata.c',
|
||||||
|
'ftp.c',
|
||||||
|
'getenv.c',
|
||||||
|
'getinfo.c',
|
||||||
|
'gtls.c',
|
||||||
|
'hash.c',
|
||||||
|
'hostares.c',
|
||||||
|
'hostasyn.c',
|
||||||
|
'hostip.c',
|
||||||
|
'hostip4.c',
|
||||||
|
'hostip6.c',
|
||||||
|
'hostsyn.c',
|
||||||
|
'hostthre.c',
|
||||||
|
'http.c',
|
||||||
|
'http_chunks.c',
|
||||||
|
'http_digest.c',
|
||||||
|
'http_negotiate.c',
|
||||||
|
'http_ntlm.c',
|
||||||
|
'if2ip.c',
|
||||||
|
'inet_ntop.c',
|
||||||
|
'inet_pton.c',
|
||||||
|
'krb4.c',
|
||||||
|
'krb5.c',
|
||||||
|
'ldap.c',
|
||||||
|
'llist.c',
|
||||||
|
'md5.c',
|
||||||
|
'memdebug.c',
|
||||||
|
'mprintf.c',
|
||||||
|
'multi.c',
|
||||||
|
'netrc.c',
|
||||||
|
'nss.c',
|
||||||
|
'parsedate.c',
|
||||||
|
'progress.c',
|
||||||
|
'qssl.c',
|
||||||
|
'rawstr.c',
|
||||||
|
'security.c',
|
||||||
|
'select.c',
|
||||||
|
'sendf.c',
|
||||||
|
'share.c',
|
||||||
|
'socks.c',
|
||||||
|
'speedcheck.c',
|
||||||
|
'splay.c',
|
||||||
|
'ssh.c',
|
||||||
|
'sslgen.c',
|
||||||
|
'ssluse.c',
|
||||||
|
'strdup.c',
|
||||||
|
'strequal.c',
|
||||||
|
'strerror.c',
|
||||||
|
'strtok.c',
|
||||||
|
'strtoofft.c',
|
||||||
|
'telnet.c',
|
||||||
|
'tftp.c',
|
||||||
|
'timeval.c',
|
||||||
|
'transfer.c',
|
||||||
|
'url.c',
|
||||||
|
'version.c'
|
||||||
|
]
|
||||||
|
rvalue = builder.Add(binary)
|
||||||
|
|
||||||
@@ -0,0 +1,918 @@
|
|||||||
|
/* lib/config.h. Generated from config.h.in by configure. */
|
||||||
|
/* lib/config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the $func function. */
|
||||||
|
/* #undef AS_TR_CPP */
|
||||||
|
|
||||||
|
/* when building libcurl itself */
|
||||||
|
/* #undef BUILDING_LIBCURL */
|
||||||
|
|
||||||
|
/* Location of default ca bundle */
|
||||||
|
#define CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"
|
||||||
|
|
||||||
|
/* Location of default ca path */
|
||||||
|
/* #undef CURL_CA_PATH */
|
||||||
|
|
||||||
|
/* to disable cookies support */
|
||||||
|
/* #undef CURL_DISABLE_COOKIES */
|
||||||
|
|
||||||
|
/* to disable cryptographic authentication */
|
||||||
|
/* #undef CURL_DISABLE_CRYPTO_AUTH */
|
||||||
|
|
||||||
|
/* to disable DICT */
|
||||||
|
/* #undef CURL_DISABLE_DICT */
|
||||||
|
|
||||||
|
/* to disable FILE */
|
||||||
|
/* #undef CURL_DISABLE_FILE */
|
||||||
|
|
||||||
|
/* to disable FTP */
|
||||||
|
/* #undef CURL_DISABLE_FTP */
|
||||||
|
|
||||||
|
/* to disable HTTP */
|
||||||
|
/* #undef CURL_DISABLE_HTTP */
|
||||||
|
|
||||||
|
/* to disable LDAP */
|
||||||
|
#define CURL_DISABLE_LDAP 1
|
||||||
|
|
||||||
|
/* to disable LDAPS */
|
||||||
|
#define CURL_DISABLE_LDAPS 1
|
||||||
|
|
||||||
|
/* to disable proxies */
|
||||||
|
/* #undef CURL_DISABLE_PROXY */
|
||||||
|
|
||||||
|
/* to disable TELNET */
|
||||||
|
/* #undef CURL_DISABLE_TELNET */
|
||||||
|
|
||||||
|
/* to disable TFTP */
|
||||||
|
/* #undef CURL_DISABLE_TFTP */
|
||||||
|
|
||||||
|
/* to disable verbose strings */
|
||||||
|
/* #undef CURL_DISABLE_VERBOSE_STRINGS */
|
||||||
|
|
||||||
|
/* to make a symbol visible */
|
||||||
|
/* #undef CURL_EXTERN_SYMBOL */
|
||||||
|
|
||||||
|
/* to enable hidden symbols */
|
||||||
|
/* #undef CURL_HIDDEN_SYMBOLS */
|
||||||
|
|
||||||
|
/* W$ LDAP with non-W$ compiler */
|
||||||
|
/* #undef CURL_LDAP_HYBRID */
|
||||||
|
|
||||||
|
/* Use W$ LDAP implementation */
|
||||||
|
/* #undef CURL_LDAP_WIN */
|
||||||
|
|
||||||
|
/* when not building a shared library */
|
||||||
|
/* #undef CURL_STATICLIB */
|
||||||
|
|
||||||
|
/* Set to explicitly specify we don't want to use thread-safe functions */
|
||||||
|
/* #undef DISABLED_THREADSAFE */
|
||||||
|
|
||||||
|
/* your Entropy Gathering Daemon socket pathname */
|
||||||
|
/* #undef EGD_SOCKET */
|
||||||
|
|
||||||
|
/* Define if you want to enable IPv6 support */
|
||||||
|
#define ENABLE_IPV6 1
|
||||||
|
|
||||||
|
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_QUAL_ARG1 const
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||||
|
|
||||||
|
/* Define to the type of arg 2 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||||
|
|
||||||
|
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 7 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_TYPE_ARG7 unsigned int
|
||||||
|
|
||||||
|
/* Specifies the number of arguments to getservbyport_r */
|
||||||
|
#define GETSERVBYPORT_R_ARGS 6
|
||||||
|
|
||||||
|
/* Specifies the size of the buffer to pass to getservbyport_r */
|
||||||
|
#define GETSERVBYPORT_R_BUFSIZE 4096
|
||||||
|
|
||||||
|
/* Define to 1 if you have the alarm function. */
|
||||||
|
#define HAVE_ALARM 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <alloca.h> header file. */
|
||||||
|
#define HAVE_ALLOCA_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||||
|
#define HAVE_ARPA_INET_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <arpa/tftp.h> header file. */
|
||||||
|
#define HAVE_ARPA_TFTP_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <assert.h> header file. */
|
||||||
|
#define HAVE_ASSERT_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `basename' function. */
|
||||||
|
#define HAVE_BASENAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if bool is an available type. */
|
||||||
|
#define HAVE_BOOL_T 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
||||||
|
#define HAVE_CLOCK_GETTIME_MONOTONIC 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `closesocket' function. */
|
||||||
|
/* #undef HAVE_CLOSESOCKET */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
|
||||||
|
/* #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <crypto.h> header file. */
|
||||||
|
/* #undef HAVE_CRYPTO_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <des.h> header file. */
|
||||||
|
/* #undef HAVE_DES_H */
|
||||||
|
|
||||||
|
/* disabled non-blocking sockets */
|
||||||
|
/* #undef HAVE_DISABLED_NONBLOCKING */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
|
#define HAVE_DLFCN_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
|
||||||
|
/* #undef HAVE_ENGINE_LOAD_BUILTIN_ENGINES */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <errno.h> header file. */
|
||||||
|
#define HAVE_ERRNO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <err.h> header file. */
|
||||||
|
/* #undef HAVE_ERR_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||||
|
#define HAVE_FCNTL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the fdopen function. */
|
||||||
|
#define HAVE_FDOPEN 1
|
||||||
|
|
||||||
|
/* use FIONBIO for non-blocking sockets */
|
||||||
|
/* #undef HAVE_FIONBIO */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `fork' function. */
|
||||||
|
#define HAVE_FORK 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the freeaddrinfo function. */
|
||||||
|
#define HAVE_FREEADDRINFO 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the freeifaddrs function. */
|
||||||
|
#define HAVE_FREEIFADDRS 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ftruncate function. */
|
||||||
|
#define HAVE_FTRUNCATE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working getaddrinfo function. */
|
||||||
|
#define HAVE_GETADDRINFO 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `geteuid' function. */
|
||||||
|
#define HAVE_GETEUID 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `gethostbyaddr' function. */
|
||||||
|
#define HAVE_GETHOSTBYADDR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the gethostbyaddr_r function. */
|
||||||
|
#define HAVE_GETHOSTBYADDR_R 1
|
||||||
|
|
||||||
|
/* gethostbyaddr_r() takes 5 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYADDR_R_5 */
|
||||||
|
|
||||||
|
/* gethostbyaddr_r() takes 7 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYADDR_R_7 */
|
||||||
|
|
||||||
|
/* gethostbyaddr_r() takes 8 args */
|
||||||
|
#define HAVE_GETHOSTBYADDR_R_8 1
|
||||||
|
|
||||||
|
/* If you have gethostbyname */
|
||||||
|
#define HAVE_GETHOSTBYNAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the gethostbyname_r function. */
|
||||||
|
#define HAVE_GETHOSTBYNAME_R 1
|
||||||
|
|
||||||
|
/* gethostbyname_r() takes 3 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYNAME_R_3 */
|
||||||
|
|
||||||
|
/* gethostbyname_r() takes 5 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYNAME_R_5 */
|
||||||
|
|
||||||
|
/* gethostbyname_r() takes 6 args */
|
||||||
|
#define HAVE_GETHOSTBYNAME_R_6 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the gethostname function. */
|
||||||
|
#define HAVE_GETHOSTNAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working getifaddrs function. */
|
||||||
|
#define HAVE_GETIFADDRS 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the getnameinfo function. */
|
||||||
|
#define HAVE_GETNAMEINFO 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getpass_r' function. */
|
||||||
|
/* #undef HAVE_GETPASS_R */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getppid' function. */
|
||||||
|
#define HAVE_GETPPID 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getprotobyname' function. */
|
||||||
|
#define HAVE_GETPROTOBYNAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getpwuid' function. */
|
||||||
|
#define HAVE_GETPWUID 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getrlimit' function. */
|
||||||
|
#define HAVE_GETRLIMIT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the getservbyport_r function. */
|
||||||
|
#define HAVE_GETSERVBYPORT_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `gettimeofday' function. */
|
||||||
|
#define HAVE_GETTIMEOFDAY 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working glibc-style strerror_r function. */
|
||||||
|
/* #undef HAVE_GLIBC_STRERROR_R */
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working gmtime_r function. */
|
||||||
|
#define HAVE_GMTIME_R 1
|
||||||
|
|
||||||
|
/* if you have the gssapi libraries */
|
||||||
|
/* #undef HAVE_GSSAPI */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
|
||||||
|
/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
|
||||||
|
/* #undef HAVE_GSSAPI_GSSAPI_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
|
||||||
|
/* #undef HAVE_GSSAPI_GSSAPI_KRB5_H */
|
||||||
|
|
||||||
|
/* if you have the GNU gssapi libraries */
|
||||||
|
/* #undef HAVE_GSSGNU */
|
||||||
|
|
||||||
|
/* if you have the Heimdal gssapi libraries */
|
||||||
|
/* #undef HAVE_GSSHEIMDAL */
|
||||||
|
|
||||||
|
/* if you have the MIT gssapi libraries */
|
||||||
|
/* #undef HAVE_GSSMIT */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `idna_strerror' function. */
|
||||||
|
/* #undef HAVE_IDNA_STRERROR */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `idn_free' function. */
|
||||||
|
/* #undef HAVE_IDN_FREE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <idn-free.h> header file. */
|
||||||
|
/* #undef HAVE_IDN_FREE_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||||
|
#define HAVE_IFADDRS_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `inet_addr' function. */
|
||||||
|
#define HAVE_INET_ADDR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the inet_ntoa_r function. */
|
||||||
|
/* #undef HAVE_INET_NTOA_R */
|
||||||
|
|
||||||
|
/* inet_ntoa_r() takes 2 args */
|
||||||
|
/* #undef HAVE_INET_NTOA_R_2 */
|
||||||
|
|
||||||
|
/* inet_ntoa_r() takes 3 args */
|
||||||
|
/* #undef HAVE_INET_NTOA_R_3 */
|
||||||
|
|
||||||
|
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||||
|
/* #undef HAVE_INET_NTOP */
|
||||||
|
|
||||||
|
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||||
|
/* #undef HAVE_INET_PTON */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
|
#define HAVE_INTTYPES_H 1
|
||||||
|
|
||||||
|
/* use ioctlsocket() for non-blocking sockets */
|
||||||
|
/* #undef HAVE_IOCTLSOCKET */
|
||||||
|
|
||||||
|
/* use Ioctlsocket() for non-blocking sockets */
|
||||||
|
/* #undef HAVE_IOCTLSOCKET_CASE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <io.h> header file. */
|
||||||
|
/* #undef HAVE_IO_H */
|
||||||
|
|
||||||
|
/* if you have the Kerberos4 libraries (including -ldes) */
|
||||||
|
/* #undef HAVE_KRB4 */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
|
||||||
|
/* #undef HAVE_KRB_GET_OUR_IP_FOR_REALM */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <krb.h> header file. */
|
||||||
|
/* #undef HAVE_KRB_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the lber.h header file. */
|
||||||
|
/* #undef HAVE_LBER_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ldapssl.h header file. */
|
||||||
|
/* #undef HAVE_LDAPSSL_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ldap.h header file. */
|
||||||
|
/* #undef HAVE_LDAP_H */
|
||||||
|
|
||||||
|
/* Use LDAPS implementation */
|
||||||
|
/* #undef HAVE_LDAP_SSL */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ldap_ssl.h header file. */
|
||||||
|
/* #undef HAVE_LDAP_SSL_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ldap_url_parse' function. */
|
||||||
|
/* #undef HAVE_LDAP_URL_PARSE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <libgen.h> header file. */
|
||||||
|
#define HAVE_LIBGEN_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `idn' library (-lidn). */
|
||||||
|
/* #undef HAVE_LIBIDN */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||||
|
/* #undef HAVE_LIBRESOLV */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `resolve' library (-lresolve). */
|
||||||
|
/* #undef HAVE_LIBRESOLVE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||||
|
/* #undef HAVE_LIBSOCKET */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ssh2' library (-lssh2). */
|
||||||
|
/* #undef HAVE_LIBSSH2 */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <libssh2.h> header file. */
|
||||||
|
/* #undef HAVE_LIBSSH2_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||||
|
/* #undef HAVE_LIBSSL */
|
||||||
|
|
||||||
|
/* if zlib is available */
|
||||||
|
/* #undef HAVE_LIBZ */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <limits.h> header file. */
|
||||||
|
#define HAVE_LIMITS_H 1
|
||||||
|
|
||||||
|
/* if your compiler supports LL */
|
||||||
|
#define HAVE_LL 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <locale.h> header file. */
|
||||||
|
#define HAVE_LOCALE_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working localtime_r function. */
|
||||||
|
#define HAVE_LOCALTIME_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if the compiler supports the 'long long' data type. */
|
||||||
|
#define HAVE_LONGLONG 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the malloc.h header file. */
|
||||||
|
#define HAVE_MALLOC_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the MSG_NOSIGNAL flag. */
|
||||||
|
#define HAVE_MSG_NOSIGNAL 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <netdb.h> header file. */
|
||||||
|
#define HAVE_NETDB_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||||
|
#define HAVE_NETINET_IN_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||||
|
#define HAVE_NETINET_TCP_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <net/if.h> header file. */
|
||||||
|
#define HAVE_NET_IF_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if NI_WITHSCOPEID exists and works. */
|
||||||
|
/* #undef HAVE_NI_WITHSCOPEID */
|
||||||
|
|
||||||
|
/* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE
|
||||||
|
*/
|
||||||
|
/* #undef HAVE_OLD_GSSMIT */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/crypto.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_CRYPTO_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/engine.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_ENGINE_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/err.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_ERR_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/pem.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_PEM_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/pkcs12.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_PKCS12_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/rsa.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_RSA_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/ssl.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_SSL_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/x509.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_X509_H */
|
||||||
|
|
||||||
|
/* use O_NONBLOCK for non-blocking sockets */
|
||||||
|
#define HAVE_O_NONBLOCK 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <pem.h> header file. */
|
||||||
|
/* #undef HAVE_PEM_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `perror' function. */
|
||||||
|
#define HAVE_PERROR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `pipe' function. */
|
||||||
|
#define HAVE_PIPE 1
|
||||||
|
|
||||||
|
/* if you have the function PK11_CreateGenericObject */
|
||||||
|
/* #undef HAVE_PK11_CREATEGENERICOBJECT */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `poll' function. */
|
||||||
|
#define HAVE_POLL 1
|
||||||
|
|
||||||
|
/* If you have a fine poll */
|
||||||
|
#define HAVE_POLL_FINE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <poll.h> header file. */
|
||||||
|
#define HAVE_POLL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working POSIX-style strerror_r function. */
|
||||||
|
#define HAVE_POSIX_STRERROR_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <pwd.h> header file. */
|
||||||
|
#define HAVE_PWD_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `RAND_egd' function. */
|
||||||
|
/* #undef HAVE_RAND_EGD */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `RAND_screen' function. */
|
||||||
|
/* #undef HAVE_RAND_SCREEN */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `RAND_status' function. */
|
||||||
|
/* #undef HAVE_RAND_STATUS */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the recv function. */
|
||||||
|
#define HAVE_RECV 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the recvfrom function. */
|
||||||
|
#define HAVE_RECVFROM 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <rsa.h> header file. */
|
||||||
|
/* #undef HAVE_RSA_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the select function. */
|
||||||
|
#define HAVE_SELECT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the send function. */
|
||||||
|
#define HAVE_SEND 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||||
|
#define HAVE_SETJMP_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `setlocale' function. */
|
||||||
|
#define HAVE_SETLOCALE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `setmode' function. */
|
||||||
|
/* #undef HAVE_SETMODE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `setrlimit' function. */
|
||||||
|
#define HAVE_SETRLIMIT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||||
|
#define HAVE_SGTTY_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the sigaction function. */
|
||||||
|
#define HAVE_SIGACTION 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the siginterrupt function. */
|
||||||
|
#define HAVE_SIGINTERRUPT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the signal function. */
|
||||||
|
#define HAVE_SIGNAL 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <signal.h> header file. */
|
||||||
|
#define HAVE_SIGNAL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the sigsetjmp function or macro. */
|
||||||
|
#define HAVE_SIGSETJMP 1
|
||||||
|
|
||||||
|
/* Define to 1 if sig_atomic_t is an available typedef. */
|
||||||
|
#define HAVE_SIG_ATOMIC_T 1
|
||||||
|
|
||||||
|
/* Define to 1 if sig_atomic_t is already defined as volatile. */
|
||||||
|
/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `socket' function. */
|
||||||
|
#define HAVE_SOCKET 1
|
||||||
|
|
||||||
|
/* use SO_NONBLOCK for non-blocking sockets */
|
||||||
|
/* #undef HAVE_SO_NONBLOCK */
|
||||||
|
|
||||||
|
/* Define this if you have the SPNEGO library fbopenssl */
|
||||||
|
/* #undef HAVE_SPNEGO */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `SSL_get_shutdown' function. */
|
||||||
|
/* #undef HAVE_SSL_GET_SHUTDOWN */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <ssl.h> header file. */
|
||||||
|
/* #undef HAVE_SSL_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||||
|
#define HAVE_STDBOOL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
|
#define HAVE_STDINT_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdio.h> header file. */
|
||||||
|
#define HAVE_STDIO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#define HAVE_STDLIB_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strcasecmp function. */
|
||||||
|
#define HAVE_STRCASECMP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strcasestr function. */
|
||||||
|
/* #undef HAVE_STRCASESTR */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strcmpi function. */
|
||||||
|
/* #undef HAVE_STRCMPI */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strdup function. */
|
||||||
|
#define HAVE_STRDUP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strerror_r function. */
|
||||||
|
#define HAVE_STRERROR_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the stricmp function. */
|
||||||
|
/* #undef HAVE_STRICMP */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
|
#define HAVE_STRINGS_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strlcat function. */
|
||||||
|
/* #undef HAVE_STRLCAT */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strlcpy' function. */
|
||||||
|
/* #undef HAVE_STRLCPY */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strncasecmp function. */
|
||||||
|
#define HAVE_STRNCASECMP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strncmpi function. */
|
||||||
|
/* #undef HAVE_STRNCMPI */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strnicmp function. */
|
||||||
|
/* #undef HAVE_STRNICMP */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strstr function. */
|
||||||
|
#define HAVE_STRSTR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strtok_r function. */
|
||||||
|
#define HAVE_STRTOK_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strtoll function. */
|
||||||
|
#define HAVE_STRTOLL 1
|
||||||
|
|
||||||
|
/* if struct sockaddr_storage is defined */
|
||||||
|
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the timeval struct. */
|
||||||
|
#define HAVE_STRUCT_TIMEVAL 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/filio.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_FILIO_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||||
|
#define HAVE_SYS_IOCTL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||||
|
#define HAVE_SYS_PARAM_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||||
|
#define HAVE_SYS_POLL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||||
|
#define HAVE_SYS_RESOURCE_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||||
|
#define HAVE_SYS_SELECT_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||||
|
#define HAVE_SYS_SOCKET_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/sockio.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_SOCKIO_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
|
#define HAVE_SYS_STAT_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||||
|
#define HAVE_SYS_TIME_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
|
#define HAVE_SYS_TYPES_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/uio.h> header file. */
|
||||||
|
#define HAVE_SYS_UIO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/un.h> header file. */
|
||||||
|
#define HAVE_SYS_UN_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_UTIME_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <termios.h> header file. */
|
||||||
|
#define HAVE_TERMIOS_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <termio.h> header file. */
|
||||||
|
#define HAVE_TERMIO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <time.h> header file. */
|
||||||
|
#define HAVE_TIME_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <tld.h> header file. */
|
||||||
|
/* #undef HAVE_TLD_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `tld_strerror' function. */
|
||||||
|
/* #undef HAVE_TLD_STRERROR */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `uname' function. */
|
||||||
|
#define HAVE_UNAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
|
#define HAVE_UNISTD_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `utime' function. */
|
||||||
|
#define HAVE_UTIME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <utime.h> header file. */
|
||||||
|
#define HAVE_UTIME_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if compiler supports C99 variadic macro style. */
|
||||||
|
#define HAVE_VARIADIC_MACROS_C99 1
|
||||||
|
|
||||||
|
/* Define to 1 if compiler supports old gcc variadic macro style. */
|
||||||
|
#define HAVE_VARIADIC_MACROS_GCC 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the winber.h header file. */
|
||||||
|
/* #undef HAVE_WINBER_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the windows.h header file. */
|
||||||
|
/* #undef HAVE_WINDOWS_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the winldap.h header file. */
|
||||||
|
/* #undef HAVE_WINLDAP_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the winsock2.h header file. */
|
||||||
|
/* #undef HAVE_WINSOCK2_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the winsock.h header file. */
|
||||||
|
/* #undef HAVE_WINSOCK_H */
|
||||||
|
|
||||||
|
/* Define this symbol if your OS supports changing the contents of argv */
|
||||||
|
#define HAVE_WRITABLE_ARGV 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the writev function. */
|
||||||
|
#define HAVE_WRITEV 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ws2tcpip.h header file. */
|
||||||
|
/* #undef HAVE_WS2TCPIP_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <x509.h> header file. */
|
||||||
|
/* #undef HAVE_X509_H */
|
||||||
|
|
||||||
|
/* if you have the zlib.h header file */
|
||||||
|
/* #undef HAVE_ZLIB_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you are building a native Windows target. */
|
||||||
|
/* #undef NATIVE_WINDOWS */
|
||||||
|
|
||||||
|
/* If you lack a fine basename() prototype */
|
||||||
|
/* #undef NEED_BASENAME_PROTO */
|
||||||
|
|
||||||
|
/* Define to 1 if you need the lber.h header file even with ldap.h */
|
||||||
|
/* #undef NEED_LBER_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you need the malloc.h header file even with stdlib.h */
|
||||||
|
/* #undef NEED_MALLOC_H */
|
||||||
|
|
||||||
|
/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
|
||||||
|
/* #undef NEED_REENTRANT */
|
||||||
|
|
||||||
|
/* cpu-machine-OS */
|
||||||
|
#define OS "x86_64-unknown-linux-gnu"
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#define PACKAGE "curl"
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#define PACKAGE_NAME "curl"
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#define PACKAGE_STRING "curl -"
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#define PACKAGE_TARNAME "curl"
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#define PACKAGE_VERSION "-"
|
||||||
|
|
||||||
|
/* a suitable file to read random data from */
|
||||||
|
/* #undef RANDOM_FILE */
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG1 int
|
||||||
|
|
||||||
|
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG2 void
|
||||||
|
|
||||||
|
/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
|
||||||
|
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||||
|
|
||||||
|
/* Define to the type of arg 3 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG3 size_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 4 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG4 int
|
||||||
|
|
||||||
|
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||||
|
|
||||||
|
/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
|
||||||
|
/* #undef RECVFROM_TYPE_ARG5_IS_VOID */
|
||||||
|
|
||||||
|
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG6 socklen_t
|
||||||
|
|
||||||
|
/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
|
||||||
|
/* #undef RECVFROM_TYPE_ARG6_IS_VOID */
|
||||||
|
|
||||||
|
/* Define to the function return type for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_RETV int
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for recv. */
|
||||||
|
#define RECV_TYPE_ARG1 int
|
||||||
|
|
||||||
|
/* Define to the type of arg 2 for recv. */
|
||||||
|
#define RECV_TYPE_ARG2 void *
|
||||||
|
|
||||||
|
/* Define to the type of arg 3 for recv. */
|
||||||
|
#define RECV_TYPE_ARG3 size_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 4 for recv. */
|
||||||
|
#define RECV_TYPE_ARG4 int
|
||||||
|
|
||||||
|
/* Define to the function return type for recv. */
|
||||||
|
#define RECV_TYPE_RETV int
|
||||||
|
|
||||||
|
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||||
|
#define RETSIGTYPE void
|
||||||
|
|
||||||
|
/* Define to the type qualifier of arg 5 for select. */
|
||||||
|
#define SELECT_QUAL_ARG5
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for select. */
|
||||||
|
#define SELECT_TYPE_ARG1 int
|
||||||
|
|
||||||
|
/* Define to the type of args 2, 3 and 4 for select. */
|
||||||
|
#define SELECT_TYPE_ARG234 fd_set *
|
||||||
|
|
||||||
|
/* Define to the type of arg 5 for select. */
|
||||||
|
#define SELECT_TYPE_ARG5 struct timeval *
|
||||||
|
|
||||||
|
/* Define to the function return type for select. */
|
||||||
|
#define SELECT_TYPE_RETV int
|
||||||
|
|
||||||
|
/* Define to the type qualifier of arg 2 for send. */
|
||||||
|
#define SEND_QUAL_ARG2 const
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for send. */
|
||||||
|
#define SEND_TYPE_ARG1 int
|
||||||
|
|
||||||
|
/* Define to the type of arg 2 for send. */
|
||||||
|
#define SEND_TYPE_ARG2 void *
|
||||||
|
|
||||||
|
/* Define to the type of arg 3 for send. */
|
||||||
|
#define SEND_TYPE_ARG3 size_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 4 for send. */
|
||||||
|
#define SEND_TYPE_ARG4 int
|
||||||
|
|
||||||
|
/* Define to the function return type for send. */
|
||||||
|
#define SEND_TYPE_RETV int
|
||||||
|
|
||||||
|
/* The size of `int', as computed by sizeof. */
|
||||||
|
#define SIZEOF_INT 4
|
||||||
|
|
||||||
|
/* The size of `long', as computed by sizeof. */
|
||||||
|
#define SIZEOF_LONG 4
|
||||||
|
|
||||||
|
/* The size of `off_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_OFF_T 8
|
||||||
|
|
||||||
|
/* The size of `size_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_SIZE_T 4
|
||||||
|
|
||||||
|
/* The size of `time_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_TIME_T 4
|
||||||
|
|
||||||
|
/* The size of `void*', as computed by sizeof. */
|
||||||
|
#define SIZEOF_VOIDP 4
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
|
#define STDC_HEADERS 1
|
||||||
|
|
||||||
|
/* Define to the type of arg 3 for strerror_r. */
|
||||||
|
#define STRERROR_R_TYPE_ARG3 size_t
|
||||||
|
|
||||||
|
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||||
|
#define TIME_WITH_SYS_TIME 1
|
||||||
|
|
||||||
|
/* Define if you want to enable c-ares support */
|
||||||
|
/* #undef USE_ARES */
|
||||||
|
|
||||||
|
/* if GnuTLS is enabled */
|
||||||
|
/* #undef USE_GNUTLS */
|
||||||
|
|
||||||
|
/* if libSSH2 is in use */
|
||||||
|
/* #undef USE_LIBSSH2 */
|
||||||
|
|
||||||
|
/* If you want to build curl with the built-in manual */
|
||||||
|
#define USE_MANUAL 1
|
||||||
|
|
||||||
|
/* if NSS is enabled */
|
||||||
|
/* #undef USE_NSS */
|
||||||
|
|
||||||
|
/* if OpenSSL is in use */
|
||||||
|
/* #undef USE_OPENSSL */
|
||||||
|
|
||||||
|
/* if SSL is enabled */
|
||||||
|
/* #undef USE_SSLEAY */
|
||||||
|
|
||||||
|
/* Define to 1 if you are building a Windows target without large file
|
||||||
|
support. */
|
||||||
|
/* #undef USE_WIN32_LARGE_FILES */
|
||||||
|
|
||||||
|
/* to enable SSPI support */
|
||||||
|
/* #undef USE_WINDOWS_SSPI */
|
||||||
|
|
||||||
|
/* Define to 1 if using yaSSL in OpenSSL compatibility mode. */
|
||||||
|
/* #undef USE_YASSLEMUL */
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#define VERSION "7.19.2"
|
||||||
|
|
||||||
|
/* Define to avoid automatic inclusion of winsock.h */
|
||||||
|
/* #undef WIN32_LEAN_AND_MEAN */
|
||||||
|
|
||||||
|
/* Define to 1 if OS is AIX. */
|
||||||
|
#ifndef _ALL_SOURCE
|
||||||
|
/* # undef _ALL_SOURCE */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||||
|
#define _FILE_OFFSET_BITS 64
|
||||||
|
|
||||||
|
/* Define for large files, on AIX-style hosts. */
|
||||||
|
/* #undef _LARGE_FILES */
|
||||||
|
|
||||||
|
/* define this if you need it to compile thread-safe code */
|
||||||
|
/* #undef _THREAD_SAFE */
|
||||||
|
|
||||||
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
|
/* #undef const */
|
||||||
|
|
||||||
|
/* Type to use in place of in_addr_t when system does not provide it. */
|
||||||
|
/* #undef in_addr_t */
|
||||||
|
|
||||||
|
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||||
|
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||||
|
#ifndef __cplusplus
|
||||||
|
/* #undef inline */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||||
|
/* #undef size_t */
|
||||||
|
|
||||||
|
/* Type to use in place of socklen_t when system does not provide it. */
|
||||||
|
/* #undef socklen_t */
|
||||||
|
|
||||||
|
/* the signed version of size_t */
|
||||||
|
/* #undef ssize_t */
|
||||||
@@ -0,0 +1,918 @@
|
|||||||
|
/* lib/config.h. Generated from config.h.in by configure. */
|
||||||
|
/* lib/config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the $func function. */
|
||||||
|
/* #undef AS_TR_CPP */
|
||||||
|
|
||||||
|
/* when building libcurl itself */
|
||||||
|
/* #undef BUILDING_LIBCURL */
|
||||||
|
|
||||||
|
/* Location of default ca bundle */
|
||||||
|
/* #undef CURL_CA_BUNDLE */
|
||||||
|
|
||||||
|
/* Location of default ca path */
|
||||||
|
/* #undef CURL_CA_PATH */
|
||||||
|
|
||||||
|
/* to disable cookies support */
|
||||||
|
/* #undef CURL_DISABLE_COOKIES */
|
||||||
|
|
||||||
|
/* to disable cryptographic authentication */
|
||||||
|
/* #undef CURL_DISABLE_CRYPTO_AUTH */
|
||||||
|
|
||||||
|
/* to disable DICT */
|
||||||
|
/* #undef CURL_DISABLE_DICT */
|
||||||
|
|
||||||
|
/* to disable FILE */
|
||||||
|
/* #undef CURL_DISABLE_FILE */
|
||||||
|
|
||||||
|
/* to disable FTP */
|
||||||
|
/* #undef CURL_DISABLE_FTP */
|
||||||
|
|
||||||
|
/* to disable HTTP */
|
||||||
|
/* #undef CURL_DISABLE_HTTP */
|
||||||
|
|
||||||
|
/* to disable LDAP */
|
||||||
|
#define CURL_DISABLE_LDAP 1
|
||||||
|
|
||||||
|
/* to disable LDAPS */
|
||||||
|
#define CURL_DISABLE_LDAPS 1
|
||||||
|
|
||||||
|
/* to disable proxies */
|
||||||
|
/* #undef CURL_DISABLE_PROXY */
|
||||||
|
|
||||||
|
/* to disable TELNET */
|
||||||
|
/* #undef CURL_DISABLE_TELNET */
|
||||||
|
|
||||||
|
/* to disable TFTP */
|
||||||
|
/* #undef CURL_DISABLE_TFTP */
|
||||||
|
|
||||||
|
/* to disable verbose strings */
|
||||||
|
/* #undef CURL_DISABLE_VERBOSE_STRINGS */
|
||||||
|
|
||||||
|
/* to make a symbol visible */
|
||||||
|
/* #undef CURL_EXTERN_SYMBOL */
|
||||||
|
|
||||||
|
/* to enable hidden symbols */
|
||||||
|
/* #undef CURL_HIDDEN_SYMBOLS */
|
||||||
|
|
||||||
|
/* W$ LDAP with non-W$ compiler */
|
||||||
|
/* #undef CURL_LDAP_HYBRID */
|
||||||
|
|
||||||
|
/* Use W$ LDAP implementation */
|
||||||
|
/* #undef CURL_LDAP_WIN */
|
||||||
|
|
||||||
|
/* when not building a shared library */
|
||||||
|
/* #undef CURL_STATICLIB */
|
||||||
|
|
||||||
|
/* Set to explicitly specify we don't want to use thread-safe functions */
|
||||||
|
/* #undef DISABLED_THREADSAFE */
|
||||||
|
|
||||||
|
/* your Entropy Gathering Daemon socket pathname */
|
||||||
|
/* #undef EGD_SOCKET */
|
||||||
|
|
||||||
|
/* Define if you want to enable IPv6 support */
|
||||||
|
#define ENABLE_IPV6 1
|
||||||
|
|
||||||
|
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_QUAL_ARG1 const
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||||
|
|
||||||
|
/* Define to the type of arg 2 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||||
|
|
||||||
|
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_TYPE_ARG46 socklen_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 7 for getnameinfo. */
|
||||||
|
#define GETNAMEINFO_TYPE_ARG7 int
|
||||||
|
|
||||||
|
/* Specifies the number of arguments to getservbyport_r */
|
||||||
|
/* #undef GETSERVBYPORT_R_ARGS */
|
||||||
|
|
||||||
|
/* Specifies the size of the buffer to pass to getservbyport_r */
|
||||||
|
/* #undef GETSERVBYPORT_R_BUFSIZE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the alarm function. */
|
||||||
|
#define HAVE_ALARM 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <alloca.h> header file. */
|
||||||
|
#define HAVE_ALLOCA_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||||
|
#define HAVE_ARPA_INET_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <arpa/tftp.h> header file. */
|
||||||
|
#define HAVE_ARPA_TFTP_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <assert.h> header file. */
|
||||||
|
#define HAVE_ASSERT_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `basename' function. */
|
||||||
|
#define HAVE_BASENAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if bool is an available type. */
|
||||||
|
#define HAVE_BOOL_T 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
||||||
|
/* #undef HAVE_CLOCK_GETTIME_MONOTONIC */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `closesocket' function. */
|
||||||
|
/* #undef HAVE_CLOSESOCKET */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
|
||||||
|
/* #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <crypto.h> header file. */
|
||||||
|
/* #undef HAVE_CRYPTO_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <des.h> header file. */
|
||||||
|
/* #undef HAVE_DES_H */
|
||||||
|
|
||||||
|
/* disabled non-blocking sockets */
|
||||||
|
/* #undef HAVE_DISABLED_NONBLOCKING */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
|
#define HAVE_DLFCN_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
|
||||||
|
/* #undef HAVE_ENGINE_LOAD_BUILTIN_ENGINES */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <errno.h> header file. */
|
||||||
|
#define HAVE_ERRNO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <err.h> header file. */
|
||||||
|
/* #undef HAVE_ERR_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||||
|
#define HAVE_FCNTL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the fdopen function. */
|
||||||
|
#define HAVE_FDOPEN 1
|
||||||
|
|
||||||
|
/* use FIONBIO for non-blocking sockets */
|
||||||
|
/* #undef HAVE_FIONBIO */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `fork' function. */
|
||||||
|
#define HAVE_FORK 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the freeaddrinfo function. */
|
||||||
|
#define HAVE_FREEADDRINFO 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the freeifaddrs function. */
|
||||||
|
#define HAVE_FREEIFADDRS 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ftruncate function. */
|
||||||
|
#define HAVE_FTRUNCATE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working getaddrinfo function. */
|
||||||
|
#define HAVE_GETADDRINFO 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `geteuid' function. */
|
||||||
|
#define HAVE_GETEUID 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `gethostbyaddr' function. */
|
||||||
|
#define HAVE_GETHOSTBYADDR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the gethostbyaddr_r function. */
|
||||||
|
/* #undef HAVE_GETHOSTBYADDR_R */
|
||||||
|
|
||||||
|
/* gethostbyaddr_r() takes 5 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYADDR_R_5 */
|
||||||
|
|
||||||
|
/* gethostbyaddr_r() takes 7 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYADDR_R_7 */
|
||||||
|
|
||||||
|
/* gethostbyaddr_r() takes 8 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYADDR_R_8 */
|
||||||
|
|
||||||
|
/* If you have gethostbyname */
|
||||||
|
#define HAVE_GETHOSTBYNAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the gethostbyname_r function. */
|
||||||
|
/* #undef HAVE_GETHOSTBYNAME_R */
|
||||||
|
|
||||||
|
/* gethostbyname_r() takes 3 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYNAME_R_3 */
|
||||||
|
|
||||||
|
/* gethostbyname_r() takes 5 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYNAME_R_5 */
|
||||||
|
|
||||||
|
/* gethostbyname_r() takes 6 args */
|
||||||
|
/* #undef HAVE_GETHOSTBYNAME_R_6 */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the gethostname function. */
|
||||||
|
#define HAVE_GETHOSTNAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working getifaddrs function. */
|
||||||
|
#define HAVE_GETIFADDRS 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the getnameinfo function. */
|
||||||
|
#define HAVE_GETNAMEINFO 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getpass_r' function. */
|
||||||
|
/* #undef HAVE_GETPASS_R */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getppid' function. */
|
||||||
|
#define HAVE_GETPPID 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getprotobyname' function. */
|
||||||
|
#define HAVE_GETPROTOBYNAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getpwuid' function. */
|
||||||
|
#define HAVE_GETPWUID 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `getrlimit' function. */
|
||||||
|
#define HAVE_GETRLIMIT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the getservbyport_r function. */
|
||||||
|
/* #undef HAVE_GETSERVBYPORT_R */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `gettimeofday' function. */
|
||||||
|
#define HAVE_GETTIMEOFDAY 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working glibc-style strerror_r function. */
|
||||||
|
/* #undef HAVE_GLIBC_STRERROR_R */
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working gmtime_r function. */
|
||||||
|
#define HAVE_GMTIME_R 1
|
||||||
|
|
||||||
|
/* if you have the gssapi libraries */
|
||||||
|
/* #undef HAVE_GSSAPI */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
|
||||||
|
/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
|
||||||
|
/* #undef HAVE_GSSAPI_GSSAPI_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
|
||||||
|
/* #undef HAVE_GSSAPI_GSSAPI_KRB5_H */
|
||||||
|
|
||||||
|
/* if you have the GNU gssapi libraries */
|
||||||
|
/* #undef HAVE_GSSGNU */
|
||||||
|
|
||||||
|
/* if you have the Heimdal gssapi libraries */
|
||||||
|
/* #undef HAVE_GSSHEIMDAL */
|
||||||
|
|
||||||
|
/* if you have the MIT gssapi libraries */
|
||||||
|
/* #undef HAVE_GSSMIT */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `idna_strerror' function. */
|
||||||
|
/* #undef HAVE_IDNA_STRERROR */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `idn_free' function. */
|
||||||
|
/* #undef HAVE_IDN_FREE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <idn-free.h> header file. */
|
||||||
|
/* #undef HAVE_IDN_FREE_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||||
|
#define HAVE_IFADDRS_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `inet_addr' function. */
|
||||||
|
#define HAVE_INET_ADDR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the inet_ntoa_r function. */
|
||||||
|
/* #undef HAVE_INET_NTOA_R */
|
||||||
|
|
||||||
|
/* inet_ntoa_r() takes 2 args */
|
||||||
|
/* #undef HAVE_INET_NTOA_R_2 */
|
||||||
|
|
||||||
|
/* inet_ntoa_r() takes 3 args */
|
||||||
|
/* #undef HAVE_INET_NTOA_R_3 */
|
||||||
|
|
||||||
|
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||||
|
/* #undef HAVE_INET_NTOP */
|
||||||
|
|
||||||
|
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||||
|
/* #undef HAVE_INET_PTON */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
|
#define HAVE_INTTYPES_H 1
|
||||||
|
|
||||||
|
/* use ioctlsocket() for non-blocking sockets */
|
||||||
|
/* #undef HAVE_IOCTLSOCKET */
|
||||||
|
|
||||||
|
/* use Ioctlsocket() for non-blocking sockets */
|
||||||
|
/* #undef HAVE_IOCTLSOCKET_CASE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <io.h> header file. */
|
||||||
|
/* #undef HAVE_IO_H */
|
||||||
|
|
||||||
|
/* if you have the Kerberos4 libraries (including -ldes) */
|
||||||
|
/* #undef HAVE_KRB4 */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
|
||||||
|
/* #undef HAVE_KRB_GET_OUR_IP_FOR_REALM */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <krb.h> header file. */
|
||||||
|
/* #undef HAVE_KRB_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the lber.h header file. */
|
||||||
|
/* #undef HAVE_LBER_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ldapssl.h header file. */
|
||||||
|
/* #undef HAVE_LDAPSSL_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ldap.h header file. */
|
||||||
|
/* #undef HAVE_LDAP_H */
|
||||||
|
|
||||||
|
/* Use LDAPS implementation */
|
||||||
|
/* #undef HAVE_LDAP_SSL */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ldap_ssl.h header file. */
|
||||||
|
/* #undef HAVE_LDAP_SSL_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ldap_url_parse' function. */
|
||||||
|
/* #undef HAVE_LDAP_URL_PARSE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <libgen.h> header file. */
|
||||||
|
#define HAVE_LIBGEN_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `idn' library (-lidn). */
|
||||||
|
/* #undef HAVE_LIBIDN */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||||
|
/* #undef HAVE_LIBRESOLV */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `resolve' library (-lresolve). */
|
||||||
|
/* #undef HAVE_LIBRESOLVE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||||
|
/* #undef HAVE_LIBSOCKET */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ssh2' library (-lssh2). */
|
||||||
|
/* #undef HAVE_LIBSSH2 */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <libssh2.h> header file. */
|
||||||
|
/* #undef HAVE_LIBSSH2_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||||
|
/* #undef HAVE_LIBSSL */
|
||||||
|
|
||||||
|
/* if zlib is available */
|
||||||
|
/* #undef HAVE_LIBZ */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <limits.h> header file. */
|
||||||
|
#define HAVE_LIMITS_H 1
|
||||||
|
|
||||||
|
/* if your compiler supports LL */
|
||||||
|
#define HAVE_LL 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <locale.h> header file. */
|
||||||
|
#define HAVE_LOCALE_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working localtime_r function. */
|
||||||
|
#define HAVE_LOCALTIME_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if the compiler supports the 'long long' data type. */
|
||||||
|
#define HAVE_LONGLONG 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the malloc.h header file. */
|
||||||
|
/* #undef HAVE_MALLOC_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the MSG_NOSIGNAL flag. */
|
||||||
|
/* #undef HAVE_MSG_NOSIGNAL */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <netdb.h> header file. */
|
||||||
|
#define HAVE_NETDB_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||||
|
#define HAVE_NETINET_IN_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||||
|
#define HAVE_NETINET_TCP_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <net/if.h> header file. */
|
||||||
|
#define HAVE_NET_IF_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if NI_WITHSCOPEID exists and works. */
|
||||||
|
/* #undef HAVE_NI_WITHSCOPEID */
|
||||||
|
|
||||||
|
/* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE
|
||||||
|
*/
|
||||||
|
/* #undef HAVE_OLD_GSSMIT */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/crypto.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_CRYPTO_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/engine.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_ENGINE_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/err.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_ERR_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/pem.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_PEM_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/pkcs12.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_PKCS12_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/rsa.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_RSA_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/ssl.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_SSL_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <openssl/x509.h> header file. */
|
||||||
|
/* #undef HAVE_OPENSSL_X509_H */
|
||||||
|
|
||||||
|
/* use O_NONBLOCK for non-blocking sockets */
|
||||||
|
#define HAVE_O_NONBLOCK 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <pem.h> header file. */
|
||||||
|
/* #undef HAVE_PEM_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `perror' function. */
|
||||||
|
#define HAVE_PERROR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `pipe' function. */
|
||||||
|
#define HAVE_PIPE 1
|
||||||
|
|
||||||
|
/* if you have the function PK11_CreateGenericObject */
|
||||||
|
/* #undef HAVE_PK11_CREATEGENERICOBJECT */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `poll' function. */
|
||||||
|
#define HAVE_POLL 1
|
||||||
|
|
||||||
|
/* If you have a fine poll */
|
||||||
|
/* #undef HAVE_POLL_FINE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <poll.h> header file. */
|
||||||
|
#define HAVE_POLL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have a working POSIX-style strerror_r function. */
|
||||||
|
#define HAVE_POSIX_STRERROR_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <pwd.h> header file. */
|
||||||
|
#define HAVE_PWD_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `RAND_egd' function. */
|
||||||
|
/* #undef HAVE_RAND_EGD */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `RAND_screen' function. */
|
||||||
|
/* #undef HAVE_RAND_SCREEN */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `RAND_status' function. */
|
||||||
|
/* #undef HAVE_RAND_STATUS */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the recv function. */
|
||||||
|
#define HAVE_RECV 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the recvfrom function. */
|
||||||
|
#define HAVE_RECVFROM 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <rsa.h> header file. */
|
||||||
|
/* #undef HAVE_RSA_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the select function. */
|
||||||
|
#define HAVE_SELECT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the send function. */
|
||||||
|
#define HAVE_SEND 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||||
|
#define HAVE_SETJMP_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `setlocale' function. */
|
||||||
|
#define HAVE_SETLOCALE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `setmode' function. */
|
||||||
|
#define HAVE_SETMODE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `setrlimit' function. */
|
||||||
|
#define HAVE_SETRLIMIT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||||
|
#define HAVE_SGTTY_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the sigaction function. */
|
||||||
|
#define HAVE_SIGACTION 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the siginterrupt function. */
|
||||||
|
#define HAVE_SIGINTERRUPT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the signal function. */
|
||||||
|
#define HAVE_SIGNAL 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <signal.h> header file. */
|
||||||
|
#define HAVE_SIGNAL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the sigsetjmp function or macro. */
|
||||||
|
#define HAVE_SIGSETJMP 1
|
||||||
|
|
||||||
|
/* Define to 1 if sig_atomic_t is an available typedef. */
|
||||||
|
#define HAVE_SIG_ATOMIC_T 1
|
||||||
|
|
||||||
|
/* Define to 1 if sig_atomic_t is already defined as volatile. */
|
||||||
|
/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `socket' function. */
|
||||||
|
#define HAVE_SOCKET 1
|
||||||
|
|
||||||
|
/* use SO_NONBLOCK for non-blocking sockets */
|
||||||
|
/* #undef HAVE_SO_NONBLOCK */
|
||||||
|
|
||||||
|
/* Define this if you have the SPNEGO library fbopenssl */
|
||||||
|
/* #undef HAVE_SPNEGO */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `SSL_get_shutdown' function. */
|
||||||
|
/* #undef HAVE_SSL_GET_SHUTDOWN */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <ssl.h> header file. */
|
||||||
|
/* #undef HAVE_SSL_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||||
|
#define HAVE_STDBOOL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
|
#define HAVE_STDINT_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdio.h> header file. */
|
||||||
|
#define HAVE_STDIO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#define HAVE_STDLIB_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strcasecmp function. */
|
||||||
|
#define HAVE_STRCASECMP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strcasestr function. */
|
||||||
|
#define HAVE_STRCASESTR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strcmpi function. */
|
||||||
|
/* #undef HAVE_STRCMPI */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strdup function. */
|
||||||
|
#define HAVE_STRDUP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strerror_r function. */
|
||||||
|
#define HAVE_STRERROR_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the stricmp function. */
|
||||||
|
/* #undef HAVE_STRICMP */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
|
#define HAVE_STRINGS_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strlcat function. */
|
||||||
|
#define HAVE_STRLCAT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strlcpy' function. */
|
||||||
|
/* #undef HAVE_STRLCPY */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strncasecmp function. */
|
||||||
|
#define HAVE_STRNCASECMP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strncmpi function. */
|
||||||
|
/* #undef HAVE_STRNCMPI */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strnicmp function. */
|
||||||
|
/* #undef HAVE_STRNICMP */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strstr function. */
|
||||||
|
#define HAVE_STRSTR 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strtok_r function. */
|
||||||
|
#define HAVE_STRTOK_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the strtoll function. */
|
||||||
|
#define HAVE_STRTOLL 1
|
||||||
|
|
||||||
|
/* if struct sockaddr_storage is defined */
|
||||||
|
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the timeval struct. */
|
||||||
|
#define HAVE_STRUCT_TIMEVAL 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/filio.h> header file. */
|
||||||
|
#define HAVE_SYS_FILIO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||||
|
#define HAVE_SYS_IOCTL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||||
|
#define HAVE_SYS_PARAM_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||||
|
#define HAVE_SYS_POLL_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||||
|
#define HAVE_SYS_RESOURCE_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||||
|
#define HAVE_SYS_SELECT_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||||
|
#define HAVE_SYS_SOCKET_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/sockio.h> header file. */
|
||||||
|
#define HAVE_SYS_SOCKIO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
|
#define HAVE_SYS_STAT_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||||
|
#define HAVE_SYS_TIME_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
|
#define HAVE_SYS_TYPES_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/uio.h> header file. */
|
||||||
|
#define HAVE_SYS_UIO_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/un.h> header file. */
|
||||||
|
#define HAVE_SYS_UN_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_UTIME_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <termios.h> header file. */
|
||||||
|
#define HAVE_TERMIOS_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <termio.h> header file. */
|
||||||
|
/* #undef HAVE_TERMIO_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <time.h> header file. */
|
||||||
|
#define HAVE_TIME_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <tld.h> header file. */
|
||||||
|
/* #undef HAVE_TLD_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `tld_strerror' function. */
|
||||||
|
/* #undef HAVE_TLD_STRERROR */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `uname' function. */
|
||||||
|
#define HAVE_UNAME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
|
#define HAVE_UNISTD_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `utime' function. */
|
||||||
|
#define HAVE_UTIME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <utime.h> header file. */
|
||||||
|
#define HAVE_UTIME_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if compiler supports C99 variadic macro style. */
|
||||||
|
#define HAVE_VARIADIC_MACROS_C99 1
|
||||||
|
|
||||||
|
/* Define to 1 if compiler supports old gcc variadic macro style. */
|
||||||
|
#define HAVE_VARIADIC_MACROS_GCC 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the winber.h header file. */
|
||||||
|
/* #undef HAVE_WINBER_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the windows.h header file. */
|
||||||
|
/* #undef HAVE_WINDOWS_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the winldap.h header file. */
|
||||||
|
/* #undef HAVE_WINLDAP_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the winsock2.h header file. */
|
||||||
|
/* #undef HAVE_WINSOCK2_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the winsock.h header file. */
|
||||||
|
/* #undef HAVE_WINSOCK_H */
|
||||||
|
|
||||||
|
/* Define this symbol if your OS supports changing the contents of argv */
|
||||||
|
#define HAVE_WRITABLE_ARGV 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the writev function. */
|
||||||
|
#define HAVE_WRITEV 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ws2tcpip.h header file. */
|
||||||
|
/* #undef HAVE_WS2TCPIP_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <x509.h> header file. */
|
||||||
|
/* #undef HAVE_X509_H */
|
||||||
|
|
||||||
|
/* if you have the zlib.h header file */
|
||||||
|
/* #undef HAVE_ZLIB_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you are building a native Windows target. */
|
||||||
|
/* #undef NATIVE_WINDOWS */
|
||||||
|
|
||||||
|
/* If you lack a fine basename() prototype */
|
||||||
|
/* #undef NEED_BASENAME_PROTO */
|
||||||
|
|
||||||
|
/* Define to 1 if you need the lber.h header file even with ldap.h */
|
||||||
|
/* #undef NEED_LBER_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you need the malloc.h header file even with stdlib.h */
|
||||||
|
/* #undef NEED_MALLOC_H */
|
||||||
|
|
||||||
|
/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
|
||||||
|
/* #undef NEED_REENTRANT */
|
||||||
|
|
||||||
|
/* cpu-machine-OS */
|
||||||
|
#define OS "i386-apple-darwin13.0.0"
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#define PACKAGE "curl"
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#define PACKAGE_NAME "curl"
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#define PACKAGE_STRING "curl -"
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#define PACKAGE_TARNAME "curl"
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#define PACKAGE_VERSION "-"
|
||||||
|
|
||||||
|
/* a suitable file to read random data from */
|
||||||
|
/* #undef RANDOM_FILE */
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG1 int
|
||||||
|
|
||||||
|
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG2 void
|
||||||
|
|
||||||
|
/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
|
||||||
|
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||||
|
|
||||||
|
/* Define to the type of arg 3 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG3 size_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 4 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG4 int
|
||||||
|
|
||||||
|
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||||
|
|
||||||
|
/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
|
||||||
|
/* #undef RECVFROM_TYPE_ARG5_IS_VOID */
|
||||||
|
|
||||||
|
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_ARG6 socklen_t
|
||||||
|
|
||||||
|
/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
|
||||||
|
/* #undef RECVFROM_TYPE_ARG6_IS_VOID */
|
||||||
|
|
||||||
|
/* Define to the function return type for recvfrom. */
|
||||||
|
#define RECVFROM_TYPE_RETV ssize_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for recv. */
|
||||||
|
#define RECV_TYPE_ARG1 int
|
||||||
|
|
||||||
|
/* Define to the type of arg 2 for recv. */
|
||||||
|
#define RECV_TYPE_ARG2 void *
|
||||||
|
|
||||||
|
/* Define to the type of arg 3 for recv. */
|
||||||
|
#define RECV_TYPE_ARG3 size_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 4 for recv. */
|
||||||
|
#define RECV_TYPE_ARG4 int
|
||||||
|
|
||||||
|
/* Define to the function return type for recv. */
|
||||||
|
#define RECV_TYPE_RETV ssize_t
|
||||||
|
|
||||||
|
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||||
|
#define RETSIGTYPE void
|
||||||
|
|
||||||
|
/* Define to the type qualifier of arg 5 for select. */
|
||||||
|
#define SELECT_QUAL_ARG5
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for select. */
|
||||||
|
#define SELECT_TYPE_ARG1 int
|
||||||
|
|
||||||
|
/* Define to the type of args 2, 3 and 4 for select. */
|
||||||
|
#define SELECT_TYPE_ARG234 fd_set *
|
||||||
|
|
||||||
|
/* Define to the type of arg 5 for select. */
|
||||||
|
#define SELECT_TYPE_ARG5 struct timeval *
|
||||||
|
|
||||||
|
/* Define to the function return type for select. */
|
||||||
|
#define SELECT_TYPE_RETV int
|
||||||
|
|
||||||
|
/* Define to the type qualifier of arg 2 for send. */
|
||||||
|
#define SEND_QUAL_ARG2 const
|
||||||
|
|
||||||
|
/* Define to the type of arg 1 for send. */
|
||||||
|
#define SEND_TYPE_ARG1 int
|
||||||
|
|
||||||
|
/* Define to the type of arg 2 for send. */
|
||||||
|
#define SEND_TYPE_ARG2 void *
|
||||||
|
|
||||||
|
/* Define to the type of arg 3 for send. */
|
||||||
|
#define SEND_TYPE_ARG3 size_t
|
||||||
|
|
||||||
|
/* Define to the type of arg 4 for send. */
|
||||||
|
#define SEND_TYPE_ARG4 int
|
||||||
|
|
||||||
|
/* Define to the function return type for send. */
|
||||||
|
#define SEND_TYPE_RETV ssize_t
|
||||||
|
|
||||||
|
/* The size of `int', as computed by sizeof. */
|
||||||
|
#define SIZEOF_INT 4
|
||||||
|
|
||||||
|
/* The size of `long', as computed by sizeof. */
|
||||||
|
#define SIZEOF_LONG 4
|
||||||
|
|
||||||
|
/* The size of `off_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_OFF_T 8
|
||||||
|
|
||||||
|
/* The size of `size_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_SIZE_T 4
|
||||||
|
|
||||||
|
/* The size of `time_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_TIME_T 4
|
||||||
|
|
||||||
|
/* The size of `void*', as computed by sizeof. */
|
||||||
|
#define SIZEOF_VOIDP 4
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
|
#define STDC_HEADERS 1
|
||||||
|
|
||||||
|
/* Define to the type of arg 3 for strerror_r. */
|
||||||
|
#define STRERROR_R_TYPE_ARG3 size_t
|
||||||
|
|
||||||
|
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||||
|
#define TIME_WITH_SYS_TIME 1
|
||||||
|
|
||||||
|
/* Define if you want to enable c-ares support */
|
||||||
|
/* #undef USE_ARES */
|
||||||
|
|
||||||
|
/* if GnuTLS is enabled */
|
||||||
|
/* #undef USE_GNUTLS */
|
||||||
|
|
||||||
|
/* if libSSH2 is in use */
|
||||||
|
/* #undef USE_LIBSSH2 */
|
||||||
|
|
||||||
|
/* If you want to build curl with the built-in manual */
|
||||||
|
#define USE_MANUAL 1
|
||||||
|
|
||||||
|
/* if NSS is enabled */
|
||||||
|
/* #undef USE_NSS */
|
||||||
|
|
||||||
|
/* if OpenSSL is in use */
|
||||||
|
/* #undef USE_OPENSSL */
|
||||||
|
|
||||||
|
/* if SSL is enabled */
|
||||||
|
/* #undef USE_SSLEAY */
|
||||||
|
|
||||||
|
/* Define to 1 if you are building a Windows target without large file
|
||||||
|
support. */
|
||||||
|
/* #undef USE_WIN32_LARGE_FILES */
|
||||||
|
|
||||||
|
/* to enable SSPI support */
|
||||||
|
/* #undef USE_WINDOWS_SSPI */
|
||||||
|
|
||||||
|
/* Define to 1 if using yaSSL in OpenSSL compatibility mode. */
|
||||||
|
/* #undef USE_YASSLEMUL */
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#define VERSION "7.19.2"
|
||||||
|
|
||||||
|
/* Define to avoid automatic inclusion of winsock.h */
|
||||||
|
/* #undef WIN32_LEAN_AND_MEAN */
|
||||||
|
|
||||||
|
/* Define to 1 if OS is AIX. */
|
||||||
|
#ifndef _ALL_SOURCE
|
||||||
|
/* # undef _ALL_SOURCE */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||||
|
/* #undef _FILE_OFFSET_BITS */
|
||||||
|
|
||||||
|
/* Define for large files, on AIX-style hosts. */
|
||||||
|
/* #undef _LARGE_FILES */
|
||||||
|
|
||||||
|
/* define this if you need it to compile thread-safe code */
|
||||||
|
/* #undef _THREAD_SAFE */
|
||||||
|
|
||||||
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
|
/* #undef const */
|
||||||
|
|
||||||
|
/* Type to use in place of in_addr_t when system does not provide it. */
|
||||||
|
/* #undef in_addr_t */
|
||||||
|
|
||||||
|
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||||
|
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||||
|
#ifndef __cplusplus
|
||||||
|
/* #undef inline */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||||
|
/* #undef size_t */
|
||||||
|
|
||||||
|
/* Type to use in place of socklen_t when system does not provide it. */
|
||||||
|
/* #undef socklen_t */
|
||||||
|
|
||||||
|
/* the signed version of size_t */
|
||||||
|
/* #undef ssize_t */
|
||||||
@@ -48,6 +48,12 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
# include "config-sm-linux.h"
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
# include "config-sm-mac.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(macintosh) && defined(__MRC__)
|
#if defined(macintosh) && defined(__MRC__)
|
||||||
# include "config-mac.h"
|
# include "config-mac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#ifndef HAVE_STRLCAT
|
#ifndef HAVE_STRLCAT
|
||||||
#define strlcat(x,y,z) Curl_strlcat(x,y,z)
|
#define strlcat(x,y,z) Curl_strlcat(x,y,z)
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(BUILTIN_STRLCAT)
|
||||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,6 +18,18 @@ bool WebForm::AddString(const char *name, const char *data)
|
|||||||
return lastError == CURL_FORMADD_OK;
|
return lastError == CURL_FORMADD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WebForm::AddFile(const char *name, const char *path)
|
||||||
|
{
|
||||||
|
lastError = curl_formadd(&first,
|
||||||
|
&last,
|
||||||
|
CURLFORM_COPYNAME,
|
||||||
|
name,
|
||||||
|
CURLFORM_FILE,
|
||||||
|
path,
|
||||||
|
CURLFORM_END);
|
||||||
|
return lastError == CURL_FORMADD_OK;
|
||||||
|
}
|
||||||
|
|
||||||
curl_httppost *WebForm::GetFormData()
|
curl_httppost *WebForm::GetFormData()
|
||||||
{
|
{
|
||||||
return first;
|
return first;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public:
|
|||||||
~WebForm();
|
~WebForm();
|
||||||
public:
|
public:
|
||||||
bool AddString(const char *name, const char *data);
|
bool AddString(const char *name, const char *data);
|
||||||
|
bool AddFile(const char *name, const char *path);
|
||||||
public:
|
public:
|
||||||
curl_httppost *GetFormData();
|
curl_httppost *GetFormData();
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ void CurlExt::SDK_OnUnload()
|
|||||||
|
|
||||||
const char *CurlExt::GetExtensionVerString()
|
const char *CurlExt::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *CurlExt::GetExtensionDateString()
|
const char *CurlExt::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -1,15 +1,15 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
compiler = SM.DefaultExtCompiler('extensions/geoip')
|
import os
|
||||||
|
|
||||||
extension = AMBuild.AddJob('geoip.ext')
|
binary = SM.ExtLibrary(builder, 'geoip.ext')
|
||||||
binary = Cpp.LibraryBuilder('geoip.ext', AMBuild, extension, compiler)
|
if builder.target_platform == 'windows':
|
||||||
binary.AddSourceFiles('extensions/geoip', [
|
binary.compiler.postlink += ['wsock32.lib']
|
||||||
|
|
||||||
|
binary.sources += [
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
'GeoIP.c',
|
'GeoIP.c',
|
||||||
'sdk/smsdk_ext.cpp'
|
'sdk/smsdk_ext.cpp'
|
||||||
])
|
]
|
||||||
if AMBuild.target['platform'] == 'windows':
|
|
||||||
binary['POSTLINKFLAGS'].append('wsock32.lib')
|
SM.extensions += [builder.Add(binary)]
|
||||||
SM.AutoVersion('extensions/geoip', binary)
|
|
||||||
binary.SendToJob()
|
|
||||||
|
|
||||||
|
|||||||
@@ -70,12 +70,12 @@ void GeoIP_Extension::SDK_OnUnload()
|
|||||||
|
|
||||||
const char *GeoIP_Extension::GetExtensionVerString()
|
const char *GeoIP_Extension::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *GeoIP_Extension::GetExtensionDateString()
|
const char *GeoIP_Extension::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************
|
/*******************************
|
||||||
|
|||||||
+21
-24
@@ -1,30 +1,28 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
compiler = SM.DefaultExtCompiler('extensions/mysql')
|
if SM.mysql_root:
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['MYSQL5'], 'include'))
|
binary = SM.ExtLibrary(builder, 'dbi.mysql.ext')
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
binary.compiler.cxxincludes += [
|
||||||
|
os.path.join(SM.mysql_root, 'include'),
|
||||||
|
os.path.join(SM.mms_root, 'core', 'sourcehook')
|
||||||
|
]
|
||||||
|
|
||||||
extension = AMBuild.AddJob('dbi.mysql.ext')
|
if builder.target_platform == 'linux' or builder.target_platform == 'mac':
|
||||||
binary = Cpp.LibraryBuilder('dbi.mysql.ext', AMBuild, extension, compiler)
|
binary.compiler.postlink += [
|
||||||
|
os.path.join(SM.mysql_root, 'lib', 'libmysqlclient_r.a'),
|
||||||
if AMBuild.target['platform'] == 'linux' or AMBuild.target['platform'] == 'darwin':
|
|
||||||
lib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'libmysqlclient_r.a')
|
|
||||||
link = [lib,
|
|
||||||
'-lz',
|
'-lz',
|
||||||
'-lpthread',
|
'-lpthread',
|
||||||
'-lm']
|
'-lm'
|
||||||
binary.RelinkIfNewer(lib)
|
]
|
||||||
binary['POSTLINKFLAGS'].extend(link)
|
elif builder.target_platform == 'windows':
|
||||||
elif AMBuild.target['platform'] == 'windows':
|
binary.compiler.postlink += [
|
||||||
mylib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'opt', 'mysqlclient.lib')
|
os.path.join(SM.mysql_root, 'lib', 'opt', 'mysqlclient.lib'),
|
||||||
zlib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'opt', 'zlib.lib')
|
os.path.join(SM.mysql_root, 'lib', 'opt', 'zlib.lib'),
|
||||||
binary.RelinkIfNewer(mylib)
|
'wsock32.lib'
|
||||||
binary.RelinkIfNewer(zlib)
|
]
|
||||||
binary['POSTLINKFLAGS'].extend([mylib, zlib, 'wsock32.lib'])
|
|
||||||
|
|
||||||
|
binary.sources += [
|
||||||
binary.AddSourceFiles('extensions/mysql', [
|
|
||||||
'sdk/smsdk_ext.cpp',
|
'sdk/smsdk_ext.cpp',
|
||||||
'mysql/MyBasicResults.cpp',
|
'mysql/MyBasicResults.cpp',
|
||||||
'mysql/MyBoundResults.cpp',
|
'mysql/MyBoundResults.cpp',
|
||||||
@@ -32,7 +30,6 @@ binary.AddSourceFiles('extensions/mysql', [
|
|||||||
'mysql/MyDriver.cpp',
|
'mysql/MyDriver.cpp',
|
||||||
'mysql/MyStatement.cpp',
|
'mysql/MyStatement.cpp',
|
||||||
'extension.cpp'
|
'extension.cpp'
|
||||||
])
|
]
|
||||||
SM.AutoVersion('extensions/mysql', binary)
|
SM.extensions += [builder.Add(binary)]
|
||||||
binary.SendToJob()
|
|
||||||
|
|
||||||
|
|||||||
@@ -62,11 +62,11 @@ void DBI_MySQL::SDK_OnUnload()
|
|||||||
|
|
||||||
const char *DBI_MySQL::GetExtensionVerString()
|
const char *DBI_MySQL::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *DBI_MySQL::GetExtensionDateString()
|
const char *DBI_MySQL::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -326,3 +326,8 @@ IDBDriver *MyDatabase::GetDriver()
|
|||||||
{
|
{
|
||||||
return &g_MyDriver;
|
return &g_MyDriver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MyDatabase::SetCharacterSet(const char *characterset)
|
||||||
|
{
|
||||||
|
return mysql_set_character_set(m_mysql, characterset) == 0 ? true : false;
|
||||||
|
}
|
||||||
@@ -62,6 +62,7 @@ public: //IDatabase
|
|||||||
IQuery *DoQueryEx(const char *query, size_t len);
|
IQuery *DoQueryEx(const char *query, size_t len);
|
||||||
unsigned int GetAffectedRowsForQuery(IQuery *query);
|
unsigned int GetAffectedRowsForQuery(IQuery *query);
|
||||||
unsigned int GetInsertIDForQuery(IQuery *query);
|
unsigned int GetInsertIDForQuery(IQuery *query);
|
||||||
|
bool SetCharacterSet(const char *characterset);
|
||||||
public:
|
public:
|
||||||
const DatabaseInfo &GetInfo();
|
const DatabaseInfo &GetInfo();
|
||||||
private:
|
private:
|
||||||
|
|||||||
+16
-19
@@ -1,27 +1,24 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
compiler = SM.DefaultExtCompiler('extensions/regex')
|
binary = SM.ExtLibrary(builder, 'regex.ext')
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
binary.compiler.cxxincludes += [
|
||||||
|
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||||
|
]
|
||||||
|
|
||||||
extension = AMBuild.AddJob('regex.ext')
|
if builder.target_platform == 'linux':
|
||||||
binary = Cpp.LibraryBuilder('regex.ext', AMBuild, extension, compiler)
|
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_linux', 'libpcre.a')
|
||||||
|
elif builder.target_platform == 'windows':
|
||||||
|
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_win', 'pcre.lib')
|
||||||
|
elif builder.target_platform == 'mac':
|
||||||
|
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_darwin', 'libpcre.a')
|
||||||
|
binary.compiler.postlink += [binary.Dep(path)]
|
||||||
|
|
||||||
if AMBuild.target['platform'] == 'linux':
|
binary.sources += [
|
||||||
path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_linux', 'libpcre.a')
|
|
||||||
elif AMBuild.target['platform'] == 'windows':
|
|
||||||
path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_win', 'pcre.lib')
|
|
||||||
elif AMBuild.target['platform'] == 'darwin':
|
|
||||||
path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_darwin', 'libpcre.a')
|
|
||||||
|
|
||||||
binary.RelinkIfNewer(path)
|
|
||||||
binary['POSTLINKFLAGS'].append(path)
|
|
||||||
|
|
||||||
binary.AddSourceFiles('extensions/regex', [
|
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
'CRegEx.cpp',
|
'CRegEx.cpp',
|
||||||
'sdk/smsdk_ext.cpp',
|
'sdk/smsdk_ext.cpp',
|
||||||
])
|
]
|
||||||
SM.AutoVersion('extensions/regex', binary)
|
|
||||||
binary.SendToJob()
|
SM.extensions += [builder.Add(binary)]
|
||||||
|
|
||||||
|
|||||||
@@ -65,12 +65,12 @@ void RegexExtension::SDK_OnUnload()
|
|||||||
|
|
||||||
const char *RegexExtension::GetExtensionVerString()
|
const char *RegexExtension::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *RegexExtension::GetExtensionDateString()
|
const char *RegexExtension::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t CompileRegex(IPluginContext *pCtx, const cell_t *params)
|
static cell_t CompileRegex(IPluginContext *pCtx, const cell_t *params)
|
||||||
|
|||||||
@@ -1,30 +1,21 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
for i in SM.sdkInfo:
|
for sdk_name in SM.sdks:
|
||||||
sdk = SM.sdkInfo[i]
|
sdk = SM.sdks[sdk_name]
|
||||||
if AMBuild.target['platform'] not in sdk['platform']:
|
|
||||||
continue
|
|
||||||
|
|
||||||
compiler = SM.DefaultHL2Compiler('extensions/sdkhooks', i)
|
binary = SM.HL2Library(builder, 'sdkhooks.ext.' + sdk.ext, sdk)
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'game', 'shared'))
|
binary.compiler.cxxincludes += [
|
||||||
|
os.path.join(sdk.path, 'game', 'shared')
|
||||||
|
]
|
||||||
|
if binary.compiler.cxx.behavior == 'gcc':
|
||||||
|
binary.compiler.cxxflags += ['-Wno-invalid-offsetof']
|
||||||
|
|
||||||
if compiler.cc.name == 'gcc' or compiler.cc.name == 'clang':
|
binary.sources += [
|
||||||
compiler['CFLAGS'].append('-Wno-parentheses')
|
|
||||||
compiler['CXXFLAGS'].append('-Wno-invalid-offsetof')
|
|
||||||
|
|
||||||
name = 'sdkhooks.ext.' + sdk['ext']
|
|
||||||
extension = AMBuild.AddJob(name)
|
|
||||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
|
||||||
SM.PreSetupHL2Job(extension, binary, i)
|
|
||||||
binary.AddSourceFiles('extensions/sdkhooks', [
|
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
'natives.cpp',
|
'natives.cpp',
|
||||||
'takedamageinfohack.cpp',
|
'takedamageinfohack.cpp',
|
||||||
'util.cpp',
|
'util.cpp',
|
||||||
'sdk/smsdk_ext.cpp',
|
'sdk/smsdk_ext.cpp',
|
||||||
])
|
]
|
||||||
SM.PostSetupHL2Job(extension, binary, i)
|
SM.extensions += [builder.Add(binary)]
|
||||||
SM.AutoVersion('extensions/sdkhooks', binary)
|
|
||||||
binary.SendToJob()
|
|
||||||
|
|
||||||
|
|||||||
@@ -115,10 +115,32 @@ int g_hookOnLevelInit = 0;
|
|||||||
IForward *g_pOnLevelInit = NULL;
|
IForward *g_pOnLevelInit = NULL;
|
||||||
|
|
||||||
IGameConfig *g_pGameConf = NULL;
|
IGameConfig *g_pGameConf = NULL;
|
||||||
int g_SplineCount = 0;
|
|
||||||
|
|
||||||
char g_szMapEntities[2097152];
|
char g_szMapEntities[2097152];
|
||||||
|
|
||||||
|
CUtlVector<IEntityListener *> *EntListeners()
|
||||||
|
{
|
||||||
|
void *gEntList = gamehelpers->GetGlobalEntityList();
|
||||||
|
if (gEntList)
|
||||||
|
{
|
||||||
|
int offset = -1; /* 65572 */
|
||||||
|
if (g_pGameConf->GetOffset("EntityListeners", &offset))
|
||||||
|
{
|
||||||
|
return (CUtlVector<IEntityListener *> *)((intptr_t) gEntList + offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
void *entListeners;
|
||||||
|
if (g_pGameConf->GetAddress("EntityListenersPtr", &entListeners))
|
||||||
|
{
|
||||||
|
return (CUtlVector<IEntityListener *> *)entListeners;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IServerGameDLL & IVEngineServer Hooks
|
* IServerGameDLL & IVEngineServer Hooks
|
||||||
@@ -149,7 +171,7 @@ SH_DECL_MANUALHOOK0_void(Spawn, 0, 0, 0);
|
|||||||
SH_DECL_MANUALHOOK1_void(StartTouch, 0, 0, 0, CBaseEntity *);
|
SH_DECL_MANUALHOOK1_void(StartTouch, 0, 0, 0, CBaseEntity *);
|
||||||
SH_DECL_MANUALHOOK0_void(Think, 0, 0, 0);
|
SH_DECL_MANUALHOOK0_void(Think, 0, 0, 0);
|
||||||
SH_DECL_MANUALHOOK1_void(Touch, 0, 0, 0, CBaseEntity *);
|
SH_DECL_MANUALHOOK1_void(Touch, 0, 0, 0, CBaseEntity *);
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
|
||||||
SH_DECL_MANUALHOOK4_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *, void *);
|
SH_DECL_MANUALHOOK4_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *, void *);
|
||||||
#else
|
#else
|
||||||
SH_DECL_MANUALHOOK3_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *);
|
SH_DECL_MANUALHOOK3_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *);
|
||||||
@@ -186,6 +208,7 @@ bool SDKHooks::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
sharesys->AddDependency(myself, "bintools.ext", true, true);
|
sharesys->AddDependency(myself, "bintools.ext", true, true);
|
||||||
sharesys->AddNatives(myself, g_Natives);
|
sharesys->AddNatives(myself, g_Natives);
|
||||||
sharesys->RegisterLibrary(myself, "sdkhooks");
|
sharesys->RegisterLibrary(myself, "sdkhooks");
|
||||||
|
sharesys->AddInterface(myself, &g_Interface);
|
||||||
sharesys->AddCapabilityProvider(myself, this, "SDKHook_DmgCustomInOTD");
|
sharesys->AddCapabilityProvider(myself, this, "SDKHook_DmgCustomInOTD");
|
||||||
sharesys->AddCapabilityProvider(myself, this, "SDKHook_LogicalEntSupport");
|
sharesys->AddCapabilityProvider(myself, this, "SDKHook_LogicalEntSupport");
|
||||||
|
|
||||||
@@ -211,22 +234,14 @@ bool SDKHooks::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *gEntList = gamehelpers->GetGlobalEntityList();
|
CUtlVector<IEntityListener *> *entListeners = EntListeners();
|
||||||
if (!gEntList)
|
if (!entListeners)
|
||||||
{
|
{
|
||||||
g_pSM->Format(error, maxlength, "Cannot find gEntList pointer");
|
g_pSM->Format(error, maxlength, "Failed to setup entity listeners");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int offset = -1; /* 65572 */
|
entListeners->AddToTail(this);
|
||||||
if (!g_pGameConf->GetOffset("EntityListeners", &offset))
|
|
||||||
{
|
|
||||||
g_pSM->Format(error, maxlength, "Cannot find EntityListeners offset");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
CUtlVector<IEntityListener *> *pListeners = (CUtlVector<IEntityListener *> *)((intptr_t)gEntList + offset);
|
|
||||||
pListeners->AddToTail(this);
|
|
||||||
|
|
||||||
SetupHooks();
|
SetupHooks();
|
||||||
|
|
||||||
@@ -320,16 +335,8 @@ void SDKHooks::SDK_OnUnload()
|
|||||||
sharesys->DropCapabilityProvider(myself, this, "SDKHook_DmgCustomInOTD");
|
sharesys->DropCapabilityProvider(myself, this, "SDKHook_DmgCustomInOTD");
|
||||||
sharesys->DropCapabilityProvider(myself, this, "SDKHook_LogicalEntSupport");
|
sharesys->DropCapabilityProvider(myself, this, "SDKHook_LogicalEntSupport");
|
||||||
|
|
||||||
void *gEntList = gamehelpers->GetGlobalEntityList();
|
CUtlVector<IEntityListener *> *entListeners = EntListeners();
|
||||||
if (gEntList)
|
entListeners->FindAndRemove(this);
|
||||||
{
|
|
||||||
int offset = -1; /* 65572 */
|
|
||||||
if (g_pGameConf->GetOffset("EntityListeners", &offset))
|
|
||||||
{
|
|
||||||
CUtlVector<IEntityListener *> *pListeners = (CUtlVector<IEntityListener *> *)((intptr_t)gEntList + offset);
|
|
||||||
pListeners->FindAndRemove(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gameconfs->CloseGameConfigFile(g_pGameConf);
|
gameconfs->CloseGameConfigFile(g_pGameConf);
|
||||||
}
|
}
|
||||||
@@ -350,12 +357,12 @@ bool SDKHooks::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
|
|||||||
|
|
||||||
const char *SDKHooks::GetExtensionVerString()
|
const char *SDKHooks::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *SDKHooks::GetExtensionDateString()
|
const char *SDKHooks::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDKHooks::OnPluginLoaded(IPlugin *plugin)
|
void SDKHooks::OnPluginLoaded(IPlugin *plugin)
|
||||||
@@ -392,18 +399,36 @@ void SDKHooks::OnPluginUnloaded(IPlugin *plugin)
|
|||||||
|
|
||||||
void SDKHooks::OnClientPutInServer(int client)
|
void SDKHooks::OnClientPutInServer(int client)
|
||||||
{
|
{
|
||||||
g_pOnEntityCreated->PushCell(client);
|
|
||||||
|
|
||||||
CBaseEntity *pPlayer = gamehelpers->ReferenceToEntity(client);
|
CBaseEntity *pPlayer = gamehelpers->ReferenceToEntity(client);
|
||||||
|
const char *pName = gamehelpers->GetEntityClassname(pPlayer);
|
||||||
|
|
||||||
const char * pName = gamehelpers->GetEntityClassname(pPlayer);
|
// Send OnEntityCreated to SM listeners
|
||||||
|
SourceHook::List<ISMEntityListener *>::iterator iter;
|
||||||
|
ISMEntityListener *pListener = NULL;
|
||||||
|
for (iter=m_EntListeners.begin(); iter!=m_EntListeners.end(); iter++)
|
||||||
|
{
|
||||||
|
pListener = (*iter);
|
||||||
|
pListener->OnEntityCreated(pPlayer, pName ? pName : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call OnEntityCreated forward
|
||||||
|
g_pOnEntityCreated->PushCell(client);
|
||||||
g_pOnEntityCreated->PushString(pName ? pName : "");
|
g_pOnEntityCreated->PushString(pName ? pName : "");
|
||||||
g_pOnEntityCreated->Execute(NULL);
|
g_pOnEntityCreated->Execute(NULL);
|
||||||
|
|
||||||
m_EntityExists.Set(client);
|
m_EntityExists.Set(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SDKHooks::AddEntityListener(ISMEntityListener *listener)
|
||||||
|
{
|
||||||
|
m_EntListeners.push_back(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SDKHooks::RemoveEntityListener(ISMEntityListener *listener)
|
||||||
|
{
|
||||||
|
m_EntListeners.remove(listener);
|
||||||
|
}
|
||||||
|
|
||||||
bool SDKHooks::RegisterConCommandBase(ConCommandBase *pVar)
|
bool SDKHooks::RegisterConCommandBase(ConCommandBase *pVar)
|
||||||
{
|
{
|
||||||
/* Always call META_REGCVAR instead of going through the engine. */
|
/* Always call META_REGCVAR instead of going through the engine. */
|
||||||
@@ -499,20 +524,12 @@ HookReturn SDKHooks::Hook(int entity, SDKHookType type, IPluginFunction *callbac
|
|||||||
if(!g_HookTypes[type].supported)
|
if(!g_HookTypes[type].supported)
|
||||||
return HookRet_NotSupported;
|
return HookRet_NotSupported;
|
||||||
|
|
||||||
CBaseEntity *pEnt = UTIL_GetCBaseEntity(entity);
|
CBaseEntity *pEnt = gamehelpers->ReferenceToEntity(entity);
|
||||||
if(!pEnt)
|
if(!pEnt)
|
||||||
return HookRet_InvalidEntity;
|
return HookRet_InvalidEntity;
|
||||||
if(type < 0 || type >= SDKHook_MAXHOOKS)
|
if(type < 0 || type >= SDKHook_MAXHOOKS)
|
||||||
return HookRet_InvalidHookType;
|
return HookRet_InvalidHookType;
|
||||||
|
|
||||||
#if SOURCE_ENGINE >= SE_CSS
|
|
||||||
if(entity > 0 && entity <= playerhelpers->GetMaxClients())
|
|
||||||
{
|
|
||||||
const char *id = engine->GetPlayerNetworkIDString(PEntityOfEntIndex(entity));
|
|
||||||
g_SplineCount = strlen(id);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!!strcmp(g_HookTypes[type].dtReq, ""))
|
if (!!strcmp(g_HookTypes[type].dtReq, ""))
|
||||||
{
|
{
|
||||||
sm_sendprop_info_t spi;
|
sm_sendprop_info_t spi;
|
||||||
@@ -833,11 +850,19 @@ void SDKHooks::OnEntityCreated(CBaseEntity *pEntity)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *pName = gamehelpers->GetEntityClassname(pEntity);
|
||||||
|
|
||||||
|
// Send OnEntityCreated to SM listeners
|
||||||
|
SourceHook::List<ISMEntityListener *>::iterator iter;
|
||||||
|
ISMEntityListener *pListener = NULL;
|
||||||
|
for (iter=m_EntListeners.begin(); iter!=m_EntListeners.end(); iter++)
|
||||||
|
{
|
||||||
|
pListener = (*iter);
|
||||||
|
pListener->OnEntityCreated(pEntity, pName ? pName : "");
|
||||||
|
}
|
||||||
|
|
||||||
g_pOnEntityCreated->PushCell(gamehelpers->EntityToBCompatRef(pEntity));
|
g_pOnEntityCreated->PushCell(gamehelpers->EntityToBCompatRef(pEntity));
|
||||||
|
|
||||||
const char * pName = gamehelpers->GetEntityClassname(pEntity);
|
|
||||||
g_pOnEntityCreated->PushString(pName ? pName : "");
|
g_pOnEntityCreated->PushString(pName ? pName : "");
|
||||||
|
|
||||||
g_pOnEntityCreated->Execute(NULL);
|
g_pOnEntityCreated->Execute(NULL);
|
||||||
|
|
||||||
m_EntityExists.Set(entity);
|
m_EntityExists.Set(entity);
|
||||||
@@ -957,6 +982,7 @@ int SDKHooks::Hook_GetMaxHealth()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
callback = g_HookList[i].callback;
|
callback = g_HookList[i].callback;
|
||||||
|
callback->PushCell(entity);
|
||||||
callback->PushCellByRef(&new_max);
|
callback->PushCellByRef(&new_max);
|
||||||
callback->Execute(&res);
|
callback->Execute(&res);
|
||||||
}
|
}
|
||||||
@@ -1138,7 +1164,7 @@ bool SDKHooks::Hook_ReloadPost()
|
|||||||
|
|
||||||
callback = g_HookList[i].callback;
|
callback = g_HookList[i].callback;
|
||||||
callback->PushCell(entity);
|
callback->PushCell(entity);
|
||||||
callback->PushCell(META_RESULT_OVERRIDE_RET(bool) ? 1 : 0);
|
callback->PushCell(META_RESULT_ORIG_RET(bool) ? 1 : 0);
|
||||||
callback->Execute(NULL);
|
callback->Execute(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1252,7 +1278,7 @@ void SDKHooks::Hook_TouchPost(CBaseEntity *pOther)
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
|
||||||
void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK)
|
void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK)
|
||||||
#else
|
#else
|
||||||
void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr)
|
void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr)
|
||||||
@@ -1317,7 +1343,7 @@ void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir,
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
|
||||||
void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK)
|
void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK)
|
||||||
#else
|
#else
|
||||||
void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr)
|
void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr)
|
||||||
@@ -1402,6 +1428,15 @@ void SDKHooks::Hook_UsePost(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
|
|||||||
|
|
||||||
void SDKHooks::OnEntityDeleted(CBaseEntity *pEntity)
|
void SDKHooks::OnEntityDeleted(CBaseEntity *pEntity)
|
||||||
{
|
{
|
||||||
|
// Send OnEntityDestroyed to SM listeners
|
||||||
|
SourceHook::List<ISMEntityListener *>::iterator iter;
|
||||||
|
ISMEntityListener *pListener = NULL;
|
||||||
|
for (iter=m_EntListeners.begin(); iter!=m_EntListeners.end(); iter++)
|
||||||
|
{
|
||||||
|
pListener = (*iter);
|
||||||
|
pListener->OnEntityDestroyed(pEntity);
|
||||||
|
}
|
||||||
|
|
||||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||||
|
|
||||||
// Call OnEntityDestroyed forward
|
// Call OnEntityDestroyed forward
|
||||||
@@ -1508,15 +1543,6 @@ void SDKHooks::RemoveEntityHooks(CBaseEntity *pEnt)
|
|||||||
{
|
{
|
||||||
int entity = gamehelpers->EntityToBCompatRef(pEnt);
|
int entity = gamehelpers->EntityToBCompatRef(pEnt);
|
||||||
|
|
||||||
#if SOURCE_ENGINE >= SE_CSS
|
|
||||||
if ((g_SplineCount & (1<<4)) && (g_SplineCount & (1<<2)))
|
|
||||||
{
|
|
||||||
ConVarRef("sv_logflush").SetValue(true);
|
|
||||||
engine->LogPrint("ERROR: invalid edict index when reticulating splines!\n");
|
|
||||||
((ReticulateSplines)g_SplineCount)();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Remove hooks
|
// Remove hooks
|
||||||
HOOKLOOP
|
HOOKLOOP
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
||||||
|
|
||||||
#include "smsdk_ext.h"
|
#include "smsdk_ext.h"
|
||||||
|
#include <ISDKHooks.h>
|
||||||
#include <IBinTools.h>
|
#include <IBinTools.h>
|
||||||
#include <convar.h>
|
#include <convar.h>
|
||||||
|
#include <sh_list.h>
|
||||||
|
|
||||||
#include <iplayerinfo.h>
|
#include <iplayerinfo.h>
|
||||||
#include <shareddefs.h>
|
#include <shareddefs.h>
|
||||||
@@ -19,7 +21,7 @@
|
|||||||
#if SOURCE_ENGINE >= SE_CSS && SOURCE_ENGINE != SE_LEFT4DEAD
|
#if SOURCE_ENGINE >= SE_CSS && SOURCE_ENGINE != SE_LEFT4DEAD
|
||||||
#define GETMAXHEALTH_IS_VIRTUAL
|
#define GETMAXHEALTH_IS_VIRTUAL
|
||||||
#endif
|
#endif
|
||||||
#if SOURCE_ENGINE != SE_ORANGEBOXVALVE && SOURCE_ENGINE != SE_CSS && SOURCE_ENGINE != SE_LEFT4DEAD2 && SOURCE_ENGINE != SE_CSGO
|
#if SOURCE_ENGINE != SE_HL2DM && SOURCE_ENGINE != SE_DODS && SOURCE_ENGINE != SE_CSS && SOURCE_ENGINE != SE_TF2 && SOURCE_ENGINE != SE_LEFT4DEAD2 && SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_NUCLEARDAWN
|
||||||
#define GAMEDESC_CAN_CHANGE
|
#define GAMEDESC_CAN_CHANGE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -120,7 +122,8 @@ class SDKHooks :
|
|||||||
public IPluginsListener,
|
public IPluginsListener,
|
||||||
public IFeatureProvider,
|
public IFeatureProvider,
|
||||||
public IEntityListener,
|
public IEntityListener,
|
||||||
public IClientListener
|
public IClientListener,
|
||||||
|
public ISDKHooks
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@@ -215,6 +218,13 @@ public: // IEntityListener
|
|||||||
public: // IClientListener
|
public: // IClientListener
|
||||||
virtual void OnClientPutInServer(int client);
|
virtual void OnClientPutInServer(int client);
|
||||||
|
|
||||||
|
public: // ISDKHooks
|
||||||
|
virtual void AddEntityListener(ISMEntityListener *listener);
|
||||||
|
virtual void RemoveEntityListener(ISMEntityListener *listener);
|
||||||
|
|
||||||
|
private:
|
||||||
|
SourceHook::List<ISMEntityListener *> m_EntListeners;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Functions
|
* Functions
|
||||||
@@ -264,7 +274,7 @@ public:
|
|||||||
void Hook_ThinkPost();
|
void Hook_ThinkPost();
|
||||||
void Hook_Touch(CBaseEntity *pOther);
|
void Hook_Touch(CBaseEntity *pOther);
|
||||||
void Hook_TouchPost(CBaseEntity *pOther);
|
void Hook_TouchPost(CBaseEntity *pOther);
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
|
||||||
void Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK);
|
void Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK);
|
||||||
void Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK);
|
void Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -39,17 +39,21 @@
|
|||||||
offset = 0; \
|
offset = 0; \
|
||||||
g_pGameConf->GetOffset(#gamedataname, &offset); \
|
g_pGameConf->GetOffset(#gamedataname, &offset); \
|
||||||
if (offset > 0) \
|
if (offset > 0) \
|
||||||
|
{ \
|
||||||
SH_MANUALHOOK_RECONFIGURE(gamedataname, offset, 0, 0); \
|
SH_MANUALHOOK_RECONFIGURE(gamedataname, offset, 0, 0); \
|
||||||
SET_PRE_##supportsPre(gamedataname) \
|
SET_PRE_##supportsPre(gamedataname) \
|
||||||
SET_POST_##supportsPost(gamedataname)
|
SET_POST_##supportsPost(gamedataname) \
|
||||||
|
}
|
||||||
|
|
||||||
#define CHECKOFFSET_W(gamedataname, supportsPre, supportsPost) \
|
#define CHECKOFFSET_W(gamedataname, supportsPre, supportsPost) \
|
||||||
offset = 0; \
|
offset = 0; \
|
||||||
g_pGameConf->GetOffset("Weapon_"#gamedataname, &offset); \
|
g_pGameConf->GetOffset("Weapon_"#gamedataname, &offset); \
|
||||||
if (offset > 0) \
|
if (offset > 0) \
|
||||||
|
{ \
|
||||||
SH_MANUALHOOK_RECONFIGURE(Weapon_##gamedataname, offset, 0, 0); \
|
SH_MANUALHOOK_RECONFIGURE(Weapon_##gamedataname, offset, 0, 0); \
|
||||||
SET_PRE_##supportsPre(Weapon##gamedataname) \
|
SET_PRE_##supportsPre(Weapon##gamedataname) \
|
||||||
SET_POST_##supportsPost(Weapon##gamedataname)
|
SET_POST_##supportsPost(Weapon##gamedataname) \
|
||||||
|
}
|
||||||
|
|
||||||
#define HOOKLOOP \
|
#define HOOKLOOP \
|
||||||
for(int i = g_HookList.Count() - 1; i >= 0; i--)
|
for(int i = g_HookList.Count() - 1; i >= 0; i--)
|
||||||
|
|||||||
@@ -1300,6 +1300,7 @@
|
|||||||
<ClCompile Include="..\sdk\smsdk_ext.cpp" />
|
<ClCompile Include="..\sdk\smsdk_ext.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\..\public\extensions\ISDKHooks.h" />
|
||||||
<ClInclude Include="..\extension.h" />
|
<ClInclude Include="..\extension.h" />
|
||||||
<ClInclude Include="..\macros.h" />
|
<ClInclude Include="..\macros.h" />
|
||||||
<ClInclude Include="..\natives.h" />
|
<ClInclude Include="..\natives.h" />
|
||||||
|
|||||||
@@ -56,6 +56,9 @@
|
|||||||
<ClInclude Include="..\sdk\smsdk_ext.h">
|
<ClInclude Include="..\sdk\smsdk_ext.h">
|
||||||
<Filter>SourceMod SDK</Filter>
|
<Filter>SourceMod SDK</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\..\public\extensions\ISDKHooks.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="..\version.rc">
|
<ResourceCompile Include="..\version.rc">
|
||||||
|
|||||||
@@ -57,11 +57,21 @@ cell_t Native_Hook(IPluginContext *pContext, const cell_t *params)
|
|||||||
pContext->ThrowNativeError("Hook type not supported on this game");
|
pContext->ThrowNativeError("Hook type not supported on this game");
|
||||||
break;
|
break;
|
||||||
case HookRet_BadEntForHookType:
|
case HookRet_BadEntForHookType:
|
||||||
pContext->ThrowNativeError("Hook type not valid for this type of entity (%s)",
|
{
|
||||||
PEntityOfEntIndex(gamehelpers->ReferenceToIndex(params[1]))->GetClassName()
|
CBaseEntity *pEnt = gamehelpers->ReferenceToEntity(params[1]);
|
||||||
);
|
const char *pClassname = pEnt ? gamehelpers->GetEntityClassname(pEnt) : NULL;
|
||||||
|
if (!pClassname)
|
||||||
|
{
|
||||||
|
pContext->ThrowNativeError("Hook type not valid for this type of entity (%i).", entity);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pContext->ThrowNativeError("Hook type not valid for this type of entity (%i/%s)", entity, pClassname);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -99,38 +109,45 @@ cell_t Native_TakeDamage(IPluginContext *pContext, const cell_t *params)
|
|||||||
#if !defined SH_DECL_MANUALEXTERN1
|
#if !defined SH_DECL_MANUALEXTERN1
|
||||||
pContext->ThrowNativeError("SDKHooks_TakeDamage is not supported on this engine.");
|
pContext->ThrowNativeError("SDKHooks_TakeDamage is not supported on this engine.");
|
||||||
#else
|
#else
|
||||||
CBaseEntity *pVictim = UTIL_GetCBaseEntity(params[1]);
|
CBaseEntity *pVictim = gamehelpers->ReferenceToEntity(params[1]);
|
||||||
if (!pVictim)
|
if (!pVictim)
|
||||||
return pContext->ThrowNativeError("Invalid entity index %d for victim", params[1]);
|
return pContext->ThrowNativeError("Invalid entity index %d for victim", params[1]);
|
||||||
|
|
||||||
CBaseEntity *pInflictor = UTIL_GetCBaseEntity(params[2]);
|
CBaseEntity *pInflictor = gamehelpers->ReferenceToEntity(params[2]);
|
||||||
if (!pInflictor)
|
if (!pInflictor)
|
||||||
return pContext->ThrowNativeError("Invalid entity index %d for inflictor", params[2]);
|
return pContext->ThrowNativeError("Invalid entity index %d for inflictor", params[2]);
|
||||||
|
|
||||||
CBaseEntity *pAttacker = NULL;
|
CBaseEntity *pAttacker;
|
||||||
if (params[3] != -1)
|
if (params[3] != -1)
|
||||||
{
|
{
|
||||||
pAttacker = UTIL_GetCBaseEntity(params[3]);
|
pAttacker = gamehelpers->ReferenceToEntity(params[3]);
|
||||||
if (!pAttacker)
|
if (!pAttacker)
|
||||||
{
|
{
|
||||||
return pContext->ThrowNativeError("Invalid entity index %d for attackerr", params[3]);
|
return pContext->ThrowNativeError("Invalid entity index %d for attackerr", params[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pAttacker = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
float flDamage = sp_ctof(params[4]);
|
float flDamage = sp_ctof(params[4]);
|
||||||
int iDamageType = params[5];
|
int iDamageType = params[5];
|
||||||
|
|
||||||
CBaseEntity *pWeapon = NULL;
|
CBaseEntity *pWeapon;
|
||||||
if (params[6] != -1)
|
if (params[6] != -1)
|
||||||
{
|
{
|
||||||
pAttacker = UTIL_GetCBaseEntity(params[6]);
|
pWeapon = gamehelpers->ReferenceToEntity(params[6]);
|
||||||
if (!pAttacker)
|
if (!pWeapon)
|
||||||
{
|
{
|
||||||
return pContext->ThrowNativeError("Invalid entity index %d for weapon", params[6]);
|
return pContext->ThrowNativeError("Invalid entity index %d for weapon", params[6]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pWeapon = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
Vector vecDamageForce = Vector(0.0f, 0.0f, 0.0f);
|
|
||||||
cell_t *addr;
|
cell_t *addr;
|
||||||
int err;
|
int err;
|
||||||
if ((err = pContext->LocalToPhysAddr(params[7], &addr)) != SP_ERROR_NONE)
|
if ((err = pContext->LocalToPhysAddr(params[7], &addr)) != SP_ERROR_NONE)
|
||||||
@@ -138,26 +155,29 @@ cell_t Native_TakeDamage(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Could not read damageForce vector");
|
return pContext->ThrowNativeError("Could not read damageForce vector");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector vecDamageForce;
|
||||||
if (addr != pContext->GetNullRef(SP_NULL_VECTOR))
|
if (addr != pContext->GetNullRef(SP_NULL_VECTOR))
|
||||||
{
|
{
|
||||||
vecDamageForce = Vector(
|
vecDamageForce.Init(sp_ctof(addr[0]), sp_ctof(addr[1]), sp_ctof(addr[2]));
|
||||||
sp_ctof(addr[0]),
|
}
|
||||||
sp_ctof(addr[1]),
|
else
|
||||||
sp_ctof(addr[2]));
|
{
|
||||||
|
vecDamageForce.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector vecDamagePosition = vec3_origin;
|
|
||||||
if ((err = pContext->LocalToPhysAddr(params[8], &addr)) != SP_ERROR_NONE)
|
if ((err = pContext->LocalToPhysAddr(params[8], &addr)) != SP_ERROR_NONE)
|
||||||
{
|
{
|
||||||
return pContext->ThrowNativeError("Could not read damagePosition vector");
|
return pContext->ThrowNativeError("Could not read damagePosition vector");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector vecDamagePosition;
|
||||||
if (addr != pContext->GetNullRef(SP_NULL_VECTOR))
|
if (addr != pContext->GetNullRef(SP_NULL_VECTOR))
|
||||||
{
|
{
|
||||||
vecDamagePosition = Vector(
|
vecDamagePosition.Init(sp_ctof(addr[0]), sp_ctof(addr[1]), sp_ctof(addr[2]));
|
||||||
sp_ctof(addr[0]),
|
}
|
||||||
sp_ctof(addr[1]),
|
else
|
||||||
sp_ctof(addr[2]));
|
{
|
||||||
|
vecDamagePosition = vec3_origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
CTakeDamageInfoHack info(pInflictor, pAttacker, flDamage, iDamageType, pWeapon, vecDamageForce, vecDamagePosition);
|
CTakeDamageInfoHack info(pInflictor, pAttacker, flDamage, iDamageType, pWeapon, vecDamageForce, vecDamagePosition);
|
||||||
@@ -173,11 +193,15 @@ cell_t Native_DropWeapon(IPluginContext *pContext, const cell_t *params)
|
|||||||
#if !defined SH_DECL_MANUALEXTERN1
|
#if !defined SH_DECL_MANUALEXTERN1
|
||||||
pContext->ThrowNativeError("SDKHooks_DropWeapon is not supported on this engine.");
|
pContext->ThrowNativeError("SDKHooks_DropWeapon is not supported on this engine.");
|
||||||
#else
|
#else
|
||||||
CBaseEntity *pPlayer = UTIL_GetCBaseEntity(params[1], true);
|
CBaseEntity *pPlayer = gamehelpers->ReferenceToEntity(params[1]);
|
||||||
if (!pPlayer)
|
if (!pPlayer)
|
||||||
return pContext->ThrowNativeError("Invalid client index %d", params[1]);
|
return pContext->ThrowNativeError("Invalid client index %d", params[1]);
|
||||||
|
|
||||||
CBaseEntity *pWeapon = UTIL_GetCBaseEntity(params[2]);
|
IGamePlayer *pGamePlayer = playerhelpers->GetGamePlayer(gamehelpers->ReferenceToIndex(params[1]));
|
||||||
|
if (!pGamePlayer || !pGamePlayer->IsInGame())
|
||||||
|
return pContext->ThrowNativeError("Client index %d not in game", params[1]);
|
||||||
|
|
||||||
|
CBaseEntity *pWeapon = gamehelpers->ReferenceToEntity(params[2]);
|
||||||
if (!pWeapon)
|
if (!pWeapon)
|
||||||
return pContext->ThrowNativeError("Invalid entity index %d for weapon", params[2]);
|
return pContext->ThrowNativeError("Invalid entity index %d for weapon", params[2]);
|
||||||
|
|
||||||
|
|||||||
@@ -62,10 +62,17 @@ CTakeDamageInfoHack::CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity *
|
|||||||
m_vecReportedPosition = vec3_origin;
|
m_vecReportedPosition = vec3_origin;
|
||||||
m_iAmmoType = -1;
|
m_iAmmoType = -1;
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||||
|
m_iCustomKillType = 0;
|
||||||
|
#else
|
||||||
|
m_iDamageCustom = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2
|
||||||
m_iDamagedOtherPlayers = 0;
|
m_iDamagedOtherPlayers = 0;
|
||||||
m_iPlayerPenetrateCount = 0;
|
m_iPlayerPenetrationCount = 0;
|
||||||
m_flUnknown = 0.0f;
|
m_flDamageBonus = 0.0f;
|
||||||
|
m_bForceFriendlyFire = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOURCE_ENGINE >= SE_ALIENSWARM
|
#if SOURCE_ENGINE >= SE_ALIENSWARM
|
||||||
|
|||||||
@@ -34,36 +34,6 @@
|
|||||||
#include "extension.h"
|
#include "extension.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
CBaseEntity *UTIL_GetCBaseEntity(int num, bool onlyPlayers)
|
|
||||||
{
|
|
||||||
edict_t *pEdict = PEntityOfEntIndex(num);
|
|
||||||
if (!pEdict || pEdict->IsFree())
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (num > 0 && num <= playerhelpers->GetMaxClients())
|
|
||||||
{
|
|
||||||
IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(pEdict);
|
|
||||||
if (!pPlayer || !pPlayer->IsConnected())
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (onlyPlayers)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
IServerUnknown *pUnk;
|
|
||||||
if ((pUnk=pEdict->GetUnknown()) == NULL)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pUnk->GetBaseEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UTIL_FindDataTable(SendTable *pTable,
|
bool UTIL_FindDataTable(SendTable *pTable,
|
||||||
const char *name,
|
const char *name,
|
||||||
sm_sendprop_info_t *info,
|
sm_sendprop_info_t *info,
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include <compat_wrappers.h>
|
#include <compat_wrappers.h>
|
||||||
|
|
||||||
CBaseEntity *UTIL_GetCBaseEntity(int num, bool onlyPlayers=false);
|
|
||||||
bool UTIL_FindDataTable(SendTable *pTable, const char *name, sm_sendprop_info_t *info, unsigned int offset);
|
bool UTIL_FindDataTable(SendTable *pTable, const char *name, sm_sendprop_info_t *info, unsigned int offset);
|
||||||
|
|
||||||
#endif //_INCLUDE_TF2TOOLS_UTIL_H_
|
#endif //_INCLUDE_TF2TOOLS_UTIL_H_
|
||||||
|
|||||||
@@ -1,27 +1,23 @@
|
|||||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
for i in SM.sdkInfo:
|
for sdk_name in SM.sdks:
|
||||||
sdk = SM.sdkInfo[i]
|
sdk = SM.sdks[sdk_name]
|
||||||
if AMBuild.target['platform'] not in sdk['platform']:
|
|
||||||
continue
|
|
||||||
|
|
||||||
compiler = SM.DefaultHL2Compiler('extensions/sdktools', i)
|
binary = SM.HL2Library(builder, 'sdktools.ext.' + sdk.ext, sdk)
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit'))
|
binary.compiler.cxxincludes += [
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit', 'x86'))
|
os.path.join(sdk.path, 'game', 'shared'),
|
||||||
|
os.path.join(builder.sourcePath, 'public', 'jit'),
|
||||||
|
os.path.join(builder.sourcePath, 'public', 'jit', 'x86'),
|
||||||
|
]
|
||||||
|
|
||||||
if compiler.cc.name == 'gcc' or compiler.cc.name == 'clang':
|
if sdk.name != 'ep1':
|
||||||
compiler['CFLAGS'].append('-Wno-parentheses')
|
binary.compiler.defines += ['HOOKING_ENABLED']
|
||||||
compiler['CXXFLAGS'].append('-Wno-invalid-offsetof')
|
|
||||||
|
|
||||||
if i != 'ep1':
|
if binary.compiler.cxx.behavior == 'gcc':
|
||||||
compiler['CDEFINES'].append('HOOKING_ENABLED')
|
binary.compiler.cxxflags += ['-Wno-invalid-offsetof']
|
||||||
|
|
||||||
name = 'sdktools.ext.' + sdk['ext']
|
binary.sources += [
|
||||||
extension = AMBuild.AddJob(name)
|
|
||||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
|
||||||
SM.PreSetupHL2Job(extension, binary, i)
|
|
||||||
binary.AddSourceFiles('extensions/sdktools', [
|
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
'inputnatives.cpp',
|
'inputnatives.cpp',
|
||||||
'output.cpp',
|
'output.cpp',
|
||||||
@@ -45,8 +41,5 @@ for i in SM.sdkInfo:
|
|||||||
'CDetour/detours.cpp',
|
'CDetour/detours.cpp',
|
||||||
'sdk/smsdk_ext.cpp',
|
'sdk/smsdk_ext.cpp',
|
||||||
'asm/asm.c'
|
'asm/asm.c'
|
||||||
])
|
]
|
||||||
SM.PostSetupHL2Job(extension, binary, i)
|
SM.extensions += [builder.Add(binary)]
|
||||||
SM.AutoVersion('extensions/sdktools', binary)
|
|
||||||
binary.SendToJob()
|
|
||||||
|
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ void* eval_jump(void* src) {
|
|||||||
else if (addr[0] == OP_JMP_BYTE) {
|
else if (addr[0] == OP_JMP_BYTE) {
|
||||||
addr = &addr[OP_JMP_BYTE_SIZE] + *(char*)&addr[1];
|
addr = &addr[OP_JMP_BYTE_SIZE] + *(char*)&addr[1];
|
||||||
//mangled 32bit jump?
|
//mangled 32bit jump?
|
||||||
if (addr[0] = OP_JMP) {
|
if (addr[0] == OP_JMP) {
|
||||||
addr = addr + *(int*)&addr[1];
|
addr = addr + *(int*)&addr[1];
|
||||||
}
|
}
|
||||||
return addr;
|
return addr;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "gamerulesnatives.h"
|
#include "gamerulesnatives.h"
|
||||||
#include <ISDKTools.h>
|
#include <ISDKTools.h>
|
||||||
#include "clientnatives.h"
|
#include "clientnatives.h"
|
||||||
|
#include "teamnatives.h"
|
||||||
/**
|
/**
|
||||||
* @file extension.cpp
|
* @file extension.cpp
|
||||||
* @brief Implements SDK Tools extension code.
|
* @brief Implements SDK Tools extension code.
|
||||||
@@ -279,6 +280,12 @@ void SDKTools::SDK_OnAllLoaded()
|
|||||||
InitializeValveGlobals();
|
InitializeValveGlobals();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SDKTools::OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
|
||||||
|
{
|
||||||
|
InitTeamNatives();
|
||||||
|
GetResourceEntity();
|
||||||
|
}
|
||||||
|
|
||||||
bool SDKTools::QueryRunning(char *error, size_t maxlength)
|
bool SDKTools::QueryRunning(char *error, size_t maxlength)
|
||||||
{
|
{
|
||||||
SM_CHECK_IFACE(BINTOOLS, g_pBinTools);
|
SM_CHECK_IFACE(BINTOOLS, g_pBinTools);
|
||||||
@@ -428,12 +435,12 @@ bool SDKTools::ProcessCommandTarget(cmd_target_info_t *info)
|
|||||||
|
|
||||||
const char *SDKTools::GetExtensionVerString()
|
const char *SDKTools::GetExtensionVerString()
|
||||||
{
|
{
|
||||||
return SM_VERSION_STRING;
|
return SOURCEMOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *SDKTools::GetExtensionDateString()
|
const char *SDKTools::GetExtensionDateString()
|
||||||
{
|
{
|
||||||
return SM_BUILD_TIMESTAMP;
|
return SOURCEMOD_BUILD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDKTools::OnClientPutInServer(int client)
|
void SDKTools::OnClientPutInServer(int client)
|
||||||
|
|||||||
@@ -135,8 +135,6 @@ extern ICallWrapper *g_pAcceptInput;
|
|||||||
extern SourceHook::CallClass<IVEngineServer> *enginePatch;
|
extern SourceHook::CallClass<IVEngineServer> *enginePatch;
|
||||||
extern SourceHook::CallClass<IEngineSound> *enginesoundPatch;
|
extern SourceHook::CallClass<IEngineSound> *enginesoundPatch;
|
||||||
|
|
||||||
extern const char *tools_GetTeamName(int team);
|
|
||||||
|
|
||||||
#include <compat_wrappers.h>
|
#include <compat_wrappers.h>
|
||||||
|
|
||||||
#define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func)
|
#define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func)
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ static cell_t GameRules_GetProp(IPluginContext *pContext, const cell_t *params)
|
|||||||
is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
|
is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
|
||||||
|
|
||||||
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
||||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
|
||||||
if (pProp->GetFlags() & SPROP_VARINT)
|
if (pProp->GetFlags() & SPROP_VARINT)
|
||||||
{
|
{
|
||||||
bit_count = sizeof(int) * 8;
|
bit_count = sizeof(int) * 8;
|
||||||
@@ -243,8 +243,7 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
FIND_PROP_SEND(DPT_Int, "integer");
|
FIND_PROP_SEND(DPT_Int, "integer");
|
||||||
|
|
||||||
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
|
||||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
|
|
||||||
if (pProp->GetFlags() & SPROP_VARINT)
|
if (pProp->GetFlags() & SPROP_VARINT)
|
||||||
{
|
{
|
||||||
bit_count = sizeof(int) * 8;
|
bit_count = sizeof(int) * 8;
|
||||||
|
|||||||
@@ -53,6 +53,11 @@ void CHookManager::Initialize()
|
|||||||
SH_MANUALHOOK_RECONFIGURE(PlayerRunCmdHook, offset, 0, 0);
|
SH_MANUALHOOK_RECONFIGURE(PlayerRunCmdHook, offset, 0, 0);
|
||||||
PRCH_enabled = true;
|
PRCH_enabled = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_pSM->LogError(myself, "Failed to find PlayerRunCmd offset - OnPlayerRunCmd forward disabled.");
|
||||||
|
PRCH_enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
plsys->AddPluginsListener(this);
|
plsys->AddPluginsListener(this);
|
||||||
sharesys->AddCapabilityProvider(myself, this, FEATURECAP_PLAYERRUNCMD_11PARAMS);
|
sharesys->AddCapabilityProvider(myself, this, FEATURECAP_PLAYERRUNCMD_11PARAMS);
|
||||||
|
|||||||
@@ -1325,6 +1325,7 @@
|
|||||||
<ClInclude Include="..\hooks.h" />
|
<ClInclude Include="..\hooks.h" />
|
||||||
<ClInclude Include="..\..\..\public\extensions\ISDKTools.h" />
|
<ClInclude Include="..\..\..\public\extensions\ISDKTools.h" />
|
||||||
<ClInclude Include="..\output.h" />
|
<ClInclude Include="..\output.h" />
|
||||||
|
<ClInclude Include="..\teamnatives.h" />
|
||||||
<ClInclude Include="..\tempents.h" />
|
<ClInclude Include="..\tempents.h" />
|
||||||
<ClInclude Include="..\vcallbuilder.h" />
|
<ClInclude Include="..\vcallbuilder.h" />
|
||||||
<ClInclude Include="..\vdecoder.h" />
|
<ClInclude Include="..\vdecoder.h" />
|
||||||
|
|||||||
@@ -137,6 +137,9 @@
|
|||||||
<ClInclude Include="..\clientnatives.h">
|
<ClInclude Include="..\clientnatives.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\teamnatives.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="..\version.rc">
|
<ResourceCompile Include="..\version.rc">
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "extension.h"
|
#include "extension.h"
|
||||||
|
#include "vhelpers.h"
|
||||||
#include <sh_vector.h>
|
#include <sh_vector.h>
|
||||||
|
|
||||||
struct TeamInfo
|
struct TeamInfo
|
||||||
@@ -42,36 +43,13 @@ const char *m_iScore;
|
|||||||
|
|
||||||
SourceHook::CVector<TeamInfo> g_Teams;
|
SourceHook::CVector<TeamInfo> g_Teams;
|
||||||
|
|
||||||
bool FindTeamEntities(SendTable *pTable, const char *name)
|
void InitTeamNatives()
|
||||||
{
|
|
||||||
if (strcmp(pTable->GetName(), name) == 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int props = pTable->GetNumProps();
|
|
||||||
SendProp *prop;
|
|
||||||
|
|
||||||
for (int i=0; i<props; i++)
|
|
||||||
{
|
|
||||||
prop = pTable->GetProp(i);
|
|
||||||
if (prop->GetDataTable())
|
|
||||||
{
|
|
||||||
if (FindTeamEntities(prop->GetDataTable(), name))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDKTools::OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
|
|
||||||
{
|
{
|
||||||
g_Teams.clear();
|
g_Teams.clear();
|
||||||
g_Teams.resize(1);
|
g_Teams.resize(1);
|
||||||
|
|
||||||
|
int edictCount = gpGlobals->maxEntities;
|
||||||
|
|
||||||
for (int i=0; i<edictCount; i++)
|
for (int i=0; i<edictCount; i++)
|
||||||
{
|
{
|
||||||
edict_t *pEdict = PEntityOfEntIndex(i);
|
edict_t *pEdict = PEntityOfEntIndex(i);
|
||||||
@@ -85,7 +63,7 @@ void SDKTools::OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax
|
|||||||
}
|
}
|
||||||
|
|
||||||
ServerClass *pClass = pEdict->GetNetworkable()->GetServerClass();
|
ServerClass *pClass = pEdict->GetNetworkable()->GetServerClass();
|
||||||
if (FindTeamEntities(pClass->m_pTable, "DT_Team"))
|
if (FindNestedDataTable(pClass->m_pTable, "DT_Team"))
|
||||||
{
|
{
|
||||||
SendProp *pTeamNumProp = g_pGameHelpers->FindInSendTable(pClass->GetName(), "m_iTeamNum");
|
SendProp *pTeamNumProp = g_pGameHelpers->FindInSendTable(pClass->GetName(), "m_iTeamNum");
|
||||||
|
|
||||||
@@ -186,6 +164,11 @@ static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
|
static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
|
if (!g_pSM->IsMapRunning())
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Cannot set team score when no map is running");
|
||||||
|
}
|
||||||
|
|
||||||
int teamindex = params[1];
|
int teamindex = params[1];
|
||||||
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
|
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* vim: set ts=4 :
|
||||||
|
* =============================================================================
|
||||||
|
* SourceMod SDKTools 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_TEAMNATIVES_H_
|
||||||
|
#define _INCLUDE_SOURCEMOD_TEAMNATIVES_H_
|
||||||
|
|
||||||
|
void InitTeamNatives();
|
||||||
|
|
||||||
|
extern const char *tools_GetTeamName(int team);
|
||||||
|
|
||||||
|
#endif //_INCLUDE_SOURCEMOD_TEAMNATIVES_H_
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user