mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-05 23:22:47 +00:00
Merge branch 'proposed/database-derby-old' into proposed/database-derby
Conflicts: pom.xml src/assembly/distribution-h2-bin.xml src/assembly/distribution-mysql5-bin.xml
This commit is contained in:
14
.classpath
14
.classpath
@@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
|
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
|
||||||
<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" path="data/plugin"/>
|
|
||||||
<classpathentry kind="src" path="data/script/ai"/>
|
|
||||||
<classpathentry kind="src" path="data/script/quest"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
|
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
|
||||||
</classpath>
|
|
||||||
127
.fbprefs
127
.fbprefs
@@ -1,127 +0,0 @@
|
|||||||
#FindBugs User Preferences
|
|
||||||
#Sun Jul 31 22:17:12 BRT 2011
|
|
||||||
detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
|
|
||||||
detectorBadAppletConstructor=BadAppletConstructor|false
|
|
||||||
detectorBadResultSetAccess=BadResultSetAccess|true
|
|
||||||
detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true
|
|
||||||
detectorBadUseOfReturnValue=BadUseOfReturnValue|true
|
|
||||||
detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true
|
|
||||||
detectorBooleanReturnNull=BooleanReturnNull|true
|
|
||||||
detectorCallToUnsupportedMethod=CallToUnsupportedMethod|false
|
|
||||||
detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true
|
|
||||||
detectorCheckTypeQualifiers=CheckTypeQualifiers|true
|
|
||||||
detectorCloneIdiom=CloneIdiom|true
|
|
||||||
detectorComparatorIdiom=ComparatorIdiom|true
|
|
||||||
detectorConfusedInheritance=ConfusedInheritance|true
|
|
||||||
detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true
|
|
||||||
detectorCrossSiteScripting=CrossSiteScripting|true
|
|
||||||
detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true
|
|
||||||
detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true
|
|
||||||
detectorDontIgnoreResultOfPutIfAbsent=DontIgnoreResultOfPutIfAbsent|true
|
|
||||||
detectorDontUseEnum=DontUseEnum|true
|
|
||||||
detectorDroppedException=DroppedException|true
|
|
||||||
detectorDumbMethodInvocations=DumbMethodInvocations|true
|
|
||||||
detectorDumbMethods=DumbMethods|true
|
|
||||||
detectorDuplicateBranches=DuplicateBranches|true
|
|
||||||
detectorEmptyZipFileEntry=EmptyZipFileEntry|true
|
|
||||||
detectorEqualsOperandShouldHaveClassCompatibleWithThis=EqualsOperandShouldHaveClassCompatibleWithThis|true
|
|
||||||
detectorFinalizerNullsFields=FinalizerNullsFields|true
|
|
||||||
detectorFindBadCast2=FindBadCast2|true
|
|
||||||
detectorFindBadForLoop=FindBadForLoop|true
|
|
||||||
detectorFindCircularDependencies=FindCircularDependencies|false
|
|
||||||
detectorFindDeadLocalStores=FindDeadLocalStores|true
|
|
||||||
detectorFindDoubleCheck=FindDoubleCheck|true
|
|
||||||
detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true
|
|
||||||
detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true
|
|
||||||
detectorFindFinalizeInvocations=FindFinalizeInvocations|true
|
|
||||||
detectorFindFloatEquality=FindFloatEquality|true
|
|
||||||
detectorFindHEmismatch=FindHEmismatch|true
|
|
||||||
detectorFindInconsistentSync2=FindInconsistentSync2|true
|
|
||||||
detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true
|
|
||||||
detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true
|
|
||||||
detectorFindMaskedFields=FindMaskedFields|true
|
|
||||||
detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true
|
|
||||||
detectorFindNakedNotify=FindNakedNotify|true
|
|
||||||
detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true
|
|
||||||
detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true
|
|
||||||
detectorFindNonShortCircuit=FindNonShortCircuit|true
|
|
||||||
detectorFindNullDeref=FindNullDeref|true
|
|
||||||
detectorFindNullDerefsInvolvingNonShortCircuitEvaluation=FindNullDerefsInvolvingNonShortCircuitEvaluation|true
|
|
||||||
detectorFindOpenStream=FindOpenStream|true
|
|
||||||
detectorFindPuzzlers=FindPuzzlers|true
|
|
||||||
detectorFindRefComparison=FindRefComparison|true
|
|
||||||
detectorFindReturnRef=FindReturnRef|true
|
|
||||||
detectorFindRunInvocations=FindRunInvocations|true
|
|
||||||
detectorFindSelfComparison=FindSelfComparison|true
|
|
||||||
detectorFindSelfComparison2=FindSelfComparison2|true
|
|
||||||
detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true
|
|
||||||
detectorFindSpinLoop=FindSpinLoop|true
|
|
||||||
detectorFindSqlInjection=FindSqlInjection|true
|
|
||||||
detectorFindTwoLockWait=FindTwoLockWait|true
|
|
||||||
detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true
|
|
||||||
detectorFindUnconditionalWait=FindUnconditionalWait|true
|
|
||||||
detectorFindUninitializedGet=FindUninitializedGet|true
|
|
||||||
detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true
|
|
||||||
detectorFindUnreleasedLock=FindUnreleasedLock|true
|
|
||||||
detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|true
|
|
||||||
detectorFindUnsyncGet=FindUnsyncGet|true
|
|
||||||
detectorFindUselessControlFlow=FindUselessControlFlow|true
|
|
||||||
detectorFormatStringChecker=FormatStringChecker|true
|
|
||||||
detectorHugeSharedStringConstants=HugeSharedStringConstants|true
|
|
||||||
detectorIDivResultCastToDouble=IDivResultCastToDouble|true
|
|
||||||
detectorIncompatMask=IncompatMask|true
|
|
||||||
detectorInconsistentAnnotations=InconsistentAnnotations|true
|
|
||||||
detectorInefficientMemberAccess=InefficientMemberAccess|false
|
|
||||||
detectorInefficientToArray=InefficientToArray|true
|
|
||||||
detectorInfiniteLoop=InfiniteLoop|true
|
|
||||||
detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true
|
|
||||||
detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|false
|
|
||||||
detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true
|
|
||||||
detectorInitializationChain=InitializationChain|true
|
|
||||||
detectorInstantiateStaticClass=InstantiateStaticClass|true
|
|
||||||
detectorInvalidJUnitTest=InvalidJUnitTest|true
|
|
||||||
detectorIteratorIdioms=IteratorIdioms|true
|
|
||||||
detectorLazyInit=LazyInit|true
|
|
||||||
detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true
|
|
||||||
detectorLostLoggerDueToWeakReference=LostLoggerDueToWeakReference|true
|
|
||||||
detectorMethodReturnCheck=MethodReturnCheck|true
|
|
||||||
detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true
|
|
||||||
detectorMutableLock=MutableLock|true
|
|
||||||
detectorMutableStaticFields=MutableStaticFields|true
|
|
||||||
detectorNaming=Naming|true
|
|
||||||
detectorNumberConstructor=NumberConstructor|true
|
|
||||||
detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true
|
|
||||||
detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true
|
|
||||||
detectorPublicSemaphores=PublicSemaphores|false
|
|
||||||
detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true
|
|
||||||
detectorReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass=ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass|true
|
|
||||||
detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true
|
|
||||||
detectorRedundantInterfaces=RedundantInterfaces|true
|
|
||||||
detectorRepeatedConditionals=RepeatedConditionals|true
|
|
||||||
detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true
|
|
||||||
detectorSerializableIdiom=SerializableIdiom|true
|
|
||||||
detectorStartInConstructor=StartInConstructor|true
|
|
||||||
detectorStaticCalendarDetector=StaticCalendarDetector|true
|
|
||||||
detectorStringConcatenation=StringConcatenation|true
|
|
||||||
detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true
|
|
||||||
detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true
|
|
||||||
detectorSwitchFallthrough=SwitchFallthrough|true
|
|
||||||
detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true
|
|
||||||
detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true
|
|
||||||
detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true
|
|
||||||
detectorURLProblems=URLProblems|true
|
|
||||||
detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true
|
|
||||||
detectorUnnecessaryMath=UnnecessaryMath|true
|
|
||||||
detectorUnreadFields=UnreadFields|true
|
|
||||||
detectorUseObjectEquals=UseObjectEquals|false
|
|
||||||
detectorUselessSubclassMethod=UselessSubclassMethod|false
|
|
||||||
detectorVarArgsProblems=VarArgsProblems|true
|
|
||||||
detectorVolatileUsage=VolatileUsage|true
|
|
||||||
detectorWaitInLoop=WaitInLoop|true
|
|
||||||
detectorWrongMapIterator=WrongMapIterator|true
|
|
||||||
detectorXMLFactoryBypass=XMLFactoryBypass|true
|
|
||||||
detector_threshold=3
|
|
||||||
effort=default
|
|
||||||
filter_settings=Low|BAD_PRACTICE,CORRECTNESS,EXPERIMENTAL,MALICIOUS_CODE,MT_CORRECTNESS,NOISE,PERFORMANCE,SECURITY,STYLE|false
|
|
||||||
filter_settings_neg=I18N|
|
|
||||||
run_at_full_build=false
|
|
||||||
17
.gitignore
vendored
17
.gitignore
vendored
@@ -1,2 +1,15 @@
|
|||||||
/target
|
# Eclipse project files and folders
|
||||||
/generated
|
.project
|
||||||
|
.metadata
|
||||||
|
.classpath
|
||||||
|
.settings/*
|
||||||
|
.settings
|
||||||
|
|
||||||
|
# Locally stored "Eclipse launch configurations"
|
||||||
|
*.launch
|
||||||
|
|
||||||
|
# Maven target directory
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Find bugs configuration file
|
||||||
|
/.fbprefs
|
||||||
24
.project
24
.project
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>l2jserver2-gameserver</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#Tue Sep 13 17:32:00 BRT 2011
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +0,0 @@
|
|||||||
#Tue Sep 13 15:33:16 BRT 2011
|
|
||||||
activeProfiles=
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
resolveWorkspaceProjects=true
|
|
||||||
version=1
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#Fri May 13 16:44:30 BRT 2011
|
|
||||||
default.configuration=
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
hibernate3.enabled=false
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#Thu May 05 14:04:06 BRT 2011
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.jboss.ide.eclipse.as.core.singledeployable.deployableList=\n
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#Thu Apr 28 15:16:57 BRT 2011
|
|
||||||
activeProfiles=
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
fullBuildGoals=process-test-resources
|
|
||||||
resolveWorkspaceProjects=true
|
|
||||||
resourceFilterGoals=process-resources resources\:testResources
|
|
||||||
skipCompilerPlugin=true
|
|
||||||
version=1
|
|
||||||
147
l2jserver2-common/pom.xml
Normal file
147
l2jserver2-common/pom.xml
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
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>
|
||||||
|
<parent>
|
||||||
|
<artifactId>l2jserver2</artifactId>
|
||||||
|
<groupId>com.l2jserver</groupId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
<relativePath>..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<artifactId>l2jserver2-common</artifactId>
|
||||||
|
<dependencies>
|
||||||
|
<!-- junit -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.8.2</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- netty -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.netty</groupId>
|
||||||
|
<artifactId>netty</artifactId>
|
||||||
|
<version>3.2.4.Final</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- google guice -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.inject</groupId>
|
||||||
|
<artifactId>guice</artifactId>
|
||||||
|
<version>3.0</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.inject.extensions</groupId>
|
||||||
|
<artifactId>guice-assistedinject</artifactId>
|
||||||
|
<version>3.0</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.inject.extensions</groupId>
|
||||||
|
<artifactId>guice-multibindings</artifactId>
|
||||||
|
<version>3.0</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- logging -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
<version>1.6.1</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
|
<version>1.6.1</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- database -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>5.1.16</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
<version>1.3.155</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-dbcp</groupId>
|
||||||
|
<artifactId>commons-dbcp</artifactId>
|
||||||
|
<version>1.4</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- cache -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sf.ehcache</groupId>
|
||||||
|
<artifactId>ehcache-core</artifactId>
|
||||||
|
<version>2.4.2</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- html parser/generator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.htmlparser</groupId>
|
||||||
|
<artifactId>htmlparser</artifactId>
|
||||||
|
<version>2.1</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- utils -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javolution</groupId>
|
||||||
|
<artifactId>javolution</artifactId>
|
||||||
|
<version>5.5.1</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>10.0</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.0.1</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-pool</groupId>
|
||||||
|
<artifactId>commons-pool</artifactId>
|
||||||
|
<version>1.5.6</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-collections</groupId>
|
||||||
|
<artifactId>commons-collections</artifactId>
|
||||||
|
<version>3.2.1</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-math</artifactId>
|
||||||
|
<version>2.2</version>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of l2jserver <l2jserver.com>.
|
||||||
|
*
|
||||||
|
* l2jserver is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* l2jserver is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jserver.model.id;
|
||||||
|
|
||||||
|
import com.l2jserver.model.Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is an abstract ID for most model objects.
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the raw id type
|
||||||
|
* @param <O>
|
||||||
|
* the model this {@link ID} provides
|
||||||
|
*
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
|
*/
|
||||||
|
public abstract class AbstractModelID<T, O extends Model<? extends ID<T>>>
|
||||||
|
extends ID<T> {
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* the id
|
||||||
|
*/
|
||||||
|
protected AbstractModelID(T id) {
|
||||||
|
super(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the {@link Model} object associated with this
|
||||||
|
* {@link AbstractModelID}. <tt>null</tt> if {@link Model} does not
|
||||||
|
* exists.
|
||||||
|
*/
|
||||||
|
public abstract O getObject();
|
||||||
|
}
|
||||||
@@ -36,25 +36,12 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.inject.Guice;
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Injector;
|
|
||||||
import com.l2jserver.model.Model;
|
import com.l2jserver.model.Model;
|
||||||
import com.l2jserver.model.Model.ObjectDesire;
|
import com.l2jserver.model.Model.ObjectDesire;
|
||||||
import com.l2jserver.model.dao.CharacterDAO;
|
|
||||||
import com.l2jserver.model.dao.ClanDAO;
|
|
||||||
import com.l2jserver.model.dao.ItemDAO;
|
|
||||||
import com.l2jserver.model.dao.NPCDAO;
|
|
||||||
import com.l2jserver.model.dao.PetDAO;
|
|
||||||
import com.l2jserver.model.id.ID;
|
import com.l2jserver.model.id.ID;
|
||||||
import com.l2jserver.model.id.object.allocator.IDAllocator;
|
import com.l2jserver.model.id.object.allocator.IDAllocator;
|
||||||
import com.l2jserver.model.world.Clan;
|
|
||||||
import com.l2jserver.model.world.Item;
|
|
||||||
import com.l2jserver.model.world.L2Character;
|
|
||||||
import com.l2jserver.model.world.NPC;
|
|
||||||
import com.l2jserver.model.world.Pet;
|
|
||||||
import com.l2jserver.service.AbstractService;
|
import com.l2jserver.service.AbstractService;
|
||||||
import com.l2jserver.service.AbstractService.Depends;
|
|
||||||
import com.l2jserver.service.ServiceStartException;
|
import com.l2jserver.service.ServiceStartException;
|
||||||
import com.l2jserver.service.ServiceStopException;
|
import com.l2jserver.service.ServiceStopException;
|
||||||
import com.l2jserver.service.cache.Cache;
|
import com.l2jserver.service.cache.Cache;
|
||||||
@@ -62,12 +49,9 @@ import com.l2jserver.service.cache.CacheService;
|
|||||||
import com.l2jserver.service.configuration.ConfigurationService;
|
import com.l2jserver.service.configuration.ConfigurationService;
|
||||||
import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertiesKey;
|
import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertiesKey;
|
||||||
import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath;
|
import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath;
|
||||||
import com.l2jserver.service.core.LoggingService;
|
|
||||||
import com.l2jserver.service.core.threading.ScheduledAsyncFuture;
|
import com.l2jserver.service.core.threading.ScheduledAsyncFuture;
|
||||||
import com.l2jserver.service.core.threading.ThreadService;
|
import com.l2jserver.service.core.threading.ThreadService;
|
||||||
import com.l2jserver.service.game.template.TemplateService;
|
|
||||||
import com.l2jserver.util.ArrayIterator;
|
import com.l2jserver.util.ArrayIterator;
|
||||||
import com.l2jserver.util.ClassUtils;
|
|
||||||
import com.l2jserver.util.factory.CollectionFactory;
|
import com.l2jserver.util.factory.CollectionFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,10 +76,8 @@ import com.l2jserver.util.factory.CollectionFactory;
|
|||||||
*
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
@Depends({ LoggingService.class, CacheService.class,
|
public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||||
ConfigurationService.class, TemplateService.class, ThreadService.class })
|
implements DatabaseService {
|
||||||
public class JDBCDatabaseService extends AbstractService implements
|
|
||||||
DatabaseService {
|
|
||||||
/**
|
/**
|
||||||
* The configuration object
|
* The configuration object
|
||||||
*/
|
*/
|
||||||
@@ -104,12 +86,7 @@ public class JDBCDatabaseService extends AbstractService implements
|
|||||||
* The logger
|
* The logger
|
||||||
*/
|
*/
|
||||||
private final Logger log = LoggerFactory
|
private final Logger log = LoggerFactory
|
||||||
.getLogger(JDBCDatabaseService.class);
|
.getLogger(AbstractJDBCDatabaseService.class);
|
||||||
|
|
||||||
/**
|
|
||||||
* The Google Guice {@link Injector}. It is used to get DAO instances.
|
|
||||||
*/
|
|
||||||
private final Injector injector;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The cache service
|
* The cache service
|
||||||
@@ -149,7 +126,7 @@ public class JDBCDatabaseService extends AbstractService implements
|
|||||||
private ScheduledAsyncFuture autoSaveFuture;
|
private ScheduledAsyncFuture autoSaveFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration interface for {@link JDBCDatabaseService}.
|
* Configuration interface for {@link AbstractJDBCDatabaseService}.
|
||||||
*
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
@@ -277,19 +254,15 @@ public class JDBCDatabaseService extends AbstractService implements
|
|||||||
/**
|
/**
|
||||||
* @param configService
|
* @param configService
|
||||||
* the configuration service
|
* the configuration service
|
||||||
* @param injector
|
|
||||||
* the {@link Guice} {@link Injector}
|
|
||||||
* @param cacheService
|
* @param cacheService
|
||||||
* the cache service
|
* the cache service
|
||||||
* @param threadService
|
* @param threadService
|
||||||
* the thread service
|
* the thread service
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public JDBCDatabaseService(ConfigurationService configService,
|
public AbstractJDBCDatabaseService(ConfigurationService configService,
|
||||||
Injector injector, CacheService cacheService,
|
CacheService cacheService, ThreadService threadService) {
|
||||||
ThreadService threadService) {
|
|
||||||
config = configService.get(JDBCDatabaseConfiguration.class);
|
config = configService.get(JDBCDatabaseConfiguration.class);
|
||||||
this.injector = injector;
|
|
||||||
this.cacheService = cacheService;
|
this.cacheService = cacheService;
|
||||||
this.threadService = threadService;
|
this.threadService = threadService;
|
||||||
}
|
}
|
||||||
@@ -338,24 +311,6 @@ public class JDBCDatabaseService extends AbstractService implements
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
|
||||||
public <M extends Model<I>, I extends ID<M>> DataAccessObject<M, I> getDAO(
|
|
||||||
Class<M> model) {
|
|
||||||
if (ClassUtils.isSubclass(model, L2Character.class)) {
|
|
||||||
return (DataAccessObject) injector.getInstance(CharacterDAO.class);
|
|
||||||
} else if (ClassUtils.isSubclass(model, Clan.class)) {
|
|
||||||
return (DataAccessObject) injector.getInstance(ClanDAO.class);
|
|
||||||
} else if (ClassUtils.isSubclass(model, Item.class)) {
|
|
||||||
return (DataAccessObject) injector.getInstance(ItemDAO.class);
|
|
||||||
} else if (ClassUtils.isSubclass(model, NPC.class)) {
|
|
||||||
return (DataAccessObject) injector.getInstance(NPCDAO.class);
|
|
||||||
} else if (ClassUtils.isSubclass(model, Pet.class)) {
|
|
||||||
return (DataAccessObject) injector.getInstance(PetDAO.class);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes an <tt>query</tt> in the database.
|
* Executes an <tt>query</tt> in the database.
|
||||||
*
|
*
|
||||||
@@ -806,7 +761,7 @@ public class JDBCDatabaseService extends AbstractService implements
|
|||||||
/**
|
/**
|
||||||
* The database service instance
|
* The database service instance
|
||||||
*/
|
*/
|
||||||
private final JDBCDatabaseService database;
|
private final AbstractJDBCDatabaseService database;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link ID} mapper
|
* The {@link ID} mapper
|
||||||
@@ -821,7 +776,8 @@ public class JDBCDatabaseService extends AbstractService implements
|
|||||||
* @param idMapper
|
* @param idMapper
|
||||||
* the {@link ID} {@link Mapper}
|
* the {@link ID} {@link Mapper}
|
||||||
*/
|
*/
|
||||||
public CachedMapper(JDBCDatabaseService database, Mapper<I> idMapper) {
|
public CachedMapper(AbstractJDBCDatabaseService database,
|
||||||
|
Mapper<I> idMapper) {
|
||||||
this.database = database;
|
this.database = database;
|
||||||
this.idMapper = idMapper;
|
this.idMapper = idMapper;
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ import com.l2jserver.model.Model;
|
|||||||
import com.l2jserver.model.id.ID;
|
import com.l2jserver.model.id.ID;
|
||||||
import com.l2jserver.service.database.AbstractDAO;
|
import com.l2jserver.service.database.AbstractDAO;
|
||||||
import com.l2jserver.service.database.DatabaseService;
|
import com.l2jserver.service.database.DatabaseService;
|
||||||
import com.l2jserver.service.database.JDBCDatabaseService;
|
import com.l2jserver.service.database.AbstractJDBCDatabaseService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link AbstractDAO} for JDBC DAO implementation
|
* {@link AbstractDAO} for JDBC DAO implementation
|
||||||
@@ -38,7 +38,7 @@ public abstract class AbstractJDBCDAO<T extends Model<?>, I extends ID<?>>
|
|||||||
/**
|
/**
|
||||||
* The JDBC Database Service
|
* The JDBC Database Service
|
||||||
*/
|
*/
|
||||||
protected final JDBCDatabaseService database;
|
protected final AbstractJDBCDatabaseService database;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param database
|
* @param database
|
||||||
@@ -47,6 +47,6 @@ public abstract class AbstractJDBCDAO<T extends Model<?>, I extends ID<?>>
|
|||||||
@Inject
|
@Inject
|
||||||
protected AbstractJDBCDAO(DatabaseService database) {
|
protected AbstractJDBCDAO(DatabaseService database) {
|
||||||
super(database);
|
super(database);
|
||||||
this.database = (JDBCDatabaseService) database;
|
this.database = (AbstractJDBCDatabaseService) database;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1
l2jserver2-gameserver/.gitignore
vendored
Normal file
1
l2jserver2-gameserver/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/log
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user