Add better control over expression timeouts. (#451)

Add better control over expression timeouts.
* //timeout command can be used to change player's current timeout.
* Config now also has a max timeout, can be bypassed with permission
* Timeout of < 0 will let expressions run indefinitely.
* Said expressions won't run on a separate thread, slightly reducing the
  overhead from context switching. For large //gen commands, for example,
  this can actually increase speed.
This commit is contained in:
wizjany
2019-03-06 19:58:32 -05:00
committed by GitHub
parent f84f3c6f85
commit de08c8b8c7
21 changed files with 301 additions and 76 deletions

View File

@ -108,6 +108,7 @@ public class YAMLConfiguration extends LocalConfiguration {
scriptsDir = config.getString("scripting.dir", scriptsDir);
calculationTimeout = config.getInt("calculation.timeout", calculationTimeout);
maxCalculationTimeout = config.getInt("calculation.max-timeout", maxCalculationTimeout);
saveDir = config.getString("saving.dir", saveDir);