From 3aeef70db88fc107ee86499381d0c272faf492f6 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 30 Jun 2021 09:17:25 +0800 Subject: [PATCH] Wipe packed shard sheets if visual slot table has changed --- nel/tools/build_gamedata/configuration/scripts.py | 14 ++++++++++++++ .../processes/sheets_shard/2_build.py | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/nel/tools/build_gamedata/configuration/scripts.py b/nel/tools/build_gamedata/configuration/scripts.py index 6e885bdd3..00fa8aa00 100755 --- a/nel/tools/build_gamedata/configuration/scripts.py +++ b/nel/tools/build_gamedata/configuration/scripts.py @@ -96,6 +96,20 @@ def needUpdateLogRemoveDest(log, source, dest): printLog(log, "SKIP " + dest) return 0 +def needUpdateLogRemoveDestSilentSkip(log, source, dest): + if (os.path.isfile(source)): + if (os.path.isfile(dest)): + if (os.stat(source).st_mtime > os.stat(dest).st_mtime): + os.remove(dest) + printLog(log, source + " -> " + dest) + return 1 + else: + return 0 + printLog(log, source + " -> " + dest) + return 1 + printLog(log, "MISSING " + source) + return 0 + def copyFileList(log, dir_source, dir_target, files): for fileName in files: if fileName != ".svn" and fileName != ".." and fileName != "." and fileName != "*.*": diff --git a/nel/tools/build_gamedata/processes/sheets_shard/2_build.py b/nel/tools/build_gamedata/processes/sheets_shard/2_build.py index c66de2b28..3cb629b55 100755 --- a/nel/tools/build_gamedata/processes/sheets_shard/2_build.py +++ b/nel/tools/build_gamedata/processes/sheets_shard/2_build.py @@ -57,6 +57,11 @@ else: mkPath(log, ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory) mkPath(log, DataShardDirectory + "/mirror_sheets") # FIXME: Hardcoded path mirror_sheets mkPath(log, ExportBuildDirectory + "/" + SheetsShardBuildDirectory) + # Wipe all sheets older than visual_slot.tab + for p in os.listdir(ExportBuildDirectory + "/" + SheetsShardBuildDirectory): + fp = ExportBuildDirectory + "/" + SheetsShardBuildDirectory + "/" + p + if os.path.isfile(fp) and p.endswith(".packed_sheets"): + needUpdateLogRemoveDestSilentSkip(log, ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory + "/visual_slot.tab", fp) # sheets_packer_shard subprocess.call([ SheetsPackerShard, LeveldesignDirectory, LeveldesignDfnDirectory, DataShardDirectory + "/mirror_sheets", ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory, ExportBuildDirectory + "/" + SheetsShardBuildDirectory ]) printLog(log, "")