2014-02-08 21:46:34 +00:00
|
|
|
# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
|
|
|
|
import os
|
|
|
|
|
|
|
|
builder.SetBuildFolder('packages')
|
|
|
|
|
|
|
|
ModPackages = {
|
|
|
|
'cstrike': 'cstrike',
|
2014-02-08 22:29:15 +00:00
|
|
|
'dod': 'dod',
|
2014-02-08 21:46:34 +00:00
|
|
|
'esf': 'esf',
|
|
|
|
'ns': 'ns',
|
|
|
|
'tfc': 'tfc',
|
|
|
|
'tfcx': 'tfc',
|
|
|
|
'ts': 'ts',
|
|
|
|
}
|
|
|
|
|
|
|
|
folder_list = [
|
2014-08-04 19:40:01 +00:00
|
|
|
'base/addons/amxmodx',
|
2014-02-08 22:29:15 +00:00
|
|
|
'base/addons/amxmodx/configs',
|
|
|
|
'base/addons/amxmodx/data',
|
|
|
|
'base/addons/amxmodx/data/lang',
|
|
|
|
'base/addons/amxmodx/dlls',
|
|
|
|
'base/addons/amxmodx/logs',
|
|
|
|
'base/addons/amxmodx/modules',
|
|
|
|
'base/addons/amxmodx/plugins',
|
|
|
|
'base/addons/amxmodx/scripting',
|
|
|
|
'base/addons/amxmodx/scripting/include',
|
|
|
|
'base/addons/amxmodx/scripting/testsuite',
|
2014-02-08 21:46:34 +00:00
|
|
|
'cstrike/addons/amxmodx/configs',
|
2014-02-08 22:29:15 +00:00
|
|
|
'cstrike/addons/amxmodx/data',
|
2014-02-08 21:46:34 +00:00
|
|
|
'cstrike/addons/amxmodx/plugins',
|
|
|
|
'cstrike/addons/amxmodx/modules',
|
2014-02-08 22:29:15 +00:00
|
|
|
'cstrike/addons/amxmodx/scripting',
|
2014-02-08 21:46:34 +00:00
|
|
|
'dod/addons/amxmodx/configs',
|
2014-02-08 22:29:15 +00:00
|
|
|
'dod/addons/amxmodx/data',
|
2014-02-08 21:46:34 +00:00
|
|
|
'dod/addons/amxmodx/plugins',
|
|
|
|
'dod/addons/amxmodx/modules',
|
2014-02-08 22:29:15 +00:00
|
|
|
'dod/addons/amxmodx/scripting',
|
2014-02-08 21:46:34 +00:00
|
|
|
'esf/addons/amxmodx/configs',
|
|
|
|
'esf/addons/amxmodx/plugins',
|
2014-02-08 22:29:15 +00:00
|
|
|
'esf/addons/amxmodx/scripting',
|
2014-02-08 21:46:34 +00:00
|
|
|
'ns/addons/amxmodx/configs',
|
|
|
|
'ns/addons/amxmodx/plugins',
|
|
|
|
'ns/addons/amxmodx/modules',
|
2014-02-08 22:29:15 +00:00
|
|
|
'ns/addons/amxmodx/scripting',
|
2014-02-08 21:46:34 +00:00
|
|
|
'tfc/addons/amxmodx/configs',
|
2014-02-08 22:29:15 +00:00
|
|
|
'tfc/addons/amxmodx/data',
|
2014-02-08 21:46:34 +00:00
|
|
|
'tfc/addons/amxmodx/plugins',
|
|
|
|
'tfc/addons/amxmodx/modules',
|
2014-02-08 22:29:15 +00:00
|
|
|
'tfc/addons/amxmodx/scripting',
|
2014-02-08 21:46:34 +00:00
|
|
|
'ts/addons/amxmodx/configs',
|
2014-02-08 22:29:15 +00:00
|
|
|
'ts/addons/amxmodx/data',
|
2014-02-08 21:46:34 +00:00
|
|
|
'ts/addons/amxmodx/plugins',
|
|
|
|
'ts/addons/amxmodx/modules',
|
2014-02-08 22:29:15 +00:00
|
|
|
'ts/addons/amxmodx/scripting',
|
2014-02-08 21:46:34 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
def split_all(path):
|
|
|
|
parts = []
|
|
|
|
while True:
|
|
|
|
head, tail = os.path.split(path)
|
|
|
|
if head == path or tail == path:
|
|
|
|
parts.insert(0, path)
|
|
|
|
break
|
|
|
|
path = head
|
|
|
|
parts.insert(0, tail)
|
|
|
|
return parts
|
|
|
|
|
2014-02-10 07:40:45 +00:00
|
|
|
def copy_binary(source, dest):
|
|
|
|
builder.AddCopy(source.binary, dest)
|
|
|
|
|
2014-02-08 21:46:34 +00:00
|
|
|
# Create the distribution folder hierarchy.
|
|
|
|
folder_map = {}
|
|
|
|
for folder in folder_list:
|
|
|
|
norm_folder = os.path.normpath(folder)
|
|
|
|
folder_map[folder] = builder.AddFolder(norm_folder)
|
|
|
|
|
|
|
|
# Copy core dlls.
|
|
|
|
for dll in AMXX.binaries:
|
2014-02-10 07:40:45 +00:00
|
|
|
copy_binary(dll, folder_map['base/addons/amxmodx/dlls'])
|
2014-02-08 21:46:34 +00:00
|
|
|
|
|
|
|
# Copy modules.
|
|
|
|
for module in AMXX.modules:
|
|
|
|
parts = split_all(module.binary.path)
|
|
|
|
if parts[1] in ModPackages:
|
|
|
|
package = ModPackages[parts[1]]
|
|
|
|
else:
|
2014-02-08 22:29:15 +00:00
|
|
|
package = 'base'
|
2014-02-10 07:40:45 +00:00
|
|
|
copy_binary(module, folder_map[package + '/addons/amxmodx/modules'])
|
2014-02-08 21:46:34 +00:00
|
|
|
|
|
|
|
# Copy the compiler.
|
2014-02-08 22:29:15 +00:00
|
|
|
builder.AddCopy(AMXX.amxxpc.binary, folder_map['base/addons/amxmodx/scripting'])
|
|
|
|
builder.AddCopy(AMXX.libpc300.binary, folder_map['base/addons/amxmodx/scripting'])
|
2014-02-08 21:46:34 +00:00
|
|
|
|
|
|
|
# Copy plugins.
|
2014-02-08 22:29:15 +00:00
|
|
|
StatsPlugins = ['csstats.amxx']
|
2014-02-08 21:46:34 +00:00
|
|
|
for amxx_file in AMXX.plugins:
|
|
|
|
amxx_entry = AMXX.plugins[amxx_file]
|
|
|
|
package = os.path.dirname(amxx_file)
|
2014-02-08 22:29:15 +00:00
|
|
|
output_folder = '/addons/amxmodx/plugins'
|
2014-02-08 21:46:34 +00:00
|
|
|
if not len(package):
|
2014-02-08 22:29:15 +00:00
|
|
|
package = 'base'
|
|
|
|
else:
|
|
|
|
# Ugh - statsx plugins go into a random folder.
|
|
|
|
name = os.path.basename(amxx_file)
|
|
|
|
if name == package + 'stats.amxx' or name in StatsPlugins:
|
|
|
|
output_folder = '/addons/amxmodx/data'
|
|
|
|
|
|
|
|
builder.AddCopy(amxx_entry, folder_map[package + output_folder])
|
|
|
|
|
|
|
|
# If it was in a mod package, we can cheat and copy it to scripting since
|
|
|
|
# none of them are multi-file.
|
|
|
|
if package != 'base':
|
|
|
|
base_file, _ = os.path.splitext(os.path.basename(amxx_file))
|
|
|
|
source_file = os.path.join(
|
|
|
|
builder.sourcePath,
|
|
|
|
'plugins',
|
|
|
|
package,
|
|
|
|
base_file + '.sma'
|
|
|
|
)
|
|
|
|
builder.AddCopy(source_file, folder_map[package + '/addons/amxmodx/scripting'])
|
2014-02-08 21:46:34 +00:00
|
|
|
|
2014-02-09 04:37:33 +00:00
|
|
|
# Copy the generated version .inc.
|
|
|
|
for generated_header in AMXX.generated_headers:
|
2014-07-27 09:11:44 +00:00
|
|
|
if 'amxmodx_version.inc' in generated_header.path:
|
2014-02-09 04:37:33 +00:00
|
|
|
builder.AddCopy(generated_header, folder_map['base/addons/amxmodx/scripting/include'])
|
|
|
|
break
|
|
|
|
|
2014-02-09 05:16:41 +00:00
|
|
|
# Copy WinCSX.
|
|
|
|
if builder.target_platform == 'windows':
|
|
|
|
builder.AddCopy(AMXX.csx_app.binary, folder_map['cstrike/addons/amxmodx/data'])
|
|
|
|
|
2014-02-08 21:46:34 +00:00
|
|
|
# Copy configuration files for each mod.
|
|
|
|
configs = [
|
|
|
|
'amxx.cfg',
|
|
|
|
'clcmds.ini',
|
|
|
|
'cmds.ini',
|
|
|
|
'configs.ini',
|
|
|
|
'core.ini',
|
|
|
|
'custommenuitems.cfg',
|
|
|
|
'cvars.ini',
|
|
|
|
'hamdata.ini',
|
|
|
|
'maps.ini',
|
2014-02-08 22:29:15 +00:00
|
|
|
'miscstats.ini',
|
2014-02-08 21:46:34 +00:00
|
|
|
'modules.ini',
|
|
|
|
'plugins.ini',
|
|
|
|
'speech.ini',
|
|
|
|
'sql.cfg',
|
|
|
|
'users.ini',
|
|
|
|
'cstrike/amxx.cfg',
|
|
|
|
'cstrike/cmds.ini',
|
|
|
|
'cstrike/core.ini',
|
|
|
|
'cstrike/cvars.ini',
|
|
|
|
'cstrike/maps.ini',
|
|
|
|
'cstrike/modules.ini',
|
|
|
|
'cstrike/plugins.ini',
|
|
|
|
'cstrike/stats.ini',
|
|
|
|
'dod/core.ini',
|
|
|
|
'dod/cvars.ini',
|
|
|
|
'dod/maps.ini',
|
|
|
|
'dod/modules.ini',
|
|
|
|
'dod/plugins.ini',
|
|
|
|
'esf/modules.ini',
|
|
|
|
'esf/plugins.ini',
|
|
|
|
'ns/amxx.cfg',
|
|
|
|
'ns/clcmds.ini',
|
|
|
|
'ns/cmds.ini',
|
|
|
|
'ns/cvars.ini',
|
|
|
|
'ns/maps.ini',
|
|
|
|
'ns/modules.ini',
|
|
|
|
'ns/plugins.ini',
|
|
|
|
'ns/speech.ini',
|
|
|
|
'ns/users.ini',
|
|
|
|
'tfc/core.ini',
|
|
|
|
'tfc/cvars.ini',
|
|
|
|
'tfc/maps.ini',
|
|
|
|
'tfc/modules.ini',
|
|
|
|
'tfc/plugins.ini',
|
|
|
|
'ts/core.ini',
|
|
|
|
'ts/maps.ini',
|
|
|
|
'ts/modules.ini',
|
|
|
|
'ts/plugins.ini',
|
|
|
|
]
|
|
|
|
for config in configs:
|
|
|
|
cfg_folder, cfg_file = os.path.split(config)
|
|
|
|
if len(cfg_folder):
|
|
|
|
out_folder = cfg_folder + '/addons/amxmodx/configs'
|
|
|
|
else:
|
2014-02-08 22:29:15 +00:00
|
|
|
out_folder = 'base/addons/amxmodx/configs'
|
2014-02-08 21:46:34 +00:00
|
|
|
builder.AddCopy(
|
|
|
|
source = os.path.join(builder.sourcePath, 'configs', config),
|
|
|
|
output_path = folder_map[out_folder]
|
|
|
|
)
|
|
|
|
|
|
|
|
# Copy core scripting files.
|
|
|
|
scripting_files = [
|
|
|
|
'admin.sma',
|
|
|
|
'adminchat.sma',
|
|
|
|
'admincmd.sma',
|
|
|
|
'adminhelp.sma',
|
|
|
|
'adminslots.sma',
|
|
|
|
'adminvote.sma',
|
|
|
|
'antiflood.sma',
|
|
|
|
'cmdmenu.sma',
|
|
|
|
'imessage.sma',
|
|
|
|
'mapchooser.sma',
|
|
|
|
'mapsmenu.sma',
|
|
|
|
'menufront.sma',
|
|
|
|
'multilingual.sma',
|
|
|
|
'nextmap.sma',
|
|
|
|
'pausecfg.sma',
|
|
|
|
'plmenu.sma',
|
|
|
|
'scrollmsg.sma',
|
|
|
|
'statscfg.sma',
|
|
|
|
'telemenu.sma',
|
|
|
|
'timeleft.sma',
|
|
|
|
'pluginmenu.sma',
|
|
|
|
'testsuite/admins_test.sma',
|
|
|
|
'testsuite/arraytest.sma',
|
|
|
|
'testsuite/callfunc_test.sma',
|
2014-04-12 18:33:55 +00:00
|
|
|
'testsuite/datapack_test.sma',
|
2014-02-08 21:46:34 +00:00
|
|
|
'testsuite/fakemeta_tests.sma',
|
|
|
|
'testsuite/fmttest.sma',
|
|
|
|
'testsuite/fwdtest1.sma',
|
|
|
|
'testsuite/fwdtest2.sma',
|
Add new hashers and new natives
Replace the only hasher called MD5 with the ones listed below.
(+) CRC32, MD5, SHA1, SHA256, SHA3 224 BIT, SHA3 256 BIT, SHA3 384 BIT,
SHA3 512 BIT, Keccak 224 BIT, Keccak 256 BIT, Keccak 384 BIT and Keccak
512 BIT.
Add the natives listed below.
(+) hash_string(const string[], hashType:type, output[], const
outputSize)
(+) hash_file(const fileName, hashType:type, output[], const outputSize)
(+) is_arkshine_a_doctor() : Hidden native, but a sign of recompense
for him being very active since 1.8.3 version of AMX Mod X
(+) get_system_endianness() : Checks if the system is currently Big
Endian or Little Endian.
Add the following Enum.
(+) hashType {}
(+) sysEndianness {}
Deprecate the following natives.
(-) amx_md5()
(-) amx_md5_file()
It has been tested on Windows and Linux. The sanity checks seems to be
properly working, so no worries about them.
These are useful if people are using Sockets, cURLs or MySQLs in order
to compare hashes of different files On-line for further investigation.
You are not able to check if the files are older or newer, but you can
see if the content is different (Hash Checksum mismatch).
I'm glad I did this. Thanks to
2015-02-15 06:44:33 +00:00
|
|
|
'testsuite/hashing_test.sma',
|
2014-02-08 21:46:34 +00:00
|
|
|
'testsuite/logtest.sma',
|
|
|
|
'testsuite/menutest.sma',
|
|
|
|
'testsuite/native_test.sma',
|
|
|
|
'testsuite/nvault_test.sma',
|
2014-07-17 09:20:52 +00:00
|
|
|
'testsuite/regex_test.sma',
|
2014-02-08 21:46:34 +00:00
|
|
|
'testsuite/sorttest.sma',
|
2014-02-10 07:40:45 +00:00
|
|
|
'testsuite/strbreak.sma',
|
2014-02-08 21:46:34 +00:00
|
|
|
'testsuite/sqlxtest.sma',
|
|
|
|
'testsuite/sqlxtest.sq3',
|
|
|
|
'testsuite/sqlxtest.sql',
|
|
|
|
'testsuite/trietest.sma',
|
2014-04-30 07:33:03 +00:00
|
|
|
'testsuite/utf8test.sma',
|
2014-07-23 16:51:57 +00:00
|
|
|
'testsuite/stacktest.sma',
|
2014-07-23 09:56:35 +00:00
|
|
|
'testsuite/textparse_test.sma',
|
|
|
|
'testsuite/textparse_test.cfg',
|
|
|
|
'testsuite/textparse_test.ini',
|
2014-02-08 21:46:34 +00:00
|
|
|
'include/amxconst.inc',
|
|
|
|
'include/amxmisc.inc',
|
|
|
|
'include/amxmodx.inc',
|
|
|
|
'include/core.inc',
|
|
|
|
'include/csstats.inc',
|
|
|
|
'include/cstrike.inc',
|
|
|
|
'include/csx.inc',
|
2015-01-16 22:14:15 +00:00
|
|
|
'include/cvars.inc',
|
2014-04-12 18:33:55 +00:00
|
|
|
'include/datapack.inc',
|
2014-02-08 21:46:34 +00:00
|
|
|
'include/dbi.inc',
|
|
|
|
'include/dodconst.inc',
|
|
|
|
'include/dodfun.inc',
|
|
|
|
'include/dodstats.inc',
|
|
|
|
'include/dodx.inc',
|
|
|
|
'include/engine.inc',
|
|
|
|
'include/engine_const.inc',
|
|
|
|
'include/engine_stocks.inc',
|
|
|
|
'include/esf.inc',
|
|
|
|
'include/esf_const.inc',
|
|
|
|
'include/fakemeta.inc',
|
|
|
|
'include/fakemeta_const.inc',
|
|
|
|
'include/fakemeta_stocks.inc',
|
|
|
|
'include/file.inc',
|
|
|
|
'include/float.inc',
|
|
|
|
'include/fun.inc',
|
|
|
|
'include/geoip.inc',
|
|
|
|
'include/lang.inc',
|
|
|
|
'include/ns.inc',
|
|
|
|
'include/ns_const.inc',
|
|
|
|
'include/nvault.inc',
|
|
|
|
'include/regex.inc',
|
|
|
|
'include/sockets.inc',
|
|
|
|
'include/string.inc',
|
|
|
|
'include/tfcconst.inc',
|
|
|
|
'include/tfcstats.inc',
|
|
|
|
'include/tfcx.inc',
|
|
|
|
'include/tsconst.inc',
|
|
|
|
'include/tsfun.inc',
|
|
|
|
'include/tsstats.inc',
|
|
|
|
'include/tsx.inc',
|
|
|
|
'include/vault.inc',
|
|
|
|
'include/xs.inc',
|
|
|
|
'include/cellarray.inc',
|
2014-08-02 16:42:18 +00:00
|
|
|
'include/cellstack.inc',
|
2014-02-08 21:46:34 +00:00
|
|
|
'include/celltrie.inc',
|
|
|
|
'include/fakemeta_util.inc',
|
|
|
|
'include/ham_const.inc',
|
|
|
|
'include/hamsandwich.inc',
|
|
|
|
'include/hlsdk_const.inc',
|
|
|
|
'include/message_const.inc',
|
|
|
|
'include/message_stocks.inc',
|
|
|
|
'include/messages.inc',
|
|
|
|
'include/newmenus.inc',
|
|
|
|
'include/sorting.inc',
|
|
|
|
'include/sqlx.inc',
|
2014-08-03 21:49:53 +00:00
|
|
|
'include/textparse_ini.inc',
|
|
|
|
'include/textparse_smc.inc',
|
2014-02-08 21:46:34 +00:00
|
|
|
'include/time.inc',
|
|
|
|
'include/vector.inc',
|
|
|
|
]
|
|
|
|
for filename in scripting_files:
|
2014-02-08 22:29:15 +00:00
|
|
|
output_folder = 'base/addons/amxmodx/scripting'
|
2014-02-08 21:46:34 +00:00
|
|
|
inner_folder = os.path.dirname(filename)
|
|
|
|
if len(inner_folder):
|
|
|
|
output_folder += '/' + inner_folder
|
|
|
|
builder.AddCopy(
|
|
|
|
source = os.path.join(builder.sourcePath, 'plugins', filename),
|
|
|
|
output_path = folder_map[output_folder]
|
|
|
|
)
|
|
|
|
|
|
|
|
# Copy weird things.
|
|
|
|
weirdfiles = [
|
2015-03-13 13:23:05 +00:00
|
|
|
('modules/geoip/GeoLite2-Country.mmdb', 'base/addons/amxmodx/data'),
|
2014-02-08 22:29:15 +00:00
|
|
|
('plugins/esf/ESF_mod_tutorial.txt', 'esf/addons/amxmodx/scripting'),
|
2014-02-08 21:46:34 +00:00
|
|
|
]
|
|
|
|
|
2014-02-08 22:29:15 +00:00
|
|
|
if builder.target_platform == 'windows':
|
|
|
|
weirdfiles += [
|
|
|
|
('plugins/compile.exe', 'base/addons/amxmodx/scripting'),
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
weirdfiles += [
|
|
|
|
('plugins/compile.sh', 'base/addons/amxmodx/scripting'),
|
|
|
|
]
|
|
|
|
|
2014-02-08 21:46:34 +00:00
|
|
|
for source, dest in weirdfiles:
|
|
|
|
builder.AddCopy(
|
|
|
|
source = os.path.join(builder.sourcePath, source),
|
|
|
|
output_path = folder_map[dest]
|
|
|
|
)
|
|
|
|
|
|
|
|
# Copy language data.
|
|
|
|
datafiles = [
|
|
|
|
'admin.txt',
|
|
|
|
'adminchat.txt',
|
|
|
|
'admincmd.txt',
|
|
|
|
'adminhelp.txt',
|
|
|
|
'adminslots.txt',
|
|
|
|
'adminvote.txt',
|
|
|
|
'antiflood.txt',
|
|
|
|
'cmdmenu.txt',
|
|
|
|
'common.txt',
|
|
|
|
'imessage.txt',
|
|
|
|
'languages.txt',
|
|
|
|
'mapchooser.txt',
|
|
|
|
'mapsmenu.txt',
|
|
|
|
'menufront.txt',
|
|
|
|
'miscstats.txt',
|
|
|
|
'multilingual.txt',
|
|
|
|
'nextmap.txt',
|
|
|
|
'pausecfg.txt',
|
|
|
|
'plmenu.txt',
|
|
|
|
'restmenu.txt',
|
|
|
|
'scrollmsg.txt',
|
|
|
|
'stats_dod.txt',
|
|
|
|
'statscfg.txt',
|
|
|
|
'statsx.txt',
|
|
|
|
'telemenu.txt',
|
|
|
|
'timeleft.txt',
|
|
|
|
'time.txt',
|
|
|
|
]
|
|
|
|
for datafile in datafiles:
|
|
|
|
builder.AddCopy(
|
|
|
|
source = os.path.join(builder.sourcePath, 'plugins', 'lang', datafile),
|
2014-02-08 22:29:15 +00:00
|
|
|
output_path = folder_map['base/addons/amxmodx/data/lang']
|
2014-02-08 21:46:34 +00:00
|
|
|
)
|
2014-08-04 19:40:01 +00:00
|
|
|
|
|
|
|
# Copy license files
|
|
|
|
licenses = [
|
|
|
|
'ACKNOWLEDGEMENTS.txt',
|
|
|
|
'GPLv2.txt',
|
|
|
|
'GPLv3.txt',
|
|
|
|
'LICENSE.txt',
|
|
|
|
]
|
|
|
|
|
|
|
|
for license in licenses:
|
|
|
|
builder.AddCopy(
|
|
|
|
source = os.path.join(builder.sourcePath, 'public', 'licenses', license),
|
|
|
|
output_path = folder_map['base/addons/amxmodx']
|
|
|
|
)
|