From 45d26a82f2b71dc3871ae13de75407d08ad14b3a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 23 May 2023 12:53:04 -0400 Subject: [PATCH] bugfix: runafterload for instanced agos --- src/engine/db/handlers/dbGuildHandler.java | 2 +- src/engine/db/handlers/dbHandlerBase.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/db/handlers/dbGuildHandler.java b/src/engine/db/handlers/dbGuildHandler.java index 159c2bee..e625f939 100644 --- a/src/engine/db/handlers/dbGuildHandler.java +++ b/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`")) { ResultSet rs = preparedStatement.executeQuery(); - guildList = getObjectsFromRs(rs, 20); + guildList = getObjectsFromRs(rs, 100); } catch (SQLException e) { Logger.error(e); diff --git a/src/engine/db/handlers/dbHandlerBase.java b/src/engine/db/handlers/dbHandlerBase.java index e16b49ca..1e1ee851 100644 --- a/src/engine/db/handlers/dbHandlerBase.java +++ b/src/engine/db/handlers/dbHandlerBase.java @@ -9,7 +9,9 @@ package engine.db.handlers; +import engine.Enum; import engine.Enum.GameObjectType; +import engine.gameManager.ConfigManager; import engine.gameManager.DbManager; import engine.objects.AbstractGameObject; import engine.objects.AbstractWorldObject; @@ -37,6 +39,13 @@ public abstract class dbHandlerBase { 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; }