forked from MagicBane/Server
Must wait for a mine window to close to change your guild's WOO to it.
This commit is contained in:
@@ -46,13 +46,13 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler {
|
|||||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
|
||||||
|
|
||||||
PlayerCharacter playerCharacter = SessionManager.getPlayerCharacter(origin);
|
PlayerCharacter playerCharacter = SessionManager.getPlayerCharacter(origin);
|
||||||
ArcMineWindowChangeMsg mineWindowChangeMsg = (ArcMineWindowChangeMsg)baseMsg;
|
ArcMineWindowChangeMsg mineWindowChangeMsg = (ArcMineWindowChangeMsg) baseMsg;
|
||||||
int newMineTime;
|
int newMineTime;
|
||||||
|
|
||||||
if (playerCharacter == null)
|
if (playerCharacter == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
Building treeOfLife = BuildingManager.getBuildingFromCache(mineWindowChangeMsg.getBuildingID());
|
Building treeOfLife = BuildingManager.getBuildingFromCache(mineWindowChangeMsg.getBuildingID());
|
||||||
|
|
||||||
if (treeOfLife == null)
|
if (treeOfLife == null)
|
||||||
return true;
|
return true;
|
||||||
@@ -64,7 +64,8 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
Guild mineGuild = treeOfLife.getGuild();
|
Guild mineGuild = treeOfLife.getGuild();
|
||||||
if (mineGuild == null)
|
|
||||||
|
if (mineGuild.isErrant())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!Guild.sameGuild(mineGuild, playerCharacter.getGuild()))
|
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.
|
//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 &&
|
if (newMineTime < MBServerStatics.MINE_EARLY_WINDOW &&
|
||||||
newMineTime != MBServerStatics.MINE_LATE_WINDOW)
|
newMineTime != MBServerStatics.MINE_LATE_WINDOW) {
|
||||||
return true; //invalid mine time, must be in range
|
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
|
// Update guild mine time
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user