Stop reading the replaced race, base class and promotion columns

static_rune_race is read only for the race ids and the server-only heights;
the hair/beard style, racebaseclass, baseclass and promotionrunereq queries
are gone. GET_BASE_CLASS is cache-only, which also drops the obj_account
cache-miss query. CSR/admin promotions 2901+ (no promotionrunereq rows) get an
empty allowed list. No value changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-22 12:41:06 -04:00
1 parent 658d52cf41
commit d576ed1468
6 files changed
+21 -224

No files matched your search

+11 -57
View File
@@ -11,7 +11,6 @@ package engine.objects;
import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.RaceType;
import engine.net.ByteBufferWriter;
import engine.parsers.cache.CacheParserUtil;
import engine.parsers.objects.RuneTemplate;
@@ -19,10 +18,10 @@ import engine.server.MBServerStatics;
import engine.util.Hasher;
import org.pmw.tinylog.Logger;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class Race {
@@ -70,55 +69,11 @@ public class Race {
private HashSet<Integer> beardStyles;
private ArrayList<MobBaseEffects> effectsList = new ArrayList<>();
/**
* ResultSet Constructor
*/
public Race(ResultSet rs) throws SQLException {
this.raceRuneID = rs.getInt("ID");
this.raceType = mbEnums.RaceType.getRaceTypebyRuneID(raceRuneID);
this.name = rs.getString("name");
this.description = rs.getString("description");
this.strStart = rs.getShort("strStart");
this.strMin = rs.getShort("strMin");
this.strMax = rs.getShort("strMax");
this.dexStart = rs.getShort("dexStart");
this.dexMin = rs.getShort("dexMin");
this.dexMax = rs.getShort("dexMax");
this.conStart = rs.getShort("conStart");
this.conMin = rs.getShort("conMin");
this.conMax = rs.getShort("conMax");
this.intStart = rs.getShort("intStart");
this.intMin = rs.getShort("intMin");
this.intMax = rs.getShort("intMax");
this.spiStart = rs.getShort("spiStart");
this.spiMin = rs.getShort("spiMin");
this.spiMax = rs.getShort("spiMax");
this.token = rs.getInt("token");
this.healthBonus = rs.getShort("healthBonus");
this.manaBonus = rs.getShort("manaBonus");
this.staminaBonus = rs.getShort("staminaBonus");
this.startingPoints = rs.getByte("startingPoints");
this.raceType = RaceType.getRaceTypebyRuneID(this.raceRuneID);
this.minHeight = rs.getFloat("minHeight");
this.strHeightMod = rs.getFloat("strHeightMod");
this.hairStyles = DbManager.RaceQueries.HAIR_STYLES_FOR_RACE(raceRuneID);
this.beardStyles = DbManager.RaceQueries.BEARD_STYLES_FOR_RACE(raceRuneID);
this.skinColors = DbManager.RaceQueries.SKIN_COLOR_FOR_RACE(raceRuneID);
this.beardColors = DbManager.RaceQueries.BEARD_COLORS_FOR_RACE(raceRuneID);
this.hairColors = DbManager.RaceQueries.HAIR_COLORS_FOR_RACE(raceRuneID);
this.baseClasses = DbManager.BaseClassQueries.GET_BASECLASS_FOR_RACE(raceRuneID);
this.skillsGranted = SkillReq.getSkillReqsForRune(raceRuneID);
this.powersGranted = PowerReq.getPowerReqsForRune(raceRuneID);
this.effectsList = MobBaseEffects.getEffectsForRune(this.raceRuneID);
}
/**
* Rune Template Constructor
* minHeight and strHeightMod are server-only and come from the static_rune_race row.
*/
public Race(RuneTemplate rune, Race dbRace) {
public Race(RuneTemplate rune, float[] heights) {
this.raceRuneID = rune.template_id;
this.raceType = mbEnums.RaceType.getRaceTypebyRuneID(raceRuneID);
@@ -144,8 +99,8 @@ public class Race {
this.manaBonus = (short) rune.rune_mana;
this.staminaBonus = (short) rune.rune_stamina;
this.startingPoints = (byte) (STARTING_POINT_POOL - rune.rune_creation_cost);
this.minHeight = dbRace.minHeight;
this.strHeightMod = dbRace.strHeightMod;
this.minHeight = heights[0];
this.strHeightMod = heights[1];
this.hairStyles = new HashSet<>(rune.rune_hair);
this.beardStyles = new HashSet<>(rune.rune_beard);
this.skinColors = DbManager.RaceQueries.SKIN_COLOR_FOR_RACE(raceRuneID);
@@ -193,23 +148,22 @@ public class Race {
public static void loadAllRaces() {
ConcurrentHashMap<Integer, Race> dbRaces;
HashMap<Integer, float[]> raceHeights;
ConcurrentHashMap<Integer, Race> races;
RuneTemplate rune;
dbRaces = DbManager.RaceQueries.LOAD_ALL_RACES();
raceHeights = DbManager.RaceQueries.LOAD_RACE_HEIGHTS();
races = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
for (Race dbRace : dbRaces.values()) {
rune = RuneTemplate._runes.get(dbRace.raceRuneID);
for (Map.Entry<Integer, float[]> raceRow : raceHeights.entrySet()) {
rune = RuneTemplate._runes.get(raceRow.getKey());
if (rune == null || rune.rune_type != mbEnums.RuneType.RACE) {
Logger.warn("Race " + dbRace.raceRuneID + " has no race rune; loaded from static_rune_race");
races.put(dbRace.raceRuneID, dbRace);
Logger.warn("Race " + raceRow.getKey() + " in static_rune_race has no race rune; skipped");
continue;
}
races.put(dbRace.raceRuneID, new Race(rune, dbRace));
races.put(rune.template_id, new Race(rune, raceRow.getValue()));
}
Race._raceByID = races;