Browse Source

fixed login bug

lakebane-strongholds
FatBoy-DOTC 2 months ago
parent
commit
8f394cd01d
  1. 19
      src/engine/db/handlers/dbCityHandler.java
  2. 2
      src/engine/objects/Mine.java
  3. 3
      src/engine/server/login/LoginServer.java

19
src/engine/db/handlers/dbCityHandler.java

@ -11,10 +11,7 @@ package engine.db.handlers; @@ -11,10 +11,7 @@ package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager;
import engine.objects.AbstractGameObject;
import engine.objects.Building;
import engine.objects.City;
import engine.objects.Zone;
import engine.objects.*;
import org.pmw.tinylog.Logger;
import java.sql.*;
@ -98,21 +95,11 @@ public class dbCityHandler extends dbHandlerBase { @@ -98,21 +95,11 @@ public class dbCityHandler extends dbHandlerBase {
public Integer GET_CAPITAL_CITY_COUNT() {
int cityCount = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM obj_city;")) {
ResultSet rs = preparedStatement.executeQuery();
while(rs.next()){
if(rs.getInt("isNpc") == 0)
if(DbManager.BuildingQueries.GET_BUILDINGBYUUID(rs.getInt("treeOfLifeUUID")).getRank() == 8)
for(Realm realm : Realm._realms.values()){
if(realm.isRuled())
cityCount ++;
}
} catch (SQLException e) {
Logger.error(e);
}
return cityCount;
}
public ArrayList<City> GET_CITIES_BY_ZONE(final int objectUUID) {

2
src/engine/objects/Mine.java

@ -504,7 +504,7 @@ public class Mine extends AbstractGameObject { @@ -504,7 +504,7 @@ public class Mine extends AbstractGameObject {
return false;
ItemBase resourceIB = ItemBase.getItemBase(this.production.UUID);
return this.owningGuild.getOwnedCity().getWarehouse().depositFromMine(this, resourceIB, (int)(this.getModifiedProductionAmount() * 0.5f));
return this.owningGuild.getOwnedCity().getWarehouse().depositFromMine(this, resourceIB, this.getModifiedProductionAmount());
}
public boolean updateGuildOwner(PlayerCharacter playerCharacter) {

3
src/engine/server/login/LoginServer.java

@ -210,6 +210,9 @@ public class LoginServer { @@ -210,6 +210,9 @@ public class LoginServer {
nextServerTime = LocalDateTime.now().plusSeconds(1);
}
//load realm for the server pop creation screen
Realm.loadAllRealms();
if (LocalDateTime.now().isAfter(nextDatabaseTime)) {
String pop = SimulationManager.getPopulationString();
Logger.info("Keepalive: " + pop);

Loading…
Cancel
Save