forked from MagicBane/Server
cleanup
This commit is contained in:
@@ -133,12 +133,8 @@ public class dbLootTableHandler extends dbHandlerBase {
|
|||||||
ResultSet rs = executeQuery();
|
ResultSet rs = executeQuery();
|
||||||
|
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
try {
|
LootManager.GenTableRow row = new LootManager.GenTableRow(rs);
|
||||||
LootManager.GenTable gt = new LootManager.GenTable();
|
LootManager.AddGenTableRow(rs.getInt("groupID"), row);
|
||||||
LootManager.AddGenTableRow(rs.getInt("groupID"), gt, new LootManager.GenTableRow(rs));
|
|
||||||
} catch(Exception ex){
|
|
||||||
Logger.info("LOOT TABLE ERROR FOR TABLE: " + rs.getInt("groupID"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.info( "read: " + recordsRead);
|
Logger.info( "read: " + recordsRead);
|
||||||
@@ -162,12 +158,8 @@ public class dbLootTableHandler extends dbHandlerBase {
|
|||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
|
||||||
recordsRead++;
|
recordsRead++;
|
||||||
try{
|
LootManager.ItemTableRow row = new LootManager.ItemTableRow(rs);
|
||||||
LootManager.ItemTable it = new LootManager.ItemTable();
|
LootManager.AddItemTableRow(rs.getInt("lootTable"),row);
|
||||||
LootManager.AddItemTableRow(rs.getInt("lootTable"),it,new LootManager.ItemTableRow(rs));
|
|
||||||
} catch(Exception ex){
|
|
||||||
Logger.info("LOOT TABLE ERROR FOR TABLE: " + rs.getInt("lootTable"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.info("read: " + recordsRead);
|
Logger.info("read: " + recordsRead);
|
||||||
@@ -190,12 +182,8 @@ public class dbLootTableHandler extends dbHandlerBase {
|
|||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
|
||||||
recordsRead++;
|
recordsRead++;
|
||||||
try{
|
LootManager.ModTypeTableRow mttr = new LootManager.ModTypeTableRow(rs);
|
||||||
LootManager.ModTypeTable mtt = new LootManager.ModTypeTable();
|
LootManager.AddModTypeTableRow(rs.getInt("modGroup"),mttr);
|
||||||
LootManager.AddModTypeTableRow(rs.getInt("modGroup"),mtt,new LootManager.ModTypeTableRow(rs));
|
|
||||||
} catch(Exception ex){
|
|
||||||
Logger.info("LOOT TABLE ERROR FOR TABLE: " + rs.getInt("modGroup"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.info( "read: " + recordsRead);
|
Logger.info( "read: " + recordsRead);
|
||||||
@@ -218,12 +206,8 @@ public class dbLootTableHandler extends dbHandlerBase {
|
|||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
|
||||||
recordsRead++;
|
recordsRead++;
|
||||||
try{
|
LootManager.ModTableRow mtr = new LootManager.ModTableRow(rs);
|
||||||
LootManager.ModTable mt = new LootManager.ModTable();
|
LootManager.AddModTableRow(rs.getInt("modTable"),mtr);
|
||||||
LootManager.AddModTableRow(rs.getInt("modTable"),mt,new LootManager.ModTableRow(rs));
|
|
||||||
} catch(Exception ex){
|
|
||||||
Logger.info("LOOT TABLE ERROR FOR TABLE: " + rs.getInt("modTable"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.info( "read: " + recordsRead);
|
Logger.info( "read: " + recordsRead);
|
||||||
|
|||||||
@@ -112,48 +112,48 @@ public class LootManager {
|
|||||||
}
|
}
|
||||||
return outItem;
|
return outItem;
|
||||||
}
|
}
|
||||||
public static void AddGenTableRow(int tableID, GenTable genTable, GenTableRow row){
|
public static void AddGenTableRow(int tableID,GenTableRow row){
|
||||||
if(!generalItemTables.containsKey(tableID)){
|
if(!generalItemTables.containsKey(tableID)){
|
||||||
//create the new table
|
//create the new table
|
||||||
generalItemTables.put(tableID,genTable);
|
GenTable gt = new GenTable();
|
||||||
//add row to new table
|
gt.rows.add(row);
|
||||||
generalItemTables.get(tableID).rows.add(row);
|
generalItemTables.put(tableID,gt);
|
||||||
} else{
|
} else{
|
||||||
//add row to existing table
|
//add row to existing table
|
||||||
GenTable toAdd = generalItemTables.get(tableID);
|
GenTable toAdd = generalItemTables.get(tableID);
|
||||||
toAdd.rows.add(row);
|
toAdd.rows.add(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void AddItemTableRow(int tableID,ItemTable itemTable, ItemTableRow row){
|
public static void AddItemTableRow(int tableID, ItemTableRow row){
|
||||||
if(!itemTables.containsKey(tableID)){
|
if(!itemTables.containsKey(tableID)){
|
||||||
//create the new table
|
//create the new table
|
||||||
itemTables.put(tableID,itemTable);
|
ItemTable it = new ItemTable();
|
||||||
//add new row to table
|
it.rows.add(row);
|
||||||
itemTables.get(tableID).rows.add(row);
|
itemTables.put(tableID,it);
|
||||||
} else{
|
} else{
|
||||||
//add row to existing table
|
//add row to existing table
|
||||||
ItemTable toAdd = itemTables.get(tableID);
|
ItemTable toAdd = itemTables.get(tableID);
|
||||||
toAdd.rows.add(row);
|
toAdd.rows.add(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void AddModTypeTableRow(int tableID,ModTypeTable modtypeTable, ModTypeTableRow row){
|
public static void AddModTypeTableRow(int tableID, ModTypeTableRow row){
|
||||||
if(!modTypeTables.containsKey(tableID)){
|
if(!modTypeTables.containsKey(tableID)){
|
||||||
//create the new table
|
//create the new table
|
||||||
modTypeTables.put(tableID,modtypeTable);
|
ModTypeTable mtt = new ModTypeTable();
|
||||||
//add row to new table
|
mtt.rows.add(row);
|
||||||
modTypeTables.get(tableID).rows.add(row);
|
modTypeTables.put(tableID,mtt);
|
||||||
} else{
|
} else{
|
||||||
//add row to existing table
|
//add row to existing table
|
||||||
ModTypeTable toAdd = modTypeTables.get(tableID);
|
ModTypeTable toAdd = modTypeTables.get(tableID);
|
||||||
toAdd.rows.add(row);
|
toAdd.rows.add(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void AddModTableRow(int tableID, ModTable modTable, ModTableRow row){
|
public static void AddModTableRow(int tableID,ModTableRow row){
|
||||||
if(!itemTables.containsKey(tableID)){
|
if(!itemTables.containsKey(tableID)){
|
||||||
//create the new table
|
//create the new table
|
||||||
modTables.put(tableID,modTable);
|
ModTable mt = new ModTable();
|
||||||
//add row to new table
|
mt.rows.add(row);
|
||||||
modTables.get(tableID).rows.add(row);
|
modTables.put(tableID,mt);
|
||||||
} else{
|
} else{
|
||||||
//add row to existing table
|
//add row to existing table
|
||||||
ModTable toAdd = modTables.get(tableID);
|
ModTable toAdd = modTables.get(tableID);
|
||||||
|
|||||||
Reference in New Issue
Block a user