Build BaseClass from its class rune and compare every field
Adds BaseClass(RuneTemplate): attributes from rune_attr_adj, health/mana/stamina from rune_health/mana/stamina, token = SBStringHash(rune_sub_type), description from rune_dsc. Skills, powers and effects still load from the DB by rune id (tasks 2.8, 2.9, 2.10). The static_rune_baseclass comparator now checks every field against a JSON-built BaseClass. Offline parity (scripts/p21.py, 4 rows vs the CLASS runes with rune_is_standard_character_creation = 2500-2503): 0 differences except description, which is '' in the DB and the class blurb in rune_dsc. Nothing reads BaseClass.getDescription(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0283f85e87
commit
5acd3492ed
2 files changed
+44
-3
No files matched your search
@@ -10,7 +10,10 @@
|
||||
package engine.objects;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.util.Hasher;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -104,6 +107,28 @@ public class BaseClass extends AbstractGameObject {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Rune Template Constructor
|
||||
*/
|
||||
public BaseClass(RuneTemplate rune) {
|
||||
super(rune.template_id);
|
||||
|
||||
this.name = rune.obj_name;
|
||||
this.description = rune.rune_dsc;
|
||||
this.strMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Strength, 0).byteValue();
|
||||
this.dexMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Dexterity, 0).byteValue();
|
||||
this.conMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Constitution, 0).byteValue();
|
||||
this.intMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Intelligence, 0).byteValue();
|
||||
this.spiMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Spirit, 0).byteValue();
|
||||
this.token = Hasher.SBStringHash(rune.rune_sub_type);
|
||||
this.healthMod = rune.rune_health;
|
||||
this.manaMod = rune.rune_mana;
|
||||
this.staminaMod = rune.rune_stamina;
|
||||
this.skillsGranted = DbManager.SkillReqQueries.GET_REQS_FOR_RUNE(this.getObjectUUID());
|
||||
this.powersGranted = PowerReq.getPowerReqsForRune(this.getObjectUUID());
|
||||
this.effectsList = (DbManager.MobBaseQueries.GET_RUNEBASE_EFFECTS(this.getObjectUUID()));
|
||||
}
|
||||
|
||||
public static void LoadAllBaseClasses() {
|
||||
DbManager.BaseClassQueries.GET_ALL_BASE_CLASSES();
|
||||
}
|
||||
|
||||
+19
-3
@@ -96,7 +96,9 @@ public class ParityCheck {
|
||||
|
||||
ConcurrentHashMap<Integer, AbstractGameObject> cache;
|
||||
BaseClass baseClass;
|
||||
BaseClass jsonClass;
|
||||
RuneTemplate rune;
|
||||
int id;
|
||||
|
||||
cache = DbManager.getMap(mbEnums.GameObjectType.BaseClass);
|
||||
|
||||
@@ -107,12 +109,26 @@ public class ParityCheck {
|
||||
|
||||
for (AbstractGameObject cached : cache.values()) {
|
||||
baseClass = (BaseClass) cached;
|
||||
rune = RuneTemplate._runes.get(baseClass.getObjectUUID());
|
||||
id = baseClass.getObjectUUID();
|
||||
rune = RuneTemplate._runes.get(id);
|
||||
|
||||
if (!check.compareRow(baseClass.getObjectUUID(), rune))
|
||||
if (!check.compareRow(id, rune))
|
||||
continue;
|
||||
|
||||
check.compareField(baseClass.getObjectUUID(), "name", baseClass.getName(), rune.obj_name);
|
||||
jsonClass = new BaseClass(rune);
|
||||
|
||||
check.compareField(id, "name", baseClass.getName(), jsonClass.getName());
|
||||
check.compareField(id, "strMod", baseClass.getStrMod(), jsonClass.getStrMod());
|
||||
check.compareField(id, "dexMod", baseClass.getDexMod(), jsonClass.getDexMod());
|
||||
check.compareField(id, "conMod", baseClass.getConMod(), jsonClass.getConMod());
|
||||
check.compareField(id, "intMod", baseClass.getIntMod(), jsonClass.getIntMod());
|
||||
check.compareField(id, "spiMod", baseClass.getSpiMod(), jsonClass.getSpiMod());
|
||||
check.compareField(id, "token", baseClass.getToken(), jsonClass.getToken());
|
||||
check.compareField(id, "healthMod", baseClass.getHealthMod(), jsonClass.getHealthMod());
|
||||
check.compareField(id, "manaMod", baseClass.getManaMod(), jsonClass.getManaMod());
|
||||
check.compareField(id, "staminaMod", baseClass.getStaminaMod(), jsonClass.getStaminaMod());
|
||||
check.compareField(id, "isStandardCreation", true, rune.rune_type == mbEnums.RuneType.CLASS
|
||||
&& rune.rune_is_standard_character_creation);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user