1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-05 23:22:47 +00:00

Adds missing orientdb assembly descriptor

This commit is contained in:
2011-12-26 12:34:55 -02:00
parent d363c30c5c
commit d4d20215a2
12 changed files with 129 additions and 47 deletions

View File

@@ -18,8 +18,7 @@
<exclude>.gitignore</exclude>
<exclude>data/cache/**</exclude>
<exclude>data/pathing.db</exclude>
<exclude>data/database/h2/**</exclude>
<exclude>data/database/orientdb/**</exclude>
<exclude>data/database/**</exclude>
</excludes>
</fileSet>
<fileSet>
@@ -44,6 +43,7 @@
<excludes>
<exclude>mysql:*</exclude>
<exclude>com.h2database:*</exclude>
<exclude>com.orientechnologies:*</exclude>
</excludes>
</dependencySet>
</dependencySets>

View File

@@ -18,8 +18,7 @@
<exclude>.gitignore</exclude>
<exclude>data/cache/**</exclude>
<exclude>data/pathing.db</exclude>
<exclude>data/database/derby/**</exclude>
<exclude>data/database/orientdb/**</exclude>
<exclude>data/database/**</exclude>
</excludes>
</fileSet>
<fileSet>
@@ -44,6 +43,7 @@
<excludes>
<exclude>mysql:*</exclude>
<exclude>org.apache.derby:*</exclude>
<exclude>com.orientechnologies:*</exclude>
</excludes>
</dependencySet>
</dependencySets>

View File

@@ -43,6 +43,7 @@
<excludes>
<exclude>com.h2database:*</exclude>
<exclude>org.apache.derby:*</exclude>
<exclude>com.orientechnologies:*</exclude>
</excludes>
</dependencySet>
</dependencySets>

View File

@@ -0,0 +1,50 @@
<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>orientdb-bin</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory></baseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>data/**</include>
</includes>
<excludes>
<exclude>.gitignore</exclude>
<exclude>data/cache/**</exclude>
<exclude>data/pathing.db</exclude>
<exclude>data/database/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.basedir}/distribution/global</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>l2jserver2.jar</destName>
<fileMode>0755</fileMode>
</file>
</files>
<dependencySets>
<dependencySet>
<outputDirectory>/libs</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>mysql:*</exclude>
<exclude>com.h2database:*</exclude>
<exclude>org.apache.derby:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.template;
import java.util.Collections;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
@@ -33,7 +33,6 @@ import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.model.template.effect.EffectTemplate;
import com.l2jserver.model.template.effect.TeleportEffectTemplate;
import com.l2jserver.util.factory.CollectionFactory;
import com.l2jserver.util.jaxb.SkillTemplateIDAdapter;
/**
@@ -61,7 +60,7 @@ public class SkillTemplate extends AbstractTemplate {
protected int maximumLevel = 1;
@XmlElements({ @XmlElement(name = "teleport", type = TeleportEffectTemplate.class) })
protected List<EffectTemplate> effects = CollectionFactory.newList();
protected EffectTemplate[] effects;
/**
* Create a new {@link Skill}
@@ -127,7 +126,7 @@ public class SkillTemplate extends AbstractTemplate {
* @return the effects
*/
public List<EffectTemplate> getEffects() {
return Collections.unmodifiableList(effects);
return Arrays.asList(effects);
}
/**

View File

@@ -207,7 +207,7 @@ public class NPCStats extends ActorStats<NPCCalculatorContext> {
/**
* The NPC calculator
*/
private static final NPCCalculator calculator = new NPCCalculator();
private final NPCCalculator calculator = new NPCCalculator();
/**
* Creates a new {@link NPCStats} and adds default calculators

View File

@@ -87,17 +87,17 @@ public class ChatMessageMapper extends
}
@Override
public void insert(QLogChat e, ChatMessage onject, WritableDatabaseRow row) {
row.set(e.type, onject.getType())
.set(e.sender, onject.getSender().getID())
.set(e.date, onject.getDate())
.set(e.message, onject.getMessage());
switch (onject.getType()) {
public void insert(QLogChat e, ChatMessage object, WritableDatabaseRow row) {
row.set(e.type, object.getType())
.set(e.sender, object.getSender().getID())
.set(e.date, object.getDate())
.set(e.message, object.getMessage());
switch (object.getType()) {
case SHOUT:
row.set(e.channelId, onject.getTarget().getID());
row.set(e.channelId, object.getTarget().getID());
break;
default:
row.set(e.channelId, onject.getChannelID());
row.set(e.channelId, object.getChannelID());
break;
}
}

View File

@@ -17,13 +17,12 @@
package com.l2jserver.util.calculator;
import java.io.Serializable;
import java.util.Collections;
import java.util.Arrays;
import java.util.Comparator;
import java.util.EnumMap;
import java.util.List;
import java.util.Map.Entry;
import com.l2jserver.util.factory.CollectionFactory;
import org.apache.commons.lang3.ArrayUtils;
/**
* An calculator is used to compute data and outputs its result. Note also, that
@@ -41,7 +40,7 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
/**
* List of operations in this calculator
*/
private EnumMap<V, List<Function<T, V>>> functions;
private EnumMap<V, Function<T, V>[]> functions;
/**
* Creates a new empty calculator. Functions can be add using
@@ -52,7 +51,7 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
*/
public ComplexCalculator(Class<V> type) {
super(0x00, null);
functions = new EnumMap<V, List<Function<T, V>>>(type);
functions = new EnumMap<V, Function<T, V>[]>(type);
}
/**
@@ -84,7 +83,7 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
@SafeVarargs
public ComplexCalculator(V value, Function<T, V>... functions) {
super(0x00, value);
this.functions = new EnumMap<V, List<Function<T, V>>>(
this.functions = new EnumMap<V, Function<T, V>[]>(
value.getDeclaringClass());
add(functions);
}
@@ -103,10 +102,13 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
this(type);
add(functions);
for (final Function<T, V> func : functions) {
getList(func.type()).add(func);
Function<T, V>[] funcs = getList(func.type());
funcs = Arrays.copyOf(funcs, funcs.length + 1);
funcs[funcs.length - 1] = func;
setList(func.type(), funcs);
}
for (final List<Function<T, V>> funcs : this.functions.values()) {
Collections.sort(funcs, FunctionOrderComparator.SHARED_INSTANCE);
for (final Function<T, V>[] funcs : this.functions.values()) {
Arrays.sort(funcs, FunctionOrderComparator.SHARED_INSTANCE);
}
}
@@ -120,10 +122,11 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
* the operation
*/
public void add(Function<T, V> function) {
getList(function.type()).add(function);
for (final List<Function<T, V>> funcs : functions.values()) {
Collections.sort(funcs, FunctionOrderComparator.SHARED_INSTANCE);
}
Function<T, V>[] funcs = getList(function.type());
funcs = Arrays.copyOf(funcs, funcs.length + 1);
funcs[funcs.length - 1] = function;
setList(function.type(), funcs);
Arrays.sort(funcs, FunctionOrderComparator.SHARED_INSTANCE);
}
/**
@@ -138,7 +141,10 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
@SafeVarargs
public final void add(Function<T, V>... functions) {
for (final Function<T, V> func : functions) {
getList(func.type()).add(func);
Function<T, V>[] funcs = getList(func.type());
funcs = Arrays.copyOf(funcs, funcs.length + 1);
funcs[funcs.length - 1] = func;
setList(func.type(), funcs);
}
sort();
}
@@ -155,7 +161,10 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
@SafeVarargs
public final void addNoSort(Function<T, V>... functions) {
for (final Function<T, V> func : functions) {
getList(func.type()).add(func);
Function<T, V>[] funcs = getList(func.type());
funcs = Arrays.copyOf(funcs, funcs.length + 1);
funcs[funcs.length - 1] = func;
setList(func.type(), funcs);
}
}
@@ -166,15 +175,22 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
* the operation
*/
public void remove(Function<T, V> function) {
getList(function.type()).remove(function);
Function<T, V>[] funcs = getList(function.type());
int index = Arrays.binarySearch(funcs, function);
if (index >= 0) {
funcs = ArrayUtils.remove(funcs, index);
}
setList(function.type(), funcs);
}
/**
* Removes all functions from <code>type</code>
* @param type the type
*
* @param type
* the type
*/
public void remove(V type) {
getList(type).clear();
setList(type, null);
}
/**
@@ -199,7 +215,7 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
}
}
} else if (calculator instanceof ComplexCalculator) {
for (final Entry<V, List<Function<T, V>>> e : ((ComplexCalculator<T, V>) calculator).functions
for (final Entry<V, Function<T, V>[]> e : ((ComplexCalculator<T, V>) calculator).functions
.entrySet()) {
for (final Function<T, V> function : e.getValue()) {
if (function instanceof Calculator) {
@@ -233,7 +249,7 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
}
}
} else if (calculator instanceof ComplexCalculator) {
for (final Entry<V, List<Function<T, V>>> e : ((ComplexCalculator<T, V>) calculator).functions
for (final Entry<V, Function<T, V>[]> e : ((ComplexCalculator<T, V>) calculator).functions
.entrySet()) {
for (final Function<T, V> function : e.getValue()) {
if (function instanceof Calculator) {
@@ -248,8 +264,8 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
}
public void sort() {
for (final List<Function<T, V>> funcs : functions.values()) {
Collections.sort(funcs, FunctionOrderComparator.SHARED_INSTANCE);
for (final Function<T, V>[] funcs : functions.values()) {
Arrays.sort(funcs, FunctionOrderComparator.SHARED_INSTANCE);
}
}
@@ -275,15 +291,20 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
return calculate(v, ctx, 0);
}
private List<Function<T, V>> getList(V value) {
List<Function<T, V>> list = functions.get(value);
@SuppressWarnings("unchecked")
private Function<T, V>[] getList(V value) {
Function<T, V>[] list = functions.get(value);
if (list == null) {
list = CollectionFactory.newList();
list = new Function[0];
functions.put(value, list);
}
return list;
}
private void setList(V value, Function<T, V>[] func) {
functions.put(value, func);
}
public static class FunctionOrderComparator implements
Comparator<Function<?, ?>>, Serializable {
private static final long serialVersionUID = 1L;