More info on template bootstrap
This commit is contained in:
@@ -26,6 +26,7 @@ import java.sql.PreparedStatement;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
|
||||||
@@ -181,6 +182,8 @@ public class dbItemHandler extends dbHandlerBase {
|
|||||||
|
|
||||||
JSONParser jsonParser = new JSONParser();
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
|
||||||
|
HashMap<ItemType, Integer> templateTCountMap = new HashMap<>();
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
try (Connection connection = DbManager.getConnection();
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_templates`;");
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_templates`;");
|
||||||
ResultSet rs = preparedStatement.executeQuery()) {
|
ResultSet rs = preparedStatement.executeQuery()) {
|
||||||
@@ -191,8 +194,14 @@ public class dbItemHandler extends dbHandlerBase {
|
|||||||
ItemTemplate itemTemplate = new ItemTemplate(jsonObject);
|
ItemTemplate itemTemplate = new ItemTemplate(jsonObject);
|
||||||
itemTemplate.template_id = templateID;
|
itemTemplate.template_id = templateID;
|
||||||
ItemTemplate.templates.put(templateID, itemTemplate);
|
ItemTemplate.templates.put(templateID, itemTemplate);
|
||||||
|
|
||||||
|
if (templateTCountMap.entrySet().contains(itemTemplate.item_type))
|
||||||
|
templateTCountMap.put(itemTemplate.item_type, templateTCountMap.get(itemTemplate.item_type) + 1);
|
||||||
|
else
|
||||||
|
templateTCountMap.put(itemTemplate.item_type, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.info(templateTCountMap.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user