Browse Source

bugfix: runafterload for instanced agos

master
MagicBot 2 years ago
parent
commit
45d26a82f2
  1. 2
      src/engine/db/handlers/dbGuildHandler.java
  2. 9
      src/engine/db/handlers/dbHandlerBase.java

2
src/engine/db/handlers/dbGuildHandler.java

@ -307,7 +307,7 @@ public class dbGuildHandler extends dbHandlerBase {
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_guild`.*, `object`.`parent` FROM `obj_guild` INNER JOIN `object` ON `object`.`UID` = `obj_guild`.`UID`")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_guild`.*, `object`.`parent` FROM `obj_guild` INNER JOIN `object` ON `object`.`UID` = `obj_guild`.`UID`")) {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
guildList = getObjectsFromRs(rs, 20); guildList = getObjectsFromRs(rs, 100);
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);

9
src/engine/db/handlers/dbHandlerBase.java

@ -9,7 +9,9 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
@ -37,6 +39,13 @@ public abstract class dbHandlerBase {
Logger.error(e); Logger.error(e);
} }
// Only call runAfterLoad() for objects instanced on the world server
if ((abstractGameObject != null && abstractGameObject instanceof AbstractWorldObject) &&
(ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER) ||
(abstractGameObject.getObjectType() == GameObjectType.Guild)))
((AbstractWorldObject) abstractGameObject).runAfterLoad();
return abstractGameObject; return abstractGameObject;
} }

Loading…
Cancel
Save