Remove the dead skill and power DB loaders
Deletes the uncalled static_rune_skill_adjusts, static_rune_maxskills, static_skill_skillsgranted, static_skill_skillreq and static_power_powergrant loaders and their ResultSet constructors. LOAD_RUNE_POWERS stays for the 14 Magister Captain guard contract ids. No value changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d576ed1468
commit
8b9aa43c1b
7 files changed
+2
-215
No files matched your search
@@ -9,17 +9,12 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.util.Hasher;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -31,14 +26,6 @@ public class PowerGrantedTrains {
|
||||
private int token;
|
||||
private ConcurrentHashMap<Integer, Short> runeGrants = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public PowerGrantedTrains(ResultSet rs) throws SQLException {
|
||||
this.token = rs.getInt("powerToken");
|
||||
runeGrants.put(rs.getInt("runeID"), rs.getShort("grantAmount"));
|
||||
}
|
||||
|
||||
public PowerGrantedTrains(int token) {
|
||||
this.token = token;
|
||||
}
|
||||
@@ -124,41 +111,6 @@ public class PowerGrantedTrains {
|
||||
Logger.info("Loaded " + grantCount + " power train grants for " + powerGrants.size() + " powers");
|
||||
}
|
||||
|
||||
public static void fillGrantedPowers() {
|
||||
|
||||
PowerGrantedTrains.grantedPowers = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_powergrant")) {
|
||||
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
if (PowerGrantedTrains.grantedPowers.size() > 0) {
|
||||
rs.close();
|
||||
return;
|
||||
}
|
||||
|
||||
while (rs.next()) {
|
||||
|
||||
int token = rs.getInt("powerToken");
|
||||
|
||||
PowerGrantedTrains pg;
|
||||
|
||||
if (PowerGrantedTrains.grantedPowers.containsKey(token)) {
|
||||
pg = PowerGrantedTrains.grantedPowers.get(token);
|
||||
pg.addRuneGrant(rs.getInt("runeID"), rs.getShort("grantAmount"));
|
||||
} else {
|
||||
pg = new PowerGrantedTrains(rs);
|
||||
PowerGrantedTrains.grantedPowers.put(token, pg);
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
Logger.error("SQL Error number: " + e.getErrorCode(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Database
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user