Load BaseClass from the class runes instead of static_rune_baseclass
LoadAllBaseClasses builds one BaseClass per CLASS rune with rune_is_standard_character_creation (2500-2503; promotions and Pet are skipped) and caches it. Race.baseClasses picks up the cached objects through GET_BASECLASS_FOR_RACE. The SQL loader stays until task 2.11. Value changes: description goes from '' to the rune_dsc class blurb (unread). All other fields unchanged; final parity before the switch (scripts/p21.py): 4 rows, 0 differences in name, attribute mods, token, health/mana/stamina mods. The static_rune_baseclass 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
5acd3492ed
commit
c8c322a3f5
2 files changed
+14
-51
No files matched your search
@@ -14,6 +14,7 @@ import engine.mbEnums;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.util.Hasher;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -130,7 +131,19 @@ public class BaseClass extends AbstractGameObject {
|
||||
}
|
||||
|
||||
public static void LoadAllBaseClasses() {
|
||||
DbManager.BaseClassQueries.GET_ALL_BASE_CLASSES();
|
||||
|
||||
int loadedCount = 0;
|
||||
|
||||
// Promotion classes and the Pet class are also CLASS runes, but not standard creation runes
|
||||
for (RuneTemplate rune : RuneTemplate._runes.values()) {
|
||||
if (rune.rune_type != mbEnums.RuneType.CLASS || !rune.rune_is_standard_character_creation)
|
||||
continue;
|
||||
|
||||
DbManager.addToCache(new BaseClass(rune));
|
||||
loadedCount++;
|
||||
}
|
||||
|
||||
Logger.info("Loaded " + loadedCount + " base classes from runes");
|
||||
}
|
||||
|
||||
public static void serializeForClientMsg(BaseClass baseClass, ByteBufferWriter writer) {
|
||||
|
||||
Reference in new issue
Block a user