1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2026-04-30 12:03:56 +00:00

Update XSD files for templates

This commit updades all XSD files for templates.
This commit is contained in:
2011-10-11 23:45:02 -03:00
parent fe882c4467
commit 6a40656a38
26363 changed files with 95293 additions and 94194 deletions

View File

@@ -16,6 +16,8 @@
*/
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlType;
import com.l2jserver.model.id.TemplateID;
/**
@@ -26,6 +28,7 @@ import com.l2jserver.model.id.TemplateID;
* @param <T>
* the type of object created by this template
*/
@XmlType(name = "AbstractTemplateType")
public abstract class AbstractTemplate<T> implements Template<T> {
// /**
// * The {@link TemplateID}

View File

@@ -16,6 +16,8 @@
*/
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -28,6 +30,7 @@ import com.l2jserver.model.world.Actor;
* the {@link Actor} type this template is for
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "AbstractActorType")
public abstract class ActorTemplate<T extends Actor> extends
AbstractTemplate<T> {
/**

View File

@@ -36,134 +36,134 @@ import com.l2jserver.util.jaxb.CharacterTemplateIDAdapter;
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "character")
@XmlType(namespace = "character")
@XmlRootElement(name = "character", namespace = "http://schemas.l2jserver2.com/character")
@XmlType(namespace = "http://schemas.l2jserver2.com/character", name = "CharacterType")
@XmlAccessorType(XmlAccessType.FIELD)
public class CharacterTemplate extends ActorTemplate<L2Character> {
@XmlJavaTypeAdapter(CharacterTemplateIDAdapter.class)
@XmlAttribute(name = "class")
@XmlAttribute(name = "class", required = true)
protected CharacterTemplateID id = null;
@XmlElement(name = "stats")
@XmlElement(name = "stats", required = true)
protected CharacterStatsMetadata stats = null;
@XmlType(namespace = "character")
@XmlType(name = "CharacterStatsType")
protected static class CharacterStatsMetadata {
@XmlAttribute(name = "level")
@XmlAttribute(name = "level", required = true)
protected int level = 0;
@XmlAttribute(name = "crafter")
@XmlAttribute(name = "crafter", required = false)
protected boolean crafter = false;
@XmlElement(name = "hp")
@XmlElement(name = "hp", required = true)
protected Stat hp = null;
@XmlElement(name = "mp")
@XmlElement(name = "mp", required = true)
protected Stat mp = null;
@XmlElement(name = "cp")
@XmlElement(name = "cp", required = true)
protected Stat cp = null;
@XmlType(namespace = "character")
@XmlType(name = "")
protected static class Stat {
@XmlAttribute(name = "base")
@XmlAttribute(name = "base", required = true)
protected double base = 0;
@XmlAttribute(name = "modifier")
@XmlAttribute(name = "modifier", required = true)
protected double modifier = 0;
@XmlAttribute(name = "add")
@XmlAttribute(name = "add", required = true)
protected double add = 0;
}
@XmlElement(name = "attack")
@XmlElement(name = "attack", required = true)
protected AttackMetadata attack = null;
@XmlType(namespace = "character")
@XmlType(name = "CharacterAttackType")
protected static class AttackMetadata {
@XmlAttribute(name = "evasion")
@XmlAttribute(name = "evasion", required = true)
protected int evasion = 0;
@XmlAttribute(name = "critical")
@XmlAttribute(name = "critical", required = true)
protected int critical = 0;
@XmlAttribute(name = "accuracy")
@XmlAttribute(name = "accuracy", required = true)
protected int accuracy = 0;
@XmlElement(name = "physical")
@XmlElement(name = "physical", required = true)
protected AttackValueMetadata physical = null;
@XmlElement(name = "magical")
@XmlElement(name = "magical", required = true)
protected AttackValueMetadata magical = null;
@XmlType(namespace = "character")
@XmlType(name = "")
protected static class AttackValueMetadata {
@XmlAttribute(name = "damage")
@XmlAttribute(name = "damage", required = true)
protected double damage = 0;
@XmlAttribute(name = "speed")
@XmlAttribute(name = "speed", required = true)
protected double speed = 0;
}
}
@XmlElement(name = "defense")
@XmlElement(name = "defense", required = true)
protected DefenseMetadata defense = null;
@XmlType(namespace = "character")
@XmlType(name = "CharacterDefenseType")
protected static class DefenseMetadata {
@XmlElement(name = "physical")
@XmlElement(name = "physical", required = true)
protected DefenseValueMetadata physical = null;
@XmlElement(name = "magical")
@XmlElement(name = "magical", required = true)
protected DefenseValueMetadata magical = null;
@XmlType(namespace = "character")
@XmlType(name = "")
protected static class DefenseValueMetadata {
@XmlAttribute(name = "value")
@XmlAttribute(name = "value", required = true)
protected double value = 0;
}
}
@XmlElement(name = "move")
@XmlElement(name = "move", required = true)
protected MoveMetadata move = null;
@XmlType(namespace = "character")
@XmlType(name = "CharacterMovementType")
protected static class MoveMetadata {
@XmlAttribute(name = "run")
@XmlAttribute(name = "run", required = true)
protected double run = 0;
@XmlAttribute(name = "walk")
@XmlAttribute(name = "walk", required = true)
protected double walk = 0;
}
@XmlElement(name = "base")
@XmlElement(name = "base", required = true)
protected BaseMetadata base = null;
@XmlType(namespace = "character")
@XmlType(name = "CharacterBaseStatsType")
protected static class BaseMetadata {
@XmlAttribute(name = "int")
@XmlAttribute(name = "int", required = true)
protected int intelligence = 0;
@XmlAttribute(name = "str")
@XmlAttribute(name = "str", required = true)
protected int strength = 0;
@XmlAttribute(name = "con")
@XmlAttribute(name = "con", required = true)
protected int concentration = 0;
@XmlAttribute(name = "men")
@XmlAttribute(name = "men", required = true)
protected int mentality = 0;
@XmlAttribute(name = "dex")
@XmlAttribute(name = "dex", required = true)
protected int dexterity = 0;
@XmlAttribute(name = "wit")
@XmlAttribute(name = "wit", required = true)
protected int witness = 0;
}
@XmlElement(name = "maxload")
@XmlElement(name = "maxload", required = true)
protected int maximumLoad = 0;
}
@XmlElement(name = "collision")
@XmlElement(name = "collision", required = true)
protected CollitionMetadataContainer collision = null;
@XmlType(namespace = "character")
@XmlType(name = "CharacterCollisionType")
protected static class CollitionMetadataContainer {
@XmlElement(name = "male")
@XmlElement(name = "male", required = true)
protected CollisionMetadata male = null;
@XmlElement(name = "female")
@XmlElement(name = "female", required = true)
protected CollisionMetadata female = null;
@XmlType(namespace = "character")
@XmlType(name = "")
protected static class CollisionMetadata {
@XmlAttribute(name = "radius")
@XmlAttribute(name = "radius", required = true)
protected double radius = 0;
@XmlAttribute(name = "heigth")
@XmlAttribute(name = "heigth", required = true)
protected double height = 0;
}
}

View File

@@ -43,8 +43,8 @@ import com.l2jserver.util.jaxb.ItemTemplateIDAdapter;
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "item")
@XmlType(namespace = "item")
@XmlRootElement(name = "item", namespace = "http://schemas.l2jserver2.com/item")
@XmlType(namespace = "http://schemas.l2jserver2.com/item", name = "ItemType")
@XmlAccessorType(XmlAccessType.FIELD)
public class ItemTemplate extends AbstractTemplate<Item> {
/**
@@ -53,44 +53,46 @@ public class ItemTemplate extends AbstractTemplate<Item> {
private static final Logger log = LoggerFactory
.getLogger(ItemTemplate.class);
@XmlAttribute(name = "id")
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(ItemTemplateIDAdapter.class)
protected ItemTemplateID id;
@XmlAttribute(name = "name")
@XmlAttribute(name = "name", required = true)
protected String name;
@XmlElement(name = "weight")
@XmlElement(name = "weight", required = true)
protected int weight = 0;
@XmlElement(name = "price")
@XmlElement(name = "price", required = true)
protected int price = 0;
@XmlElement(name = "icon")
@XmlElement(name = "icon", required = false)
protected String icon;
@XmlElement(name = "effect")
@XmlElement(name = "effect", required = false)
protected EffectContainer effect;
@XmlType(namespace = "item")
@XmlType(name = "ItemEffectsType")
private static class EffectContainer {
@XmlAttribute(name = "type")
@XmlAttribute(name = "type", required = true)
protected EffectType effect;
}
@XmlType(namespace = "item")
@XmlType(name = "ItemStatsType")
protected static class StatsContainer {
@XmlElement(name = "physicalDamage")
@XmlElement(name = "physicalDamage", required = false)
protected StatAttribute physicalDamage;
@XmlElement(name = "magicalDamage")
@XmlElement(name = "magicalDamage", required = false)
protected StatAttribute magicalDamage;
@XmlElement(name = "criticalChance")
@XmlElement(name = "criticalChance", required = false)
protected StatAttribute criticalChance;
@XmlElement(name = "physicalAttackSpeed")
@XmlElement(name = "physicalAttackSpeed", required = false)
protected StatAttribute physicalAttackSpeed;
}
@XmlElement(name = "stats")
@XmlElement(name = "stats", required = false)
protected StatsContainer stats;
@XmlElement(name = "material", required = true)
protected ItemMaterial material;
@XmlType(name = "ItemEffectType")
public enum EffectType {
IMMEDIATE;
}
@@ -99,13 +101,14 @@ public class ItemTemplate extends AbstractTemplate<Item> {
protected WeaponType weaponType = WeaponType.NONE;
protected ArmorType armorType = ArmorType.NONE;
@XmlType(namespace = "item")
@XmlType(name = "ItemAttributeType")
public static class StatAttribute {
@XmlElement(name = "set")
@XmlElement(name = "set", required = true)
protected StatSet set;
@XmlType(name = "")
public static class StatSet {
@XmlAttribute(name = "order")
@XmlAttribute(name = "order", required = true)
protected int order;
@XmlValue
protected double value;

View File

@@ -33,6 +33,7 @@ import com.l2jserver.model.game.Skill;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.id.template.NPCTemplateID;
import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.model.template.NPCTemplate.TalkMetadata.Chat;
import com.l2jserver.model.template.actor.ActorSex;
import com.l2jserver.model.template.npc.NPCRace;
import com.l2jserver.model.world.NPC;
@@ -45,245 +46,246 @@ import com.l2jserver.util.jaxb.SkillTemplateIDAdapter;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "npc")
@XmlType(namespace = "npc", name = "npc")
@XmlRootElement(name = "npc", namespace = "http://schemas.l2jserver2.com/npc")
@XmlType(namespace = "http://schemas.l2jserver2.com/npc", name = "NPCType")
@XmlAccessorType(XmlAccessType.FIELD)
public class NPCTemplate extends ActorTemplate<NPC> {
@XmlAttribute(name = "id")
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(value = NPCTemplateIDAdapter.class)
protected NPCTemplateID id = null;
@XmlAttribute(name = "controller")
@XmlAttribute(name = "controller", required = true)
protected Class<? extends NPCController> controller;
@XmlElement(name = "info")
@XmlElement(name = "info", required = true)
protected NPCInformationMetadata info = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCInfoType")
protected static class NPCInformationMetadata {
@XmlElement(name = "name")
@XmlElement(name = "name", required = false)
public NPCNameMetadata nameMetadata = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCNameType")
protected static class NPCNameMetadata {
@XmlValue
protected String name = null;
@XmlAttribute(name = "send")
protected Boolean send = null;
protected Boolean send = false;
@XmlAttribute(name = "display")
protected Boolean display = null;
protected Boolean display = false;
}
@XmlElement(name = "title")
@XmlElement(name = "title", required = false)
protected NPCTitleMetadata titleMetadata = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCTitleType")
protected static class NPCTitleMetadata {
@XmlValue
protected String title = null;
@XmlAttribute(name = "send")
protected Boolean send = null;
protected Boolean send = false;
}
@XmlElement(name = "level")
@XmlElement(name = "level", required = true)
protected int level = 0;
@XmlElement(name = "race")
@XmlElement(name = "race", required = false)
protected NPCRace race = NPCRace.NONE;
@XmlElement(name = "sex")
@XmlElement(name = "sex", required = false)
protected ActorSex sex = null;
@XmlAttribute(name = "attackable")
protected boolean attackable;
@XmlAttribute(name = "targetable")
protected boolean targetable;
@XmlAttribute(name = "aggressive")
protected boolean aggressive;
@XmlAttribute(name = "attackable", required = false)
protected boolean attackable = false;
@XmlAttribute(name = "targetable", required = false)
protected boolean targetable = false;
@XmlAttribute(name = "aggressive", required = false)
protected boolean aggressive = false;
@XmlElement(name = "stats")
@XmlElement(name = "stats", required = true)
protected NPCStatsMetadata stats = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCStatsType")
protected static class NPCStatsMetadata {
@XmlElement(name = "hp")
@XmlElement(name = "hp", required = true)
protected Stat hp = null;
@XmlElement(name = "mp")
@XmlElement(name = "mp", required = true)
protected Stat mp = null;
@XmlType(namespace = "npc")
@XmlType(name = "")
protected static class Stat {
@XmlAttribute(name = "max")
@XmlAttribute(name = "max", required = true)
protected double max = 0;
@XmlAttribute(name = "regen")
@XmlAttribute(name = "regen", required = true)
protected double regen = 0;
}
@XmlElement(name = "attack")
@XmlElement(name = "attack", required = false)
protected AttackMetadata attack = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCAttackType")
protected static class AttackMetadata {
@XmlAttribute(name = "range")
@XmlAttribute(name = "range", required = true)
protected int range = 0;
@XmlAttribute(name = "evasion")
@XmlAttribute(name = "evasion", required = true)
protected int evasion = 0;
@XmlAttribute(name = "critical")
@XmlAttribute(name = "critical", required = true)
protected int critical = 0;
@XmlElement(name = "physical")
@XmlElement(name = "physical", required = true)
protected AttackValueMetadata physical = null;
@XmlElement(name = "magical")
@XmlElement(name = "magical", required = true)
protected AttackValueMetadata magical = null;
@XmlType(namespace = "npc")
@XmlType(name = "")
protected static class AttackValueMetadata {
@XmlAttribute(name = "damage")
@XmlAttribute(name = "damage", required = true)
protected double damage = 0;
@XmlAttribute(name = "speed")
@XmlAttribute(name = "speed", required = true)
protected double speed = 0;
}
}
@XmlElement(name = "defense")
@XmlElement(name = "defense", required = false)
protected DefenseMetadata defense = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCDefenseType")
protected static class DefenseMetadata {
@XmlElement(name = "physical")
@XmlElement(name = "physical", required = true)
protected DefenseValueMetadata physical = null;
@XmlElement(name = "magical")
@XmlElement(name = "magical", required = true)
protected DefenseValueMetadata magical = null;
@XmlType(namespace = "npc")
@XmlType(name = "")
protected static class DefenseValueMetadata {
@XmlAttribute(name = "value")
@XmlAttribute(name = "value", required = true)
protected double value = 0;
}
}
@XmlElement(name = "move")
@XmlElement(name = "move", required = false)
protected MoveMetadata move = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCMovementType")
protected static class MoveMetadata {
@XmlAttribute(name = "run")
@XmlAttribute(name = "run", required = true)
protected double run = 0;
@XmlAttribute(name = "walk")
@XmlAttribute(name = "walk", required = true)
protected double walk = 0;
}
@XmlElement(name = "base")
@XmlElement(name = "base", required = true)
public BaseMetadata base = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCBaseStatsType")
protected static class BaseMetadata {
@XmlAttribute(name = "int")
@XmlAttribute(name = "int", required = true)
protected int intelligence = 0;
@XmlAttribute(name = "str")
@XmlAttribute(name = "str", required = true)
protected int strength = 0;
@XmlAttribute(name = "con")
@XmlAttribute(name = "con", required = true)
protected int concentration = 0;
@XmlAttribute(name = "men")
@XmlAttribute(name = "men", required = true)
protected int mentality = 0;
@XmlAttribute(name = "dex")
@XmlAttribute(name = "dex", required = true)
protected int dexterity = 0;
@XmlAttribute(name = "wit")
@XmlAttribute(name = "wit", required = true)
protected int witness = 0;
}
}
@XmlElement(name = "experience")
@XmlElement(name = "experience", required = true)
protected long experience = 0;
@XmlElement(name = "sp")
@XmlElement(name = "sp", required = true)
protected int sp = 0;
@XmlElement(name = "item")
@XmlElement(name = "item", required = false)
protected ItemMetadata item = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCItemsType")
protected static class ItemMetadata {
@XmlAttribute(name = "righthand")
@XmlAttribute(name = "righthand", required = false)
@XmlJavaTypeAdapter(value = ItemTemplateIDAdapter.class)
protected ItemTemplateID rightHand = null;
@XmlAttribute(name = "lefthand")
@XmlAttribute(name = "lefthand", required = false)
@XmlJavaTypeAdapter(value = ItemTemplateIDAdapter.class)
protected ItemTemplateID leftHand = null;
}
@XmlElement(name = "collision")
@XmlElement(name = "collision", required = false)
protected CollisionMetadata collision = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCCollisionType")
protected static class CollisionMetadata {
@XmlAttribute(name = "radius")
@XmlAttribute(name = "radius", required = true)
protected double radius = 0;
@XmlAttribute(name = "heigth")
@XmlAttribute(name = "heigth", required = true)
protected double height = 0;
}
}
@XmlElement(name = "ai")
@XmlElement(name = "ai", required = false)
protected AIMetadata ai = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCAIType")
protected static class AIMetadata {
@XmlAttribute(name = "script")
@XmlAttribute(name = "script", required = true)
protected String script = null;
}
@XmlElement(name = "talk")
@XmlElement(name = "talk", required = false)
protected TalkMetadata talk = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCTalkType")
protected static class TalkMetadata {
@XmlAttribute(name = "default")
@XmlAttribute(name = "default", required = true)
protected String defaultChat = null;
@XmlElement(name = "chat")
@XmlElement(name = "chat", required = true)
protected List<Chat> chats = null;
@XmlType(name = "")
public static class Chat {
@XmlAttribute(name = "id", required = true)
protected String id = null;
@XmlValue
protected String html = null;
}
}
@XmlType(namespace = "npc")
public static class Chat {
@XmlAttribute(name = "id")
protected String id = null;
@XmlValue
protected String html = null;
}
@XmlElementWrapper(name = "droplist")
@XmlElement(name = "item")
@XmlElementWrapper(name = "droplist", required = false)
@XmlElement(name = "item", required = true)
protected List<DropItemMetadata> droplist = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCDropType")
protected static class DropItemMetadata {
@XmlAttribute(name = "id")
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(value = ItemTemplateIDAdapter.class)
protected ItemTemplateID item = null;
@XmlAttribute(name = "min")
@XmlAttribute(name = "min", required = true)
protected int min = 0;
@XmlAttribute(name = "max")
@XmlAttribute(name = "max", required = true)
protected int max = 0;
@XmlAttribute(name = "category")
@XmlAttribute(name = "category", required = true)
protected DropCategory category = null;
@XmlType(name = "NPCDropCategoryType")
public enum DropCategory {
DROP, SPOIL, UNK_1, UNK_2, UNK_3, UNK_4, UNK_5, UNK_6, UNK_7, UNK_8, UNK_9, UNK_10, UNK_11, UNK_12, UNK_13, UNK_14, UNK_15, UNK_16, UNK_17, UNK_18, UNK_19, UNK_20, UNK_21, UNK_22, UNK_23, UNK_24, UNK_25, UNK_26, UNK_27, UNK_28, UNK_29, UNK_30, UNK_31, UNK_32, UNK_33, UNK_34, UNK_35, UNK_36, UNK_100, UNK_101, UNK_102, UNK_200;
}
@XmlAttribute(name = "chance")
@XmlAttribute(name = "chance", required = true)
protected int chance = 0;
}
@XmlElementWrapper(name = "skills")
@XmlElement(name = "skill")
@XmlElementWrapper(name = "skills", required = false)
@XmlElement(name = "skill", required = true)
protected List<SkillMetadata> skills = null;
@XmlType(namespace = "npc")
@XmlType(name = "NPCSkillType")
protected static class SkillMetadata {
@XmlAttribute(name = "id")
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(value = SkillTemplateIDAdapter.class)
protected SkillTemplateID skill = null;
@XmlAttribute(name = "level")
@XmlAttribute(name = "level", required = true)
protected int level = 0;
}

View File

@@ -33,14 +33,14 @@ import com.l2jserver.util.jaxb.SkillTemplateIDAdapter;
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "skill")
@XmlType(namespace = "skill", name = "skill")
@XmlRootElement(name = "skill", namespace = "http://schemas.l2jserver2.com/skill")
@XmlType(namespace = "http://schemas.l2jserver2.com/skill", name = "SkillType")
@XmlAccessorType(XmlAccessType.FIELD)
public class SkillTemplate extends AbstractTemplate<Skill> {
@XmlAttribute(name = "id")
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(value = SkillTemplateIDAdapter.class)
protected SkillTemplateID id;
@XmlAttribute(name = "name")
@XmlAttribute(name = "name", required = true)
protected String name;
@XmlAttribute(name = "delay")
protected int delay;

View File

@@ -22,6 +22,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -38,9 +39,9 @@ import com.l2jserver.util.jaxb.TeleportationTemplateIDAdapter;
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "teleport")
@XmlRootElement(name = "teleport", namespace = "http://schemas.l2jserver2.com/teleport")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "teleports")
@XmlType(namespace = "http://schemas.l2jserver2.com/teleport", name = "TeleportType")
public class TeleportationTemplate extends AbstractTemplate<Coordinate> {
@XmlAttribute(name = "id")
@XmlJavaTypeAdapter(TeleportationTemplateIDAdapter.class)
@@ -48,18 +49,21 @@ public class TeleportationTemplate extends AbstractTemplate<Coordinate> {
@XmlAttribute(name = "name")
protected String name;
@XmlAttribute(name = "item")
@XmlAttribute(name = "item", required = false)
@XmlJavaTypeAdapter(ItemTemplateIDAdapter.class)
protected ItemTemplateID itemTemplateID;
@XmlAttribute(name = "price")
@XmlAttribute(name = "price", required = true)
protected int price;
@XmlElement(name = "point")
@XmlElement(name = "point", required = false)
@XmlJavaTypeAdapter(CoordinateAdapter.class)
protected Coordinate coordinate;
@XmlElementWrapper(name = "restrictions", required = false)
@XmlElement(name = "restriction", required = true)
protected List<TeleportRestriction> restrictions;
@XmlType(name = "TeleportRestrictionType")
public enum TeleportRestriction {
NOBLE;
}

View File

@@ -1,11 +1,14 @@
package com.l2jserver.model.template.actor;
import javax.xml.bind.annotation.XmlType;
/**
* Represent the sex of an actor.
* <p>
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "ActorSexType")
public enum ActorSex {
/**
* Represents an male character

View File

@@ -26,11 +26,14 @@ import static com.l2jserver.model.template.character.CharacterRace.HUMAN;
import static com.l2jserver.model.template.character.CharacterRace.KAMAEL;
import static com.l2jserver.model.template.character.CharacterRace.ORC;
import javax.xml.bind.annotation.XmlType;
/**
* Defines all the possible classes for an character
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "CharacterClassType")
public enum CharacterClass {
/**
* Human fighter

View File

@@ -1,10 +1,13 @@
package com.l2jserver.model.template.character;
import javax.xml.bind.annotation.XmlType;
/**
* Represents the character race.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "CharacterRaceType")
public enum CharacterRace {
HUMAN(0x00), ELF(0x01), DARK_ELF(0x02), ORC(0x03), DWARF(0x04), KAMAEL(0x05);

View File

@@ -16,11 +16,14 @@
*/
package com.l2jserver.model.template.item;
import javax.xml.bind.annotation.XmlType;
/**
* Enum of all available armor types
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "ArmorType")
public enum ArmorType {
NONE, LIGHT, HEAVY, MAGIC, SIGILO;
}

View File

@@ -16,6 +16,9 @@
*/
package com.l2jserver.model.template.item;
import javax.xml.bind.annotation.XmlType;
@XmlType(name = "ItemMaterialType")
public enum ItemMaterial {
COTTON, WOOD, PAPER, FISH, ORIHARUKON, HORN, ADAMANTAITE, CHRYSOLITE, MITHRIL, COBWEB, RUNE_XP, CLOTH, SCALE_OF_DRAGON, BONE, GOLD, LEATHER, FINE_STEEL, SILVER, DYESTUFF, CRYSTAL, RUNE_REMOVE_PENALTY, STEEL, BRONZE, RUNE_SP, LIQUID, BLOOD_STEEL, DAMASCUS;
}

View File

@@ -16,11 +16,14 @@
*/
package com.l2jserver.model.template.item;
import javax.xml.bind.annotation.XmlType;
/**
* Enum for all available item types
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "ItemEnumType")
public enum ItemType {
/**
* No specific item type

View File

@@ -1,5 +1,7 @@
package com.l2jserver.model.template.item;
import javax.xml.bind.annotation.XmlType;
import com.l2jserver.model.world.actor.stat.StatType;
/**
@@ -7,6 +9,7 @@ import com.l2jserver.model.world.actor.stat.StatType;
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "WeaponType")
public enum WeaponType {
/**
* The Sword weapon type

View File

@@ -16,9 +16,12 @@
*/
package com.l2jserver.model.template.npc;
import javax.xml.bind.annotation.XmlType;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "NPCRaceType")
public enum NPCRace {
// character races
HUMAN, ELVEN, DARKELVEN, ORC, DWARVEN, KAMAEL,

View File

@@ -52,5 +52,9 @@ public class H2DAOModule extends AbstractModule {
// logs
bind(ChatMessageDAO.class).to(H2ChatMessageDAO.class).in(
Scopes.SINGLETON);
// DAO Resolver
bind(DAOResolver.class).to(GameServerDAOResolver.class).in(
Scopes.SINGLETON);
}
}

View File

@@ -53,5 +53,9 @@ public class MySQL5DAOModule extends AbstractModule {
// logs
bind(ChatMessageDAO.class).to(MySQL5ChatMessageDAO.class).in(
Scopes.SINGLETON);
// DAO Resolver
bind(DAOResolver.class).to(GameServerDAOResolver.class).in(
Scopes.SINGLETON);
}
}

View File

@@ -43,5 +43,9 @@ public class OrientDBDAOModule extends AbstractModule {
// // logs
// bind(ChatMessageDAO.class).to(OrientDBChatMessageDAO.class).in(
// Scopes.SINGLETON);
// DAO Resolver
bind(DAOResolver.class).to(GameServerDAOResolver.class).in(
Scopes.SINGLETON);
}
}

View File

@@ -141,7 +141,7 @@ public class XMLTemplateService extends AbstractService implements
/**
* @return the directory in which templates are stored
*/
@ConfigurationPropertyGetter(defaultValue = "data/templates")
@ConfigurationPropertyGetter(defaultValue = "data/template")
@ConfigurationPropertiesKey("template.directory")
@ConfigurationXPath("/configuration/services/template/directory")
URI getTemplateDirectory();
@@ -232,6 +232,12 @@ public class XMLTemplateService extends AbstractService implements
BasicFileAttributes attrs) throws IOException {
if (!file.toString().endsWith(".xml"))
return FileVisitResult.CONTINUE;
// FIXME remove hard coded skip of item template loading
if (file.toString().contains("/item/"))
return FileVisitResult.CONTINUE;
// FIXME remove hard coded skip of zone template loading
if (file.toString().contains("zones.xml"))
return FileVisitResult.CONTINUE;
try {
loadTemplate(file);
return FileVisitResult.CONTINUE;
@@ -240,19 +246,6 @@ public class XMLTemplateService extends AbstractService implements
}
}
});
final Path teleportsXmlPath = templatePath.getParent().resolve(
"teleports.xml");
final InputStream in = Files.newInputStream(teleportsXmlPath);
try {
TeleportationTemplateContainer container = (TeleportationTemplateContainer) unmarshaller
.unmarshal(in);
for (final TeleportationTemplate template : container.templates) {
templates.put(template.getID(), template);
}
} finally {
in.close();
}
} catch (JAXBException e) {
throw new ServiceStartException(e);
} catch (IOException e) {
@@ -282,13 +275,21 @@ public class XMLTemplateService extends AbstractService implements
log.debug("Loading template {}", path);
final InputStream in = Files.newInputStream(path);
try {
final Template<?> template = (Template<?>) unmarshaller
.unmarshal(in);
log.debug("Template loaded: {}", template);
if (template.getID() != null)
templates.put(template.getID(), template);
Object obj = unmarshaller.unmarshal(in);
if (obj instanceof Template) {
final Template<?> template = (Template<?>) obj;
log.debug("Template loaded: {}", template);
if (template.getID() != null)
templates.put(template.getID(), template);
} else if (obj instanceof TeleportationTemplateContainer) {
for (final Template<?> template : ((TeleportationTemplateContainer) obj).templates) {
log.debug("Template loaded: {}", template);
if (template.getID() != null)
templates.put(template.getID(), template);
}
}
} finally {
in.close();
// in.close();
}
}
@@ -317,14 +318,14 @@ public class XMLTemplateService extends AbstractService implements
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "teleports")
@XmlRootElement(name = "teleports", namespace = "http://schemas.l2jserver2.com/teleport")
@XmlType(namespace = "http://schemas.l2jserver2.com/teleport", name = "TeleportsType")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "teleports")
public static class TeleportationTemplateContainer {
/**
* The list of all teleportation templates
*/
@XmlElement(name = "teleport")
@XmlElement(namespace = "http://schemas.l2jserver2.com/teleport", name = "teleport")
public List<TeleportationTemplate> templates;
}
}

View File

@@ -34,6 +34,13 @@ public class CharacterTemplateIDAdapter extends
* The character template id provider
*/
private final CharacterTemplateIDProvider provider;
/**
* Used for template generator
*/
protected CharacterTemplateIDAdapter() {
this.provider = null;
}
/**
* @param provider

View File

@@ -17,6 +17,7 @@
package com.l2jserver.util.jaxb;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import com.l2jserver.util.geometry.Coordinate;
@@ -52,21 +53,22 @@ public class CoordinateAdapter extends
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "CoordinateType")
protected static class CoordinateElement {
/**
* The x cord
*/
@XmlAttribute(name = "x")
@XmlAttribute(name = "x", required = true)
public int x;
/**
* The y cord
*/
@XmlAttribute(name = "y")
@XmlAttribute(name = "y", required = true)
public int y;
/**
* The z cord
*/
@XmlAttribute(name = "z")
@XmlAttribute(name = "z", required = true)
public int z;
/**
@@ -84,7 +86,6 @@ public class CoordinateAdapter extends
* the z cord
*/
public CoordinateElement(int x, int y, int z) {
super();
this.x = x;
this.y = y;
this.z = z;

View File

@@ -55,13 +55,15 @@ public class ItemTemplateIDAdapter extends XmlAdapter<Integer, ItemTemplateID> {
return null;
if (provider == null)
return new ItemTemplateID(v, null);
if (v == null)
v = 57; // FIXME create constant holding important item ids
return provider.resolveID(v);
}
@Override
public Integer marshal(ItemTemplateID v) throws Exception {
if (v == null)
return 0;
return 57;
return v.getID();
}
}