Load RuneBase and its attributes from the runes
LoadAllRuneBases builds one RuneBase per static_rune_runebase row from the rune
with the same id (all 315 have one) and fills runeBaseAttributeMap from the
rune; the row now only supplies type, subtype, the runereq maps and effects. A
row without a rune would stay the DB object, without attributes, with a
warning. static_rune_runebaseattribute is no longer read at boot (the
LoadAllAttributes calls are gone from both servers). The SQL loaders stay until
task 2.11.
Value changes (decisions: JSON, D2):
- name: Confesser -> Confessor, Theif -> Thief, LagMaster -> Lagmaster,
WP Dev -> Wolfpack Developer, Exception X -> Exceptional X (Strength,
Dexterity, Constitution, Intelligence, Spirit). No code matches these names.
- description: '' / CSR text -> rune_dsc (unread)
- attributes added where the DB had none:
- admin 2905 Lagmaster spi +200, spi max +200; 2907 Watcher con +200;
2909 Feature Character every max +200; 2911 QA Test Rune con +200
(applies to characters granted them; none hold them on dev)
- creation cost 5/12/10/10/10 on 250116, 250117, 250123-250125 (duplicate
talents not offered at creation)
- base classes 2500-2503, Pet 2522, guards 252621-252623: start/max
attributes (never player CharacterRunes; NPC rune attributes are unread)
All 365 DB attribute rows match the JSON; final parity before the switch
(scripts/p24.py): 0 other differences. The static_rune_runebase 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
83f57b4def
commit
0ff7e7736c
4 files changed
+32
-62
No files matched your search
@@ -14,6 +14,7 @@ import engine.mbEnums;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -122,9 +123,39 @@ public class RuneBase extends AbstractGameObject {
|
||||
|
||||
}
|
||||
|
||||
// Iterates the static_rune_runebase rows: no rune field separates the player runes from the mob
|
||||
// talents, and each row still holds the server type/subtype and requirement maps.
|
||||
|
||||
public static void LoadAllRuneBases() {
|
||||
|
||||
DbManager.RuneBaseQueries.LOAD_ALL_RUNEBASES();
|
||||
ArrayList<RuneBase> dbRuneBases;
|
||||
ArrayList<RuneBaseAttribute> attributes;
|
||||
RuneTemplate rune;
|
||||
int loadedCount = 0;
|
||||
|
||||
dbRuneBases = DbManager.RuneBaseQueries.LOAD_ALL_RUNEBASES();
|
||||
RuneBaseAttribute.runeBaseAttributeMap.clear();
|
||||
|
||||
for (RuneBase dbRuneBase : dbRuneBases) {
|
||||
rune = RuneTemplate._runes.get(dbRuneBase.getObjectUUID());
|
||||
|
||||
if (rune == null) {
|
||||
Logger.warn("RuneBase " + dbRuneBase.getObjectUUID() + " has no rune; loaded from static_rune_runebase without attributes");
|
||||
continue;
|
||||
}
|
||||
|
||||
DbManager.addToCache(new RuneBase(rune, dbRuneBase));
|
||||
attributes = RuneBaseAttribute.getAttributesForRune(rune);
|
||||
|
||||
// getAttrs() returns null for a rune without attributes, as the DB map did
|
||||
if (!attributes.isEmpty())
|
||||
RuneBaseAttribute.runeBaseAttributeMap.put(rune.template_id, attributes);
|
||||
|
||||
loadedCount++;
|
||||
}
|
||||
|
||||
Logger.info("Loaded " + loadedCount + " rune bases from runes");
|
||||
|
||||
RuneBase.AllowedBaseClassRunesMap = DbManager.RuneBaseQueries.LOAD_ALLOWED_STARTING_RUNES_FOR_BASECLASS();
|
||||
RuneBase.AllowedRaceRunesMap = DbManager.RuneBaseQueries.LOAD_ALLOWED_STARTING_RUNES_FOR_RACE();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user