Data populated at bootstrap.
This commit is contained in:
@@ -28,7 +28,6 @@ import java.sql.SQLException;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@@ -550,6 +549,29 @@ public class dbBuildingHandler extends dbHandlerBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void POPULATE_RENDER_LOOKUP() {
|
||||||
|
|
||||||
|
try (Connection connection = DbManager.getConnection();
|
||||||
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_structure_renders`")) {
|
||||||
|
|
||||||
|
ResultSet rs = preparedStatement.executeQuery();
|
||||||
|
|
||||||
|
while (rs.next()) {
|
||||||
|
|
||||||
|
int structureID = rs.getInt("structureID");
|
||||||
|
int renderID = rs.getInt("renderID");
|
||||||
|
|
||||||
|
if (!BuildingManager._render_lookup.containsKey(structureID))
|
||||||
|
BuildingManager._render_lookup.put(structureID, new ArrayList<>());
|
||||||
|
|
||||||
|
BuildingManager._render_lookup.get(structureID).add(renderID);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException e) {
|
||||||
|
Logger.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void LOAD_MESH_HULLS() {
|
public void LOAD_MESH_HULLS() {
|
||||||
|
|
||||||
int recordsRead = 0;
|
int recordsRead = 0;
|
||||||
|
|||||||
@@ -403,6 +403,9 @@ public class WorldServer {
|
|||||||
Logger.info("Loading building slot/stuck location data.");
|
Logger.info("Loading building slot/stuck location data.");
|
||||||
BuildingLocation.loadBuildingLocations();
|
BuildingLocation.loadBuildingLocations();
|
||||||
|
|
||||||
|
Logger.info("Populating structure to render lookup.");
|
||||||
|
DbManager.BuildingQueries.POPULATE_RENDER_LOOKUP();
|
||||||
|
|
||||||
Logger.info("Loading mesh hulls.");
|
Logger.info("Loading mesh hulls.");
|
||||||
DbManager.BuildingQueries.LOAD_MESH_HULLS();
|
DbManager.BuildingQueries.LOAD_MESH_HULLS();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user