mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-06 07:32:46 +00:00
10
.classpath
10
.classpath
@@ -4,13 +4,13 @@
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
||||
<classpathentry excluding="mysql5/|db4o/" kind="src" path="src/dao"/>
|
||||
<classpathentry kind="src" path="src/dao/mysql5"/>
|
||||
<classpathentry kind="src" path="data/script/template"/>
|
||||
<classpathentry kind="src" path="data/script/quest"/>
|
||||
<classpathentry kind="src" path="data/script/ai"/>
|
||||
<classpathentry kind="src" path="data/plugin"/>
|
||||
<classpathentry kind="src" output="target/scripts" path="data/script/template"/>
|
||||
<classpathentry kind="src" output="target/scripts" path="data/script/quest"/>
|
||||
<classpathentry kind="src" output="target/scripts" path="data/script/ai"/>
|
||||
<classpathentry kind="src" output="target/scripts" path="data/plugin"/>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
|
||||
<classpathentry kind="src" path="src/tool/java"/>
|
||||
<classpathentry kind="src" output="target/tools-classes" path="src/tool/java"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.google.inject.Inject;
|
||||
import com.l2jserver.model.template.Template;
|
||||
import com.l2jserver.service.game.scripting.classlistener.Loader;
|
||||
import com.l2jserver.service.game.scripting.classlistener.Unloader;
|
||||
import com.l2jserver.service.game.template.StaticTemplateService;
|
||||
import com.l2jserver.service.game.template.ScriptTemplateService;
|
||||
import com.l2jserver.service.game.template.TemplateService;
|
||||
import com.l2jserver.util.ClassUtils;
|
||||
import com.l2jserver.util.factory.CollectionFactory;
|
||||
@@ -26,11 +26,11 @@ public class PluginLoader implements Loader, Unloader {
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(PluginLoader.class);
|
||||
|
||||
private final StaticTemplateService templateService;
|
||||
private final ScriptTemplateService templateService;
|
||||
|
||||
@Inject
|
||||
public PluginLoader(TemplateService templateService) {
|
||||
this.templateService = (StaticTemplateService) templateService;
|
||||
this.templateService = (ScriptTemplateService) templateService;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.google.inject.Inject;
|
||||
import com.l2jserver.model.template.Template;
|
||||
import com.l2jserver.service.game.scripting.classlistener.Loader;
|
||||
import com.l2jserver.service.game.scripting.classlistener.Unloader;
|
||||
import com.l2jserver.service.game.template.StaticTemplateService;
|
||||
import com.l2jserver.service.game.template.ScriptTemplateService;
|
||||
import com.l2jserver.service.game.template.TemplateService;
|
||||
import com.l2jserver.util.ClassUtils;
|
||||
import com.l2jserver.util.factory.CollectionFactory;
|
||||
@@ -26,11 +26,11 @@ public class TemplateLoader implements Loader, Unloader {
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(TemplateLoader.class);
|
||||
|
||||
private final StaticTemplateService templateService;
|
||||
private final ScriptTemplateService templateService;
|
||||
|
||||
@Inject
|
||||
public TemplateLoader(TemplateService templateService) {
|
||||
this.templateService = (StaticTemplateService) templateService;
|
||||
this.templateService = (ScriptTemplateService) templateService;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
2
dist/start.sh
vendored
Normal file
2
dist/start.sh
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
echo "Not yet implemented!"
|
||||
81
pom.xml
81
pom.xml
@@ -2,8 +2,8 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.l2jserver</groupId>
|
||||
<artifactId>l2jserver2-gameserver</artifactId>
|
||||
<version>2.0.0-DEVEL</version>
|
||||
<artifactId>l2j2-gameserver</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<name>L2JServer - Game Server</name>
|
||||
<description>Lineage II server emulator</description>
|
||||
<inceptionYear>2011</inceptionYear>
|
||||
@@ -20,56 +20,56 @@
|
||||
<groupId>org.jboss.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>3.2.4.Final</version>
|
||||
<scope>compile</scope>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice</artifactId>
|
||||
<version>3.0</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.inject.extensions</groupId>
|
||||
<artifactId>guice-assistedinject</artifactId>
|
||||
<version>3.0</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.6.1</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.16</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javacc</groupId>
|
||||
<artifactId>javacc</artifactId>
|
||||
<version>4.1</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.kenai.nbpwr</groupId>
|
||||
<artifactId>org-apache-commons-dbcp</artifactId>
|
||||
<version>1.2.2-201002241055</version>
|
||||
<type>nbm</type>
|
||||
<scope>compile</scope>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -98,21 +98,40 @@
|
||||
</contributors>
|
||||
<scm>
|
||||
<connection>git://github.com/Rogiel/l2jserver2-gs.git</connection>
|
||||
<developerConnection>ssh://git@github.com:Rogiel/l2jserver2-gs.git</developerConnection>
|
||||
<developerConnection>ssh://git@github.com:Rogiel/l2jserver2-gs.git
|
||||
</developerConnection>
|
||||
<tag>master</tag>
|
||||
<url>https://github.com/Rogiel/l2jserver2-gs</url>
|
||||
</scm>
|
||||
<build>
|
||||
<defaultGoal>package</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>2.4.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>assembly</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>libs/</classpathPrefix>
|
||||
<mainClass>com.l2jserver.L2JGameServerMain</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jar</id>
|
||||
<phase>package</phase>
|
||||
<phase>assembly</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
@@ -121,38 +140,22 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/assembly/distribution-bin.xml</descriptor>
|
||||
<descriptor>src/assembly/distribution-src.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>repository.jboss.org</id>
|
||||
<url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
|
||||
<url>https://repository.jboss.org/nexus/content/repositories/releases/
|
||||
</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
|
||||
46
src/assembly/distribution-bin.xml
Normal file
46
src/assembly/distribution-bin.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||
<id>bin</id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
<format>tar.bz2</format>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<baseDirectory></baseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>data/**</include>
|
||||
<include>README</include>
|
||||
<include>LICENSE</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/dist</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>*.jar</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>*-sources.jar</exclude>
|
||||
<exclude>*-javadoc.jar</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<unpack>false</unpack>
|
||||
<scope>runtime</scope>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
36
src/assembly/distribution-src.xml
Normal file
36
src/assembly/distribution-src.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||
<id>src</id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
<format>tar.bz2</format>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<baseDirectory></baseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>data/**</include>
|
||||
<include>src/**</include>
|
||||
<include>README</include>
|
||||
<include>LICENSE</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/dist</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<unpack>false</unpack>
|
||||
<scope>runtime</scope>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
@@ -8,7 +8,7 @@ import com.l2jserver.service.database.DatabaseService;
|
||||
import com.l2jserver.service.database.MySQLDatabaseService;
|
||||
import com.l2jserver.service.game.scripting.ScriptingService;
|
||||
import com.l2jserver.service.game.scripting.ScriptingServiceImpl;
|
||||
import com.l2jserver.service.game.template.StaticTemplateService;
|
||||
import com.l2jserver.service.game.template.ScriptTemplateService;
|
||||
import com.l2jserver.service.game.template.TemplateService;
|
||||
import com.l2jserver.service.game.world.WorldService;
|
||||
import com.l2jserver.service.game.world.WorldServiceImpl;
|
||||
@@ -34,7 +34,7 @@ public class ServiceModule extends AbstractModule {
|
||||
Scopes.SINGLETON);
|
||||
bind(ScriptingService.class).to(ScriptingServiceImpl.class).in(
|
||||
Scopes.SINGLETON);
|
||||
bind(TemplateService.class).to(StaticTemplateService.class).in(
|
||||
bind(TemplateService.class).to(ScriptTemplateService.class).in(
|
||||
Scopes.SINGLETON);
|
||||
|
||||
bind(WorldService.class).to(WorldServiceImpl.class)
|
||||
|
||||
@@ -14,10 +14,10 @@ import com.l2jserver.service.game.scripting.ScriptContext;
|
||||
import com.l2jserver.service.game.scripting.ScriptingService;
|
||||
import com.l2jserver.util.factory.CollectionFactory;
|
||||
|
||||
public class StaticTemplateService extends AbstractService implements
|
||||
public class ScriptTemplateService extends AbstractService implements
|
||||
TemplateService {
|
||||
private final ScriptingService scriptingService;
|
||||
private final StaticTemplateServiceConfiguration config;
|
||||
private final ScriptTemplateServiceConfiguration config;
|
||||
private final Injector injector;
|
||||
|
||||
private ScriptContext context;
|
||||
@@ -27,12 +27,12 @@ public class StaticTemplateService extends AbstractService implements
|
||||
TemplateID.class, Template.class);
|
||||
|
||||
@Inject
|
||||
public StaticTemplateService(ScriptingService scriptingService,
|
||||
public ScriptTemplateService(ScriptingService scriptingService,
|
||||
ConfigurationService configService, Injector injector) {
|
||||
this.scriptingService = scriptingService;
|
||||
this.injector = injector;
|
||||
this.config = configService
|
||||
.get(StaticTemplateServiceConfiguration.class);
|
||||
.get(ScriptTemplateServiceConfiguration.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -6,7 +6,7 @@ import com.l2jserver.service.configuration.Configuration;
|
||||
import com.l2jserver.service.configuration.Configuration.ConfigurationName;
|
||||
|
||||
@ConfigurationName("template")
|
||||
public interface StaticTemplateServiceConfiguration extends Configuration {
|
||||
public interface ScriptTemplateServiceConfiguration extends Configuration {
|
||||
@ConfigurationPropertyGetter(name = "template.descriptor", defaultValue = "data/script/template/template.xml")
|
||||
File getTemplateDescriptor();
|
||||
|
||||
@@ -4,28 +4,17 @@ import org.junit.Test;
|
||||
|
||||
import script.template.item.AdenaItemTemplate;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Scopes;
|
||||
import com.l2jserver.db.dao.DAOModuleMySQL5;
|
||||
import com.l2jserver.model.id.factory.IDFactoryModule;
|
||||
import com.l2jserver.model.id.template.factory.ItemTemplateIDFactory;
|
||||
import com.l2jserver.service.ServiceModule;
|
||||
import com.l2jserver.service.ServiceStartException;
|
||||
import com.l2jserver.service.game.scripting.ScriptingService;
|
||||
import com.l2jserver.service.game.scripting.ScriptingServiceImpl;
|
||||
|
||||
public class StaticTemplateServiceTest {
|
||||
private final Injector injector = Guice.createInjector(
|
||||
new IDFactoryModule(), new DAOModuleMySQL5(), new AbstractModule() {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(ScriptingService.class).to(ScriptingServiceImpl.class)
|
||||
.in(Scopes.SINGLETON);
|
||||
bind(TemplateService.class).to(StaticTemplateService.class)
|
||||
.in(Scopes.SINGLETON);
|
||||
}
|
||||
});
|
||||
private final Injector injector = Guice.createInjector(new ServiceModule(),
|
||||
new IDFactoryModule(), new DAOModuleMySQL5());
|
||||
private final TemplateService service = injector
|
||||
.getInstance(TemplateService.class);
|
||||
private final ItemTemplateIDFactory factory = injector
|
||||
|
||||
Reference in New Issue
Block a user