Synced ScriptEngineManager changes from Test to HighFive.
This commit is contained in:
@ -16,11 +16,10 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.taskmanager.tasks;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.script.ScriptException;
|
||||
|
||||
import com.l2jmobius.gameserver.scripting.L2ScriptEngineManager;
|
||||
import com.l2jmobius.gameserver.scripting.ScriptEngineManager;
|
||||
import com.l2jmobius.gameserver.taskmanager.Task;
|
||||
import com.l2jmobius.gameserver.taskmanager.TaskManager.ExecutedTask;
|
||||
|
||||
@ -40,26 +39,13 @@ public class TaskScript extends Task
|
||||
@Override
|
||||
public void onTimeElapsed(ExecutedTask task)
|
||||
{
|
||||
final File file = new File(L2ScriptEngineManager.SCRIPT_FOLDER, "cron/" + task.getParams()[2]);
|
||||
if (file.isFile())
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
L2ScriptEngineManager.getInstance().executeScript(file);
|
||||
}
|
||||
catch (ScriptException e)
|
||||
{
|
||||
_log.warning("Failed loading: " + task.getParams()[2]);
|
||||
L2ScriptEngineManager.getInstance().reportScriptFileError(file, e);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning("Failed loading: " + task.getParams()[2]);
|
||||
}
|
||||
ScriptEngineManager.getInstance().executeScript(Paths.get("cron", task.getParams()[2]));
|
||||
}
|
||||
else
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning("File Not Found: " + task.getParams()[2]);
|
||||
_log.log(Level.WARNING, "Script execution failed!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user