Redo delay?
Skyguysnips opened this issue ยท 2 comments
The plugin works to great effect, however having a redo delay that is measured in seconds leads to frustration because I want some quests to be impossible to redo, yet I can't do anything about it. The longest redo delay that has worked successfully for me is 22 days. I tried 28 days (written in seconds) and the plugin wouldn't recognize it as a value. Can we change redo delay to minutes or make it possible to add longer strings?
Hey there,
just open the Quest Editor, select the Quest and enter
4 - Set redo delay
In the English version there will appear that sentence:
Enter amount of time (in seconds), 0 to clear the redo delay or -1 to cancel
So just enter 0 to remove the redo delay - a Quester is not able to do this Quest again.
I think the max size of delay depends on the declaration of the variables for the numbers.
For example:
A minute has 60 seconds -> 3.600seconds a hour -> 86.400 seconds a day -> 1.900.800 seconds for 22 days
@Override
public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
return new CreateMenuPrompt();
}
if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.setSessionData(CK.Q_REDO_DELAY, null);
}
long delay;
try {
int i = Integer.parseInt(input);
delay = i * 1000;
} catch (NumberFormatException e) {
context.getForWhom().sendRawMessage(ITALIC + "" + RED + input + RESET + RED + " " + Lang.get("stageEditorInvalidNumber"));
//delay = MiscUtil.getTimeFromString(input);
return new RedoDelayPrompt();
}
if (delay < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorPositiveAmount"));
} else if (delay == 0) {
context.setSessionData(CK.Q_REDO_DELAY, null);
} else if (delay != -1) {
context.setSessionData(CK.Q_REDO_DELAY, delay);
}
return new CreateMenuPrompt();
}
}
Tha maximum input for the delay is 2.147.483.647.
Well in this case there is much space to the maximum limit. I am finished with my knowledge right here.
Hope someone else has a solution for that problem...
With kind regards
BloodSKreaper
@BloodSKreaper Better late than never, but thank you for your writeup.
Considering this setting used milliseconds prior to my taking over development, I like to think progress has been made. And of course, changing units to minutes would disadvantage those that want a timeout of 30 seconds. A solution would be to allow both with a String variable of "5m" or "30s" with the letter indicating time unit, but seeing as redo delays are still broken (see #329), I'm going to mark this as an enhancement and close it for now.