|
|
@ -10,12 +10,17 @@ package engine.gameManager; |
|
|
|
|
|
|
|
|
|
|
|
import engine.Enum; |
|
|
|
import engine.Enum; |
|
|
|
import engine.Enum.GameObjectType; |
|
|
|
import engine.Enum.GameObjectType; |
|
|
|
|
|
|
|
import engine.db.archive.DataWarehouse; |
|
|
|
import engine.objects.AbstractGameObject; |
|
|
|
import engine.objects.AbstractGameObject; |
|
|
|
import engine.objects.City; |
|
|
|
import engine.objects.City; |
|
|
|
import engine.objects.PlayerCharacter; |
|
|
|
import engine.objects.PlayerCharacter; |
|
|
|
import engine.objects.Runegate; |
|
|
|
import engine.objects.Runegate; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.sql.Connection; |
|
|
|
|
|
|
|
import java.sql.PreparedStatement; |
|
|
|
|
|
|
|
import java.sql.ResultSet; |
|
|
|
|
|
|
|
import java.sql.SQLException; |
|
|
|
import java.time.Duration; |
|
|
|
import java.time.Duration; |
|
|
|
import java.time.Instant; |
|
|
|
import java.time.Instant; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.Collection; |
|
|
@ -50,11 +55,22 @@ public enum SimulationManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static String getPopulationString() { |
|
|
|
public static String getPopulationString() { |
|
|
|
String outString; |
|
|
|
|
|
|
|
String newLine = System.getProperty("line.separator"); |
|
|
|
String popString = ""; |
|
|
|
outString = "[LUA_POPULATION()]" + newLine; |
|
|
|
|
|
|
|
outString += DbManager.CSSessionQueries.GET_POPULATION_STRING(); |
|
|
|
try (Connection connection = DataWarehouse.connectionPool.getConnection(); |
|
|
|
return outString; |
|
|
|
PreparedStatement getPopString = connection.prepareStatement("CALL GET_POPULATION_STRING()");) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ResultSet rs = getPopString.executeQuery(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rs.next()) |
|
|
|
|
|
|
|
popString = rs.getString("popstring"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
|
|
|
Logger.error(e.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return popString; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|