mirror of
https://bitbucket.org/seefoe/dockerized-swg.git
synced 2026-01-16 23:04:17 -05:00
45 lines
1.0 KiB
Python
Executable File
45 lines
1.0 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from os import walk, path, makedirs
|
|
from subprocess import PIPE, Popen
|
|
|
|
def read_objects(objectdir):
|
|
files = []
|
|
|
|
for (dirname, dirnames, filenames) in walk(objectdir):
|
|
for filename in filenames:
|
|
filename = filename.replace('.iff', '')
|
|
|
|
objfile = path.join(dirname, filename)
|
|
objfile = objfile.replace("%s/" % objectdir, '')
|
|
|
|
files.append(objfile)
|
|
|
|
return files
|
|
|
|
questlistdir = './data/sku.0/sys.shared/compiled/game/datatables/questlist'
|
|
|
|
allobjs = []
|
|
|
|
allobjs.extend(read_objects(questlistdir))
|
|
|
|
allobjs.sort()
|
|
|
|
tabfile = './dsrc/sku.0/sys.shared/built/game/misc/quest_crc_string_table.tab'
|
|
ifffile = './data/sku.0/sys.shared/built/game/misc/quest_crc_string_table.iff'
|
|
|
|
if not path.exists(path.dirname(tabfile)):
|
|
makedirs(path.dirname(tabfile))
|
|
|
|
if not path.exists(path.dirname(ifffile)):
|
|
makedirs(path.dirname(ifffile))
|
|
|
|
crc_call = ['./utils/tools/buildCrcStringTable.pl', '-t', tabfile, ifffile]
|
|
|
|
p = Popen(crc_call, stdin=PIPE, stdout=PIPE)
|
|
|
|
for obj in allobjs:
|
|
p.stdin.write(obj + '\n')
|
|
|
|
p.communicate()
|