BootySets generated with cache data loaded at bootstrap.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.NPCManager;
|
||||
import engine.objects.BootySetEntry;
|
||||
import engine.objects.EquipmentSetEntry;
|
||||
import engine.objects.ItemBase;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -191,4 +192,46 @@ public class dbItemBaseHandler extends dbHandlerBase {
|
||||
}
|
||||
return runeSets;
|
||||
}
|
||||
|
||||
public HashMap<Integer, ArrayList<BootySetEntry>> LOAD_BOOTY_FOR_MOBS() {
|
||||
|
||||
HashMap<Integer, ArrayList<BootySetEntry>> bootySets = new HashMap<>();
|
||||
BootySetEntry bootySetEntry;
|
||||
int bootySetID;
|
||||
|
||||
int recordsRead = 0;
|
||||
|
||||
prepareCallable("SELECT * FROM static_npc_bootySet");
|
||||
|
||||
try {
|
||||
ResultSet rs = executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
|
||||
recordsRead++;
|
||||
|
||||
bootySetID = rs.getInt("bootySet");
|
||||
bootySetEntry = new BootySetEntry(rs);
|
||||
|
||||
if (bootySets.get(bootySetID) == null){
|
||||
ArrayList<BootySetEntry> bootyList = new ArrayList<>();
|
||||
bootyList.add(bootySetEntry);
|
||||
bootySets.put(bootySetID, bootyList);
|
||||
}
|
||||
else{
|
||||
ArrayList<BootySetEntry>bootyList = bootySets.get(bootySetID);
|
||||
bootyList.add(bootySetEntry);
|
||||
bootySets.put(bootySetID, bootyList);
|
||||
}
|
||||
}
|
||||
|
||||
Logger.info("read: " + recordsRead + " cached: " + bootySets.size());
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error( e.toString());
|
||||
} finally {
|
||||
closeCallable();
|
||||
}
|
||||
return bootySets;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user