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>
99 lines
3.4 KiB
Java
99 lines
3.4 KiB
Java
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
// 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.SkillsBase;
|
|
import org.pmw.tinylog.Logger;
|
|
|
|
import java.sql.Connection;
|
|
import java.sql.PreparedStatement;
|
|
import java.sql.ResultSet;
|
|
import java.sql.SQLException;
|
|
|
|
public class dbSkillBaseHandler extends dbHandlerBase {
|
|
|
|
public dbSkillBaseHandler() {
|
|
this.localClass = SkillsBase.class;
|
|
this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
|
|
}
|
|
|
|
public SkillsBase GET_BASE(final int objectUUID) {
|
|
|
|
SkillsBase skillsBase = (SkillsBase) DbManager.getFromCache(GameObjectType.SkillsBase, objectUUID);
|
|
|
|
if (skillsBase != null)
|
|
return skillsBase;
|
|
|
|
try (Connection connection = DbManager.getConnection();
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_skill_skillsbase WHERE ID = ?")) {
|
|
|
|
preparedStatement.setInt(1, objectUUID);
|
|
ResultSet rs = preparedStatement.executeQuery();
|
|
|
|
skillsBase = (SkillsBase) getObjectFromRs(rs);
|
|
|
|
} catch (SQLException e) {
|
|
Logger.error(e);
|
|
}
|
|
|
|
SkillsBase.putInCache(skillsBase);
|
|
return skillsBase;
|
|
}
|
|
|
|
public SkillsBase GET_BASE_BY_NAME(String name) {
|
|
|
|
SkillsBase skillsBase = SkillsBase.getFromCache(name);
|
|
|
|
if (skillsBase != null)
|
|
return skillsBase;
|
|
|
|
try (Connection connection = DbManager.getConnection();
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_skill_skillsbase WHERE name = ?")) {
|
|
|
|
preparedStatement.setString(1, name);
|
|
ResultSet rs = preparedStatement.executeQuery();
|
|
|
|
skillsBase = (SkillsBase) getObjectFromRs(rs);
|
|
|
|
} catch (SQLException e) {
|
|
Logger.error(e);
|
|
}
|
|
|
|
SkillsBase.putInCache(skillsBase);
|
|
return skillsBase;
|
|
}
|
|
|
|
public SkillsBase GET_BASE_BY_TOKEN(final int token) {
|
|
|
|
SkillsBase skillsBase = SkillsBase.getFromCache(token);
|
|
|
|
if (skillsBase != null)
|
|
return skillsBase;
|
|
|
|
try (Connection connection = DbManager.getConnection();
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_skill_skillsbase WHERE token = ?")) {
|
|
|
|
preparedStatement.setInt(1, token);
|
|
ResultSet rs = preparedStatement.executeQuery();
|
|
|
|
skillsBase = (SkillsBase) getObjectFromRs(rs);
|
|
|
|
} catch (SQLException e) {
|
|
Logger.error(e);
|
|
}
|
|
|
|
SkillsBase.putInCache(skillsBase);
|
|
return skillsBase;
|
|
}
|
|
}
|