Skip to content

Commit

Permalink
Configurable tag timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 30, 2015
1 parent f4e68b1 commit 3330cb4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -132,4 +132,6 @@ public interface DenizenImplementation {
public abstract String getLastEntryFromFlag(String flag);

public TagContext getTagContext(ScriptEntry entry);

public int getTagTimeout();
}
@@ -1,5 +1,6 @@
package net.aufdemrand.denizencore.tags;

import net.aufdemrand.denizencore.DenizenCore;
import net.aufdemrand.denizencore.objects.ObjectFetcher;
import net.aufdemrand.denizencore.objects.dList;
import net.aufdemrand.denizencore.objects.dObject;
Expand Down Expand Up @@ -277,7 +278,13 @@ public static String readSingleTag(String str, TagContext context) {
}
else {
// Call Event
executeWithTimeLimit(event, 10); // TODO: timeout setting
int tT = DenizenCore.getImplementation().getTagTimeout();
if (tT <= 0) {
fireEvent(event);
}
else {
executeWithTimeLimit(event, tT);
}
if ((!event.replaced() && event.getAlternative() != null) && event.hasAlternative())
event.setReplaced(event.getAlternative());
if (context.debug)
Expand Down

0 comments on commit 3330cb4

Please sign in to comment.