Remove the static_effect_costmaps loader
Deletes dbEffectsResourceCostHandler, EffectsResourceCosts and DbManager.EffectsResourceCostsQueries. GameObjectType.EffectsResourceCosts stays because the enum ordinals are sent to the client and stored in the DB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f323ae12d
commit
aef3212b06
3 files changed
-132
No files matched your search
@@ -1,58 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2026
|
||||
// https://www.magicbane.com
|
||||
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.EffectsResourceCosts;
|
||||
import org.json.JSONObject;
|
||||
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;
|
||||
|
||||
public class dbEffectsResourceCostHandler extends dbHandlerBase {
|
||||
|
||||
public dbEffectsResourceCostHandler() {
|
||||
this.localClass = EffectsResourceCosts.class;
|
||||
this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
|
||||
}
|
||||
|
||||
public void LOAD_ALL_COSTMAPS() {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_effect_costmaps`")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String effectID = rs.getString("effectID");
|
||||
String costString = rs.getString("costmap");
|
||||
JSONObject costJSON = new JSONObject(costString);
|
||||
HashMap<mbEnums.ResourceType, Integer> costmap = new HashMap<>();
|
||||
|
||||
for (String key : costJSON.keySet()) {
|
||||
int value = costJSON.getInt(key);
|
||||
costmap.put(mbEnums.ResourceType.valueOf(key), value);
|
||||
}
|
||||
|
||||
PowersManager._effect_costMaps.put(effectID, costmap);
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,7 +44,6 @@ public enum DbManager {
|
||||
// Omg refactor this out, somebody!
|
||||
public static final dbCSSessionHandler CSSessionQueries = new dbCSSessionHandler();
|
||||
public static final dbEnchantmentHandler EnchantmentQueries = new dbEnchantmentHandler();
|
||||
public static final dbEffectsResourceCostHandler EffectsResourceCostsQueries = new dbEffectsResourceCostHandler();
|
||||
public static final dbGuildHandler GuildQueries = new dbGuildHandler();
|
||||
public static final dbItemHandler ItemQueries = new dbItemHandler();
|
||||
public static final dbLootHandler LootQueries = new dbLootHandler();
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2026
|
||||
// https://www.magicbane.com
|
||||
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class EffectsResourceCosts extends AbstractGameObject {
|
||||
|
||||
private String IDString;
|
||||
private int resourceID;
|
||||
private int amount;
|
||||
private int UID;
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public EffectsResourceCosts() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public EffectsResourceCosts(ResultSet rs) throws SQLException {
|
||||
|
||||
this.UID = rs.getInt("UID");
|
||||
this.IDString = rs.getString("IDString");
|
||||
this.resourceID = rs.getInt("resource");
|
||||
this.amount = rs.getInt("amount");
|
||||
}
|
||||
|
||||
|
||||
public String getIDString() {
|
||||
return this.IDString;
|
||||
}
|
||||
|
||||
|
||||
public int getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
|
||||
public int getResourceID() {
|
||||
return resourceID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromCache() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDatabase() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public int getUID() {
|
||||
return UID;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user