Remove the static_rune_validkit loader
Kits come from StartingKitTable.cfg since c1e1ed91 (tested); drop
dbKitHandler, DbManager.KitQueries, the Kit ResultSet ctor and
RaceClassIDMap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c1e1ed9148
commit
9af6dd30ea
3 files changed
-84
No files matched your search
@@ -1,46 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2026
|
|
||||||
// https://www.magicbane.com
|
|
||||||
|
|
||||||
|
|
||||||
package engine.db.handlers;
|
|
||||||
|
|
||||||
import engine.gameManager.DbManager;
|
|
||||||
import engine.mbEnums;
|
|
||||||
import engine.objects.Kit;
|
|
||||||
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;
|
|
||||||
|
|
||||||
public class dbKitHandler extends dbHandlerBase {
|
|
||||||
|
|
||||||
public dbKitHandler() {
|
|
||||||
this.localClass = Kit.class;
|
|
||||||
this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Kit> GET_ALL_KITS() {
|
|
||||||
|
|
||||||
ArrayList<Kit> kitList = new ArrayList<>();
|
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_rune_validkit`")) {
|
|
||||||
|
|
||||||
ResultSet rs = preparedStatement.executeQuery();
|
|
||||||
kitList = getObjectsFromRs(rs, 20);
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
|
||||||
Logger.error(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return kitList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -47,7 +47,6 @@ public enum DbManager {
|
|||||||
public static final dbEffectsResourceCostHandler EffectsResourceCostsQueries = new dbEffectsResourceCostHandler();
|
public static final dbEffectsResourceCostHandler EffectsResourceCostsQueries = new dbEffectsResourceCostHandler();
|
||||||
public static final dbGuildHandler GuildQueries = new dbGuildHandler();
|
public static final dbGuildHandler GuildQueries = new dbGuildHandler();
|
||||||
public static final dbItemHandler ItemQueries = new dbItemHandler();
|
public static final dbItemHandler ItemQueries = new dbItemHandler();
|
||||||
public static final dbKitHandler KitQueries = new dbKitHandler();
|
|
||||||
public static final dbLootHandler LootQueries = new dbLootHandler();
|
public static final dbLootHandler LootQueries = new dbLootHandler();
|
||||||
public static final dbMenuHandler MenuQueries = new dbMenuHandler();
|
public static final dbMenuHandler MenuQueries = new dbMenuHandler();
|
||||||
public static final dbMineHandler MineQueries = new dbMineHandler();
|
public static final dbMineHandler MineQueries = new dbMineHandler();
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ import engine.parsers.objects.RuneTemplate;
|
|||||||
import engine.parsers.objects.wpak.StartingKitTemplate;
|
import engine.parsers.objects.wpak.StartingKitTemplate;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -32,7 +29,6 @@ import java.util.Map;
|
|||||||
public class Kit extends AbstractGameObject {
|
public class Kit extends AbstractGameObject {
|
||||||
|
|
||||||
public static HashMap<Integer, Boolean> NoobGearIDS = new HashMap<>();
|
public static HashMap<Integer, Boolean> NoobGearIDS = new HashMap<>();
|
||||||
public static HashMap<Integer, ArrayList<Kit>> RaceClassIDMap = new HashMap<>();
|
|
||||||
|
|
||||||
// Keyed like the client's kit map (0x620250): race name, sex and class name, not rune ids
|
// Keyed like the client's kit map (0x620250): race name, sex and class name, not rune ids
|
||||||
private static final HashMap<String, ArrayList<Kit>> _kitsByRaceClass = new HashMap<>();
|
private static final HashMap<String, ArrayList<Kit>> _kitsByRaceClass = new HashMap<>();
|
||||||
@@ -73,30 +69,6 @@ public class Kit extends AbstractGameObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* RecordSet Constructor
|
|
||||||
*/
|
|
||||||
public Kit(ResultSet rs) throws SQLException, UnknownHostException {
|
|
||||||
super(rs);
|
|
||||||
|
|
||||||
int raceBaseClassID = rs.getInt("RaceBaseClassesID");
|
|
||||||
this.kitNumber = rs.getByte("kitNumber");
|
|
||||||
|
|
||||||
putColumn(EquipSlotType.LEGS, rs.getInt("legs"));
|
|
||||||
putColumn(EquipSlotType.CHEST, rs.getInt("chest"));
|
|
||||||
putColumn(EquipSlotType.FEET, rs.getInt("feet"));
|
|
||||||
putColumn(EquipSlotType.LHELD, rs.getInt("offhand"));
|
|
||||||
putColumn(EquipSlotType.RHELD, rs.getInt("weapon"));
|
|
||||||
|
|
||||||
if (Kit.RaceClassIDMap.containsKey(raceBaseClassID)) {
|
|
||||||
Kit.RaceClassIDMap.get(raceBaseClassID).add(this);
|
|
||||||
} else {
|
|
||||||
ArrayList<Kit> tempList = new ArrayList<>();
|
|
||||||
tempList.add(this);
|
|
||||||
Kit.RaceClassIDMap.put(raceBaseClassID, tempList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LoadAllKits() {
|
public static void LoadAllKits() {
|
||||||
|
|
||||||
Kit kit;
|
Kit kit;
|
||||||
@@ -168,15 +140,6 @@ public class Kit extends AbstractGameObject {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void putColumn(EquipSlotType slot, int itemID) {
|
|
||||||
|
|
||||||
if (itemID == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this.items.put(slot, itemID);
|
|
||||||
Kit.NoobGearIDS.put(itemID, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte getKitNumber() {
|
public byte getKitNumber() {
|
||||||
return kitNumber;
|
return kitNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user