From 94be3335a0eed3963a45df2da15c69b398fc8577 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 25 Jun 2024 19:55:30 -0500 Subject: [PATCH] mine production change error tracking --- .../ArcMineChangeProductionMsgHandler.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java b/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java index 67e42527..4e60d332 100644 --- a/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java @@ -11,6 +11,7 @@ import engine.objects.GuildStatusController; import engine.objects.Mine; import engine.objects.PlayerCharacter; import engine.objects.Resource; +import org.pmw.tinylog.Logger; /* * @Author: @@ -35,26 +36,28 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler //TODO verify this against the warehouse? - if (GuildStatusController.isInnerCouncil(playerCharacter.getGuildStatus()) == false) // is this only GL? + if (!GuildStatusController.isInnerCouncil(playerCharacter.getGuildStatus())) // is this only GL? return true; Mine mine = Mine.getMine(changeProductionMsg.getMineID()); - if (mine == null) + if (mine == null) { + Logger.error("Player Character: " + playerCharacter.getName() + " Tried To Change Mine: " + changeProductionMsg.getMineID() + " and Mine was Null"); return true; - + } //make sure mine belongs to guild - if (mine.getOwningGuild().isEmptyGuild() || - mine.getOwningGuild().getObjectUUID() != playerCharacter.getGuild().getObjectUUID()) + if (mine.getOwningGuild().isEmptyGuild() || mine.getOwningGuild().getObjectUUID() != playerCharacter.getGuild().getObjectUUID()) return true; //make sure valid resource Resource resource = Resource.resourceByHash.get(changeProductionMsg.getResourceHash()); - if (resource == null) + if (resource == null) { + Logger.error("Player Character: " + playerCharacter.getName() + " Tried To Change Mine: " + changeProductionMsg.getMineID() + " and Resource was Null"); return true; + } //update resource