mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-12-21 06:58:55 -05:00
Refactored DataStore and moved it into the Modules directory
This commit is contained in:
parent
978de20d53
commit
6634a8d22a
@ -4,11 +4,12 @@
|
||||
<property name="bin" location="bin" />
|
||||
<property name="lib_managed" location="lib_managed" />
|
||||
<property name="lib" location="lib" />
|
||||
<property name="module" location="module" />
|
||||
<property name="doc" location="doc" />
|
||||
<property name="jar" value="moparclassic.jar" />
|
||||
<property name="main-class" value="org.moparscape.msc.gs.Server" />
|
||||
<property name="scala-version" value="2.9.1" />
|
||||
<property name="ivy.lib.dir" value="lib_managed"/>
|
||||
<property name="ivy.lib.dir" value="lib_managed" />
|
||||
|
||||
<fileset id="libraries" dir="${lib}">
|
||||
<include name="*.jar" />
|
||||
@ -18,6 +19,10 @@
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
|
||||
<fileset id="modules" dir="${module}">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
|
||||
<fileset id="production-classes" dir="${bin}">
|
||||
<include name="**/*.class" />
|
||||
</fileset>
|
||||
@ -29,6 +34,7 @@
|
||||
<path id="library-path">
|
||||
<fileset refid="libraries" />
|
||||
<fileset refid="libraries_managed" />
|
||||
<fileset refid="modules" />
|
||||
</path>
|
||||
|
||||
<path id="master-path">
|
||||
|
BIN
GameServer/module/DataStoreCore.jar
Normal file
BIN
GameServer/module/DataStoreCore.jar
Normal file
Binary file not shown.
BIN
GameServer/module/XMLUsingXStreamDataStore.jar
Normal file
BIN
GameServer/module/XMLUsingXStreamDataStore.jar
Normal file
Binary file not shown.
BIN
GameServer/moparclassic.jar
Normal file
BIN
GameServer/moparclassic.jar
Normal file
Binary file not shown.
@ -6,7 +6,7 @@ import org.moparscape.msc.gs.db.DBConnection;
|
||||
import org.moparscape.msc.gs.db.ReportHandlerQueries;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.persistence.DataStore;
|
||||
import org.moparscape.msc.gs.persistence.DataStoreFactory;
|
||||
import org.moparscape.msc.gs.persistence.impl.DataStoreFactory;
|
||||
import org.moparscape.msc.gs.plugins.dependencies.PluginHandler;
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,6 @@
|
||||
package org.moparscape.msc.gs.persistence;
|
||||
package org.moparscape.msc.gs.persistence.impl;
|
||||
|
||||
import org.moparscape.msc.gs.persistence.DataStore;
|
||||
|
||||
public class DataStoreFactory {
|
||||
|
@ -26,7 +26,7 @@
|
||||
</target>
|
||||
|
||||
|
||||
<target name="runls" depends="build">
|
||||
<target name="run" depends="build">
|
||||
<java classname="org.moparscape.msc.ls.Server" fork="true">
|
||||
<classpath>
|
||||
<pathelement location="${lib}/mina.jar" />
|
||||
|
BIN
Modules/DataStore/DataStoreCore.jar
Normal file
BIN
Modules/DataStore/DataStoreCore.jar
Normal file
Binary file not shown.
66
Modules/DataStore/XMLUsingXStream/build.xml
Normal file
66
Modules/DataStore/XMLUsingXStream/build.xml
Normal file
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="XML Using XStream" default="build" basedir="../../../">
|
||||
<property name="base" location="Modules/DataStore/XMLUsingXStream" />
|
||||
<property name="src" location="${base}/src" />
|
||||
<property name="bin" location="${base}/bin" />
|
||||
<property name="lib" location="${base}/lib" />
|
||||
<property name="common-lib" location="${base}/../lib" />
|
||||
<property name="jar" value="${base}/XMLUsingXStreamDataStore.jar" />
|
||||
|
||||
<fileset id="mopar" dir="GameServer">
|
||||
<include name="moparclassic.jar" />
|
||||
</fileset>
|
||||
|
||||
<fileset id="libraries" dir="${lib}">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
|
||||
<fileset id="common-libraries" dir="${common-lib}">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
|
||||
<fileset id="datastore-core" dir="${base}/../">
|
||||
<include name="DataStoreCore.jar" />
|
||||
</fileset>
|
||||
|
||||
<fileset id="production-classes" dir="${bin}">
|
||||
<include name="**/*.class" />
|
||||
</fileset>
|
||||
|
||||
<path id="binary-path">
|
||||
<pathelement path="${bin}" />
|
||||
</path>
|
||||
|
||||
<path id="library-path">
|
||||
<fileset refid="common-libraries" />
|
||||
<fileset refid="libraries" />
|
||||
<fileset refid="mopar" />
|
||||
<fileset refid="datastore-core" />
|
||||
</path>
|
||||
|
||||
<path id="master-path">
|
||||
<path refid="binary-path" />
|
||||
<path refid="library-path" />
|
||||
</path>
|
||||
|
||||
<target name="init">
|
||||
<mkdir dir="${bin}" />
|
||||
<mkdir dir="${lib}" />
|
||||
</target>
|
||||
|
||||
<target name="build" depends="init">
|
||||
<javac destdir="${bin}" includeantruntime="false">
|
||||
<src path="${src}" />
|
||||
<classpath refid="library-path" />
|
||||
</javac>
|
||||
<jar destfile="${jar}">
|
||||
<zipgroupfileset refid="libraries" />
|
||||
<fileset refid="production-classes" />
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="${bin}" />
|
||||
<delete file="${jar}" />
|
||||
</target>
|
||||
</project>
|
@ -36,12 +36,16 @@ import com.thoughtworks.xstream.XStream;
|
||||
* A DataStore that parses XML using XStream.
|
||||
*
|
||||
* @author Joe Pritzel
|
||||
*
|
||||
*
|
||||
*/
|
||||
@NotThreadSafe
|
||||
@SuppressWarnings("unchecked")
|
||||
public class XMLUsingXStream implements DataStore {
|
||||
|
||||
protected XMLUsingXStream() {
|
||||
// To conform to the contract specified by the DataStore interface.
|
||||
}
|
||||
|
||||
private static final XStream xstream = new XStream();
|
||||
|
||||
static {
|
55
Modules/DataStore/build.xml
Normal file
55
Modules/DataStore/build.xml
Normal file
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="DataStore Core" default="build" basedir="../../">
|
||||
<property name="base" location="Modules/DataStore" />
|
||||
<property name="src" location="${base}/src" />
|
||||
<property name="bin" location="${base}/bin" />
|
||||
<property name="lib" location="${base}/lib" />
|
||||
<property name="jar" value="${base}/DataStoreCore.jar" />
|
||||
|
||||
<fileset id="mopar" dir="GameServer">
|
||||
<include name="moparclassic.jar" />
|
||||
</fileset>
|
||||
|
||||
<fileset id="libraries" dir="${lib}">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
|
||||
<fileset id="production-classes" dir="${bin}">
|
||||
<include name="**/*.class" />
|
||||
</fileset>
|
||||
|
||||
<path id="binary-path">
|
||||
<pathelement path="${bin}" />
|
||||
</path>
|
||||
|
||||
<path id="library-path">
|
||||
<fileset refid="libraries" />
|
||||
<fileset refid="mopar" />
|
||||
</path>
|
||||
|
||||
<path id="master-path">
|
||||
<path refid="binary-path" />
|
||||
<path refid="library-path" />
|
||||
</path>
|
||||
|
||||
<target name="init">
|
||||
<mkdir dir="${bin}" />
|
||||
<mkdir dir="${lib}" />
|
||||
</target>
|
||||
|
||||
<target name="build" depends="init">
|
||||
<javac destdir="${bin}" includeantruntime="false">
|
||||
<src path="${src}" />
|
||||
<classpath refid="library-path" />
|
||||
</javac>
|
||||
<jar destfile="${jar}">
|
||||
<zipgroupfileset refid="libraries" />
|
||||
<fileset refid="production-classes" />
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="${bin}" />
|
||||
<delete file="${jar}" />
|
||||
</target>
|
||||
</project>
|
BIN
Modules/DataStore/lib/jcip-annotations-1.0.jar
Normal file
BIN
Modules/DataStore/lib/jcip-annotations-1.0.jar
Normal file
Binary file not shown.
@ -13,12 +13,17 @@ import org.moparscape.msc.gs.npchandler.NpcHandlerDef;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandlerDef;
|
||||
|
||||
/**
|
||||
* Any retrieval of unchanging data should be done through this interface.
|
||||
* Any retrieval of unchanging data should be done through this interface. All
|
||||
* implementations should be only accessable by the
|
||||
* org.moparscape.msc.gs.persistence.impl package.<br>
|
||||
* Implementations should also use JCIP annotations to specify their degree of thread
|
||||
* saftey.
|
||||
*
|
||||
* @author Joe Pritzel
|
||||
*
|
||||
*/
|
||||
public interface DataStore {
|
||||
public abstract interface DataStore {
|
||||
|
||||
public PacketHandlerDef[] loadPacketHandlerDefs();
|
||||
|
||||
public PacketHandlerDef[] loadLSPacketHandlerDefs();
|
Loading…
Reference in New Issue
Block a user