}
LocalSession session = getSessionManager().get(player);
CraftScriptContext scriptContext = new CraftScriptContext(this, getServer(), getConfiguration(), session, player, args);
CraftScriptEngine engine = null;
try {
engine = new RhinoCraftScriptEngine();
} catch (NoClassDefFoundError e) {
player.printError("Failed to find an installed script engine.");
player.printError("Please see http://wiki.sk89q.com/wiki/WorldEdit/Installation");
return;
}
engine.setTimeLimit(getConfiguration().scriptTimeout);
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("argv", args);
vars.put("context", scriptContext);
vars.put("player", player);
try {
engine.evaluate(script, filename, vars);
} catch (ScriptException e) {
player.printError("Failed to execute:");
player.printRaw(e.getMessage());
logger.log(Level.WARNING, "Failed to execute script", e);
} catch (NumberFormatException e) {