Remove the dead static_rune_baseeffect path
RuneBaseEffect, its handler, every effectsGranted field and getter (including the PromotionClass promoID*10+2500..2503 lookups) and the empty PlayerBonuses.grantEffect had no reader (2.10a). The GameObjectType constant stays so later ordinals are unchanged. No value changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
64a86152d3
commit
658d52cf41
11 files changed
-245
No files matched your search
@@ -1,92 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2026
|
||||
// https://www.magicbane.com
|
||||
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.RuneBaseEffect;
|
||||
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.HashMap;
|
||||
|
||||
public class dbRuneBaseEffectHandler extends dbHandlerBase {
|
||||
|
||||
public dbRuneBaseEffectHandler() {
|
||||
this.localClass = RuneBaseEffect.class;
|
||||
this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
|
||||
}
|
||||
|
||||
public ArrayList<RuneBaseEffect> GET_EFFECTS_FOR_RUNEBASE(int id) {
|
||||
|
||||
ArrayList<RuneBaseEffect> runeBaseEffectsList = new ArrayList<>();
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_rune_baseeffect` WHERE `runeID`=?")) {
|
||||
|
||||
preparedStatement.setInt(1, id);
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
runeBaseEffectsList = getObjectsFromRs(rs, 250);
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
return runeBaseEffectsList;
|
||||
}
|
||||
|
||||
public ArrayList<RuneBaseEffect> GET_ALL_RUNEBASE_EFFECTS() {
|
||||
|
||||
ArrayList<RuneBaseEffect> runeBaseEffectsList = new ArrayList<>();
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_rune_baseeffect`;")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
runeBaseEffectsList = getObjectsFromRs(rs, 250);
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
return runeBaseEffectsList;
|
||||
}
|
||||
|
||||
//This calls from cache only. Call this AFTER caching all runebase effects;
|
||||
|
||||
public HashMap<Integer, ArrayList<RuneBaseEffect>> LOAD_BASEEFFECTS_FOR_RUNEBASE() {
|
||||
|
||||
HashMap<Integer, ArrayList<RuneBaseEffect>> runeBaseEffectSet;
|
||||
runeBaseEffectSet = new HashMap<>();
|
||||
|
||||
for (AbstractGameObject runeBaseEffect : DbManager.getList(GameObjectType.RuneBaseEffect)) {
|
||||
|
||||
int runeBaseID = ((RuneBaseEffect) runeBaseEffect).getRuneBaseID();
|
||||
if (runeBaseEffectSet.get(runeBaseID) == null) {
|
||||
ArrayList<RuneBaseEffect> runeBaseEffectList = new ArrayList<>();
|
||||
runeBaseEffectList.add((RuneBaseEffect) runeBaseEffect);
|
||||
runeBaseEffectSet.put(runeBaseID, runeBaseEffectList);
|
||||
} else {
|
||||
ArrayList<RuneBaseEffect> runeBaseEffectList = runeBaseEffectSet.get(runeBaseID);
|
||||
runeBaseEffectList.add((RuneBaseEffect) runeBaseEffect);
|
||||
runeBaseEffectSet.put(runeBaseID, runeBaseEffectList);
|
||||
}
|
||||
}
|
||||
return runeBaseEffectSet;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,7 +58,6 @@ public enum DbManager {
|
||||
public static final dbPromotionClassHandler PromotionQueries = new dbPromotionClassHandler();
|
||||
public static final dbRaceHandler RaceQueries = new dbRaceHandler();
|
||||
public static final dbResistHandler ResistQueries = new dbResistHandler();
|
||||
public static final dbRuneBaseEffectHandler RuneBaseEffectQueries = new dbRuneBaseEffectHandler();
|
||||
public static final dbRuneBaseHandler RuneBaseQueries = new dbRuneBaseHandler();
|
||||
public static final dbSkillBaseHandler SkillsBaseQueries = new dbSkillBaseHandler();
|
||||
public static final dbSkillReqHandler SkillReqQueries = new dbSkillReqHandler();
|
||||
|
||||
@@ -225,10 +225,6 @@ public class BaseClass extends AbstractGameObject {
|
||||
return this.powersGranted;
|
||||
}
|
||||
|
||||
public ArrayList<RuneBaseEffect> getEffectsGranted() {
|
||||
return RuneBaseEffect.RuneIDBaseEffectMap.get(this.getObjectUUID());
|
||||
}
|
||||
|
||||
/*
|
||||
* Utils
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@ public class CharacterRune extends AbstractGameObject {
|
||||
private final int player;
|
||||
private final ArrayList<SkillReq> skillsGranted;
|
||||
private final ArrayList<PowerReq> powersGranted;
|
||||
private final ArrayList<RuneBaseEffect> effectsGranted;
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
@@ -43,10 +42,6 @@ public class CharacterRune extends AbstractGameObject {
|
||||
this.skillsGranted = new ArrayList<>();
|
||||
this.powersGranted = new ArrayList<>();
|
||||
}
|
||||
if (this.runeBase != null)
|
||||
this.effectsGranted = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE(this.runeBase.getObjectUUID());
|
||||
else
|
||||
this.effectsGranted = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,10 +58,6 @@ public class CharacterRune extends AbstractGameObject {
|
||||
this.skillsGranted = new ArrayList<>();
|
||||
this.powersGranted = new ArrayList<>();
|
||||
}
|
||||
if (this.runeBase != null)
|
||||
this.effectsGranted = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE(this.runeBase.getObjectUUID());
|
||||
else
|
||||
this.effectsGranted = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,12 +71,10 @@ public class CharacterRune extends AbstractGameObject {
|
||||
if (this.runeBase != null) {
|
||||
this.skillsGranted = SkillReq.getSkillReqsForRune(this.runeBase.getObjectUUID());
|
||||
this.powersGranted = PowerReq.getPowerReqsForRune(this.runeBase.getObjectUUID());
|
||||
this.effectsGranted = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE(this.runeBase.getObjectUUID());
|
||||
} else {
|
||||
Logger.error("Failed to find RuneBase for CharacterRune " + this.getObjectUUID());
|
||||
this.skillsGranted = new ArrayList<>();
|
||||
this.powersGranted = new ArrayList<>();
|
||||
this.effectsGranted = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,10 +189,6 @@ public class CharacterRune extends AbstractGameObject {
|
||||
return this.powersGranted;
|
||||
}
|
||||
|
||||
public ArrayList<RuneBaseEffect> getEffectsGranted() {
|
||||
return this.effectsGranted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDatabase() {
|
||||
DbManager.CharacterRuneQueries.updateDatabase(this);
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@@ -22,7 +21,6 @@ public class NPCRune extends AbstractGameObject {
|
||||
private final RuneBase runeBase;
|
||||
private final int player;
|
||||
private final ArrayList<SkillReq> skillsGranted;
|
||||
private final ArrayList<RuneBaseEffect> effectsGranted;
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
@@ -35,7 +33,6 @@ public class NPCRune extends AbstractGameObject {
|
||||
this.skillsGranted = SkillReq.getSkillReqsForRune(this.runeBase.getObjectUUID());
|
||||
else
|
||||
this.skillsGranted = new ArrayList<>();
|
||||
this.effectsGranted = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,7 +46,6 @@ public class NPCRune extends AbstractGameObject {
|
||||
this.skillsGranted = SkillReq.getSkillReqsForRune(this.runeBase.getObjectUUID());
|
||||
else
|
||||
this.skillsGranted = new ArrayList<>();
|
||||
this.effectsGranted = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,11 +58,9 @@ public class NPCRune extends AbstractGameObject {
|
||||
this.player = rs.getInt("NpcID");
|
||||
if (this.runeBase != null) {
|
||||
this.skillsGranted = SkillReq.getSkillReqsForRune(this.runeBase.getObjectUUID());
|
||||
this.effectsGranted = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE(this.runeBase.getObjectUUID());
|
||||
} else {
|
||||
Logger.error("Failed to find RuneBase for NPCRune " + this.getObjectUUID());
|
||||
this.skillsGranted = new ArrayList<>();
|
||||
this.effectsGranted = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,10 +89,6 @@ public class NPCRune extends AbstractGameObject {
|
||||
* Serializing
|
||||
*/
|
||||
|
||||
public ArrayList<RuneBaseEffect> getEffectsGranted() {
|
||||
return this.effectsGranted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDatabase() {
|
||||
|
||||
|
||||
@@ -236,10 +236,6 @@ public class PlayerBonuses {
|
||||
}
|
||||
|
||||
|
||||
public void grantEffect(RuneBaseEffect rbe) {
|
||||
}
|
||||
|
||||
|
||||
public void setFloat(AbstractEffectModifier mod, float val) {
|
||||
if (val != 0)
|
||||
this.bonusFloats.put(mod, val);
|
||||
|
||||
@@ -33,11 +33,6 @@ public class PromotionClass extends AbstractGameObject {
|
||||
private final ArrayList<Integer> allowedRunes;
|
||||
private final ArrayList<SkillReq> skillsGranted;
|
||||
private final ArrayList<PowerReq> powersGranted;
|
||||
private final ArrayList<RuneBaseEffect> effectsGranted;
|
||||
private final ArrayList<RuneBaseEffect> effectsGrantedFighter;
|
||||
private final ArrayList<RuneBaseEffect> effectsGrantedHealer;
|
||||
private final ArrayList<RuneBaseEffect> effectsGrantedRogue;
|
||||
private final ArrayList<RuneBaseEffect> effectsGrantedMage;
|
||||
private int token = 0;
|
||||
private ArrayList<MobBaseEffects> effectsList = new ArrayList<>();
|
||||
|
||||
@@ -55,11 +50,6 @@ public class PromotionClass extends AbstractGameObject {
|
||||
this.healthMod = 0f;
|
||||
this.manaMod = 0f;
|
||||
this.staminaMod = 0f;
|
||||
this.effectsGranted = new ArrayList<>();
|
||||
this.effectsGrantedFighter = new ArrayList<>();
|
||||
this.effectsGrantedHealer = new ArrayList<>();
|
||||
this.effectsGrantedRogue = new ArrayList<>();
|
||||
this.effectsGrantedMage = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,11 +66,6 @@ public class PromotionClass extends AbstractGameObject {
|
||||
this.healthMod = 0f;
|
||||
this.manaMod = 0f;
|
||||
this.staminaMod = 0f;
|
||||
this.effectsGranted = new ArrayList<>();
|
||||
this.effectsGrantedFighter = new ArrayList<>();
|
||||
this.effectsGrantedHealer = new ArrayList<>();
|
||||
this.effectsGrantedRogue = new ArrayList<>();
|
||||
this.effectsGrantedMage = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,11 +83,6 @@ public class PromotionClass extends AbstractGameObject {
|
||||
this.allowedRunes = DbManager.PromotionQueries.GET_ALLOWED_RUNES(this);
|
||||
this.skillsGranted = SkillReq.getSkillReqsForRune(this.getObjectUUID());
|
||||
this.powersGranted = PowerReq.getPowerReqsForRune(this.getObjectUUID());
|
||||
this.effectsGranted = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE(this.getObjectUUID());
|
||||
this.effectsGrantedFighter = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE((this.getObjectUUID() * 10) + 2500);
|
||||
this.effectsGrantedHealer = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE((this.getObjectUUID() * 10) + 2501);
|
||||
this.effectsGrantedRogue = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE((this.getObjectUUID() * 10) + 2502);
|
||||
this.effectsGrantedMage = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE((this.getObjectUUID() * 10) + 2503);
|
||||
this.effectsList = MobBaseEffects.getEffectsForRune(this.getObjectUUID());
|
||||
|
||||
|
||||
@@ -123,11 +103,6 @@ public class PromotionClass extends AbstractGameObject {
|
||||
this.allowedRunes = getAllowedRuneTokens(rune);
|
||||
this.skillsGranted = SkillReq.getSkillReqsForRune(this.getObjectUUID());
|
||||
this.powersGranted = PowerReq.getPowerReqsForRune(this.getObjectUUID());
|
||||
this.effectsGranted = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE(this.getObjectUUID());
|
||||
this.effectsGrantedFighter = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE((this.getObjectUUID() * 10) + 2500);
|
||||
this.effectsGrantedHealer = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE((this.getObjectUUID() * 10) + 2501);
|
||||
this.effectsGrantedRogue = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE((this.getObjectUUID() * 10) + 2502);
|
||||
this.effectsGrantedMage = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE((this.getObjectUUID() * 10) + 2503);
|
||||
this.effectsList = MobBaseEffects.getEffectsForRune(this.getObjectUUID());
|
||||
}
|
||||
|
||||
@@ -247,23 +222,6 @@ public class PromotionClass extends AbstractGameObject {
|
||||
* Serializing
|
||||
*/
|
||||
|
||||
public ArrayList<RuneBaseEffect> getEffectsGranted() {
|
||||
return this.effectsGranted;
|
||||
}
|
||||
|
||||
public ArrayList<RuneBaseEffect> getEffectsGranted(int baseClassID) {
|
||||
if (baseClassID == 2500)
|
||||
return this.effectsGrantedFighter;
|
||||
else if (baseClassID == 2501)
|
||||
return this.effectsGrantedHealer;
|
||||
else if (baseClassID == 2502)
|
||||
return this.effectsGrantedRogue;
|
||||
else if (baseClassID == 2503)
|
||||
return this.effectsGrantedMage;
|
||||
else
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDatabase() {
|
||||
// TODO Create update logic.
|
||||
|
||||
@@ -363,10 +363,6 @@ public class Race {
|
||||
return this.powersGranted;
|
||||
}
|
||||
|
||||
public ArrayList<RuneBaseEffect> getEffectsGranted() {
|
||||
return RuneBaseEffect.RuneIDBaseEffectMap.get(this.raceRuneID);
|
||||
}
|
||||
|
||||
/*
|
||||
* Validators
|
||||
*/
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2026
|
||||
// https://www.magicbane.com
|
||||
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class RuneBaseEffect extends AbstractGameObject {
|
||||
|
||||
public static HashMap<Integer, ArrayList<RuneBaseEffect>> RuneIDBaseEffectMap = new HashMap<>();
|
||||
private byte type;
|
||||
private String name;
|
||||
private short amount;
|
||||
private int runeBaseID;
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public RuneBaseEffect(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
this.type = rs.getByte("type");
|
||||
this.name = rs.getString("name");
|
||||
this.amount = rs.getShort("amount");
|
||||
this.runeBaseID = rs.getInt("runeID");
|
||||
}
|
||||
|
||||
/*
|
||||
* Getters
|
||||
*/
|
||||
|
||||
public static void LoadRuneBaseEffects() {
|
||||
//cache runebase effects.
|
||||
DbManager.RuneBaseEffectQueries.GET_ALL_RUNEBASE_EFFECTS();
|
||||
//store runebase effects in new hashmap.
|
||||
RuneBaseEffect.RuneIDBaseEffectMap = DbManager.RuneBaseEffectQueries.LOAD_BASEEFFECTS_FOR_RUNEBASE();
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public short getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDatabase() {
|
||||
|
||||
}
|
||||
|
||||
public int getRuneBaseID() {
|
||||
return runeBaseID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -335,7 +335,6 @@ public class LoginServer {
|
||||
BaseClass.LoadAllBaseClasses();
|
||||
PromotionClass.LoadAllPromotions();
|
||||
Race.loadAllRaces();
|
||||
RuneBaseEffect.LoadRuneBaseEffects();
|
||||
|
||||
Logger.info("Initializing Blueprint data.");
|
||||
Blueprint.loadAllBlueprints();
|
||||
|
||||
@@ -440,7 +440,6 @@ public class WorldServer {
|
||||
RuneBase.LoadAllRuneBases();
|
||||
BaseClass.LoadAllBaseClasses();
|
||||
Race.loadAllRaces();
|
||||
RuneBaseEffect.LoadRuneBaseEffects();
|
||||
|
||||
Logger.info("Loading granted Skills for Runes");
|
||||
SkillsBase.LoadAllRuneSkills();
|
||||
|
||||
Reference in new issue
Block a user