Abort world server startup when any deed or rune file fails to parse
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ad476db166
commit
7309159f83
3 files changed
+16
-4
No files matched your search
+6
@@ -30,6 +30,7 @@ public class RuneParser {
|
||||
File[] runeFiles = CacheParserUtil.listJsonFiles(runePath);
|
||||
int templateId;
|
||||
JSONObject runeJson;
|
||||
int failedCount = 0;
|
||||
|
||||
for (File runeFile : runeFiles) {
|
||||
try {
|
||||
@@ -38,11 +39,16 @@ public class RuneParser {
|
||||
runeTemplates.put(templateId, parseRuneEntry(templateId, runeJson));
|
||||
} catch (Exception e) {
|
||||
Logger.error(runeFile.getName() + ": " + e);
|
||||
failedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
Logger.info("Loaded " + runeTemplates.size() + " of " + runeFiles.length + " rune templates");
|
||||
|
||||
// Partial rune data is never usable; null tells the caller to abort
|
||||
if (failedCount > 0)
|
||||
return null;
|
||||
|
||||
return runeTemplates;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user