|
|
@ -13,7 +13,12 @@ import engine.Enum.GameObjectType; |
|
|
|
import engine.gameManager.DbManager; |
|
|
|
import engine.gameManager.DbManager; |
|
|
|
import engine.objects.AbstractGameObject; |
|
|
|
import engine.objects.AbstractGameObject; |
|
|
|
import engine.objects.RuneBaseEffect; |
|
|
|
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.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
|
|
|
@ -25,34 +30,49 @@ public class dbRuneBaseEffectHandler extends dbHandlerBase { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<RuneBaseEffect> GET_EFFECTS_FOR_RUNEBASE(int id) { |
|
|
|
public ArrayList<RuneBaseEffect> GET_EFFECTS_FOR_RUNEBASE(int id) { |
|
|
|
prepareCallable("SELECT * FROM `static_rune_baseeffect` WHERE `runeID`=?"); |
|
|
|
|
|
|
|
setInt(1, id); |
|
|
|
|
|
|
|
return getObjectList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public RuneBaseEffect GET_RUNEBASE_EFFECT(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); |
|
|
|
|
|
|
|
|
|
|
|
if (id == 0) |
|
|
|
} catch (SQLException e) { |
|
|
|
return null; |
|
|
|
Logger.error(e); |
|
|
|
RuneBaseEffect runeBaseEffect = (RuneBaseEffect) DbManager.getFromCache(GameObjectType.RuneBaseEffect, id); |
|
|
|
} |
|
|
|
if (runeBaseEffect != null) |
|
|
|
|
|
|
|
return runeBaseEffect; |
|
|
|
return runeBaseEffectsList; |
|
|
|
prepareCallable("SELECT * FROM `static_rune_baseeffect` WHERE `ID` = ?"); |
|
|
|
|
|
|
|
setInt(1, id); |
|
|
|
|
|
|
|
return (RuneBaseEffect) getObjectSingle(id); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<RuneBaseEffect> GET_ALL_RUNEBASE_EFFECTS(){ |
|
|
|
public ArrayList<RuneBaseEffect> GET_ALL_RUNEBASE_EFFECTS() { |
|
|
|
prepareCallable("SELECT * FROM `static_rune_baseeffect`;"); |
|
|
|
|
|
|
|
return getObjectList(); |
|
|
|
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;
|
|
|
|
//This calls from cache only. Call this AFTER caching all runebase effects;
|
|
|
|
|
|
|
|
|
|
|
|
public HashMap<Integer, ArrayList<RuneBaseEffect>> LOAD_BASEEFFECTS_FOR_RUNEBASE() { |
|
|
|
public HashMap<Integer, ArrayList<RuneBaseEffect>> LOAD_BASEEFFECTS_FOR_RUNEBASE() { |
|
|
|
|
|
|
|
|
|
|
|
HashMap<Integer, ArrayList<RuneBaseEffect>> runeBaseEffectSet; |
|
|
|
HashMap<Integer, ArrayList<RuneBaseEffect>> runeBaseEffectSet; |
|
|
|
runeBaseEffectSet = new HashMap<>(); |
|
|
|
runeBaseEffectSet = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (AbstractGameObject runeBaseEffect:DbManager.getList(GameObjectType.RuneBaseEffect)){ |
|
|
|
for (AbstractGameObject runeBaseEffect:DbManager.getList(GameObjectType.RuneBaseEffect)){ |
|
|
|
|
|
|
|
|
|
|
|
int runeBaseID = ((RuneBaseEffect)runeBaseEffect).getRuneBaseID(); |
|
|
|
int runeBaseID = ((RuneBaseEffect)runeBaseEffect).getRuneBaseID(); |
|
|
|