mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-28 23:13:02 +00:00
767809f56a
Mods are now loaded into a table Clients now request a mod list from the server, then download each file one at a time before joining Embedded constants.lua into the program
18 lines
582 B
Python
18 lines
582 B
Python
import os
|
|
|
|
in_filename = os.path.dirname(os.path.realpath(__file__)) + "/lua_constants/constants.lua"
|
|
out_filename = os.path.dirname(os.path.realpath(__file__)) + '/../src/pc/lua/smlua_constants_autogen.c'
|
|
|
|
built = "char gSmluaConstants[] = "
|
|
with open(in_filename) as fp:
|
|
lines = fp.readlines()
|
|
for line in lines:
|
|
if line.startswith('--'):
|
|
continue
|
|
if line.strip() == '':
|
|
continue
|
|
built += '"' + line.replace('\n', '').replace('\r', '') + '\\n"' + "\n"
|
|
built += ';'
|
|
|
|
with open(out_filename, 'w') as out:
|
|
out.write(built)
|