Refactor WOO change timer mechanics to use the same system as the mine claims. Moved both resets to the hourly job.
This commit is contained in:
@@ -81,10 +81,10 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler {
|
||||
if (newMineTime == 24)
|
||||
newMineTime = 0;
|
||||
|
||||
// Enforce 15hr restriction between WOO edits
|
||||
// Enforce time restriction between WOO edits
|
||||
|
||||
if (LocalDateTime.now().isBefore(mineGuild.lastWooEditTime.plusHours(14))) {
|
||||
ErrorPopupMsg.sendErrorMsg(playerCharacter, "You must wait 15 hours between WOO changes.");
|
||||
if (mineGuild.wooWasModified) {
|
||||
ErrorPopupMsg.sendErrorMsg(playerCharacter, "You can only modify your WOO once per day.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -110,19 +110,11 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
mineGuild.setMineTime(newMineTime);
|
||||
mineGuild.lastWooEditTime = LocalDateTime.now();
|
||||
|
||||
// Update guild WOO timer for reboot persistence
|
||||
|
||||
if (!DbManager.GuildQueries.SET_LAST_WOO_UPDATE(mineGuild, mineGuild.lastWooEditTime)) {
|
||||
Logger.error("MineWindowChange", "Failed to update woo timer for guild " + mineGuild.getObjectUUID());
|
||||
ChatManager.chatGuildError(playerCharacter, "A Serious error has for to occurred.");
|
||||
return true;
|
||||
}
|
||||
mineGuild.wooWasModified = true;
|
||||
|
||||
ChatManager.chatGuildInfo(playerCharacter, "Mine time updated.");
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user