Add Planet CRC utility

This commit is contained in:
Alec Harley
2022-05-08 19:38:52 -07:00
parent 3273a39c65
commit e682e19939
2 changed files with 23 additions and 0 deletions

View File

@@ -397,6 +397,13 @@
</exec>
</target>
<!-- Creates the Planet CRC file -->
<target name="build_planet_crc" description="creates the planet crc file" depends="compile_tab">
<exec executable="utils/build_planet_crc_string_tables.py" dir="${basedir}">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
</exec>
</target>
<!-- Creates SQL (insert statements) to get all the CRC Templates into the database -->
<target name="process_templates" description="generates sql from generated crc files" depends="build_object_template_crc,build_quest_crc">
<exec executable="perl" dir="${basedir}/src/game/server/database/templates" input="${object_crc_file}" output="${templates_sql_file}">

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python
from os import path, makedirs
from subprocess import PIPE, Popen
inputfile = './dsrc/sku.0/sys.shared/compiled/game/misc/planet_crc_string_table.txt'
ifffile = './data/sku.0/sys.shared/compiled/game/misc/planet_crc_string_table.iff'
if not path.exists(path.dirname(ifffile)):
makedirs(path.dirname(ifffile))
crc_call = ['./tools/buildCrcStringTable.pl', ifffile, inputfile]
p = Popen(crc_call, stdin=PIPE, stdout=PIPE)
p.communicate()