Load PromotionClass from the promotion runes instead of static_rune_promotion
LoadAllPromotions builds one PromotionClass per promotion CLASS rune (22, 2504-2526 without 2522) and caches it, then runs the DB loader, which skips cached ids, so only the CSR/admin rows 2901-2911 still come from static_rune_promotion (decision: DB fallback). The world server calls it in place of GET_ALL_PROMOTIONS; the login server now preloads promotions too, so character load there gets the same cached objects. The SQL loader stays until task 2.11. Value changes: Templar 2516 manaMod 14 -> 15 (decision: JSON, D2). description NULL -> rune_dsc blurb (unread). All other fields unchanged; final parity before the switch (scripts/p22.py): 22 promotion rows, 0 differences in name, token, health, stamina and the 163 allowed rune tokens. The static_rune_promotion comparator is removed; it would only compare the JSON with itself now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e91c803a32
commit
957293165b
4 files changed
+21
-50
No files matched your search
-49
@@ -9,17 +9,10 @@
|
||||
package engine.parsers.cache;
|
||||
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.PromotionClass;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
// Dev-only check that compares DB-built objects with the cache JSON before a loader is switched.
|
||||
@@ -35,10 +28,6 @@ public class ParityCheck {
|
||||
private int differenceCount = 0;
|
||||
private int missingCount = 0;
|
||||
|
||||
static {
|
||||
register("static_rune_promotion", ParityCheck::comparePromotionClasses);
|
||||
}
|
||||
|
||||
private ParityCheck(String table) {
|
||||
this.table = table;
|
||||
}
|
||||
@@ -92,42 +81,4 @@ public class ParityCheck {
|
||||
differenceCount++;
|
||||
Logger.warn("Parity: " + table + "/" + id + "/" + field + ": db=" + dbValue + " json=" + jsonValue);
|
||||
}
|
||||
|
||||
private static void comparePromotionClasses(ParityCheck check) {
|
||||
|
||||
ConcurrentHashMap<Integer, AbstractGameObject> cache;
|
||||
PromotionClass promotionClass;
|
||||
PromotionClass jsonClass;
|
||||
RuneTemplate rune;
|
||||
int id;
|
||||
|
||||
cache = DbManager.getMap(mbEnums.GameObjectType.PromotionClass);
|
||||
|
||||
if (cache == null) {
|
||||
Logger.warn("Parity: static_rune_promotion: no PromotionClass objects loaded");
|
||||
return;
|
||||
}
|
||||
|
||||
for (AbstractGameObject cached : cache.values()) {
|
||||
promotionClass = (PromotionClass) cached;
|
||||
id = promotionClass.getObjectUUID();
|
||||
rune = RuneTemplate._runes.get(id);
|
||||
|
||||
// The CSR/admin rows 2901+ are TALENT runes in the JSON, not promotions
|
||||
if (rune != null && !PromotionClass.isPromotionRune(rune))
|
||||
rune = null;
|
||||
|
||||
if (!check.compareRow(id, rune))
|
||||
continue;
|
||||
|
||||
jsonClass = new PromotionClass(rune);
|
||||
|
||||
check.compareField(id, "name", promotionClass.getName(), jsonClass.getName());
|
||||
check.compareField(id, "token", promotionClass.getToken(), jsonClass.getToken());
|
||||
check.compareField(id, "healthMod", promotionClass.getHealthMod(), jsonClass.getHealthMod());
|
||||
check.compareField(id, "manaMod", promotionClass.getManaMod(), jsonClass.getManaMod());
|
||||
check.compareField(id, "staminaMod", promotionClass.getStaminaMod(), jsonClass.getStaminaMod());
|
||||
check.compareField(id, "allowedRunes", new HashSet<>(promotionClass.getRuneList()), new HashSet<>(jsonClass.getRuneList()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user