L2J_GeoDriver, java-engine-1.8 and mmocore libraries are dropped and directly integrated to project under "com.l2jserver.commons".
This commit is contained in:
@@ -30,13 +30,12 @@ import java.util.logging.Level;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.mmocore.network.SelectorConfig;
|
||||
import org.mmocore.network.SelectorThread;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.Server;
|
||||
import com.l2jserver.UPnPService;
|
||||
import com.l2jserver.commons.mmocore.SelectorConfig;
|
||||
import com.l2jserver.commons.mmocore.SelectorThread;
|
||||
import com.l2jserver.gameserver.cache.HtmCache;
|
||||
import com.l2jserver.gameserver.data.sql.impl.AnnouncementsTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.CharNameTable;
|
||||
|
@@ -24,6 +24,8 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.commons.geodriver.Cell;
|
||||
import com.l2jserver.commons.geodriver.GeoDriver;
|
||||
import com.l2jserver.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
@@ -32,8 +34,6 @@ import com.l2jserver.gameserver.model.interfaces.ILocational;
|
||||
import com.l2jserver.gameserver.util.GeoUtils;
|
||||
import com.l2jserver.gameserver.util.LinePointIterator;
|
||||
import com.l2jserver.gameserver.util.LinePointIterator3D;
|
||||
import com.l2jserver.geodriver.Cell;
|
||||
import com.l2jserver.geodriver.GeoDriver;
|
||||
|
||||
/**
|
||||
* @author -Nemesiss-, HorridoJoho
|
||||
|
@@ -33,12 +33,11 @@ import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.mmocore.network.MMOClient;
|
||||
import org.mmocore.network.MMOConnection;
|
||||
import org.mmocore.network.ReceivablePacket;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.commons.mmocore.MMOClient;
|
||||
import com.l2jserver.commons.mmocore.MMOConnection;
|
||||
import com.l2jserver.commons.mmocore.ReceivablePacket;
|
||||
import com.l2jserver.gameserver.LoginServerThread;
|
||||
import com.l2jserver.gameserver.LoginServerThread.SessionKey;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
|
@@ -21,13 +21,12 @@ package com.l2jserver.gameserver.network;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.mmocore.network.IClientFactory;
|
||||
import org.mmocore.network.IMMOExecutor;
|
||||
import org.mmocore.network.IPacketHandler;
|
||||
import org.mmocore.network.MMOConnection;
|
||||
import org.mmocore.network.ReceivablePacket;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.commons.mmocore.IClientFactory;
|
||||
import com.l2jserver.commons.mmocore.IMMOExecutor;
|
||||
import com.l2jserver.commons.mmocore.IPacketHandler;
|
||||
import com.l2jserver.commons.mmocore.MMOConnection;
|
||||
import com.l2jserver.commons.mmocore.ReceivablePacket;
|
||||
import com.l2jserver.gameserver.network.L2GameClient.GameClientState;
|
||||
import com.l2jserver.gameserver.network.clientpackets.*;
|
||||
import com.l2jserver.gameserver.network.clientpackets.crystalization.RequestCrystallizeEstimate;
|
||||
|
@@ -22,9 +22,8 @@ import java.nio.BufferUnderflowException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.mmocore.network.ReceivablePacket;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.commons.mmocore.ReceivablePacket;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.L2GameClient;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
|
@@ -21,8 +21,7 @@ package com.l2jserver.gameserver.network.serverpackets;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.mmocore.network.SendablePacket;
|
||||
|
||||
import com.l2jserver.commons.mmocore.SendablePacket;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.interfaces.IPositionable;
|
||||
import com.l2jserver.gameserver.model.interfaces.IUpdateTypeComponent;
|
||||
|
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.pathfinding.cellnodes;
|
||||
|
||||
import com.l2jserver.commons.geodriver.Cell;
|
||||
import com.l2jserver.gameserver.GeoData;
|
||||
import com.l2jserver.gameserver.pathfinding.AbstractNodeLoc;
|
||||
import com.l2jserver.geodriver.Cell;
|
||||
|
||||
/**
|
||||
* @author -Nemesiss-, HorridoJoho
|
||||
|
@@ -23,8 +23,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import javax.script.ScriptContext;
|
||||
|
||||
import com.l2jserver.gameserver.scripting.L2ScriptEngineManager;
|
||||
|
||||
public class Expression
|
||||
{
|
||||
protected static final Logger _log = Logger.getLogger(Expression.class.getName());
|
||||
@@ -34,32 +32,6 @@ public class Expression
|
||||
@SuppressWarnings("unused")
|
||||
private final String _code;
|
||||
|
||||
public static Object eval(String lang, String code)
|
||||
{
|
||||
try
|
||||
{
|
||||
return L2ScriptEngineManager.getInstance().eval(lang, code);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Object eval(ScriptContext context, String lang, String code)
|
||||
{
|
||||
try
|
||||
{
|
||||
return L2ScriptEngineManager.getInstance().eval(lang, code, context);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression create(ScriptContext context, String lang, String code)
|
||||
{
|
||||
try
|
||||
|
@@ -25,6 +25,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -40,9 +41,8 @@ import javax.script.ScriptEngineManager;
|
||||
import javax.script.ScriptException;
|
||||
import javax.script.SimpleScriptContext;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.commons.javaengine.JavaScriptEngineFactory;
|
||||
|
||||
/**
|
||||
* Caches script engines and provides functionality for executing and managing scripts.
|
||||
@@ -59,8 +59,7 @@ public final class L2ScriptEngineManager
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private final Map<String, ScriptEngine> _nameEngines = new FastMap<>();
|
||||
private final Map<String, ScriptEngine> _extEngines = new FastMap<>();
|
||||
private final Map<String, ScriptEngine> _extEngines = new HashMap<>();
|
||||
private final List<ScriptManager<?>> _scriptManagers = new LinkedList<>();
|
||||
|
||||
private File _currentLoadingScript;
|
||||
@@ -87,56 +86,10 @@ public final class L2ScriptEngineManager
|
||||
protected L2ScriptEngineManager()
|
||||
{
|
||||
ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
|
||||
List<ScriptEngineFactory> factories = scriptEngineManager.getEngineFactories();
|
||||
|
||||
for (ScriptEngineFactory factory : factories)
|
||||
{
|
||||
try
|
||||
{
|
||||
ScriptEngine engine = factory.getScriptEngine();
|
||||
boolean reg = false;
|
||||
for (String name : factory.getNames())
|
||||
{
|
||||
ScriptEngine existentEngine = _nameEngines.get(name);
|
||||
|
||||
if (existentEngine != null)
|
||||
{
|
||||
double engineVer = Double.parseDouble(factory.getEngineVersion());
|
||||
double existentEngVer = Double.parseDouble(existentEngine.getFactory().getEngineVersion());
|
||||
|
||||
if (engineVer <= existentEngVer)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
reg = true;
|
||||
_nameEngines.put(name, engine);
|
||||
}
|
||||
|
||||
if (reg)
|
||||
{
|
||||
_log.info("Script Engine: " + factory.getEngineName() + " " + factory.getEngineVersion() + " - Language: " + factory.getLanguageName() + " - Language Version: " + factory.getLanguageVersion());
|
||||
}
|
||||
|
||||
for (String ext : factory.getExtensions())
|
||||
{
|
||||
if (!ext.equals("java") || factory.getLanguageName().equals("java"))
|
||||
{
|
||||
_extEngines.put(ext, engine);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "Failed initializing factory: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ScriptEngine getEngineByName(String name)
|
||||
{
|
||||
return _nameEngines.get(name);
|
||||
ScriptEngineFactory factory = new JavaScriptEngineFactory();
|
||||
scriptEngineManager.registerEngineExtension("java", factory);
|
||||
_extEngines.put("java", factory.getScriptEngine());
|
||||
_log.info("Script Engine: " + factory.getEngineName() + " " + factory.getEngineVersion() + " - Language: " + factory.getLanguageName() + " - Language Version: " + factory.getLanguageVersion());
|
||||
}
|
||||
|
||||
private ScriptEngine getEngineByExtension(String ext)
|
||||
@@ -303,16 +256,6 @@ public final class L2ScriptEngineManager
|
||||
executeScript(engine, file);
|
||||
}
|
||||
|
||||
public void executeScript(String engineName, File file) throws ScriptException
|
||||
{
|
||||
ScriptEngine engine = getEngineByName(engineName);
|
||||
if (engine == null)
|
||||
{
|
||||
throw new ScriptException("No engine registered with name (" + engineName + ")");
|
||||
}
|
||||
executeScript(engine, file);
|
||||
}
|
||||
|
||||
public void executeScript(ScriptEngine engine, File file) throws ScriptException
|
||||
{
|
||||
if (VERBOSE_LOADING)
|
||||
@@ -375,16 +318,6 @@ public final class L2ScriptEngineManager
|
||||
return engine.getContext();
|
||||
}
|
||||
|
||||
public ScriptContext getScriptContext(String engineName)
|
||||
{
|
||||
ScriptEngine engine = getEngineByName(engineName);
|
||||
if (engine == null)
|
||||
{
|
||||
throw new IllegalStateException("No engine registered with name (" + engineName + ")");
|
||||
}
|
||||
return getScriptContext(engine);
|
||||
}
|
||||
|
||||
public Object eval(ScriptEngine engine, String script, ScriptContext context) throws ScriptException
|
||||
{
|
||||
if ((engine instanceof Compilable) && ATTEMPT_COMPILATION)
|
||||
@@ -396,21 +329,6 @@ public final class L2ScriptEngineManager
|
||||
return context != null ? engine.eval(script, context) : engine.eval(script);
|
||||
}
|
||||
|
||||
public Object eval(String engineName, String script) throws ScriptException
|
||||
{
|
||||
return eval(engineName, script, null);
|
||||
}
|
||||
|
||||
public Object eval(String engineName, String script, ScriptContext context) throws ScriptException
|
||||
{
|
||||
ScriptEngine engine = getEngineByName(engineName);
|
||||
if (engine == null)
|
||||
{
|
||||
throw new ScriptException("No engine registered with name (" + engineName + ")");
|
||||
}
|
||||
return eval(engine, script, context);
|
||||
}
|
||||
|
||||
public Object eval(ScriptEngine engine, String script) throws ScriptException
|
||||
{
|
||||
return eval(engine, script, null);
|
||||
@@ -454,7 +372,6 @@ public final class L2ScriptEngineManager
|
||||
public List<ScriptManager<?>> getScriptManagers()
|
||||
{
|
||||
return _scriptManagers;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -20,10 +20,10 @@ package com.l2jserver.gameserver.util;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import com.l2jserver.commons.geodriver.Cell;
|
||||
import com.l2jserver.gameserver.GeoData;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExServerPrimitive;
|
||||
import com.l2jserver.geodriver.Cell;
|
||||
|
||||
/**
|
||||
* @author HorridoJoho
|
||||
|
Reference in New Issue
Block a user