From dab909768071c03d4ec1d52b84be6340175ffb64 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 19 Jan 2023 12:41:32 -0500 Subject: [PATCH] Must wait for a mine window to close to change your guild's WOO to it. --- .../handlers/MineWindowChangeHandler.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/engine/net/client/handlers/MineWindowChangeHandler.java b/src/engine/net/client/handlers/MineWindowChangeHandler.java index 96312545..e4ee4df7 100644 --- a/src/engine/net/client/handlers/MineWindowChangeHandler.java +++ b/src/engine/net/client/handlers/MineWindowChangeHandler.java @@ -46,13 +46,13 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler { protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException { PlayerCharacter playerCharacter = SessionManager.getPlayerCharacter(origin); - ArcMineWindowChangeMsg mineWindowChangeMsg = (ArcMineWindowChangeMsg)baseMsg; + ArcMineWindowChangeMsg mineWindowChangeMsg = (ArcMineWindowChangeMsg) baseMsg; int newMineTime; if (playerCharacter == null) return true; - Building treeOfLife = BuildingManager.getBuildingFromCache(mineWindowChangeMsg.getBuildingID()); + Building treeOfLife = BuildingManager.getBuildingFromCache(mineWindowChangeMsg.getBuildingID()); if (treeOfLife == null) return true; @@ -64,7 +64,8 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler { return true; Guild mineGuild = treeOfLife.getGuild(); - if (mineGuild == null) + + if (mineGuild.isErrant()) return true; if (!Guild.sameGuild(mineGuild, playerCharacter.getGuild())) @@ -85,8 +86,15 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler { //hodge podge sanity check to make sure they don't set it before early window and is not set at late window. if (newMineTime < MBServerStatics.MINE_EARLY_WINDOW && - newMineTime != MBServerStatics.MINE_LATE_WINDOW) - return true; //invalid mine time, must be in range + newMineTime != MBServerStatics.MINE_LATE_WINDOW) { + ErrorPopupMsg.sendErrorMsg(playerCharacter, "Mine time is outside the NA Woo window."); + return true; + } + + if (newMineTime <= LocalDateTime.now().getHour()) { + ErrorPopupMsg.sendErrorMsg(playerCharacter, "You must first wait for that mine window to close."); + return true; + } // Update guild mine time