From 86539771e240913e600b83e9ff2b094b5f807e73 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 17 May 2023 16:38:08 -0400 Subject: [PATCH] Unused method. --- .../handlers/dbBuildingLocationHandler.java | 5 -- src/engine/db/handlers/dbMobHandler.java | 11 +-- src/engine/db/handlers/dbRealmHandler.java | 78 +++++++++---------- 3 files changed, 41 insertions(+), 53 deletions(-) diff --git a/src/engine/db/handlers/dbBuildingLocationHandler.java b/src/engine/db/handlers/dbBuildingLocationHandler.java index 2c642e83..7a24bfcc 100644 --- a/src/engine/db/handlers/dbBuildingLocationHandler.java +++ b/src/engine/db/handlers/dbBuildingLocationHandler.java @@ -28,9 +28,4 @@ public class dbBuildingLocationHandler extends dbHandlerBase { return getObjectList(); } - public ArrayList LOAD_ALL_BUILDING_LOCATIONS() { - prepareCallable("SELECT * FROM `static_building_location`;"); - return getObjectList(); - } - } diff --git a/src/engine/db/handlers/dbMobHandler.java b/src/engine/db/handlers/dbMobHandler.java index 004d8de8..aea15d00 100644 --- a/src/engine/db/handlers/dbMobHandler.java +++ b/src/engine/db/handlers/dbMobHandler.java @@ -80,8 +80,6 @@ public class dbMobHandler extends dbHandlerBase { public void LOAD_PATROL_POINTS(Mob captain) { - - prepareCallable("SELECT * FROM `dyn_guards` WHERE `captainUID` = ?"); setInt(1,captain.getObjectUUID()); @@ -89,31 +87,26 @@ public class dbMobHandler extends dbHandlerBase { ResultSet rs = executeQuery(); //shrines cached in rs for easy cache on creation. - while (rs.next()) { + + while (rs.next()) { int mobBaseID = rs.getInt("mobBaseID"); String name = rs.getString("name"); Mob toCreate = Mob.createGuardMob(captain, captain.getGuild(), captain.getParentZone(), captain.building.getLoc(), captain.getLevel(),name); if (toCreate == null) return; - // toCreate.despawn(); if (toCreate != null) { - toCreate.setTimeToSpawnSiege(System.currentTimeMillis() + MBServerStatics.FIFTEEN_MINUTES); toCreate.setDeathTime(System.currentTimeMillis()); - } } - } catch (SQLException e) { Logger.error( e.toString()); } finally { closeCallable(); } - - } public boolean ADD_TO_GUARDS(final long captainUID, final int mobBaseID, final String name, final int slot) { diff --git a/src/engine/db/handlers/dbRealmHandler.java b/src/engine/db/handlers/dbRealmHandler.java index 932d6425..c11147c6 100644 --- a/src/engine/db/handlers/dbRealmHandler.java +++ b/src/engine/db/handlers/dbRealmHandler.java @@ -24,50 +24,50 @@ public class dbRealmHandler extends dbHandlerBase { } - public ConcurrentHashMap LOAD_ALL_REALMS() { - - ConcurrentHashMap realmList; - Realm thisRealm; - - realmList = new ConcurrentHashMap<>(); - int recordsRead = 0; - - prepareCallable("SELECT * FROM obj_realm"); - - try { - ResultSet rs = executeQuery(); - - while (rs.next()) { - - recordsRead++; - thisRealm = new Realm(rs); - realmList.put(thisRealm.getRealmID(), thisRealm); - } - - Logger.info( "read: " + recordsRead + " cached: " + realmList.size()); - - } catch (SQLException e) { - Logger.error(e.getErrorCode() + ' ' + e.getMessage(), e); - } catch (UnknownHostException ex) { + public ConcurrentHashMap LOAD_ALL_REALMS() { + + ConcurrentHashMap realmList; + Realm thisRealm; + + realmList = new ConcurrentHashMap<>(); + int recordsRead = 0; + + prepareCallable("SELECT * FROM obj_realm"); + + try { + ResultSet rs = executeQuery(); + + while (rs.next()) { + + recordsRead++; + thisRealm = new Realm(rs); + realmList.put(thisRealm.getRealmID(), thisRealm); + } + + Logger.info("read: " + recordsRead + " cached: " + realmList.size()); + + } catch (SQLException e) { + Logger.error(e.getErrorCode() + ' ' + e.getMessage(), e); + } catch (UnknownHostException ex) { java.util.logging.Logger.getLogger(dbRealmHandler.class.getName()).log(Level.SEVERE, null, ex); } finally { - closeCallable(); - } - return realmList; - } - + closeCallable(); + } + return realmList; + } + public void REALM_UPDATE(Realm realm) { - prepareCallable("CALL realm_UPDATE(?,?,?,?)"); - - setInt(1, realm.getRealmID()); - setInt(2, (realm.getRulingCity() == null) ? 0 : realm.getRulingCity().getObjectUUID()); - setInt(3, realm.getCharterType()); + prepareCallable("CALL realm_UPDATE(?,?,?,?)"); + + setInt(1, realm.getRealmID()); + setInt(2, (realm.getRulingCity() == null) ? 0 : realm.getRulingCity().getObjectUUID()); + setInt(3, realm.getCharterType()); if (realm.ruledSince != null) setLocalDateTime(4, realm.ruledSince); - else - setNULL(4, java.sql.Types.DATE); - - executeUpdate(); + else + setNULL(4, java.sql.Types.DATE); + + executeUpdate(); } }