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:
1 parent
658d52cf41
commit
d576ed1468
6 files changed
+21
-224
No files matched your search
@@ -10,15 +10,14 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.Race;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class dbRaceHandler extends dbHandlerBase {
|
||||
|
||||
@@ -46,27 +45,6 @@ public class dbRaceHandler extends dbHandlerBase {
|
||||
return integerSet;
|
||||
}
|
||||
|
||||
public HashSet<Integer> BEARD_STYLES_FOR_RACE(final int id) {
|
||||
|
||||
HashSet<Integer> integerSet = new HashSet<>();
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `beardStyle` FROM `static_rune_racebeardstyle` WHERE `RaceID` = ?")) {
|
||||
|
||||
preparedStatement.setInt(1, id);
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next())
|
||||
integerSet.add(rs.getInt(1));
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
return integerSet;
|
||||
}
|
||||
|
||||
public HashSet<Integer> HAIR_COLORS_FOR_RACE(final int id) {
|
||||
|
||||
HashSet<Integer> integerSet = new HashSet<>();
|
||||
@@ -89,28 +67,6 @@ public class dbRaceHandler extends dbHandlerBase {
|
||||
|
||||
}
|
||||
|
||||
public HashSet<Integer> HAIR_STYLES_FOR_RACE(final int id) {
|
||||
|
||||
HashSet<Integer> integerSet = new HashSet<>();
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `hairStyle` FROM `static_rune_racehairstyle` WHERE `RaceID` = ?")) {
|
||||
|
||||
preparedStatement.setInt(1, id);
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next())
|
||||
integerSet.add(rs.getInt(1));
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
return integerSet;
|
||||
|
||||
}
|
||||
|
||||
public HashSet<Integer> SKIN_COLOR_FOR_RACE(final int id) {
|
||||
|
||||
HashSet<Integer> integerSet = new HashSet<>();
|
||||
@@ -132,32 +88,23 @@ public class dbRaceHandler extends dbHandlerBase {
|
||||
return integerSet;
|
||||
}
|
||||
|
||||
public ConcurrentHashMap<Integer, Race> LOAD_ALL_RACES() {
|
||||
// Rune id -> {minHeight, strHeightMod}; the rows also decide which race runes are player races
|
||||
public HashMap<Integer, float[]> LOAD_RACE_HEIGHTS() {
|
||||
|
||||
ConcurrentHashMap<Integer, Race> races;
|
||||
Race thisRace;
|
||||
|
||||
races = new ConcurrentHashMap<>();
|
||||
int recordsRead = 0;
|
||||
HashMap<Integer, float[]> raceHeights = new HashMap<>();
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_rune_race")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
|
||||
recordsRead++;
|
||||
thisRace = new Race(rs);
|
||||
|
||||
races.put(thisRace.getRaceRuneID(), thisRace);
|
||||
}
|
||||
while (rs.next())
|
||||
raceHeights.put(rs.getInt("ID"), new float[]{rs.getFloat("minHeight"), rs.getFloat("strHeightMod")});
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
Logger.info("read: " + recordsRead + " cached: " + races.size());
|
||||
return races;
|
||||
return raceHeights;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user