added strict configuration
This commit is contained in:
1 parent
0f9d2f6d5b
commit
893c3b984f
2 files changed
+4
No files matched your search
@@ -100,6 +100,7 @@ public class CarpetScriptHost extends ScriptHost
|
|||||||
else if (parent != null)
|
else if (parent != null)
|
||||||
{
|
{
|
||||||
persistenceRequired = ((CarpetScriptHost)parent).persistenceRequired;
|
persistenceRequired = ((CarpetScriptHost)parent).persistenceRequired;
|
||||||
|
strict = parent.strict;
|
||||||
}
|
}
|
||||||
appConfig = config;
|
appConfig = config;
|
||||||
appArgTypes = argTypes;
|
appArgTypes = argTypes;
|
||||||
@@ -306,6 +307,7 @@ public class CarpetScriptHost extends ScriptHost
|
|||||||
Map<Value, Value> config = ((MapValue) ret).getMap();
|
Map<Value, Value> config = ((MapValue) ret).getMap();
|
||||||
setPerPlayer(config.getOrDefault(new StringValue("scope"), new StringValue("player")).getString().equalsIgnoreCase("player"));
|
setPerPlayer(config.getOrDefault(new StringValue("scope"), new StringValue("player")).getString().equalsIgnoreCase("player"));
|
||||||
persistenceRequired = config.getOrDefault(new StringValue("stay_loaded"), Value.TRUE).getBoolean();
|
persistenceRequired = config.getOrDefault(new StringValue("stay_loaded"), Value.TRUE).getBoolean();
|
||||||
|
strict = config.getOrDefault(StringValue.of("strict"), Value.FALSE).getBoolean();
|
||||||
// check requires
|
// check requires
|
||||||
Value loadRequirements = config.get(new StringValue("requires"));
|
Value loadRequirements = config.get(new StringValue("requires"));
|
||||||
if (loadRequirements instanceof FunctionValue)
|
if (loadRequirements instanceof FunctionValue)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public abstract class ScriptHost
|
|||||||
private final Map<Value, ThreadPoolExecutor> executorServices = new HashMap<>();
|
private final Map<Value, ThreadPoolExecutor> executorServices = new HashMap<>();
|
||||||
private final Map<Value, Object> locks = new ConcurrentHashMap<>();
|
private final Map<Value, Object> locks = new ConcurrentHashMap<>();
|
||||||
protected boolean inTermination = false;
|
protected boolean inTermination = false;
|
||||||
|
public boolean strict;
|
||||||
|
|
||||||
private final Set<String> deprecations = new HashSet<>();
|
private final Set<String> deprecations = new HashSet<>();
|
||||||
|
|
||||||
@@ -118,6 +119,7 @@ public abstract class ScriptHost
|
|||||||
this.main = code;
|
this.main = code;
|
||||||
this.perUser = perUser;
|
this.perUser = perUser;
|
||||||
this.user = null;
|
this.user = null;
|
||||||
|
this.strict = false;
|
||||||
ModuleData moduleData = new ModuleData(code);
|
ModuleData moduleData = new ModuleData(code);
|
||||||
initializeModuleGlobals(moduleData);
|
initializeModuleGlobals(moduleData);
|
||||||
this.moduleData.put(code, moduleData);
|
this.moduleData.put(code, moduleData);
|
||||||
|
|||||||
Reference in new issue
Block a user