From cc7343bf5d86d7f88ec048ac9a7f62e2bc49f425 Mon Sep 17 00:00:00 2001 From: Rodgerwilco Date: Fri, 13 Jan 2012 16:08:16 -0700 Subject: [PATCH] Some organization and cleanup --- GameServer/conf/aliases.xml | 72 ++--- .../org/moparscape/msc/config/Formulae.java | 52 ++-- .../msc/gs/connection/LSCodecFactory.java | 2 + .../msc/gs/connection/RSCCodecFactory.java | 2 + .../{ => codec}/LSProtocolDecoder.java | 3 +- .../{ => codec}/LSProtocolEncoder.java | 3 +- .../{ => codec}/RSCProtocolDecoder.java | 3 +- .../{ => codec}/RSCProtocolEncoder.java | 3 +- .../moparscape/msc/gs/core/GameEngine.java | 6 +- .../msc/gs/core/LoginConnector.java | 6 +- .../msc/gs/event/WalkMobToMobEvent.java | 4 +- .../org/moparscape/msc/gs/io/WorldLoader.java | 14 +- .../moparscape/msc/gs/model/GameObject.java | 20 +- .../org/moparscape/msc/gs/model/InvItem.java | 22 +- .../src/org/moparscape/msc/gs/model/Item.java | 14 +- .../src/org/moparscape/msc/gs/model/Npc.java | 30 +-- .../org/moparscape/msc/gs/model/Player.java | 14 +- .../org/moparscape/msc/gs/model/Script.java | 2 +- .../org/moparscape/msc/gs/model/World.java | 14 +- .../definition/EntityDefinition.java} | 4 +- .../definition}/EntityHandler.java | 147 +++++----- .../entity/GameObjectDefinition.java} | 6 +- .../entity/GameObjectLocationDefinition.java} | 104 +++---- .../definition/entity/ItemDefinition.java} | 6 +- .../entity/ItemDropDefinition.java} | 48 ++-- .../entity/ItemLocationDefinition.java} | 88 +++--- .../definition/entity/NPCDefinition.java} | 10 +- .../entity/NPCLocationDefinition.java} | 142 +++++----- .../definition/extra/CertDefinition.java} | 54 ++-- .../definition/extra/CerterDefinition.java} | 74 ++--- .../definition/extra/DoorDefinition.java} | 6 +- .../definition/extra/TileDefinition.java} | 36 +-- .../skill/AgilityCourseDefinition.java} | 166 ++++++------ .../definition/skill/AgilityDefinition.java} | 254 +++++++++--------- .../skill/FiremakingDefinition.java} | 54 ++-- .../skill/ItemArrowHeadDefinition.java} | 64 ++--- .../skill/ItemBowStringDefinition.java} | 64 ++--- .../skill/ItemCookingDefinition.java} | 82 +++--- .../skill/ItemCraftingDefinition.java} | 54 ++-- .../skill/ItemDartTipDefinition.java} | 64 ++--- .../definition/skill/ItemGemDefinition.java} | 64 ++--- .../definition/skill/ItemHerbDefinition.java} | 66 ++--- .../skill/ItemHerbSecondDefinition.java} | 96 +++---- .../skill/ItemLogCutDefinition.java} | 110 ++++---- .../skill/ItemSmeltingDefinition.java} | 83 +++--- .../skill/ItemSmithingDefinition.java} | 70 ++--- .../skill/ItemUnIdentHerbDefinition.java} | 66 ++--- .../skill/ItemWieldableDefinition.java} | 218 +++++++-------- .../skill/ObjectFishDefinition.java} | 66 ++--- .../skill/ObjectFishingDefinition.java} | 86 +++--- .../skill/ObjectMiningDefinition.java} | 82 +++--- .../skill/ObjectWoodcuttingDefinition.java} | 98 +++---- .../definition/skill/PrayerDefinition.java} | 6 +- .../definition/skill/ReqOreDefinition.java} | 50 ++-- .../definition/skill/SpellDefinition.java} | 6 +- .../moparscape/msc/gs/npchandler/Aggie.java | 2 +- .../moparscape/msc/gs/npchandler/Certer.java | 6 +- ...dlerDef.java => NpcHandlerDefinition.java} | 96 +++---- .../msc/gs/npchandler/ShopKeeper.java.1 | 54 ---- .../msc/gs/persistence/DataStore.java | 168 +++++++----- ...rDef.java => PacketHandlerDefinition.java} | 96 +++---- .../msc/gs/phandler/client/BankHandler.java | 2 +- .../msc/gs/phandler/client/DuelHandler.java | 4 +- .../gs/phandler/client/InvActionHandler.java | 6 +- .../phandler/client/InvUseOnGroundItem.java | 6 +- .../msc/gs/phandler/client/InvUseOnItem.java | 32 +-- .../gs/phandler/client/InvUseOnObject.java | 30 +-- .../msc/gs/phandler/client/ObjectAction.java | 26 +- .../msc/gs/phandler/client/PrayerHandler.java | 6 +- .../msc/gs/phandler/client/SpellHandler.java | 30 +-- .../msc/gs/phandler/client/TradeHandler.java | 4 +- .../gs/phandler/client/WallObjectAction.java | 6 +- .../msc/gs/phandler/client/WieldHandler.java | 2 +- .../msc/gs/plugins/extras/Thieving.java | 8 +- .../msc/gs/plugins/plugs/skills/Mining.java | 6 +- .../msc/gs/plugins/quests/ImpCatcher.java | 2 +- .../gs/persistence/impl/BinaryUsingNIO.java | 172 +++++++----- .../impl/bun/codec/NpcDefCodec.java | 10 +- .../gs/persistence/impl/XMLUsingXStream.java | 236 +++++++++------- 79 files changed, 2038 insertions(+), 1952 deletions(-) rename GameServer/src/org/moparscape/msc/gs/connection/{ => codec}/LSProtocolDecoder.java (94%) rename GameServer/src/org/moparscape/msc/gs/connection/{ => codec}/LSProtocolEncoder.java (94%) rename GameServer/src/org/moparscape/msc/gs/connection/{ => codec}/RSCProtocolDecoder.java (95%) rename GameServer/src/org/moparscape/msc/gs/connection/{ => codec}/RSCProtocolEncoder.java (96%) rename GameServer/src/org/moparscape/msc/gs/{external/EntityDef.java => model/definition/EntityDefinition.java} (83%) rename GameServer/src/org/moparscape/msc/gs/{external => model/definition}/EntityHandler.java (58%) rename GameServer/src/org/moparscape/msc/gs/{external/GameObjectDef.java => model/definition/entity/GameObjectDefinition.java} (84%) rename GameServer/src/org/moparscape/msc/gs/{external/GameObjectLoc.java => model/definition/entity/GameObjectLocationDefinition.java} (75%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemDef.java => model/definition/entity/ItemDefinition.java} (85%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemDropDef.java => model/definition/entity/ItemDropDefinition.java} (63%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemLoc.java => model/definition/entity/ItemLocationDefinition.java} (82%) rename GameServer/src/org/moparscape/msc/gs/{external/NPCDef.java => model/definition/entity/NPCDefinition.java} (89%) rename GameServer/src/org/moparscape/msc/gs/{external/NPCLoc.java => model/definition/entity/NPCLocationDefinition.java} (79%) rename GameServer/src/org/moparscape/msc/gs/{external/CertDef.java => model/definition/extra/CertDefinition.java} (79%) rename GameServer/src/org/moparscape/msc/gs/{external/CerterDef.java => model/definition/extra/CerterDefinition.java} (82%) rename GameServer/src/org/moparscape/msc/gs/{external/DoorDef.java => model/definition/extra/DoorDefinition.java} (81%) rename GameServer/src/org/moparscape/msc/gs/{external/TileDef.java => model/definition/extra/TileDefinition.java} (72%) rename GameServer/src/org/moparscape/msc/gs/{external/AgilityCourseDef.java => model/definition/skill/AgilityCourseDefinition.java} (86%) rename GameServer/src/org/moparscape/msc/gs/{external/AgilityDef.java => model/definition/skill/AgilityDefinition.java} (89%) rename GameServer/src/org/moparscape/msc/gs/{external/FiremakingDef.java => model/definition/skill/FiremakingDefinition.java} (79%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemArrowHeadDef.java => model/definition/skill/ItemArrowHeadDefinition.java} (80%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemBowStringDef.java => model/definition/skill/ItemBowStringDefinition.java} (79%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemCookingDef.java => model/definition/skill/ItemCookingDefinition.java} (82%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemCraftingDef.java => model/definition/skill/ItemCraftingDefinition.java} (77%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemDartTipDef.java => model/definition/skill/ItemDartTipDefinition.java} (80%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemGemDef.java => model/definition/skill/ItemGemDefinition.java} (80%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemHerbDef.java => model/definition/skill/ItemHerbDefinition.java} (79%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemHerbSecond.java => model/definition/skill/ItemHerbSecondDefinition.java} (84%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemLogCutDef.java => model/definition/skill/ItemLogCutDefinition.java} (85%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemSmeltingDef.java => model/definition/skill/ItemSmeltingDefinition.java} (72%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemSmithingDef.java => model/definition/skill/ItemSmithingDefinition.java} (81%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemUnIdentHerbDef.java => model/definition/skill/ItemUnIdentHerbDefinition.java} (79%) rename GameServer/src/org/moparscape/msc/gs/{external/ItemWieldableDef.java => model/definition/skill/ItemWieldableDefinition.java} (91%) rename GameServer/src/org/moparscape/msc/gs/{external/ObjectFishDef.java => model/definition/skill/ObjectFishDefinition.java} (79%) rename GameServer/src/org/moparscape/msc/gs/{external/ObjectFishingDef.java => model/definition/skill/ObjectFishingDefinition.java} (71%) rename GameServer/src/org/moparscape/msc/gs/{external/ObjectMiningDef.java => model/definition/skill/ObjectMiningDefinition.java} (82%) rename GameServer/src/org/moparscape/msc/gs/{external/ObjectWoodcuttingDef.java => model/definition/skill/ObjectWoodcuttingDefinition.java} (83%) rename GameServer/src/org/moparscape/msc/gs/{external/PrayerDef.java => model/definition/skill/PrayerDefinition.java} (64%) rename GameServer/src/org/moparscape/msc/gs/{external/ReqOreDef.java => model/definition/skill/ReqOreDefinition.java} (73%) rename GameServer/src/org/moparscape/msc/gs/{external/SpellDef.java => model/definition/skill/SpellDefinition.java} (82%) rename GameServer/src/org/moparscape/msc/gs/npchandler/{NpcHandlerDef.java => NpcHandlerDefinition.java} (88%) delete mode 100644 GameServer/src/org/moparscape/msc/gs/npchandler/ShopKeeper.java.1 rename GameServer/src/org/moparscape/msc/gs/phandler/{PacketHandlerDef.java => PacketHandlerDefinition.java} (87%) diff --git a/GameServer/conf/aliases.xml b/GameServer/conf/aliases.xml index 562e951..b1ba45c 100644 --- a/GameServer/conf/aliases.xml +++ b/GameServer/conf/aliases.xml @@ -3,8 +3,8 @@ Stores aliases for the XStream engine - org.moparscape.msc.gs.phandler.PacketHandlerDef - org.moparscape.msc.gs.npchandler.NpcHandlerDef + org.moparscape.msc.gs.phandler.PacketHandlerDefinition + org.moparscape.msc.gs.npchandler.NpcHandlerDefinition org.moparscape.msc.gs.model.Point org.moparscape.msc.gs.model.TelePoint @@ -12,41 +12,41 @@ org.moparscape.msc.gs.model.Shop org.moparscape.msc.gs.model.InvItem - org.moparscape.msc.gs.external.CerterDef - org.moparscape.msc.gs.external.CertDef - org.moparscape.msc.gs.external.GameObjectLoc - org.moparscape.msc.gs.external.ItemLoc - org.moparscape.msc.gs.external.NPCLoc + org.moparscape.msc.gs.model.definition.GameObjectLoc + org.moparscape.msc.gs.model.definition.ItemLoc + org.moparscape.msc.gs.model.definition.NPCLoc + org.moparscape.msc.gs.model.definition.GameObjectDefinition + org.moparscape.msc.gs.model.definition.ItemDefinition + org.moparscape.msc.gs.model.definition.NPCDefinition - org.moparscape.msc.gs.external.TileDef - org.moparscape.msc.gs.external.GameObjectDef - org.moparscape.msc.gs.external.DoorDef - org.moparscape.msc.gs.external.ItemDef - org.moparscape.msc.gs.external.PrayerDef - org.moparscape.msc.gs.external.SpellDef - org.moparscape.msc.gs.external.NPCDef + org.moparscape.msc.gs.model.definition.extra.TileDefinition + org.moparscape.msc.gs.model.definition.extra.DoorDefinition + org.moparscape.msc.gs.model.definition.CerterDefinition + org.moparscape.msc.gs.model.definition.CertDefinition - org.moparscape.msc.gs.external.ItemCraftingDef - org.moparscape.msc.gs.external.ItemHerbSecond - org.moparscape.msc.gs.external.ItemDartTipDef - org.moparscape.msc.gs.external.ItemGemDef - org.moparscape.msc.gs.external.ItemLogCutDef - org.moparscape.msc.gs.external.ItemBowStringDef - org.moparscape.msc.gs.external.ItemArrowHeadDef - org.moparscape.msc.gs.external.FiremakingDef - org.moparscape.msc.gs.external.ReqOreDef - org.moparscape.msc.gs.external.ItemWieldableDef - org.moparscape.msc.gs.external.ItemUnIdentHerbDef - org.moparscape.msc.gs.external.ItemHerbDef - org.moparscape.msc.gs.external.ItemCookingDef - org.moparscape.msc.gs.external.ItemSmeltingDef - org.moparscape.msc.gs.external.ItemSmithingDef - org.moparscape.msc.gs.external.ObjectMiningDef - org.moparscape.msc.gs.external.ObjectWoodcuttingDef - org.moparscape.msc.gs.external.ObjectFishingDef - org.moparscape.msc.gs.external.ObjectFishDef - org.moparscape.msc.gs.external.ItemDropDef - org.moparscape.msc.gs.external.AgilityDef - org.moparscape.msc.gs.external.AgilityCourseDef + org.moparscape.msc.gs.model.definition.PrayerDefinition + org.moparscape.msc.gs.model.definition.SpellDefinition + org.moparscape.msc.gs.model.definition.ItemCraftingDefinition + org.moparscape.msc.gs.model.definition.ItemHerbSecondDefinition + org.moparscape.msc.gs.model.definition.ItemDartTipDefinition + org.moparscape.msc.gs.model.definition.ItemGemDefinition + org.moparscape.msc.gs.model.definition.ItemLogCutDefinition + org.moparscape.msc.gs.model.definition.ItemBowStringDefinition + org.moparscape.msc.gs.model.definition.ItemArrowHeadDefinition + org.moparscape.msc.gs.model.definition.FiremakingDefinition + org.moparscape.msc.gs.model.definition.ReqOreDefinition + org.moparscape.msc.gs.model.definition.ItemWieldableDefinition + org.moparscape.msc.gs.model.definition.ItemUnIdentHerbDefinition + org.moparscape.msc.gs.model.definition.ItemHerbDefinition + org.moparscape.msc.gs.model.definition.ItemCookingDefinition + org.moparscape.msc.gs.model.definition.ItemSmeltingDefinition + org.moparscape.msc.gs.model.definition.ItemSmithingDefinition + org.moparscape.msc.gs.model.definition.ObjectMiningDefinition + org.moparscape.msc.gs.model.definition.ObjectWoodcuttingDefinition + org.moparscape.msc.gs.model.definition.ObjectFishingDefinition + org.moparscape.msc.gs.model.definition.ObjectFishDefinition + org.moparscape.msc.gs.model.definition.ItemDropDefinition + org.moparscape.msc.gs.model.definition.AgilityDefinition + org.moparscape.msc.gs.model.definition.AgilityCourseDefinition diff --git a/GameServer/src/org/moparscape/msc/config/Formulae.java b/GameServer/src/org/moparscape/msc/config/Formulae.java index 4f0e771..3aa6bfb 100644 --- a/GameServer/src/org/moparscape/msc/config/Formulae.java +++ b/GameServer/src/org/moparscape/msc/config/Formulae.java @@ -4,15 +4,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.FiremakingDef; -import org.moparscape.msc.gs.external.GameObjectLoc; -import org.moparscape.msc.gs.external.ItemLoc; -import org.moparscape.msc.gs.external.NPCLoc; -import org.moparscape.msc.gs.external.ObjectFishDef; -import org.moparscape.msc.gs.external.ObjectMiningDef; -import org.moparscape.msc.gs.external.ObjectWoodcuttingDef; -import org.moparscape.msc.gs.external.SpellDef; import org.moparscape.msc.gs.model.Entity; import org.moparscape.msc.gs.model.GameObject; import org.moparscape.msc.gs.model.InvItem; @@ -21,6 +12,15 @@ import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.Shop; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.entity.GameObjectLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCLocationDefinition; +import org.moparscape.msc.gs.model.definition.skill.FiremakingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectFishDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectMiningDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectWoodcuttingDefinition; +import org.moparscape.msc.gs.model.definition.skill.SpellDefinition; import org.moparscape.msc.gs.tools.DataConversions; public class Formulae { @@ -514,7 +514,7 @@ public class Formulae { /** * Should the spell cast or fail? */ - public static boolean castSpell(SpellDef def, int magicLevel, int magicEquip) { + public static boolean castSpell(SpellDefinition def, int magicLevel, int magicEquip) { int levelDiff = magicLevel - def.getReqLevel(); if (magicEquip >= 30 && levelDiff >= 5) @@ -709,9 +709,9 @@ public class Formulae { /** * Decide what fish, if any, we should get from the water */ - public static ObjectFishDef getFish(int waterId, int fishingLevel, int click) { - ArrayList fish = new ArrayList(); - for (ObjectFishDef def : EntityHandler.getObjectFishingDef(waterId, + public static ObjectFishDefinition getFish(int waterId, int fishingLevel, int click) { + ArrayList fish = new ArrayList(); + for (ObjectFishDefinition def : EntityHandler.getObjectFishingDef(waterId, click).getFishDefs()) { if (fishingLevel >= def.getReqLevel()) { fish.add(def); @@ -720,7 +720,7 @@ public class Formulae { if (fish.size() <= 0) { return null; } - ObjectFishDef thisFish = fish.get(DataConversions.random(0, + ObjectFishDefinition thisFish = fish.get(DataConversions.random(0, fish.size() - 1)); int levelDiff = fishingLevel - thisFish.getReqLevel(); if (levelDiff < 0) { @@ -779,7 +779,7 @@ public class Formulae { /** * Should we get a log from the tree? */ - public static boolean getLog(ObjectWoodcuttingDef def, int woodcutLevel, + public static boolean getLog(ObjectWoodcuttingDefinition def, int woodcutLevel, int axeId) { int levelDiff = woodcutLevel - def.getReqLevel(); if (levelDiff < 0) { @@ -901,7 +901,7 @@ public class Formulae { /** * Should we can get an ore from the rock? */ - public static boolean getOre(ObjectMiningDef def, int miningLevel, int axeId) { + public static boolean getOre(ObjectMiningDefinition def, int miningLevel, int axeId) { int levelDiff = miningLevel - def.getReqLevel(); if (levelDiff > 50) @@ -1137,15 +1137,15 @@ public class Formulae { int y = -1; if (objs.length == 1) { Object obj = objs[0]; - if (obj instanceof GameObjectLoc) { - x = ((GameObjectLoc) obj).x; - y = ((GameObjectLoc) obj).y; - } else if ((obj instanceof ItemLoc)) { - x = ((ItemLoc) obj).x; - y = ((ItemLoc) obj).y; - } else if (obj instanceof NPCLoc) { - x = ((NPCLoc) obj).startX; - y = ((NPCLoc) obj).startY; + if (obj instanceof GameObjectLocationDefinition) { + x = ((GameObjectLocationDefinition) obj).x; + y = ((GameObjectLocationDefinition) obj).y; + } else if ((obj instanceof ItemLocationDefinition)) { + x = ((ItemLocationDefinition) obj).x; + y = ((ItemLocationDefinition) obj).y; + } else if (obj instanceof NPCLocationDefinition) { + x = ((NPCLocationDefinition) obj).startX; + y = ((NPCLocationDefinition) obj).startY; } } else { if (objs[0] instanceof Integer && objs[1] instanceof Integer) { @@ -1190,7 +1190,7 @@ public class Formulae { /** * Should the fire light or fail? */ - public static boolean lightLogs(FiremakingDef def, int firemakingLvl) { + public static boolean lightLogs(FiremakingDefinition def, int firemakingLvl) { int levelDiff = firemakingLvl - def.getRequiredLevel(); if (levelDiff < 0) { return false; diff --git a/GameServer/src/org/moparscape/msc/gs/connection/LSCodecFactory.java b/GameServer/src/org/moparscape/msc/gs/connection/LSCodecFactory.java index d7ed92a..2ff3f5f 100644 --- a/GameServer/src/org/moparscape/msc/gs/connection/LSCodecFactory.java +++ b/GameServer/src/org/moparscape/msc/gs/connection/LSCodecFactory.java @@ -3,6 +3,8 @@ package org.moparscape.msc.gs.connection; import org.apache.mina.filter.codec.ProtocolCodecFactory; import org.apache.mina.filter.codec.ProtocolDecoder; import org.apache.mina.filter.codec.ProtocolEncoder; +import org.moparscape.msc.gs.connection.codec.LSProtocolDecoder; +import org.moparscape.msc.gs.connection.codec.LSProtocolEncoder; /** * Provides access to the protocol encoders and decoders for the LS protocol. diff --git a/GameServer/src/org/moparscape/msc/gs/connection/RSCCodecFactory.java b/GameServer/src/org/moparscape/msc/gs/connection/RSCCodecFactory.java index 7ffa2e4..e1243d2 100644 --- a/GameServer/src/org/moparscape/msc/gs/connection/RSCCodecFactory.java +++ b/GameServer/src/org/moparscape/msc/gs/connection/RSCCodecFactory.java @@ -3,6 +3,8 @@ package org.moparscape.msc.gs.connection; import org.apache.mina.filter.codec.ProtocolCodecFactory; import org.apache.mina.filter.codec.ProtocolDecoder; import org.apache.mina.filter.codec.ProtocolEncoder; +import org.moparscape.msc.gs.connection.codec.RSCProtocolDecoder; +import org.moparscape.msc.gs.connection.codec.RSCProtocolEncoder; /** * Provides access to the protocol encoders and decoders for the RSC protocol. diff --git a/GameServer/src/org/moparscape/msc/gs/connection/LSProtocolDecoder.java b/GameServer/src/org/moparscape/msc/gs/connection/codec/LSProtocolDecoder.java similarity index 94% rename from GameServer/src/org/moparscape/msc/gs/connection/LSProtocolDecoder.java rename to GameServer/src/org/moparscape/msc/gs/connection/codec/LSProtocolDecoder.java index da0406f..0fefb26 100644 --- a/GameServer/src/org/moparscape/msc/gs/connection/LSProtocolDecoder.java +++ b/GameServer/src/org/moparscape/msc/gs/connection/codec/LSProtocolDecoder.java @@ -1,9 +1,10 @@ -package org.moparscape.msc.gs.connection; +package org.moparscape.msc.gs.connection.codec; import org.apache.mina.common.ByteBuffer; import org.apache.mina.common.IoSession; import org.apache.mina.filter.codec.CumulativeProtocolDecoder; import org.apache.mina.filter.codec.ProtocolDecoderOutput; +import org.moparscape.msc.gs.connection.LSPacket; /** * A decoder for the LS protocol. Parses the incoming data from an IoSession and diff --git a/GameServer/src/org/moparscape/msc/gs/connection/LSProtocolEncoder.java b/GameServer/src/org/moparscape/msc/gs/connection/codec/LSProtocolEncoder.java similarity index 94% rename from GameServer/src/org/moparscape/msc/gs/connection/LSProtocolEncoder.java rename to GameServer/src/org/moparscape/msc/gs/connection/codec/LSProtocolEncoder.java index 001319a..add55c1 100644 --- a/GameServer/src/org/moparscape/msc/gs/connection/LSProtocolEncoder.java +++ b/GameServer/src/org/moparscape/msc/gs/connection/codec/LSProtocolEncoder.java @@ -1,9 +1,10 @@ -package org.moparscape.msc.gs.connection; +package org.moparscape.msc.gs.connection.codec; import org.apache.mina.common.ByteBuffer; import org.apache.mina.common.IoSession; import org.apache.mina.filter.codec.ProtocolEncoder; import org.apache.mina.filter.codec.ProtocolEncoderOutput; +import org.moparscape.msc.gs.connection.LSPacket; import org.moparscape.msc.gs.util.Logger; /** diff --git a/GameServer/src/org/moparscape/msc/gs/connection/RSCProtocolDecoder.java b/GameServer/src/org/moparscape/msc/gs/connection/codec/RSCProtocolDecoder.java similarity index 95% rename from GameServer/src/org/moparscape/msc/gs/connection/RSCProtocolDecoder.java rename to GameServer/src/org/moparscape/msc/gs/connection/codec/RSCProtocolDecoder.java index b9e1916..617c4c6 100644 --- a/GameServer/src/org/moparscape/msc/gs/connection/RSCProtocolDecoder.java +++ b/GameServer/src/org/moparscape/msc/gs/connection/codec/RSCProtocolDecoder.java @@ -1,9 +1,10 @@ -package org.moparscape.msc.gs.connection; +package org.moparscape.msc.gs.connection.codec; import org.apache.mina.common.ByteBuffer; import org.apache.mina.common.IoSession; import org.apache.mina.filter.codec.CumulativeProtocolDecoder; import org.apache.mina.filter.codec.ProtocolDecoderOutput; +import org.moparscape.msc.gs.connection.RSCPacket; import org.moparscape.msc.gs.util.Logger; /** diff --git a/GameServer/src/org/moparscape/msc/gs/connection/RSCProtocolEncoder.java b/GameServer/src/org/moparscape/msc/gs/connection/codec/RSCProtocolEncoder.java similarity index 96% rename from GameServer/src/org/moparscape/msc/gs/connection/RSCProtocolEncoder.java rename to GameServer/src/org/moparscape/msc/gs/connection/codec/RSCProtocolEncoder.java index b36851b..96e775b 100644 --- a/GameServer/src/org/moparscape/msc/gs/connection/RSCProtocolEncoder.java +++ b/GameServer/src/org/moparscape/msc/gs/connection/codec/RSCProtocolEncoder.java @@ -1,9 +1,10 @@ -package org.moparscape.msc.gs.connection; +package org.moparscape.msc.gs.connection.codec; import org.apache.mina.common.ByteBuffer; import org.apache.mina.common.IoSession; import org.apache.mina.filter.codec.ProtocolEncoder; import org.apache.mina.filter.codec.ProtocolEncoderOutput; +import org.moparscape.msc.gs.connection.RSCPacket; import org.moparscape.msc.gs.util.Logger; /** diff --git a/GameServer/src/org/moparscape/msc/gs/core/GameEngine.java b/GameServer/src/org/moparscape/msc/gs/core/GameEngine.java index e49e66d..b3fc6dc 100644 --- a/GameServer/src/org/moparscape/msc/gs/core/GameEngine.java +++ b/GameServer/src/org/moparscape/msc/gs/core/GameEngine.java @@ -22,7 +22,7 @@ import org.moparscape.msc.gs.model.World; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.model.snapshot.Snapshot; import org.moparscape.msc.gs.phandler.PacketHandler; -import org.moparscape.msc.gs.phandler.PacketHandlerDef; +import org.moparscape.msc.gs.phandler.PacketHandlerDefinition; import org.moparscape.msc.gs.plugins.dependencies.NpcAI; import org.moparscape.msc.gs.tools.Captcha; import org.moparscape.msc.gs.util.Logger; @@ -154,9 +154,9 @@ public final class GameEngine extends Thread { * @throws Exception */ protected void loadPacketHandlers() throws Exception { - PacketHandlerDef[] handlerDefs = Instance.getDataStore() + PacketHandlerDefinition[] handlerDefs = Instance.getDataStore() .loadPacketHandlerDefs(); - for (PacketHandlerDef handlerDef : handlerDefs) { + for (PacketHandlerDefinition handlerDef : handlerDefs) { try { String className = handlerDef.getClassName(); Class c = Class.forName(className); diff --git a/GameServer/src/org/moparscape/msc/gs/core/LoginConnector.java b/GameServer/src/org/moparscape/msc/gs/core/LoginConnector.java index f010a62..ed41d3f 100644 --- a/GameServer/src/org/moparscape/msc/gs/core/LoginConnector.java +++ b/GameServer/src/org/moparscape/msc/gs/core/LoginConnector.java @@ -17,7 +17,7 @@ import org.moparscape.msc.gs.connection.LSConnectionHandler; import org.moparscape.msc.gs.connection.LSPacket; import org.moparscape.msc.gs.connection.PacketQueue; import org.moparscape.msc.gs.phandler.PacketHandler; -import org.moparscape.msc.gs.phandler.PacketHandlerDef; +import org.moparscape.msc.gs.phandler.PacketHandlerDefinition; import org.moparscape.msc.gs.util.Logger; public class LoginConnector { @@ -144,8 +144,8 @@ public class LoginConnector { } private void loadPacketHandlers() throws Exception { - PacketHandlerDef[] handlerDefs = Instance.getDataStore().loadLSPacketHandlerDefs(); - for (PacketHandlerDef handlerDef : handlerDefs) { + PacketHandlerDefinition[] handlerDefs = Instance.getDataStore().loadLSPacketHandlerDefs(); + for (PacketHandlerDefinition handlerDef : handlerDefs) { try { String className = handlerDef.getClassName(); Class c = Class.forName(className); diff --git a/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java b/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java index 2348cfd..318bfe0 100644 --- a/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java +++ b/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java @@ -1,14 +1,14 @@ package org.moparscape.msc.gs.event; import org.moparscape.msc.gs.core.GameEngine; -import org.moparscape.msc.gs.external.NPCLoc; import org.moparscape.msc.gs.model.Mob; import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Path; +import org.moparscape.msc.gs.model.definition.entity.NPCLocationDefinition; public abstract class WalkMobToMobEvent extends DelayedEvent { protected Mob affectedMob; - private NPCLoc loc = null; + private NPCLocationDefinition loc = null; protected Mob owner; private int radius; private long startTime = 0L; diff --git a/GameServer/src/org/moparscape/msc/gs/io/WorldLoader.java b/GameServer/src/org/moparscape/msc/gs/io/WorldLoader.java index c0b4e3e..c6479e2 100644 --- a/GameServer/src/org/moparscape/msc/gs/io/WorldLoader.java +++ b/GameServer/src/org/moparscape/msc/gs/io/WorldLoader.java @@ -9,15 +9,15 @@ import java.util.zip.ZipFile; import org.moparscape.msc.config.Config; import org.moparscape.msc.config.Formulae; import org.moparscape.msc.gs.Instance; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.GameObjectLoc; -import org.moparscape.msc.gs.external.ItemLoc; -import org.moparscape.msc.gs.external.NPCLoc; import org.moparscape.msc.gs.model.GameObject; import org.moparscape.msc.gs.model.Item; import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Shop; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.entity.GameObjectLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCLocationDefinition; import org.moparscape.msc.gs.model.landscape.MutableTileValue; import org.moparscape.msc.gs.model.landscape.Sector; import org.moparscape.msc.gs.tools.DataConversions; @@ -167,14 +167,14 @@ public class WorldLoader { public void loadObjects() throws Exception { World world = Instance.getWorld(); - for (GameObjectLoc gameObject : Instance.getDataStore().loadGameObjectLocs()) { + for (GameObjectLocationDefinition gameObject : Instance.getDataStore().loadGameObjectLocs()) { if (Config.f2pWildy && Formulae.isP2P(true, gameObject)) continue; if (Formulae.isP2P(gameObject) && !World.isMembers()) continue; world.registerGameObject(new GameObject(gameObject)); } - for (ItemLoc item : Instance.getDataStore().loadItemLocs()) { + for (ItemLocationDefinition item : Instance.getDataStore().loadItemLocs()) { if (Config.f2pWildy && Formulae.isP2P(true, item)) continue; if (Formulae.isP2P(item) && !World.isMembers()) @@ -182,7 +182,7 @@ public class WorldLoader { world.registerItem(new Item(item)); }// ember - for (NPCLoc npc : Instance.getDataStore().loadNPCLocs()) { + for (NPCLocationDefinition npc : Instance.getDataStore().loadNPCLocs()) { if (Config.f2pWildy && Formulae.isP2P(true, npc)) continue; if (Formulae.isP2P(npc) && !World.isMembers()) diff --git a/GameServer/src/org/moparscape/msc/gs/model/GameObject.java b/GameServer/src/org/moparscape/msc/gs/model/GameObject.java index fb2bb95..4b630ce 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/GameObject.java +++ b/GameServer/src/org/moparscape/msc/gs/model/GameObject.java @@ -1,9 +1,9 @@ package org.moparscape.msc.gs.model; -import org.moparscape.msc.gs.external.DoorDef; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.GameObjectDef; -import org.moparscape.msc.gs.external.GameObjectLoc; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.entity.GameObjectDefinition; +import org.moparscape.msc.gs.model.definition.entity.GameObjectLocationDefinition; +import org.moparscape.msc.gs.model.definition.extra.DoorDefinition; public class GameObject extends Entity { /** @@ -19,7 +19,7 @@ public class GameObject extends Entity { /** * Location definition of the object */ - private GameObjectLoc loc = null; + private GameObjectLocationDefinition loc = null; /** * Set when the item has been destroyed to alert players */ @@ -30,7 +30,7 @@ public class GameObject extends Entity { */ private int type; - public GameObject(GameObjectLoc loc) { + public GameObject(GameObjectLocationDefinition loc) { direction = loc.direction; type = loc.type; this.loc = loc; @@ -39,7 +39,7 @@ public class GameObject extends Entity { } public GameObject(Point location, int id, int direction, int type) { - this(new GameObjectLoc(id, location.getX(), location.getY(), direction, + this(new GameObjectLocationDefinition(id, location.getX(), location.getY(), direction, type)); } @@ -66,15 +66,15 @@ public class GameObject extends Entity { return direction; } - public DoorDef getDoorDef() { + public DoorDefinition getDoorDef() { return EntityHandler.getDoorDef(super.getID()); } - public GameObjectDef getGameObjectDef() { + public GameObjectDefinition getGameObjectDef() { return EntityHandler.getGameObjectDef(super.getID()); } - public GameObjectLoc getLoc() { + public GameObjectLocationDefinition getLoc() { return loc; } diff --git a/GameServer/src/org/moparscape/msc/gs/model/InvItem.java b/GameServer/src/org/moparscape/msc/gs/model/InvItem.java index 142b7bb..db644e1 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/InvItem.java +++ b/GameServer/src/org/moparscape/msc/gs/model/InvItem.java @@ -1,11 +1,11 @@ package org.moparscape.msc.gs.model; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.ItemCookingDef; -import org.moparscape.msc.gs.external.ItemDef; -import org.moparscape.msc.gs.external.ItemSmeltingDef; -import org.moparscape.msc.gs.external.ItemUnIdentHerbDef; -import org.moparscape.msc.gs.external.ItemWieldableDef; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.entity.ItemDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCookingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmeltingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemUnIdentHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemWieldableDefinition; public class InvItem extends Entity implements Comparable { @@ -51,23 +51,23 @@ public class InvItem extends Entity implements Comparable { return amount; } - public ItemCookingDef getCookingDef() { + public ItemCookingDefinition getCookingDef() { return EntityHandler.getItemCookingDef(id); } - public ItemDef getDef() { + public ItemDefinition getDef() { return EntityHandler.getItemDef(id); } - public ItemSmeltingDef getSmeltingDef() { + public ItemSmeltingDefinition getSmeltingDef() { return EntityHandler.getItemSmeltingDef(id); } - public ItemUnIdentHerbDef getUnIdentHerbDef() { + public ItemUnIdentHerbDefinition getUnIdentHerbDef() { return EntityHandler.getItemUnIdentHerbDef(id); } - public ItemWieldableDef getWieldableDef() { + public ItemWieldableDefinition getWieldableDef() { return EntityHandler.getItemWieldableDef(id); } diff --git a/GameServer/src/org/moparscape/msc/gs/model/Item.java b/GameServer/src/org/moparscape/msc/gs/model/Item.java index 3098ab2..ac2db89 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/Item.java +++ b/GameServer/src/org/moparscape/msc/gs/model/Item.java @@ -4,9 +4,9 @@ import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.core.GameEngine; import org.moparscape.msc.gs.db.DataManager; import org.moparscape.msc.gs.event.DelayedEvent; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.ItemDef; -import org.moparscape.msc.gs.external.ItemLoc; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.entity.ItemDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemLocationDefinition; public class Item extends Entity { /** @@ -21,7 +21,7 @@ public class Item extends Entity { /** * Location definition of the item */ - private ItemLoc loc = null; + private ItemLocationDefinition loc = null; /** * Contains the player that the item belongs to, if any @@ -84,7 +84,7 @@ public class Item extends Entity { } } - public Item(ItemLoc loc) { + public Item(ItemLocationDefinition loc) { this.loc = loc; setID(loc.id); setAmount(loc.amount); @@ -125,11 +125,11 @@ public class Item extends Entity { return amount; } - public ItemDef getDef() { + public ItemDefinition getDef() { return EntityHandler.getItemDef(id); } - public ItemLoc getLoc() { + public ItemLocationDefinition getLoc() { return loc; } diff --git a/GameServer/src/org/moparscape/msc/gs/model/Npc.java b/GameServer/src/org/moparscape/msc/gs/model/Npc.java index f08a65c..deb8094 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/Npc.java +++ b/GameServer/src/org/moparscape/msc/gs/model/Npc.java @@ -11,10 +11,10 @@ import org.moparscape.msc.gs.Server; import org.moparscape.msc.gs.core.GameEngine; import org.moparscape.msc.gs.event.DelayedEvent; import org.moparscape.msc.gs.event.FightEvent; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.ItemDropDef; -import org.moparscape.msc.gs.external.NPCDef; -import org.moparscape.msc.gs.external.NPCLoc; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.entity.ItemDropDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCLocationDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.plugins.dependencies.NpcAI; import org.moparscape.msc.gs.states.Action; @@ -111,13 +111,13 @@ public class Npc extends Mob { /** * The definition of this npc */ - private NPCDef def; + private NPCDefinition def; private Syndicate syndicate = new Syndicate(); private boolean goingToAttack = false; /** * The location of this npc */ - private NPCLoc loc; + private NPCLocationDefinition loc; public boolean hasRan() { return ran; @@ -199,11 +199,11 @@ public class Npc extends Mob { this.weakend = weakend; } - public void setDef(NPCDef def) { + public void setDef(NPCDefinition def) { this.def = def; } - public void setLoc(NPCLoc loc) { + public void setLoc(NPCLocationDefinition loc) { this.loc = loc; } @@ -222,7 +222,7 @@ public class Npc extends Mob { public Npc(int id, int startX, int startY, int minX, int maxX, int minY, int maxY) { - this(new NPCLoc(id, startX, startY, minX, maxX, minY, maxY)); + this(new NPCLocationDefinition(id, startX, startY, minX, maxX, minY, maxY)); } public boolean isScripted() { @@ -233,7 +233,7 @@ public class Npc extends Mob { this.scripted = scripted; } - public Npc(NPCLoc loc) { + public Npc(NPCLocationDefinition loc) { for (int i : Constants.GameServer.UNDEAD_NPCS) { if (loc.getId() == i) { this.undead = true; @@ -384,7 +384,7 @@ public class Npc extends Mob { return 0; } - public NPCDef getDef() { + public NPCDefinition getDef() { return EntityHandler.getNpcDef(getID()); } @@ -396,7 +396,7 @@ public class Npc extends Mob { return curHits; } - public NPCLoc getLoc() { + public NPCLocationDefinition getLoc() { return loc; } @@ -433,10 +433,10 @@ public class Npc extends Mob { Player owner = mob instanceof Player ? (Player) mob : null; - ItemDropDef[] drops = def.getDrops(); + ItemDropDefinition[] drops = def.getDrops(); int total = 0; - for (ItemDropDef drop : drops) { + for (ItemDropDefinition drop : drops) { total += drop.getWeight(); } // @@ -445,7 +445,7 @@ public class Npc extends Mob { if (!this.getDef().name.equalsIgnoreCase("ghost")) { - for (ItemDropDef drop : drops) { + for (ItemDropDefinition drop : drops) { if (drop == null) { continue; } diff --git a/GameServer/src/org/moparscape/msc/gs/model/Player.java b/GameServer/src/org/moparscape/msc/gs/model/Player.java index 05afd98..785e642 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/Player.java +++ b/GameServer/src/org/moparscape/msc/gs/model/Player.java @@ -25,9 +25,9 @@ import org.moparscape.msc.gs.event.DelayedEvent; import org.moparscape.msc.gs.event.MiniEvent; import org.moparscape.msc.gs.event.RangeEvent; import org.moparscape.msc.gs.event.ShortEvent; -import org.moparscape.msc.gs.external.AgilityCourseDef; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.PrayerDef; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.skill.AgilityCourseDefinition; +import org.moparscape.msc.gs.model.definition.skill.PrayerDefinition; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.client.WieldHandler; import org.moparscape.msc.gs.quest.Quest; @@ -52,7 +52,7 @@ public final class Player extends Mob { /** * The current agility course the player's doing */ - private AgilityCourseDef agilityCourseDef = null; + private AgilityCourseDefinition agilityCourseDef = null; /** * The Players appearance */ @@ -623,7 +623,7 @@ public final class Player extends Mob { public void addPrayerDrain(int prayerID) { drainRate = 0; - PrayerDef prayer = EntityHandler.getPrayerDef(prayerID); + PrayerDefinition prayer = EntityHandler.getPrayerDef(prayerID); for (int x = 0; x <= 13; x++) { prayer = EntityHandler.getPrayerDef(x); if (super.isPrayerActivated(x)) { @@ -876,7 +876,7 @@ public final class Player extends Mob { /** * @return this player's current agility course */ - public AgilityCourseDef getAgilityCourseDef() { + public AgilityCourseDefinition getAgilityCourseDef() { return agilityCourseDef; } @@ -2370,7 +2370,7 @@ public final class Player extends Mob { /** * Sets this player's current agility course */ - public void setAgilityCourseDef(AgilityCourseDef def) { + public void setAgilityCourseDef(AgilityCourseDefinition def) { agilityCourseDef = def; } diff --git a/GameServer/src/org/moparscape/msc/gs/model/Script.java b/GameServer/src/org/moparscape/msc/gs/model/Script.java index 5f91ff6..64374bd 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/Script.java +++ b/GameServer/src/org/moparscape/msc/gs/model/Script.java @@ -5,7 +5,7 @@ import java.io.IOException; import java.util.ConcurrentModificationException; import org.moparscape.msc.gs.core.GameEngine; -import org.moparscape.msc.gs.external.EntityHandler; +import org.moparscape.msc.gs.model.definition.EntityHandler; import org.moparscape.msc.gs.util.Logger; import bsh.EvalError; diff --git a/GameServer/src/org/moparscape/msc/gs/model/World.java b/GameServer/src/org/moparscape/msc/gs/model/World.java index 2085986..1fc07e2 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/World.java +++ b/GameServer/src/org/moparscape/msc/gs/model/World.java @@ -15,15 +15,15 @@ import org.moparscape.msc.gs.core.ClientUpdater; import org.moparscape.msc.gs.core.DelayedEventHandler; import org.moparscape.msc.gs.event.DelayedEvent; import org.moparscape.msc.gs.event.SingleEvent; -import org.moparscape.msc.gs.external.GameObjectLoc; -import org.moparscape.msc.gs.external.NPCLoc; import org.moparscape.msc.gs.io.WorldLoader; +import org.moparscape.msc.gs.model.definition.entity.GameObjectLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCLocationDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.model.landscape.MutableTileValue; import org.moparscape.msc.gs.model.landscape.TileValue; import org.moparscape.msc.gs.model.snapshot.Snapshot; import org.moparscape.msc.gs.npchandler.NpcHandler; -import org.moparscape.msc.gs.npchandler.NpcHandlerDef; +import org.moparscape.msc.gs.npchandler.NpcHandlerDefinition; import org.moparscape.msc.gs.quest.QuestManager; import org.moparscape.msc.gs.states.CombatState; import org.moparscape.msc.gs.util.EntityList; @@ -241,7 +241,7 @@ public final class World { /** * Adds a DelayedEvent that will spawn a GameObject */ - public void delayedSpawnObject(final GameObjectLoc loc, + public void delayedSpawnObject(final GameObjectLocationDefinition loc, final int respawnTime) { delayedEventHandler.add(new SingleEvent(null, respawnTime) { @@ -446,8 +446,8 @@ public final class World { */ private void loadNpcHandlers() throws Exception { - NpcHandlerDef[] handlerDefs = Instance.getDataStore().loadNpcHandlers(); - for (NpcHandlerDef handlerDef : handlerDefs) { + NpcHandlerDefinition[] handlerDefs = Instance.getDataStore().loadNpcHandlers(); + for (NpcHandlerDefinition handlerDef : handlerDefs) { try { String className = handlerDef.getClassName(); Class c = Class.forName(className); @@ -532,7 +532,7 @@ public final class World { * Registers an npc with the world */ public void registerNpc(Npc n) { - NPCLoc npc = n.getLoc(); + NPCLocationDefinition npc = n.getLoc(); if (npc.startX < npc.minX || npc.startX > npc.maxX || npc.startY < npc.minY || npc.startY > npc.maxY || (getTileValue(npc.startX, npc.startY).mapValue & 64) != 0) { diff --git a/GameServer/src/org/moparscape/msc/gs/external/EntityDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/EntityDefinition.java similarity index 83% rename from GameServer/src/org/moparscape/msc/gs/external/EntityDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/EntityDefinition.java index 8f3169d..e902264 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/EntityDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/EntityDefinition.java @@ -1,10 +1,10 @@ -package org.moparscape.msc.gs.external; +package org.moparscape.msc.gs.model.definition; /** * The abstract class EntityDef implements methods for return values which are * shared between entities. */ -public abstract class EntityDef { +public abstract class EntityDefinition { /** * The description of the entity diff --git a/GameServer/src/org/moparscape/msc/gs/external/EntityHandler.java b/GameServer/src/org/moparscape/msc/gs/model/definition/EntityHandler.java similarity index 58% rename from GameServer/src/org/moparscape/msc/gs/external/EntityHandler.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/EntityHandler.java index 230acf7..bdc1522 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/EntityHandler.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/EntityHandler.java @@ -1,4 +1,4 @@ -package org.moparscape.msc.gs.external; +package org.moparscape.msc.gs.model.definition; import java.util.List; import java.util.Map; @@ -7,6 +7,33 @@ import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.TelePoint; +import org.moparscape.msc.gs.model.definition.entity.GameObjectDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCDefinition; +import org.moparscape.msc.gs.model.definition.extra.CerterDefinition; +import org.moparscape.msc.gs.model.definition.extra.DoorDefinition; +import org.moparscape.msc.gs.model.definition.extra.TileDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityCourseDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityDefinition; +import org.moparscape.msc.gs.model.definition.skill.FiremakingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemArrowHeadDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemBowStringDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCookingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCraftingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemDartTipDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemGemDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbSecondDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemLogCutDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmeltingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmithingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemUnIdentHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemWieldableDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectFishingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectMiningDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectWoodcuttingDefinition; +import org.moparscape.msc.gs.model.definition.skill.PrayerDefinition; +import org.moparscape.msc.gs.model.definition.skill.SpellDefinition; import org.moparscape.msc.gs.persistence.DataStore; /** @@ -14,41 +41,41 @@ import org.moparscape.msc.gs.persistence.DataStore; * methods for relaying these entities to the user. */ public class EntityHandler { - private static Map agilityCourses; - private static Map agilityObjects; - private static Map arrowHeads; - private static Map bowString; - private static Map certers; - private static Map dartTips; + private static Map agilityCourses; + private static Map agilityObjects; + private static Map arrowHeads; + private static Map bowString; + private static Map certers; + private static Map dartTips; - private static DoorDef[] doors; - private static Map firemaking; - private static GameObjectDef[] gameObjects; - private static Map gems; - private static ItemHerbSecond[] herbSeconds; + private static DoorDefinition[] doors; + private static Map firemaking; + private static GameObjectDefinition[] gameObjects; + private static Map gems; + private static ItemHerbSecondDefinition[] herbSeconds; private static Map itemAffectedTypes; - private static Map itemCooking; - private static ItemCraftingDef[] itemCrafting; + private static Map itemCooking; + private static ItemCraftingDefinition[] itemCrafting; private static Map itemEdibleHeals; - private static Map itemHerb; - private static ItemDef[] items; - private static Map itemSmelting; - private static ItemSmithingDef[] itemSmithing; - private static Map itemUnIdentHerb; - private static Map itemWieldable; + private static Map itemHerb; + private static ItemDefinition[] items; + private static Map itemSmelting; + private static ItemSmithingDefinition[] itemSmithing; + private static Map itemUnIdentHerb; + private static Map itemWieldable; private static List[] keyChestLoots; - private static Map logCut; + private static Map logCut; - private static NPCDef[] npcs; - private static Map objectFishing; + private static NPCDefinition[] npcs; + private static Map objectFishing; - private static Map objectMining; + private static Map objectMining; private static Map objectTelePoints; - private static Map objectWoodcutting; - private static PrayerDef[] prayers; + private static Map objectWoodcutting; + private static PrayerDefinition[] prayers; private static Map spellAggressiveLvl; - private static SpellDef[] spells; - private static TileDef[] tiles; + private static SpellDefinition[] spells; + private static TileDefinition[] tiles; static { DataStore dataStore = Instance.getDataStore(); @@ -56,7 +83,7 @@ public class EntityHandler { doors = dataStore.loadDoorDefs(); gameObjects = dataStore.loadGameObjectDefs(); npcs = dataStore.loadNPCDefs(); - for (NPCDef n : npcs) { + for (NPCDefinition n : npcs) { if (n.isAttackable()) { n.respawnTime -= (n.respawnTime / 3); } @@ -102,7 +129,7 @@ public class EntityHandler { * the agility courses's start ID * @return the AgilityCourseDef with the given start ID */ - public static AgilityCourseDef getAgilityCourseDef(int id) { + public static AgilityCourseDefinition getAgilityCourseDef(int id) { return agilityCourses.get(id); } @@ -111,7 +138,7 @@ public class EntityHandler { * the agility object's ID * @return the AgilityDef with the given object ID */ - public static AgilityDef getAgilityDef(int id) { + public static AgilityDefinition getAgilityDef(int id) { return agilityObjects.get(id); } @@ -120,14 +147,14 @@ public class EntityHandler { * the npcs ID * @return the CerterDef for the given npc */ - public static CerterDef getCerterDef(int id) { + public static CerterDefinition getCerterDef(int id) { return certers.get(id); } /** * @return the ItemCraftingDef for the requested item */ - public static ItemCraftingDef getCraftingDef(int id) { + public static ItemCraftingDefinition getCraftingDef(int id) { if (id < 0 || id >= itemCrafting.length) { return null; } @@ -139,7 +166,7 @@ public class EntityHandler { * the entities ID * @return the DoorDef with the given ID */ - public static DoorDef getDoorDef(int id) { + public static DoorDefinition getDoorDef(int id) { if (id < 0 || id >= doors.length) { return null; } @@ -149,7 +176,7 @@ public class EntityHandler { /** * @return the FiremakingDef for the given log */ - public static FiremakingDef getFiremakingDef(int id) { + public static FiremakingDefinition getFiremakingDef(int id) { return firemaking.get(id); } @@ -158,7 +185,7 @@ public class EntityHandler { * the entities ID * @return the GameObjectDef with the given ID */ - public static GameObjectDef getGameObjectDef(int id) { + public static GameObjectDefinition getGameObjectDef(int id) { if (id < 0 || id >= gameObjects.length) { return null; } @@ -177,14 +204,14 @@ public class EntityHandler { /** * @return the ItemArrowHeadDef for the given arrow */ - public static ItemArrowHeadDef getItemArrowHeadDef(int id) { + public static ItemArrowHeadDefinition getItemArrowHeadDef(int id) { return arrowHeads.get(id); } /** * @return the ItemBowStringDef for the given bow */ - public static ItemBowStringDef getItemBowStringDef(int id) { + public static ItemBowStringDefinition getItemBowStringDef(int id) { return bowString.get(id); } @@ -193,14 +220,14 @@ public class EntityHandler { * the entities ID * @return the ItemCookingDef with the given ID */ - public static ItemCookingDef getItemCookingDef(int id) { + public static ItemCookingDefinition getItemCookingDef(int id) { return itemCooking.get(id); } /** * @return the ItemDartTipDef for the given tip */ - public static ItemDartTipDef getItemDartTipDef(int id) { + public static ItemDartTipDefinition getItemDartTipDef(int id) { return dartTips.get(id); } @@ -209,7 +236,7 @@ public class EntityHandler { * the entities ID * @return the ItemDef with the given ID */ - public static ItemDef getItemDef(int id) { + public static ItemDefinition getItemDef(int id) { if (id < 0 || id >= items.length) { return null; } @@ -232,7 +259,7 @@ public class EntityHandler { /** * @return the ItemGemDef for the given gem */ - public static ItemGemDef getItemGemDef(int id) { + public static ItemGemDefinition getItemGemDef(int id) { return gems.get(id); } @@ -241,16 +268,16 @@ public class EntityHandler { * the entities ID * @return the ItemHerbDef with the given ID */ - public static ItemHerbDef getItemHerbDef(int id) { + public static ItemHerbDefinition getItemHerbDef(int id) { return itemHerb.get(id); } /** * @return the ItemHerbSecond for the given second ingredient */ - public static ItemHerbSecond getItemHerbSecond(int secondID, + public static ItemHerbSecondDefinition getItemHerbSecond(int secondID, int unfinishedID) { - for (ItemHerbSecond def : herbSeconds) { + for (ItemHerbSecondDefinition def : herbSeconds) { if (def.getSecondID() == secondID && def.getUnfinishedID() == unfinishedID) { return def; @@ -262,7 +289,7 @@ public class EntityHandler { /** * @return the ItemLogCutDef for the given log */ - public static ItemLogCutDef getItemLogCutDef(int id) { + public static ItemLogCutDefinition getItemLogCutDef(int id) { return logCut.get(id); } @@ -271,7 +298,7 @@ public class EntityHandler { * the entities ID * @return the ItemSmeltingDef with the given ID */ - public static ItemSmeltingDef getItemSmeltingDef(int id) { + public static ItemSmeltingDefinition getItemSmeltingDef(int id) { return itemSmelting.get(id); } @@ -280,7 +307,7 @@ public class EntityHandler { * the entities ID * @return the ItemUnIdentHerbDef with the given ID */ - public static ItemUnIdentHerbDef getItemUnIdentHerbDef(int id) { + public static ItemUnIdentHerbDefinition getItemUnIdentHerbDef(int id) { return itemUnIdentHerb.get(id); } @@ -289,7 +316,7 @@ public class EntityHandler { * the entities ID * @return the ItemWieldableDef with the given ID */ - public static ItemWieldableDef getItemWieldableDef(int id) { + public static ItemWieldableDefinition getItemWieldableDef(int id) { return itemWieldable.get(id); } @@ -302,7 +329,7 @@ public class EntityHandler { * the entities ID * @return the NPCDef with the given ID */ - public static NPCDef getNpcDef(int id) { + public static NPCDefinition getNpcDef(int id) { if (id < 0 || id >= npcs.length) { return null; } @@ -314,8 +341,8 @@ public class EntityHandler { * the entities ID * @return the ObjectFishingDef with the given ID */ - public static ObjectFishingDef getObjectFishingDef(int id, int click) { - ObjectFishingDef[] defs = objectFishing.get(id); + public static ObjectFishingDefinition getObjectFishingDef(int id, int click) { + ObjectFishingDefinition[] defs = objectFishing.get(id); if (defs == null) { return null; } @@ -327,7 +354,7 @@ public class EntityHandler { * the entities ID * @return the ObjectMiningDef with the given ID */ - public static ObjectMiningDef getObjectMiningDef(int id) { + public static ObjectMiningDefinition getObjectMiningDef(int id) { return objectMining.get(id); } @@ -352,7 +379,7 @@ public class EntityHandler { * the entities ID * @return the ObjectWoodcuttingDef with the given ID */ - public static ObjectWoodcuttingDef getObjectWoodcuttingDef(int id) { + public static ObjectWoodcuttingDefinition getObjectWoodcuttingDef(int id) { return objectWoodcutting.get(id); } @@ -361,7 +388,7 @@ public class EntityHandler { * the entities ID * @return the PrayerDef with the given ID */ - public static PrayerDef getPrayerDef(int id) { + public static PrayerDefinition getPrayerDef(int id) { if (id < 0 || id >= prayers.length) { return null; } @@ -371,7 +398,7 @@ public class EntityHandler { /** * @return the ItemSmithingDef for the requested item */ - public static ItemSmithingDef getSmithingDef(int id) { + public static ItemSmithingDefinition getSmithingDef(int id) { if (id < 0 || id >= itemSmithing.length) { return null; } @@ -381,8 +408,8 @@ public class EntityHandler { /** * @return the ItemSmithingDef for the requested item */ - public static ItemSmithingDef getSmithingDefbyID(int itemID) { - for (ItemSmithingDef i : itemSmithing) { + public static ItemSmithingDefinition getSmithingDefbyID(int itemID) { + for (ItemSmithingDefinition i : itemSmithing) { if (i.itemID == itemID) return i; } @@ -407,7 +434,7 @@ public class EntityHandler { * the entities ID * @return the SpellDef with the given ID */ - public static SpellDef getSpellDef(int id) { + public static SpellDefinition getSpellDef(int id) { if (id < 0 || id >= spells.length) { return null; } @@ -419,7 +446,7 @@ public class EntityHandler { * the entities ID * @return the TileDef with the given ID */ - public static TileDef getTileDef(int id) { + public static TileDefinition getTileDef(int id) { if (id < 0 || id >= tiles.length) { return null; } diff --git a/GameServer/src/org/moparscape/msc/gs/external/GameObjectDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/GameObjectDefinition.java similarity index 84% rename from GameServer/src/org/moparscape/msc/gs/external/GameObjectDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/entity/GameObjectDefinition.java index e5d35e6..dc17268 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/GameObjectDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/GameObjectDefinition.java @@ -1,9 +1,11 @@ -package org.moparscape.msc.gs.external; +package org.moparscape.msc.gs.model.definition.entity; + +import org.moparscape.msc.gs.model.definition.EntityDefinition; /** * The definition wrapper for game objects */ -public class GameObjectDef extends EntityDef { +public class GameObjectDefinition extends EntityDefinition { /** * The first command of the object diff --git a/GameServer/src/org/moparscape/msc/gs/external/GameObjectLoc.java b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/GameObjectLocationDefinition.java similarity index 75% rename from GameServer/src/org/moparscape/msc/gs/external/GameObjectLoc.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/entity/GameObjectLocationDefinition.java index 21264bf..8c6fffa 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/GameObjectLoc.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/GameObjectLocationDefinition.java @@ -1,52 +1,52 @@ -package org.moparscape.msc.gs.external; - -public class GameObjectLoc { - /** - * The direction it faces - */ - public int direction; - /** - * The id of the gameObject - */ - public int id; - /** - * Type of object - 0: Object, 1: WallObject - */ - public int type; - /** - * The objects x coord - */ - public int x; - /** - * The objects y coord - */ - public int y; - - public GameObjectLoc(int id, int x, int y, int direction, int type) { - this.id = id; - this.x = x; - this.y = y; - this.direction = direction; - this.type = type; - } - - public int getDirection() { - return direction; - } - - public int getId() { - return id; - } - - public int getType() { - return type; - } - - public int getX() { - return x; - } - - public int getY() { - return y; - } -} +package org.moparscape.msc.gs.model.definition.entity; + +public class GameObjectLocationDefinition { + /** + * The direction it faces + */ + public int direction; + /** + * The id of the gameObject + */ + public int id; + /** + * Type of object - 0: Object, 1: WallObject + */ + public int type; + /** + * The objects x coord + */ + public int x; + /** + * The objects y coord + */ + public int y; + + public GameObjectLocationDefinition(int id, int x, int y, int direction, int type) { + this.id = id; + this.x = x; + this.y = y; + this.direction = direction; + this.type = type; + } + + public int getDirection() { + return direction; + } + + public int getId() { + return id; + } + + public int getType() { + return type; + } + + public int getX() { + return x; + } + + public int getY() { + return y; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemDefinition.java similarity index 85% rename from GameServer/src/org/moparscape/msc/gs/external/ItemDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemDefinition.java index 4210278..9424b3a 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemDefinition.java @@ -1,9 +1,11 @@ -package org.moparscape.msc.gs.external; +package org.moparscape.msc.gs.model.definition.entity; + +import org.moparscape.msc.gs.model.definition.EntityDefinition; /** * The definition wrapper for items */ -public class ItemDef extends EntityDef { +public class ItemDefinition extends EntityDefinition { /** * The base price of the object */ diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemDropDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemDropDefinition.java similarity index 63% rename from GameServer/src/org/moparscape/msc/gs/external/ItemDropDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemDropDefinition.java index 0b15b53..ba6ebb9 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemDropDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemDropDefinition.java @@ -1,25 +1,25 @@ -package org.moparscape.msc.gs.external; - -public class ItemDropDef { - public int amount; - public int id; - public int weight; - - public ItemDropDef(int id, int amount, int weight) { - this.id = id; - this.amount = amount; - this.weight = weight; - } - - public int getAmount() { - return amount; - } - - public int getID() { - return id; - } - - public int getWeight() { - return weight; - } +package org.moparscape.msc.gs.model.definition.entity; + +public class ItemDropDefinition { + public int amount; + public int id; + public int weight; + + public ItemDropDefinition(int id, int amount, int weight) { + this.id = id; + this.amount = amount; + this.weight = weight; + } + + public int getAmount() { + return amount; + } + + public int getID() { + return id; + } + + public int getWeight() { + return weight; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemLoc.java b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemLocationDefinition.java similarity index 82% rename from GameServer/src/org/moparscape/msc/gs/external/ItemLoc.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemLocationDefinition.java index 525d12e..cdefc3b 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemLoc.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/ItemLocationDefinition.java @@ -1,44 +1,44 @@ -package org.moparscape.msc.gs.external; - -public class ItemLoc { - /** - * Amount of item (stackables) - */ - public int amount; - /** - * The id of the gameObject - */ - public int id; - /** - * How long the item takes to spawn - */ - public int respawnTime; - /** - * The objects x coord - */ - public int x; - /** - * The objects y coord - */ - public int y; - - public int getAmount() { - return amount; - } - - public int getId() { - return id; - } - - public int getRespawnTime() { - return respawnTime; - } - - public int getX() { - return x; - } - - public int getY() { - return y; - } -} +package org.moparscape.msc.gs.model.definition.entity; + +public class ItemLocationDefinition { + /** + * Amount of item (stackables) + */ + public int amount; + /** + * The id of the gameObject + */ + public int id; + /** + * How long the item takes to spawn + */ + public int respawnTime; + /** + * The objects x coord + */ + public int x; + /** + * The objects y coord + */ + public int y; + + public int getAmount() { + return amount; + } + + public int getId() { + return id; + } + + public int getRespawnTime() { + return respawnTime; + } + + public int getX() { + return x; + } + + public int getY() { + return y; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/NPCDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/NPCDefinition.java similarity index 89% rename from GameServer/src/org/moparscape/msc/gs/external/NPCDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/entity/NPCDefinition.java index 9695e85..271bd33 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/NPCDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/NPCDefinition.java @@ -1,9 +1,11 @@ -package org.moparscape.msc.gs.external; +package org.moparscape.msc.gs.model.definition.entity; + +import org.moparscape.msc.gs.model.definition.EntityDefinition; /** * The definition wrapper for npcs */ -public class NPCDef extends EntityDef { +public class NPCDefinition extends EntityDefinition { /** * Whether the npc is aggressive */ @@ -35,7 +37,7 @@ public class NPCDef extends EntityDef { /** * Possible drops */ - public ItemDropDef[] drops; + public ItemDropDefinition[] drops; /** * Colour of our hair */ @@ -101,7 +103,7 @@ public class NPCDef extends EntityDef { return defense; } - public ItemDropDef[] getDrops() { + public ItemDropDefinition[] getDrops() { return drops; } diff --git a/GameServer/src/org/moparscape/msc/gs/external/NPCLoc.java b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/NPCLocationDefinition.java similarity index 79% rename from GameServer/src/org/moparscape/msc/gs/external/NPCLoc.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/entity/NPCLocationDefinition.java index 4fa0adc..a1a5bd7 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/NPCLoc.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/entity/NPCLocationDefinition.java @@ -1,71 +1,71 @@ -package org.moparscape.msc.gs.external; - -public class NPCLoc { - /** - * The id of the Npc - */ - public int id; - /** - * The Npcs max x coord - */ - public int maxX; - /** - * The Npcs max y coord - */ - public int maxY; - /** - * The Npcs min x coord - */ - public int minX; - /** - * The Npcs min y coord - */ - public int minY; - /** - * The Npcs x coord - */ - public int startX; - /** - * The Npcs y coord - */ - public int startY; - - public NPCLoc(int id, int startX, int startY, int minX, int maxX, int minY, - int maxY) { - this.id = id; - this.startX = startX; - this.startY = startY; - this.minX = minX; - this.maxX = maxX; - this.minY = minY; - this.maxY = maxY; - } - - public int getId() { - return id; - } - - public int maxX() { - return maxX; - } - - public int maxY() { - return maxY; - } - - public int minX() { - return minX; - } - - public int minY() { - return minY; - } - - public int startX() { - return startX; - } - - public int startY() { - return startY; - } -} +package org.moparscape.msc.gs.model.definition.entity; + +public class NPCLocationDefinition { + /** + * The id of the Npc + */ + public int id; + /** + * The Npcs max x coord + */ + public int maxX; + /** + * The Npcs max y coord + */ + public int maxY; + /** + * The Npcs min x coord + */ + public int minX; + /** + * The Npcs min y coord + */ + public int minY; + /** + * The Npcs x coord + */ + public int startX; + /** + * The Npcs y coord + */ + public int startY; + + public NPCLocationDefinition(int id, int startX, int startY, int minX, int maxX, int minY, + int maxY) { + this.id = id; + this.startX = startX; + this.startY = startY; + this.minX = minX; + this.maxX = maxX; + this.minY = minY; + this.maxY = maxY; + } + + public int getId() { + return id; + } + + public int maxX() { + return maxX; + } + + public int maxY() { + return maxY; + } + + public int minX() { + return minX; + } + + public int minY() { + return minY; + } + + public int startX() { + return startX; + } + + public int startY() { + return startY; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/CertDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/extra/CertDefinition.java similarity index 79% rename from GameServer/src/org/moparscape/msc/gs/external/CertDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/extra/CertDefinition.java index 912c305..e98a39a 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/CertDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/extra/CertDefinition.java @@ -1,28 +1,28 @@ -package org.moparscape.msc.gs.external; - -public class CertDef { - /** - * The ID of the certificate - */ - public int certID; - /** - * The ID of the assosiated item - */ - public int itemID; - /** - * The name of the item this cert is for - */ - public String name; - - public int getCertID() { - return certID; - } - - public int getItemID() { - return itemID; - } - - public String getName() { - return name; - } +package org.moparscape.msc.gs.model.definition.extra; + +public class CertDefinition { + /** + * The ID of the certificate + */ + public int certID; + /** + * The ID of the assosiated item + */ + public int itemID; + /** + * The name of the item this cert is for + */ + public String name; + + public int getCertID() { + return certID; + } + + public int getItemID() { + return itemID; + } + + public String getName() { + return name; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/CerterDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/extra/CerterDefinition.java similarity index 82% rename from GameServer/src/org/moparscape/msc/gs/external/CerterDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/extra/CerterDefinition.java index a9cc4ec..a935cd0 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/CerterDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/extra/CerterDefinition.java @@ -1,38 +1,38 @@ -package org.moparscape.msc.gs.external; - -public class CerterDef { - /** - * Certs this stall can deal with - */ - private CertDef[] certs; - /** - * Type of stall - */ - private String type; - - public int getCertID(int index) { - if (index < 0 || index >= certs.length) { - return -1; - } - return certs[index].getCertID(); - } - - public String[] getCertNames() { - String[] names = new String[certs.length]; - for (int i = 0; i < certs.length; i++) { - names[i] = certs[i].getName(); - } - return names; - } - - public int getItemID(int index) { - if (index < 0 || index >= certs.length) { - return -1; - } - return certs[index].getItemID(); - } - - public String getType() { - return type; - } +package org.moparscape.msc.gs.model.definition.extra; + +public class CerterDefinition { + /** + * Certs this stall can deal with + */ + private CertDefinition[] certs; + /** + * Type of stall + */ + private String type; + + public int getCertID(int index) { + if (index < 0 || index >= certs.length) { + return -1; + } + return certs[index].getCertID(); + } + + public String[] getCertNames() { + String[] names = new String[certs.length]; + for (int i = 0; i < certs.length; i++) { + names[i] = certs[i].getName(); + } + return names; + } + + public int getItemID(int index) { + if (index < 0 || index >= certs.length) { + return -1; + } + return certs[index].getItemID(); + } + + public String getType() { + return type; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/DoorDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/extra/DoorDefinition.java similarity index 81% rename from GameServer/src/org/moparscape/msc/gs/external/DoorDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/extra/DoorDefinition.java index 2f54b63..b1b4d2a 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/DoorDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/extra/DoorDefinition.java @@ -1,9 +1,11 @@ -package org.moparscape.msc.gs.external; +package org.moparscape.msc.gs.model.definition.extra; + +import org.moparscape.msc.gs.model.definition.EntityDefinition; /** * The definition wrapper for doors */ -public class DoorDef extends EntityDef { +public class DoorDefinition extends EntityDefinition { /** * The first command of the door diff --git a/GameServer/src/org/moparscape/msc/gs/external/TileDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/extra/TileDefinition.java similarity index 72% rename from GameServer/src/org/moparscape/msc/gs/external/TileDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/extra/TileDefinition.java index 2b60a03..561191a 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/TileDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/extra/TileDefinition.java @@ -1,19 +1,19 @@ -package org.moparscape.msc.gs.external; - -public class TileDef { - public int colour; - public int objectType; - public int unknown; - - public int getColour() { - return colour; - } - - public int getObjectType() { - return objectType; - } - - public int getUnknown() { - return unknown; - } +package org.moparscape.msc.gs.model.definition.extra; + +public class TileDefinition { + public int colour; + public int objectType; + public int unknown; + + public int getColour() { + return colour; + } + + public int getObjectType() { + return objectType; + } + + public int getUnknown() { + return unknown; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/AgilityCourseDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/AgilityCourseDefinition.java similarity index 86% rename from GameServer/src/org/moparscape/msc/gs/external/AgilityCourseDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/AgilityCourseDefinition.java index 53de9d9..27660ef 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/AgilityCourseDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/AgilityCourseDefinition.java @@ -1,84 +1,84 @@ -package org.moparscape.msc.gs.external; - -/** - * Defines an agility course - */ -public class AgilityCourseDef { - /** - * Ending object ID - */ - public int endID; - /** - * Ending object x - */ - public int endX; - /** - * Ending object y - */ - public int endY; - /** - * The exp reward for completing this course - */ - public int exp; - /** - * This course's name - */ - public String name; - /** - * Starting object x - */ - public int startX; - /** - * Starting object y - */ - public int startY; - - /** - * @return the end ID - */ - public int getEndID() { - return endID; - } - - /** - * @return the end x - */ - public int getEndX() { - return endX; - } - - /** - * @return the end y - */ - public int getEndY() { - return endY; - } - - /** - * @return the exp reward - */ - public int getExp() { - return exp; - } - - /** - * @return this course's name - */ - public String getName() { - return name; - } - - /** - * @return the starting object x - */ - public int getStartX() { - return startX; - } - - /** - * @return the starting object y - */ - public int getStartY() { - return startY; - } +package org.moparscape.msc.gs.model.definition.skill; + +/** + * Defines an agility course + */ +public class AgilityCourseDefinition { + /** + * Ending object ID + */ + public int endID; + /** + * Ending object x + */ + public int endX; + /** + * Ending object y + */ + public int endY; + /** + * The exp reward for completing this course + */ + public int exp; + /** + * This course's name + */ + public String name; + /** + * Starting object x + */ + public int startX; + /** + * Starting object y + */ + public int startY; + + /** + * @return the end ID + */ + public int getEndID() { + return endID; + } + + /** + * @return the end x + */ + public int getEndX() { + return endX; + } + + /** + * @return the end y + */ + public int getEndY() { + return endY; + } + + /** + * @return the exp reward + */ + public int getExp() { + return exp; + } + + /** + * @return this course's name + */ + public String getName() { + return name; + } + + /** + * @return the starting object x + */ + public int getStartX() { + return startX; + } + + /** + * @return the starting object y + */ + public int getStartY() { + return startY; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/AgilityDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/AgilityDefinition.java similarity index 89% rename from GameServer/src/org/moparscape/msc/gs/external/AgilityDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/AgilityDefinition.java index fdb1b89..fa6149b 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/AgilityDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/AgilityDefinition.java @@ -1,128 +1,128 @@ -package org.moparscape.msc.gs.external; - -/** - * Defines an agility course object - */ -public class AgilityDef { - /** - * Can you fail this obstacle? - */ - public boolean canFail; - /** - * The xp you get for doing this obstacle safely - */ - public int exp; - /** - * The fail x coord - */ - public int failX; - /** - * The fail y coord - */ - public int failY; - /** - * What message does this object spew to the client? - */ - public String message; - /** - * What order this object is in the obstacle course - */ - public int order; - /** - * Required level - */ - public int reqLevel; - /** - * Tele x coord - */ - public int toX; - /** - * Tele y coord - */ - public int toY; - /** - * The x coord - */ - public int x; - /** - * The y coord - */ - public int y; - - /** - * @return if you can fail this def - */ - public boolean canFail() { - return canFail; - } - - /** - * @return the xp you get for doing this agility object - */ - public int getExp() { - return exp; - } - - /** - * @return the fail x coord we go to if we fail - */ - public int getFailX() { - return failX; - } - - /** - * @return the fail y coord we go to if we fail - */ - public int getFailY() { - return failY; - } - - /** - * @return the object's message - */ - public String getMessage() { - return message; - } - - /** - * @return the order of this agility object - */ - public int getOrder() { - return order; - } - - /** - * @return this def's required level - */ - public int getReqLevel() { - return reqLevel; - } - - /** - * @return this def's tele x - */ - public int getToX() { - return toX; - } - - /** - * @return this def's tele y - */ - public int getToY() { - return toY; - } - - /** - * @return this def's x coord - */ - public int getX() { - return x; - } - - /** - * @return this def's y coord - */ - public int getY() { - return y; - } +package org.moparscape.msc.gs.model.definition.skill; + +/** + * Defines an agility course object + */ +public class AgilityDefinition { + /** + * Can you fail this obstacle? + */ + public boolean canFail; + /** + * The xp you get for doing this obstacle safely + */ + public int exp; + /** + * The fail x coord + */ + public int failX; + /** + * The fail y coord + */ + public int failY; + /** + * What message does this object spew to the client? + */ + public String message; + /** + * What order this object is in the obstacle course + */ + public int order; + /** + * Required level + */ + public int reqLevel; + /** + * Tele x coord + */ + public int toX; + /** + * Tele y coord + */ + public int toY; + /** + * The x coord + */ + public int x; + /** + * The y coord + */ + public int y; + + /** + * @return if you can fail this def + */ + public boolean canFail() { + return canFail; + } + + /** + * @return the xp you get for doing this agility object + */ + public int getExp() { + return exp; + } + + /** + * @return the fail x coord we go to if we fail + */ + public int getFailX() { + return failX; + } + + /** + * @return the fail y coord we go to if we fail + */ + public int getFailY() { + return failY; + } + + /** + * @return the object's message + */ + public String getMessage() { + return message; + } + + /** + * @return the order of this agility object + */ + public int getOrder() { + return order; + } + + /** + * @return this def's required level + */ + public int getReqLevel() { + return reqLevel; + } + + /** + * @return this def's tele x + */ + public int getToX() { + return toX; + } + + /** + * @return this def's tele y + */ + public int getToY() { + return toY; + } + + /** + * @return this def's x coord + */ + public int getX() { + return x; + } + + /** + * @return this def's y coord + */ + public int getY() { + return y; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/FiremakingDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/FiremakingDefinition.java similarity index 79% rename from GameServer/src/org/moparscape/msc/gs/external/FiremakingDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/FiremakingDefinition.java index d92ef11..e2f3ec5 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/FiremakingDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/FiremakingDefinition.java @@ -1,28 +1,28 @@ -package org.moparscape.msc.gs.external; - -public class FiremakingDef { - /** - * The exp given by these logs - */ - public int exp; - /** - * How many ms the fire should last for - */ - public int length; - /** - * The firemaking level required to light these logs - */ - public int level; - - public int getExp() { - return exp; - } - - public int getLength() { - return length * 1000; - } - - public int getRequiredLevel() { - return level; - } +package org.moparscape.msc.gs.model.definition.skill; + +public class FiremakingDefinition { + /** + * The exp given by these logs + */ + public int exp; + /** + * How many ms the fire should last for + */ + public int length; + /** + * The firemaking level required to light these logs + */ + public int level; + + public int getExp() { + return exp; + } + + public int getLength() { + return length * 1000; + } + + public int getRequiredLevel() { + return level; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemArrowHeadDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemArrowHeadDefinition.java similarity index 80% rename from GameServer/src/org/moparscape/msc/gs/external/ItemArrowHeadDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemArrowHeadDefinition.java index a821175..629a65e 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemArrowHeadDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemArrowHeadDefinition.java @@ -1,32 +1,32 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemArrowHeadDef { - - /** - * The ID of the arrow created - */ - public int arrowID; - /** - * The exp given by attaching this arrow head - */ - public double exp; - /** - * The level required to attach this head to an arrow - */ - public int requiredLvl; - - public int getArrowID() { - return arrowID; - } - - public double getExp() { - return exp; - } - - public int getReqLevel() { - return requiredLvl; - } -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for items + */ +public class ItemArrowHeadDefinition { + + /** + * The ID of the arrow created + */ + public int arrowID; + /** + * The exp given by attaching this arrow head + */ + public double exp; + /** + * The level required to attach this head to an arrow + */ + public int requiredLvl; + + public int getArrowID() { + return arrowID; + } + + public double getExp() { + return exp; + } + + public int getReqLevel() { + return requiredLvl; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemBowStringDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemBowStringDefinition.java similarity index 79% rename from GameServer/src/org/moparscape/msc/gs/external/ItemBowStringDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemBowStringDefinition.java index 339b738..9a807e1 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemBowStringDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemBowStringDefinition.java @@ -1,32 +1,32 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemBowStringDef { - - /** - * The ID of the bow created - */ - public int bowID; - /** - * The exp given by attaching this bow string - */ - public int exp; - /** - * The level required to attach this bow string - */ - public int requiredLvl; - - public int getBowID() { - return bowID; - } - - public int getExp() { - return exp; - } - - public int getReqLevel() { - return requiredLvl; - } -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for items + */ +public class ItemBowStringDefinition { + + /** + * The ID of the bow created + */ + public int bowID; + /** + * The exp given by attaching this bow string + */ + public int exp; + /** + * The level required to attach this bow string + */ + public int requiredLvl; + + public int getBowID() { + return bowID; + } + + public int getExp() { + return exp; + } + + public int getReqLevel() { + return requiredLvl; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemCookingDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemCookingDefinition.java similarity index 82% rename from GameServer/src/org/moparscape/msc/gs/external/ItemCookingDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemCookingDefinition.java index b4c1773..1e4163a 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemCookingDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemCookingDefinition.java @@ -1,41 +1,41 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemCookingDef { - - /** - * The id of the burned version - */ - public int burnedId; - /** - * The id of the cooked version - */ - public int cookedId; - /** - * The exp cooking this item gives - */ - public int exp; - /** - * The level required to cook this - */ - public int requiredLvl; - - public int getBurnedId() { - return burnedId; - } - - public int getCookedId() { - return cookedId; - } - - public int getExp() { - return exp; - } - - public int getReqLevel() { - return requiredLvl; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for items + */ +public class ItemCookingDefinition { + + /** + * The id of the burned version + */ + public int burnedId; + /** + * The id of the cooked version + */ + public int cookedId; + /** + * The exp cooking this item gives + */ + public int exp; + /** + * The level required to cook this + */ + public int requiredLvl; + + public int getBurnedId() { + return burnedId; + } + + public int getCookedId() { + return cookedId; + } + + public int getExp() { + return exp; + } + + public int getReqLevel() { + return requiredLvl; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemCraftingDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemCraftingDefinition.java similarity index 77% rename from GameServer/src/org/moparscape/msc/gs/external/ItemCraftingDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemCraftingDefinition.java index 1f5d2b2..40f1bdd 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemCraftingDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemCraftingDefinition.java @@ -1,28 +1,28 @@ -package org.moparscape.msc.gs.external; - -public class ItemCraftingDef { - /** - * The exp given - */ - public int exp; - /** - * The ID of the item produced - */ - public int itemID; - /** - * The crafting level required to make this item - */ - public int requiredLvl; - - public int getExp() { - return exp; - } - - public int getItemID() { - return itemID; - } - - public int getReqLevel() { - return requiredLvl; - } +package org.moparscape.msc.gs.model.definition.skill; + +public class ItemCraftingDefinition { + /** + * The exp given + */ + public int exp; + /** + * The ID of the item produced + */ + public int itemID; + /** + * The crafting level required to make this item + */ + public int requiredLvl; + + public int getExp() { + return exp; + } + + public int getItemID() { + return itemID; + } + + public int getReqLevel() { + return requiredLvl; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemDartTipDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemDartTipDefinition.java similarity index 80% rename from GameServer/src/org/moparscape/msc/gs/external/ItemDartTipDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemDartTipDefinition.java index 8b3029a..1b81194 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemDartTipDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemDartTipDefinition.java @@ -1,32 +1,32 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemDartTipDef { - - /** - * The ID of the arrow created - */ - public int dartID; - /** - * The exp given by attaching this arrow head - */ - public double exp; - /** - * The level required to attach this head to an arrow - */ - public int requiredLvl; - - public int getDartID() { - return dartID; - } - - public double getExp() { - return exp; - } - - public int getReqLevel() { - return requiredLvl; - } -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for items + */ +public class ItemDartTipDefinition { + + /** + * The ID of the arrow created + */ + public int dartID; + /** + * The exp given by attaching this arrow head + */ + public double exp; + /** + * The level required to attach this head to an arrow + */ + public int requiredLvl; + + public int getDartID() { + return dartID; + } + + public double getExp() { + return exp; + } + + public int getReqLevel() { + return requiredLvl; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemGemDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemGemDefinition.java similarity index 80% rename from GameServer/src/org/moparscape/msc/gs/external/ItemGemDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemGemDefinition.java index 61bd468..19ea0ee 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemGemDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemGemDefinition.java @@ -1,32 +1,32 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemGemDef { - - /** - * The exp given by attaching this bow string - */ - public int exp; - /** - * The ID of the gem - */ - public int gemID; - /** - * The level required to attach this bow string - */ - public int requiredLvl; - - public int getExp() { - return exp; - } - - public int getGemID() { - return gemID; - } - - public int getReqLevel() { - return requiredLvl; - } -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for items + */ +public class ItemGemDefinition { + + /** + * The exp given by attaching this bow string + */ + public int exp; + /** + * The ID of the gem + */ + public int gemID; + /** + * The level required to attach this bow string + */ + public int requiredLvl; + + public int getExp() { + return exp; + } + + public int getGemID() { + return gemID; + } + + public int getReqLevel() { + return requiredLvl; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemHerbDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemHerbDefinition.java similarity index 79% rename from GameServer/src/org/moparscape/msc/gs/external/ItemHerbDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemHerbDefinition.java index b3273c8..f7701b2 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemHerbDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemHerbDefinition.java @@ -1,33 +1,33 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemHerbDef { - - /** - * The exp smelting this item gives - */ - public int exp; - /** - * The id of the related potion - */ - public int potionId; - /** - * The level required to make this - */ - public int requiredLvl; - - public int getExp() { - return exp; - } - - public int getPotionId() { - return potionId; - } - - public int getReqLevel() { - return requiredLvl; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for items + */ +public class ItemHerbDefinition { + + /** + * The exp smelting this item gives + */ + public int exp; + /** + * The id of the related potion + */ + public int potionId; + /** + * The level required to make this + */ + public int requiredLvl; + + public int getExp() { + return exp; + } + + public int getPotionId() { + return potionId; + } + + public int getReqLevel() { + return requiredLvl; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemHerbSecond.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemHerbSecondDefinition.java similarity index 84% rename from GameServer/src/org/moparscape/msc/gs/external/ItemHerbSecond.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemHerbSecondDefinition.java index cc218b9..e502c1c 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemHerbSecond.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemHerbSecondDefinition.java @@ -1,48 +1,48 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemHerbSecond { - - /** - * The exp given completing this potion - */ - public int exp; - /** - * The ID of the potion created - */ - public int potionID; - /** - * The level required to complete this potion - */ - public int requiredLvl; - /** - * The ID of the second ingredient - */ - public int secondID; - /** - * The ID of the unfinished potion required - */ - public int unfinishedID; - - public int getExp() { - return exp; - } - - public int getPotionID() { - return potionID; - } - - public int getReqLevel() { - return requiredLvl; - } - - public int getSecondID() { - return secondID; - } - - public int getUnfinishedID() { - return unfinishedID; - } -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for items + */ +public class ItemHerbSecondDefinition { + + /** + * The exp given completing this potion + */ + public int exp; + /** + * The ID of the potion created + */ + public int potionID; + /** + * The level required to complete this potion + */ + public int requiredLvl; + /** + * The ID of the second ingredient + */ + public int secondID; + /** + * The ID of the unfinished potion required + */ + public int unfinishedID; + + public int getExp() { + return exp; + } + + public int getPotionID() { + return potionID; + } + + public int getReqLevel() { + return requiredLvl; + } + + public int getSecondID() { + return secondID; + } + + public int getUnfinishedID() { + return unfinishedID; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemLogCutDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemLogCutDefinition.java similarity index 85% rename from GameServer/src/org/moparscape/msc/gs/external/ItemLogCutDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemLogCutDefinition.java index ef05669..adf83ec 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemLogCutDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemLogCutDefinition.java @@ -1,55 +1,55 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemLogCutDef { - - public int longbowExp; - public int longbowID; - public int longbowLvl; - - public int shaftAmount; - public int shaftLvl; - public int shortbowExp; - - public int shortbowID; - public int shortbowLvl; - - public int getLongbowExp() { - return longbowExp; - } - - public int getLongbowID() { - return longbowID; - } - - public int getLongbowLvl() { - return longbowLvl; - } - - public int getShaftAmount() { - return shaftAmount; - } - - public int getShaftExp() { - return shaftAmount; - } - - public int getShaftLvl() { - return shaftLvl; - } - - public int getShortbowExp() { - return shortbowExp; - } - - public int getShortbowID() { - return shortbowID; - } - - public int getShortbowLvl() { - return shortbowLvl; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for items + */ +public class ItemLogCutDefinition { + + public int longbowExp; + public int longbowID; + public int longbowLvl; + + public int shaftAmount; + public int shaftLvl; + public int shortbowExp; + + public int shortbowID; + public int shortbowLvl; + + public int getLongbowExp() { + return longbowExp; + } + + public int getLongbowID() { + return longbowID; + } + + public int getLongbowLvl() { + return longbowLvl; + } + + public int getShaftAmount() { + return shaftAmount; + } + + public int getShaftExp() { + return shaftAmount; + } + + public int getShaftLvl() { + return shaftLvl; + } + + public int getShortbowExp() { + return shortbowExp; + } + + public int getShortbowID() { + return shortbowID; + } + + public int getShortbowLvl() { + return shortbowLvl; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemSmeltingDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemSmeltingDefinition.java similarity index 72% rename from GameServer/src/org/moparscape/msc/gs/external/ItemSmeltingDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemSmeltingDefinition.java index bce63c9..918f7c8 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemSmeltingDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemSmeltingDefinition.java @@ -1,41 +1,42 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for items - */ -public class ItemSmeltingDef { - - /** - * The id of the related bar - */ - public int barId; - /** - * The exp smelting this item gives - */ - public int exp; - /** - * The ores required in addition to this one - */ - public ReqOreDef[] reqOres; - /** - * The level required to smelt this - */ - public int requiredLvl; - - public int getBarId() { - return barId; - } - - public int getExp() { - return exp; - } - - public int getReqLevel() { - return requiredLvl; - } - - public ReqOreDef[] getReqOres() { - return reqOres; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + + +/** + * The definition wrapper for items + */ +public class ItemSmeltingDefinition { + + /** + * The id of the related bar + */ + public int barId; + /** + * The exp smelting this item gives + */ + public int exp; + /** + * The ores required in addition to this one + */ + public ReqOreDefinition[] reqOres; + /** + * The level required to smelt this + */ + public int requiredLvl; + + public int getBarId() { + return barId; + } + + public int getExp() { + return exp; + } + + public int getReqLevel() { + return requiredLvl; + } + + public ReqOreDefinition[] getReqOres() { + return reqOres; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemSmithingDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemSmithingDefinition.java similarity index 81% rename from GameServer/src/org/moparscape/msc/gs/external/ItemSmithingDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemSmithingDefinition.java index bf17d00..4379233 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemSmithingDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemSmithingDefinition.java @@ -1,36 +1,36 @@ -package org.moparscape.msc.gs.external; - -public class ItemSmithingDef { - /** - * The amount of the item produced - */ - public int amount; - /** - * How many bars are required - */ - public int bars; - /** - * The ID of the item produced - */ - public int itemID; - /** - * The smithing level required to make this item - */ - public int level; - - public int getAmount() { - return amount; - } - - public int getItemID() { - return itemID; - } - - public int getRequiredBars() { - return bars; - } - - public int getRequiredLevel() { - return level; - } +package org.moparscape.msc.gs.model.definition.skill; + +public class ItemSmithingDefinition { + /** + * The amount of the item produced + */ + public int amount; + /** + * How many bars are required + */ + public int bars; + /** + * The ID of the item produced + */ + public int itemID; + /** + * The smithing level required to make this item + */ + public int level; + + public int getAmount() { + return amount; + } + + public int getItemID() { + return itemID; + } + + public int getRequiredBars() { + return bars; + } + + public int getRequiredLevel() { + return level; + } } \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemUnIdentHerbDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemUnIdentHerbDefinition.java similarity index 79% rename from GameServer/src/org/moparscape/msc/gs/external/ItemUnIdentHerbDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemUnIdentHerbDefinition.java index 54804d5..1919bcb 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemUnIdentHerbDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemUnIdentHerbDefinition.java @@ -1,33 +1,33 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for herbs - */ -public class ItemUnIdentHerbDef { - - /** - * How much experience identifying gives - */ - public int exp; - /** - * The id of the herb this turns into - */ - private int newId; - /** - * Herblaw level required to identify - */ - public int requiredLvl; - - public int getExp() { - return exp; - } - - public int getLevelRequired() { - return requiredLvl; - } - - public int getNewId() { - return newId; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for herbs + */ +public class ItemUnIdentHerbDefinition { + + /** + * How much experience identifying gives + */ + public int exp; + /** + * The id of the herb this turns into + */ + private int newId; + /** + * Herblaw level required to identify + */ + public int requiredLvl; + + public int getExp() { + return exp; + } + + public int getLevelRequired() { + return requiredLvl; + } + + public int getNewId() { + return newId; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ItemWieldableDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemWieldableDefinition.java similarity index 91% rename from GameServer/src/org/moparscape/msc/gs/external/ItemWieldableDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemWieldableDefinition.java index 4195b3f..f877baf 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ItemWieldableDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ItemWieldableDefinition.java @@ -1,108 +1,110 @@ -package org.moparscape.msc.gs.external; - -import java.util.HashMap; -import java.util.Map.Entry; -import java.util.Set; - -/** - * The definition wrapper for items - */ -public class ItemWieldableDef { - - /** - * How many armour points should be given - */ - public int armourPoints; - /** - * If the item can only be worn by females (used for female plates) - */ - private boolean femaleOnly; - /** - * How many magic points should be given - */ - public int magicPoints; - /** - * How many prayer points should be given - */ - public int prayerPoints; - /** - * How many range points should be given - */ - public int rangePoints; - /** - * The level of each stat required to wield - */ - public HashMap requiredStats; - /** - * Sprite Id of the item - */ - public int sprite; - /** - * Type of item - */ - public int type; - /** - * How many weapon aim points should be given - */ - public int weaponAimPoints; - /** - * How many weapon power points should be given - */ - public int weaponPowerPoints; - /** - * Body position the item is drawn on - */ - private int wieldPos; - - public boolean femaleOnly() { - return femaleOnly; - } - - public int[] getAffectedTypes() { - int[] affectedTypes = EntityHandler.getItemAffectedTypes(type); - if (affectedTypes != null) { - return affectedTypes; - } - return new int[0]; - } - - public int getArmourPoints() { - return armourPoints; - } - - public int getMagicPoints() { - return magicPoints; - } - - public int getPrayerPoints() { - return prayerPoints; - } - - public int getRangePoints() { - return rangePoints; - } - - public int getSprite() { - return sprite; - } - - public Set> getStatsRequired() { - return requiredStats.entrySet(); - } - - public int getType() { - return type; - } - - public int getWeaponAimPoints() { - return weaponAimPoints; - } - - public int getWeaponPowerPoints() { - return weaponPowerPoints; - } - - public int getWieldPos() { - return wieldPos; - } -} +package org.moparscape.msc.gs.model.definition.skill; + +import java.util.HashMap; +import java.util.Map.Entry; +import java.util.Set; + +import org.moparscape.msc.gs.model.definition.EntityHandler; + +/** + * The definition wrapper for items + */ +public class ItemWieldableDefinition { + + /** + * How many armour points should be given + */ + public int armourPoints; + /** + * If the item can only be worn by females (used for female plates) + */ + private boolean femaleOnly; + /** + * How many magic points should be given + */ + public int magicPoints; + /** + * How many prayer points should be given + */ + public int prayerPoints; + /** + * How many range points should be given + */ + public int rangePoints; + /** + * The level of each stat required to wield + */ + public HashMap requiredStats; + /** + * Sprite Id of the item + */ + public int sprite; + /** + * Type of item + */ + public int type; + /** + * How many weapon aim points should be given + */ + public int weaponAimPoints; + /** + * How many weapon power points should be given + */ + public int weaponPowerPoints; + /** + * Body position the item is drawn on + */ + private int wieldPos; + + public boolean femaleOnly() { + return femaleOnly; + } + + public int[] getAffectedTypes() { + int[] affectedTypes = EntityHandler.getItemAffectedTypes(type); + if (affectedTypes != null) { + return affectedTypes; + } + return new int[0]; + } + + public int getArmourPoints() { + return armourPoints; + } + + public int getMagicPoints() { + return magicPoints; + } + + public int getPrayerPoints() { + return prayerPoints; + } + + public int getRangePoints() { + return rangePoints; + } + + public int getSprite() { + return sprite; + } + + public Set> getStatsRequired() { + return requiredStats.entrySet(); + } + + public int getType() { + return type; + } + + public int getWeaponAimPoints() { + return weaponAimPoints; + } + + public int getWeaponPowerPoints() { + return weaponPowerPoints; + } + + public int getWieldPos() { + return wieldPos; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ObjectFishDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectFishDefinition.java similarity index 79% rename from GameServer/src/org/moparscape/msc/gs/external/ObjectFishDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectFishDefinition.java index df7d442..b7ceedd 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ObjectFishDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectFishDefinition.java @@ -1,33 +1,33 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for fish - */ -public class ObjectFishDef { - - /** - * How much experience this fish should give - */ - public int exp; - /** - * The id of the fish - */ - public int fishId; - /** - * The fishing level required to fish - */ - public int requiredLevel; - - public int getExp() { - return exp; - } - - public int getId() { - return fishId; - } - - public int getReqLevel() { - return requiredLevel; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for fish + */ +public class ObjectFishDefinition { + + /** + * How much experience this fish should give + */ + public int exp; + /** + * The id of the fish + */ + public int fishId; + /** + * The fishing level required to fish + */ + public int requiredLevel; + + public int getExp() { + return exp; + } + + public int getId() { + return fishId; + } + + public int getReqLevel() { + return requiredLevel; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ObjectFishingDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectFishingDefinition.java similarity index 71% rename from GameServer/src/org/moparscape/msc/gs/external/ObjectFishingDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectFishingDefinition.java index 7053733..94b2c96 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ObjectFishingDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectFishingDefinition.java @@ -1,43 +1,43 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for fishing spots - */ -public class ObjectFishingDef { - - /** - * The If of any bait required to go with the net - */ - public int baitId; - /** - * The fish that can be caught here - */ - public ObjectFishDef[] defs; - /** - * The Id of the net required to fish with - */ - public int netId; - - public int getBaitId() { - return baitId; - } - - public ObjectFishDef[] getFishDefs() { - return defs; - } - - public int getNetId() { - return netId; - } - - public int getReqLevel() { - int requiredLevel = 99; - for (ObjectFishDef def : defs) { - if (def.getReqLevel() < requiredLevel) { - requiredLevel = def.getReqLevel(); - } - } - return requiredLevel; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for fishing spots + */ +public class ObjectFishingDefinition { + + /** + * The If of any bait required to go with the net + */ + public int baitId; + /** + * The fish that can be caught here + */ + public ObjectFishDefinition[] defs; + /** + * The Id of the net required to fish with + */ + public int netId; + + public int getBaitId() { + return baitId; + } + + public ObjectFishDefinition[] getFishDefs() { + return defs; + } + + public int getNetId() { + return netId; + } + + public int getReqLevel() { + int requiredLevel = 99; + for (ObjectFishDefinition def : defs) { + if (def.getReqLevel() < requiredLevel) { + requiredLevel = def.getReqLevel(); + } + } + return requiredLevel; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ObjectMiningDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectMiningDefinition.java similarity index 82% rename from GameServer/src/org/moparscape/msc/gs/external/ObjectMiningDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectMiningDefinition.java index db0fda7..b7f2e9a 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ObjectMiningDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectMiningDefinition.java @@ -1,41 +1,41 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for rocks - */ -public class ObjectMiningDef { - - /** - * How much experience identifying gives - */ - public int exp; - /** - * The id of the ore this turns into - */ - private int oreId; - /** - * Herblaw level required to identify - */ - public int requiredLvl; - /** - * How long the rock takes to respawn afterwards - */ - public int respawnTime; - - public int getExp() { - return exp; - } - - public int getOreId() { - return oreId; - } - - public int getReqLevel() { - return requiredLvl; - } - - public int getRespawnTime() { - return respawnTime; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for rocks + */ +public class ObjectMiningDefinition { + + /** + * How much experience identifying gives + */ + public int exp; + /** + * The id of the ore this turns into + */ + private int oreId; + /** + * Herblaw level required to identify + */ + public int requiredLvl; + /** + * How long the rock takes to respawn afterwards + */ + public int respawnTime; + + public int getExp() { + return exp; + } + + public int getOreId() { + return oreId; + } + + public int getReqLevel() { + return requiredLvl; + } + + public int getRespawnTime() { + return respawnTime; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/ObjectWoodcuttingDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectWoodcuttingDefinition.java similarity index 83% rename from GameServer/src/org/moparscape/msc/gs/external/ObjectWoodcuttingDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectWoodcuttingDefinition.java index 0d1b0f0..5c165fa 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ObjectWoodcuttingDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ObjectWoodcuttingDefinition.java @@ -1,49 +1,49 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for trees - */ -public class ObjectWoodcuttingDef { - - /** - * How much experience identifying gives - */ - public int exp; - /** - * Percent chance the tree will be felled - */ - public int fell; - /** - * The id of the ore this turns into - */ - private int logId; - /** - * Herblaw level required to identify - */ - public int requiredLvl; - /** - * How long the tree takes to respawn afterwards - */ - public int respawnTime; - - public int getExp() { - return exp; - } - - public int getFell() { - return fell; - } - - public int getLogId() { - return logId; - } - - public int getReqLevel() { - return requiredLvl; - } - - public int getRespawnTime() { - return respawnTime; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for trees + */ +public class ObjectWoodcuttingDefinition { + + /** + * How much experience identifying gives + */ + public int exp; + /** + * Percent chance the tree will be felled + */ + public int fell; + /** + * The id of the ore this turns into + */ + private int logId; + /** + * Herblaw level required to identify + */ + public int requiredLvl; + /** + * How long the tree takes to respawn afterwards + */ + public int respawnTime; + + public int getExp() { + return exp; + } + + public int getFell() { + return fell; + } + + public int getLogId() { + return logId; + } + + public int getReqLevel() { + return requiredLvl; + } + + public int getRespawnTime() { + return respawnTime; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/PrayerDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/PrayerDefinition.java similarity index 64% rename from GameServer/src/org/moparscape/msc/gs/external/PrayerDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/PrayerDefinition.java index 0811017..df7d299 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/PrayerDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/PrayerDefinition.java @@ -1,9 +1,11 @@ -package org.moparscape.msc.gs.external; +package org.moparscape.msc.gs.model.definition.skill; + +import org.moparscape.msc.gs.model.definition.EntityDefinition; /** * The definition wrapper for prayers */ -public class PrayerDef extends EntityDef { +public class PrayerDefinition extends EntityDefinition { /** * The drain rate of the prayer (perhaps points per min?) diff --git a/GameServer/src/org/moparscape/msc/gs/external/ReqOreDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ReqOreDefinition.java similarity index 73% rename from GameServer/src/org/moparscape/msc/gs/external/ReqOreDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/ReqOreDefinition.java index 7e5d401..2628358 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/ReqOreDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/ReqOreDefinition.java @@ -1,25 +1,25 @@ -package org.moparscape.msc.gs.external; - -/** - * The definition wrapper for ores - */ -public class ReqOreDef { - - /** - * The amount of the ore required - */ - public int amount; - /** - * The id of the ore - */ - public int oreId; - - public int getAmount() { - return amount; - } - - public int getId() { - return oreId; - } - -} +package org.moparscape.msc.gs.model.definition.skill; + +/** + * The definition wrapper for ores + */ +public class ReqOreDefinition { + + /** + * The amount of the ore required + */ + public int amount; + /** + * The id of the ore + */ + public int oreId; + + public int getAmount() { + return amount; + } + + public int getId() { + return oreId; + } + +} diff --git a/GameServer/src/org/moparscape/msc/gs/external/SpellDef.java b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/SpellDefinition.java similarity index 82% rename from GameServer/src/org/moparscape/msc/gs/external/SpellDef.java rename to GameServer/src/org/moparscape/msc/gs/model/definition/skill/SpellDefinition.java index 8538b67..6361a56 100644 --- a/GameServer/src/org/moparscape/msc/gs/external/SpellDef.java +++ b/GameServer/src/org/moparscape/msc/gs/model/definition/skill/SpellDefinition.java @@ -1,13 +1,15 @@ -package org.moparscape.msc.gs.external; +package org.moparscape.msc.gs.model.definition.skill; import java.util.HashMap; import java.util.Map.Entry; import java.util.Set; +import org.moparscape.msc.gs.model.definition.EntityDefinition; + /** * The definition wrapper for spells */ -public class SpellDef extends EntityDef { +public class SpellDefinition extends EntityDefinition { /** * The amount of experience given by this spell diff --git a/GameServer/src/org/moparscape/msc/gs/npchandler/Aggie.java b/GameServer/src/org/moparscape/msc/gs/npchandler/Aggie.java index e5ffc33..0ac0e42 100644 --- a/GameServer/src/org/moparscape/msc/gs/npchandler/Aggie.java +++ b/GameServer/src/org/moparscape/msc/gs/npchandler/Aggie.java @@ -3,13 +3,13 @@ package org.moparscape.msc.gs.npchandler; import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.event.MiniEvent; import org.moparscape.msc.gs.event.ShortEvent; -import org.moparscape.msc.gs.external.EntityHandler; import org.moparscape.msc.gs.model.ChatMessage; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.MenuHandler; import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; /** * diff --git a/GameServer/src/org/moparscape/msc/gs/npchandler/Certer.java b/GameServer/src/org/moparscape/msc/gs/npchandler/Certer.java index 3dcb92b..39f41ca 100644 --- a/GameServer/src/org/moparscape/msc/gs/npchandler/Certer.java +++ b/GameServer/src/org/moparscape/msc/gs/npchandler/Certer.java @@ -2,14 +2,14 @@ package org.moparscape.msc.gs.npchandler; import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.event.ShortEvent; -import org.moparscape.msc.gs.external.CerterDef; -import org.moparscape.msc.gs.external.EntityHandler; import org.moparscape.msc.gs.model.ChatMessage; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.MenuHandler; import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.extra.CerterDefinition; public class Certer implements NpcHandler { /** @@ -18,7 +18,7 @@ public class Certer implements NpcHandler { public static final World world = Instance.getWorld(); public void handleNpc(final Npc npc, Player player) throws Exception { - final CerterDef certerDef = EntityHandler.getCerterDef(npc.getID()); + final CerterDefinition certerDef = EntityHandler.getCerterDef(npc.getID()); if (certerDef == null) { return; } diff --git a/GameServer/src/org/moparscape/msc/gs/npchandler/NpcHandlerDef.java b/GameServer/src/org/moparscape/msc/gs/npchandler/NpcHandlerDefinition.java similarity index 88% rename from GameServer/src/org/moparscape/msc/gs/npchandler/NpcHandlerDef.java rename to GameServer/src/org/moparscape/msc/gs/npchandler/NpcHandlerDefinition.java index f8536db..aa1aa9c 100644 --- a/GameServer/src/org/moparscape/msc/gs/npchandler/NpcHandlerDef.java +++ b/GameServer/src/org/moparscape/msc/gs/npchandler/NpcHandlerDefinition.java @@ -1,48 +1,48 @@ -package org.moparscape.msc.gs.npchandler; - -/** - * The definition of a npc handler, for use with XStream. - */ -public class NpcHandlerDef { - /** - * The name of the handler class - */ - public String className; - /** - * The IDs of npcs which the handler is responsible for - */ - public int[] ids; - - /** - * Constructs a new packet handler definition, entailing that npcs with the - * given IDs are to be handled by the specified class. - * - * @param ids - * The IDs of npcs to be handled - * @param className - * The name of the packet handler class - */ - public NpcHandlerDef(int[] ids, String className) { - this.ids = ids; - this.className = className; - } - - /** - * Returns the IDs of npcs to be handled. - * - * @return An int array containing the IDs of npcs to be - * handled. - */ - public int[] getAssociatedNpcs() { - return ids; - } - - /** - * Returns the name of the npc handler class. - * - * @return The name of the npc handler's class - */ - public String getClassName() { - return className; - } -} +package org.moparscape.msc.gs.npchandler; + +/** + * The definition of a npc handler, for use with XStream. + */ +public class NpcHandlerDefinition { + /** + * The name of the handler class + */ + public String className; + /** + * The IDs of npcs which the handler is responsible for + */ + public int[] ids; + + /** + * Constructs a new packet handler definition, entailing that npcs with the + * given IDs are to be handled by the specified class. + * + * @param ids + * The IDs of npcs to be handled + * @param className + * The name of the packet handler class + */ + public NpcHandlerDefinition(int[] ids, String className) { + this.ids = ids; + this.className = className; + } + + /** + * Returns the IDs of npcs to be handled. + * + * @return An int array containing the IDs of npcs to be + * handled. + */ + public int[] getAssociatedNpcs() { + return ids; + } + + /** + * Returns the name of the npc handler class. + * + * @return The name of the npc handler's class + */ + public String getClassName() { + return className; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/npchandler/ShopKeeper.java.1 b/GameServer/src/org/moparscape/msc/gs/npchandler/ShopKeeper.java.1 deleted file mode 100644 index 851ee3d..0000000 --- a/GameServer/src/org/moparscape/msc/gs/npchandler/ShopKeeper.java.1 +++ /dev/null @@ -1,54 +0,0 @@ -package org.rscdaemon.server.npchandler; - -import org.rscdaemon.server.model.Player; -import org.rscdaemon.server.model.Npc; -import org.rscdaemon.server.model.World; -import org.rscdaemon.server.model.ChatMessage; -import org.rscdaemon.server.model.MenuHandler; -import org.rscdaemon.server.model.Shop; -import org.rscdaemon.server.event.ShortEvent; - -public class ShopKeeper implements NpcHandler { - /** - * World instance - */ - public static final World world = World.getWorld(); - - public void handleNpc(final Npc npc, Player player) throws Exception { - final Shop shop = world.getShop(npc.getLocation()); - if(shop == null) { - return; - } - if(shop.getGreeting() != null) { - player.informOfNpcMessage(new ChatMessage(npc, shop.getGreeting(), player)); - } - player.setBusy(true); - world.getDelayedEventHandler().add(new ShortEvent(player) { - public void action() { - owner.setBusy(false); - owner.setMenuHandler(new MenuHandler(shop.getOptions()) { - public void handleReply(final int option, final String reply) { - if(owner.isBusy()) { - return; - } - owner.informOfChatMessage(new ChatMessage(owner, reply, npc)); - owner.setBusy(true); - world.getDelayedEventHandler().add(new ShortEvent(owner) { - public void action() { - owner.setBusy(false); - if(option == 0) { - owner.setAccessingShop(shop); - owner.getActionSender().showShop(shop); - } - npc.unblock(); - } - }); - } - }); - owner.getActionSender().sendMenu(shop.getOptions()); - } - }); - npc.blockedBy(player); - } - -} \ No newline at end of file diff --git a/GameServer/src/org/moparscape/msc/gs/persistence/DataStore.java b/GameServer/src/org/moparscape/msc/gs/persistence/DataStore.java index bc7ad17..9951164 100644 --- a/GameServer/src/org/moparscape/msc/gs/persistence/DataStore.java +++ b/GameServer/src/org/moparscape/msc/gs/persistence/DataStore.java @@ -8,8 +8,38 @@ import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.Shop; import org.moparscape.msc.gs.model.TelePoint; -import org.moparscape.msc.gs.npchandler.NpcHandlerDef; -import org.moparscape.msc.gs.phandler.PacketHandlerDef; +import org.moparscape.msc.gs.model.definition.entity.GameObjectDefinition; +import org.moparscape.msc.gs.model.definition.entity.GameObjectLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCLocationDefinition; +import org.moparscape.msc.gs.model.definition.extra.CerterDefinition; +import org.moparscape.msc.gs.model.definition.extra.DoorDefinition; +import org.moparscape.msc.gs.model.definition.extra.TileDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityCourseDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityDefinition; +import org.moparscape.msc.gs.model.definition.skill.FiremakingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemArrowHeadDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemBowStringDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCookingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCraftingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemDartTipDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemGemDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbSecondDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemLogCutDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmeltingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmithingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemUnIdentHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemWieldableDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectFishingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectMiningDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectWoodcuttingDefinition; +import org.moparscape.msc.gs.model.definition.skill.PrayerDefinition; +import org.moparscape.msc.gs.model.definition.skill.SpellDefinition; +import org.moparscape.msc.gs.npchandler.NpcHandlerDefinition; +import org.moparscape.msc.gs.phandler.PacketHandlerDefinition; /** * Any retrieval of unchanging data should be done through this interface. All @@ -23,18 +53,18 @@ import org.moparscape.msc.gs.phandler.PacketHandlerDef; */ public abstract interface DataStore { - public PacketHandlerDef[] loadPacketHandlerDefs() throws Exception; + public PacketHandlerDefinition[] loadPacketHandlerDefs() throws Exception; - public void savePacketHandlerDefs(PacketHandlerDef[] defs) throws Exception; + public void savePacketHandlerDefs(PacketHandlerDefinition[] defs) throws Exception; - public PacketHandlerDef[] loadLSPacketHandlerDefs() throws Exception; + public PacketHandlerDefinition[] loadLSPacketHandlerDefs() throws Exception; - public void saveLSPacketHandlerDefs(PacketHandlerDef[] defs) + public void saveLSPacketHandlerDefs(PacketHandlerDefinition[] defs) throws Exception; - public NpcHandlerDef[] loadNpcHandlers() throws Exception; + public NpcHandlerDefinition[] loadNpcHandlers() throws Exception; - public void saveNpcHandlers(NpcHandlerDef[] defs) throws Exception; + public void saveNpcHandlers(NpcHandlerDefinition[] defs) throws Exception; public Map loadTelePoints() throws Exception; @@ -44,158 +74,158 @@ public abstract interface DataStore { public void saveShops(List shops) throws Exception; - public Map loadCerterDefs() throws Exception; + public Map loadCerterDefs() throws Exception; - public void saveCerterDefs(Map certers) + public void saveCerterDefs(Map certers) throws Exception; - public List loadGameObjectLocs() throws Exception; + public List loadGameObjectLocs() throws Exception; - public void saveGameObjectLocs(List locs) throws Exception; + public void saveGameObjectLocs(List locs) throws Exception; - public List loadItemLocs() throws Exception; + public List loadItemLocs() throws Exception; - public void saveItemLocs(List locs) throws Exception; + public void saveItemLocs(List locs) throws Exception; - public List loadNPCLocs() throws Exception; + public List loadNPCLocs() throws Exception; - public void saveNPCLocs(List locs) throws Exception; + public void saveNPCLocs(List locs) throws Exception; - public TileDef[] loadTileDefs() throws Exception; + public TileDefinition[] loadTileDefs() throws Exception; - public void saveTileDefs(TileDef[] defs) throws Exception; + public void saveTileDefs(TileDefinition[] defs) throws Exception; - public GameObjectDef[] loadGameObjectDefs() throws Exception; + public GameObjectDefinition[] loadGameObjectDefs() throws Exception; - public void saveGameObjectDefs(GameObjectDef[] defs) throws Exception; + public void saveGameObjectDefs(GameObjectDefinition[] defs) throws Exception; - public DoorDef[] loadDoorDefs() throws Exception; + public DoorDefinition[] loadDoorDefs() throws Exception; - public void saveDoorDefs(DoorDef[] defs) throws Exception; + public void saveDoorDefs(DoorDefinition[] defs) throws Exception; - public ItemDef[] loadItemDefs() throws Exception; + public ItemDefinition[] loadItemDefs() throws Exception; - public void saveItemDefs(ItemDef[] defs) throws Exception; + public void saveItemDefs(ItemDefinition[] defs) throws Exception; - public PrayerDef[] loadPrayerDefs() throws Exception; + public PrayerDefinition[] loadPrayerDefs() throws Exception; - public void savePrayerDefs(PrayerDef[] defs) throws Exception; + public void savePrayerDefs(PrayerDefinition[] defs) throws Exception; - public SpellDef[] loadSpellDefs() throws Exception; + public SpellDefinition[] loadSpellDefs() throws Exception; - public void saveSpellDefs(SpellDef[] defs) throws Exception; + public void saveSpellDefs(SpellDefinition[] defs) throws Exception; - public NPCDef[] loadNPCDefs() throws Exception; + public NPCDefinition[] loadNPCDefs() throws Exception; - public void saveNPCDefs(NPCDef[] defs) throws Exception; + public void saveNPCDefs(NPCDefinition[] defs) throws Exception; - public ItemCraftingDef[] loadItemCraftingDefs() throws Exception; + public ItemCraftingDefinition[] loadItemCraftingDefs() throws Exception; - public void saveItemCraftingDefs(ItemCraftingDef[] defs) throws Exception; + public void saveItemCraftingDefs(ItemCraftingDefinition[] defs) throws Exception; - public ItemHerbSecond[] loadItemHerbSeconds() throws Exception; + public ItemHerbSecondDefinition[] loadItemHerbSeconds() throws Exception; - public void saveItemHerbSeconds(ItemHerbSecond[] seconds) throws Exception; + public void saveItemHerbSeconds(ItemHerbSecondDefinition[] seconds) throws Exception; - public Map loadItemDartTipDefs() throws Exception; + public Map loadItemDartTipDefs() throws Exception; - public void saveItemDartTipDefs(Map defs) + public void saveItemDartTipDefs(Map defs) throws Exception; - public Map loadGemDefs() throws Exception; + public Map loadGemDefs() throws Exception; - public void saveGemDefs(Map defs) throws Exception; + public void saveGemDefs(Map defs) throws Exception; - public Map loadItemLogCutDefs() throws Exception; + public Map loadItemLogCutDefs() throws Exception; - public void saveItemLogCutDefs(Map defs) + public void saveItemLogCutDefs(Map defs) throws Exception; - public Map loadItemBowStringDefs() + public Map loadItemBowStringDefs() throws Exception; - public void saveItemBowStringDefs(Map defs) + public void saveItemBowStringDefs(Map defs) throws Exception; - public Map loadItemArrowHeadDefs() + public Map loadItemArrowHeadDefs() throws Exception; - public void saveItemArrowHeadDefs(Map defs) + public void saveItemArrowHeadDefs(Map defs) throws Exception; - public Map loadFiremakingDefs() throws Exception; + public Map loadFiremakingDefs() throws Exception; - public void saveFiremakingDefs(Map defs) + public void saveFiremakingDefs(Map defs) throws Exception; public Map loadItemAffectedTypes() throws Exception; public void saveItemAffectedTypes(Map types) throws Exception; - public Map loadItemWieldableDefs() + public Map loadItemWieldableDefs() throws Exception; - public void saveItemWieldableDefs(Map defs) throws Exception; + public void saveItemWieldableDefs(Map defs) throws Exception; - public Map loadItemUnIdentHerbDefs() + public Map loadItemUnIdentHerbDefs() throws Exception; - public void saveItemUnIdentHerbDefs(Map defs) throws Exception; + public void saveItemUnIdentHerbDefs(Map defs) throws Exception; - public Map loadItemHerbDefs() throws Exception; + public Map loadItemHerbDefs() throws Exception; - public void saveItemHerbDefs(Map defs) throws Exception; + public void saveItemHerbDefs(Map defs) throws Exception; public Map loadItemEdibleHeals() throws Exception; public void saveItemEdibleHeals(Map defs) throws Exception; - public Map loadItemCookingDefs() throws Exception; + public Map loadItemCookingDefs() throws Exception; - public void saveItemCookingDefs(Map defs) throws Exception; + public void saveItemCookingDefs(Map defs) throws Exception; - public Map loadItemSmeltingDefs() + public Map loadItemSmeltingDefs() throws Exception; - public void saveItemSmeltingDefs(Map defs) throws Exception; + public void saveItemSmeltingDefs(Map defs) throws Exception; - public ItemSmithingDef[] loadItemSmithingDefs() throws Exception; + public ItemSmithingDefinition[] loadItemSmithingDefs() throws Exception; - public void saveItemSmithingDefs(ItemSmithingDef[] defs) throws Exception; + public void saveItemSmithingDefs(ItemSmithingDefinition[] defs) throws Exception; - public Map loadObjectMiningDefs() + public Map loadObjectMiningDefs() throws Exception; - public void saveObjectMiningDefs(Map defs) throws Exception; + public void saveObjectMiningDefs(Map defs) throws Exception; - public Map loadObjectWoodcuttingDefs() + public Map loadObjectWoodcuttingDefs() throws Exception; - public void saveObjectWoodcuttingDefs(Map defs) throws Exception; + public void saveObjectWoodcuttingDefs(Map defs) throws Exception; - public Map loadObjectFishDefs() + public Map loadObjectFishDefs() throws Exception; - public void saveObjectFishingDefs(Map defs) throws Exception; + public void saveObjectFishingDefs(Map defs) throws Exception; public Map loadSpellAgressiveLevel() throws Exception; public void saveSpellAgressiveLevel(Map defs) throws Exception; - public Map loadAgilityDefs() throws Exception; + public Map loadAgilityDefs() throws Exception; - public void saveAgilityDefs(Map defs) throws Exception; + public void saveAgilityDefs(Map defs) throws Exception; - public Map loadAgilityCourseDefs() + public Map loadAgilityCourseDefs() throws Exception; - public void saveAgilityCourseDef(Map defs) throws Exception; + public void saveAgilityCourseDef(Map defs) throws Exception; public List[] loadKeyChestLoots() throws Exception; public void saveKeyChestLoots(List[] loots) throws Exception; - public Map loadDartTips() throws Exception; + public Map loadDartTips() throws Exception; public void dispose(); diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/PacketHandlerDef.java b/GameServer/src/org/moparscape/msc/gs/phandler/PacketHandlerDefinition.java similarity index 87% rename from GameServer/src/org/moparscape/msc/gs/phandler/PacketHandlerDef.java rename to GameServer/src/org/moparscape/msc/gs/phandler/PacketHandlerDefinition.java index 5cb506e..d7787d0 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/PacketHandlerDef.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/PacketHandlerDefinition.java @@ -1,48 +1,48 @@ -package org.moparscape.msc.gs.phandler; - -/** - * The definition of a packet handler, for use with XStream. - */ -public class PacketHandlerDef { - /** - * The name of the handler class - */ - public String className; - /** - * The IDs of packets which the handler is responsible for - */ - public int[] ids; - - /** - * Constructs a new packet handler definition, entailing that packets with - * the given IDs are to be handled by the specified class. - * - * @param ids - * The IDs of packets to be handled - * @param className - * The name of the packet handler class - */ - public PacketHandlerDef(int[] ids, String className) { - this.ids = ids; - this.className = className; - } - - /** - * Returns the IDs of packets to be handled. - * - * @return An int array containing the IDs of packets to be - * handled. - */ - public int[] getAssociatedPackets() { - return ids; - } - - /** - * Returns the name of the packet handler class. - * - * @return The name of the packet handler's class - */ - public String getClassName() { - return className; - } -} +package org.moparscape.msc.gs.phandler; + +/** + * The definition of a packet handler, for use with XStream. + */ +public class PacketHandlerDefinition { + /** + * The name of the handler class + */ + public String className; + /** + * The IDs of packets which the handler is responsible for + */ + public int[] ids; + + /** + * Constructs a new packet handler definition, entailing that packets with + * the given IDs are to be handled by the specified class. + * + * @param ids + * The IDs of packets to be handled + * @param className + * The name of the packet handler class + */ + public PacketHandlerDefinition(int[] ids, String className) { + this.ids = ids; + this.className = className; + } + + /** + * Returns the IDs of packets to be handled. + * + * @return An int array containing the IDs of packets to be + * handled. + */ + public int[] getAssociatedPackets() { + return ids; + } + + /** + * Returns the name of the packet handler class. + * + * @return The name of the packet handler's class + */ + public String getClassName() { + return className; + } +} diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/BankHandler.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/BankHandler.java index 6cee244..ca91af1 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/BankHandler.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/BankHandler.java @@ -4,12 +4,12 @@ import org.apache.mina.common.IoSession; import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.connection.Packet; import org.moparscape.msc.gs.connection.RSCPacket; -import org.moparscape.msc.gs.external.EntityHandler; import org.moparscape.msc.gs.model.Bank; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Inventory; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/DuelHandler.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/DuelHandler.java index a2e02b8..42a0d76 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/DuelHandler.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/DuelHandler.java @@ -11,11 +11,11 @@ import org.moparscape.msc.gs.core.GameEngine; import org.moparscape.msc.gs.event.DuelEvent; import org.moparscape.msc.gs.event.SingleEvent; import org.moparscape.msc.gs.event.WalkToMobEvent; -import org.moparscape.msc.gs.external.ItemDef; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Inventory; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.entity.ItemDefinition; import org.moparscape.msc.gs.model.landscape.PathGenerator; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; @@ -393,7 +393,7 @@ public class DuelHandler implements PacketHandler { player.setSuspiciousPlayer(true); continue; } - ItemDef def = tItem.getDef(); + ItemDefinition def = tItem.getDef(); if (!def.canTrade()) { player.getActionSender().sendMessage( def.getName() diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/InvActionHandler.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/InvActionHandler.java index 619c37d..bb4b31a 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/InvActionHandler.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/InvActionHandler.java @@ -8,7 +8,6 @@ import org.moparscape.msc.gs.connection.Packet; import org.moparscape.msc.gs.event.DelayedEvent; import org.moparscape.msc.gs.event.MiniEvent; import org.moparscape.msc.gs.event.SingleEvent; -import org.moparscape.msc.gs.external.ItemUnIdentHerbDef; import org.moparscape.msc.gs.model.Bubble; import org.moparscape.msc.gs.model.GameObject; import org.moparscape.msc.gs.model.InvItem; @@ -16,6 +15,7 @@ import org.moparscape.msc.gs.model.MenuHandler; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.skill.ItemUnIdentHerbDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; @@ -88,7 +88,7 @@ public class InvActionHandler implements PacketHandler { "This feature is only avaliable on a members server"); return; } - ItemUnIdentHerbDef herb = item.getUnIdentHerbDef(); + ItemUnIdentHerbDefinition herb = item.getUnIdentHerbDef(); if (herb == null) { return; } @@ -101,7 +101,7 @@ public class InvActionHandler implements PacketHandler { player.setBusy(true); Instance.getDelayedEventHandler().add(new MiniEvent(player) { public void action() { - ItemUnIdentHerbDef herb = item.getUnIdentHerbDef(); + ItemUnIdentHerbDefinition herb = item.getUnIdentHerbDef(); InvItem newItem = new InvItem(herb.getNewId()); owner.getInventory().remove(item); owner.getInventory().add(newItem); diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnGroundItem.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnGroundItem.java index f55c001..5acee55 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnGroundItem.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnGroundItem.java @@ -7,8 +7,6 @@ import org.moparscape.msc.gs.connection.Packet; import org.moparscape.msc.gs.event.DelayedEvent; import org.moparscape.msc.gs.event.ShortEvent; import org.moparscape.msc.gs.event.WalkToPointEvent; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.FiremakingDef; import org.moparscape.msc.gs.model.Bubble; import org.moparscape.msc.gs.model.GameObject; import org.moparscape.msc.gs.model.InvItem; @@ -16,6 +14,8 @@ import org.moparscape.msc.gs.model.Item; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.skill.FiremakingDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; @@ -138,7 +138,7 @@ public class InvUseOnGroundItem implements PacketHandler { private void handleFireMaking(int tries) { final int retries = --tries; - final FiremakingDef def = EntityHandler + final FiremakingDefinition def = EntityHandler .getFiremakingDef(item.getID()); if (!itemId(new int[] { 166 }) || def == null) { owner.getActionSender().sendMessage( diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnItem.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnItem.java index 08725af..264d30f 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnItem.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnItem.java @@ -7,18 +7,18 @@ import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.Server; import org.moparscape.msc.gs.connection.Packet; import org.moparscape.msc.gs.event.MiniEvent; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.ItemArrowHeadDef; -import org.moparscape.msc.gs.external.ItemBowStringDef; -import org.moparscape.msc.gs.external.ItemDartTipDef; -import org.moparscape.msc.gs.external.ItemGemDef; -import org.moparscape.msc.gs.external.ItemHerbDef; -import org.moparscape.msc.gs.external.ItemHerbSecond; -import org.moparscape.msc.gs.external.ItemLogCutDef; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.MenuHandler; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.skill.ItemArrowHeadDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemBowStringDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemDartTipDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemGemDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbSecondDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemLogCutDefinition; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; import org.moparscape.msc.gs.tools.DataConversions; @@ -49,7 +49,7 @@ public class InvUseOnItem implements PacketHandler { } InvItem newItem; int exp; - ItemDartTipDef tipDef = null; + ItemDartTipDefinition tipDef = null; if (item.getID() == 280) { newItem = new InvItem(637, amount); exp = amount; @@ -96,7 +96,7 @@ public class InvUseOnItem implements PacketHandler { private boolean doArrowHeads(Player player, final InvItem headlessArrows, final InvItem arrowHeads) { - final ItemArrowHeadDef headDef = EntityHandler + final ItemArrowHeadDefinition headDef = EntityHandler .getItemArrowHeadDef(arrowHeads.getID()); if (!Config.members) { player.getActionSender().sendMessage( @@ -141,7 +141,7 @@ public class InvUseOnItem implements PacketHandler { private boolean doBowString(Player player, final InvItem bowString, final InvItem bow) { - final ItemBowStringDef stringDef = EntityHandler + final ItemBowStringDefinition stringDef = EntityHandler .getItemBowStringDef(bow.getID()); if (!Config.members) { player.getActionSender().sendMessage( @@ -177,7 +177,7 @@ public class InvUseOnItem implements PacketHandler { private boolean doCutGem(Player player, final InvItem chisel, final InvItem gem) { - final ItemGemDef gemDef = EntityHandler.getItemGemDef(gem.getID()); + final ItemGemDefinition gemDef = EntityHandler.getItemGemDef(gem.getID()); if (gemDef == null) { return false; } @@ -288,7 +288,7 @@ public class InvUseOnItem implements PacketHandler { private boolean doHerblaw(Player player, final InvItem vial, final InvItem herb) { - final ItemHerbDef herbDef = EntityHandler.getItemHerbDef(herb.getID()); + final ItemHerbDefinition herbDef = EntityHandler.getItemHerbDef(herb.getID()); if (herbDef == null) { return false; } @@ -322,7 +322,7 @@ public class InvUseOnItem implements PacketHandler { } private boolean doHerbSecond(Player player, final InvItem second, - final InvItem unfinished, final ItemHerbSecond def) { + final InvItem unfinished, final ItemHerbSecondDefinition def) { if (!Config.members) { player.getActionSender().sendMessage( "This feature is not avaliable in f2p"); @@ -359,7 +359,7 @@ public class InvUseOnItem implements PacketHandler { private boolean doLogCut(final Player player, final InvItem knife, final InvItem log, int times) { final int retries = --times; - final ItemLogCutDef cutDef = EntityHandler + final ItemLogCutDefinition cutDef = EntityHandler .getItemLogCutDef(log.getID()); if (!Config.members) { player.getActionSender().sendMessage( @@ -455,7 +455,7 @@ public class InvUseOnItem implements PacketHandler { World.getQuestManager().handleUseItemOnItem(item1, item2, player); - ItemHerbSecond secondDef = null; + ItemHerbSecondDefinition secondDef = null; if ((secondDef = EntityHandler.getItemHerbSecond(item1.getID(), item2.getID())) != null && doHerbSecond(player, item1, item2, secondDef)) { diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnObject.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnObject.java index b968754..2c6abce 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnObject.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/InvUseOnObject.java @@ -13,13 +13,6 @@ import org.moparscape.msc.gs.core.GameEngine; import org.moparscape.msc.gs.event.MiniEvent; import org.moparscape.msc.gs.event.ShortEvent; import org.moparscape.msc.gs.event.WalkToObjectEvent; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.ItemCookingDef; -import org.moparscape.msc.gs.external.ItemCraftingDef; -import org.moparscape.msc.gs.external.ItemSmeltingDef; -import org.moparscape.msc.gs.external.ItemSmithingDef; -import org.moparscape.msc.gs.external.ItemWieldableDef; -import org.moparscape.msc.gs.external.ReqOreDef; import org.moparscape.msc.gs.model.Bubble; import org.moparscape.msc.gs.model.ChatMessage; import org.moparscape.msc.gs.model.GameObject; @@ -28,6 +21,13 @@ import org.moparscape.msc.gs.model.MenuHandler; import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.skill.ItemCookingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCraftingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmeltingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmithingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemWieldableDefinition; +import org.moparscape.msc.gs.model.definition.skill.ReqOreDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; @@ -62,7 +62,7 @@ public class InvUseOnObject implements PacketHandler { owner.resetAll(); switch (object.getID()) { case 24: // Web - ItemWieldableDef def = item.getWieldableDef(); + ItemWieldableDefinition def = item.getWieldableDef(); if ((def == null || def.getWieldPos() != 4) && item.getID() != 13) { owner.getActionSender().sendMessage( @@ -463,7 +463,7 @@ public class InvUseOnObject implements PacketHandler { + "."); return; } - ItemCraftingDef def = EntityHandler + ItemCraftingDefinition def = EntityHandler .getCraftingDef((option * 3) + craftType); if (def == null) { @@ -1218,13 +1218,13 @@ public class InvUseOnObject implements PacketHandler { private void handleRegularSmelting(int times1) { final int times = --times1; - ItemSmeltingDef smeltingDef = item.getSmeltingDef(); + ItemSmeltingDefinition smeltingDef = item.getSmeltingDef(); if (smeltingDef == null) { owner.getActionSender().sendMessage( "Nothing interesting happens."); return; } - for (ReqOreDef reqOre : smeltingDef.getReqOres()) { + for (ReqOreDefinition reqOre : smeltingDef.getReqOres()) { if (owner.getInventory().countId(reqOre.getId()) < reqOre .getAmount()) { if (item.getID() == 151) { @@ -1264,14 +1264,14 @@ public class InvUseOnObject implements PacketHandler { "You smelt the " + item.getDef().getName() + " in the furnace."); - final ItemSmeltingDef def = smeltingDef; + final ItemSmeltingDefinition def = smeltingDef; Instance.getDelayedEventHandler().add( new ShortEvent(owner) { public void action() { InvItem bar = new InvItem(def .getBarId()); if (owner.getInventory().remove(item) > -1) { - for (ReqOreDef reqOre : def + for (ReqOreDefinition reqOre : def .getReqOres()) { for (int i = 0; i < reqOre .getAmount(); i++) { @@ -1381,7 +1381,7 @@ public class InvUseOnObject implements PacketHandler { } }); } else { - final ItemCookingDef cookingDef = item + final ItemCookingDefinition cookingDef = item .getCookingDef(); if (cookingDef == null) { owner.getActionSender().sendMessage( @@ -1457,7 +1457,7 @@ public class InvUseOnObject implements PacketHandler { private void handleSmithing(int barID, int toMake) { - ItemSmithingDef def = EntityHandler.getSmithingDef((Formulae.getBarType(barID) * 21) + toMake); + ItemSmithingDefinition def = EntityHandler.getSmithingDef((Formulae.getBarType(barID) * 21) + toMake); if(def == null) { owner.getActionSender().sendMessage("Nothing interesting happens."); return; diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/ObjectAction.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/ObjectAction.java index 85d6b9e..6ee10e1 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/ObjectAction.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/ObjectAction.java @@ -15,13 +15,6 @@ import org.moparscape.msc.gs.event.MiniEvent; import org.moparscape.msc.gs.event.ShortEvent; import org.moparscape.msc.gs.event.SingleEvent; import org.moparscape.msc.gs.event.WalkToObjectEvent; -import org.moparscape.msc.gs.external.AgilityCourseDef; -import org.moparscape.msc.gs.external.AgilityDef; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.GameObjectDef; -import org.moparscape.msc.gs.external.ObjectFishDef; -import org.moparscape.msc.gs.external.ObjectFishingDef; -import org.moparscape.msc.gs.external.ObjectWoodcuttingDef; import org.moparscape.msc.gs.model.Bubble; import org.moparscape.msc.gs.model.ChatMessage; import org.moparscape.msc.gs.model.GameObject; @@ -33,6 +26,13 @@ import org.moparscape.msc.gs.model.Path; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.entity.GameObjectDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityCourseDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectFishDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectFishingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectWoodcuttingDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; @@ -128,7 +128,7 @@ public class ObjectAction implements PacketHandler { if (owner.getStatus() != Action.AGILITYING) owner.resetPath(); - GameObjectDef def = object.getGameObjectDef(); + GameObjectDefinition def = object.getGameObjectDef(); if (owner.isBusy() || owner.isRanging() || !owner.nextTo(object) || def == null || owner.getStatus() != Action.USING_OBJECT) { @@ -1025,7 +1025,7 @@ public class ObjectAction implements PacketHandler { "This feature is only avaliable on a members server"); return; } - final AgilityDef def = EntityHandler + final AgilityDefinition def = EntityHandler .getAgilityDef(object.getID()); if (owner.getCurStat(16) < def.getReqLevel()) { owner.getActionSender().sendMessage( @@ -1105,7 +1105,7 @@ public class ObjectAction implements PacketHandler { owner.getActionSender() .sendStat(16); - AgilityCourseDef course = EntityHandler + AgilityCourseDefinition course = EntityHandler .getAgilityCourseDef(object .getID()); @@ -1195,7 +1195,7 @@ public class ObjectAction implements PacketHandler { private void handleFishing(final int click, int passvalue) { final int tries = --passvalue; - final ObjectFishingDef def = EntityHandler + final ObjectFishingDefinition def = EntityHandler .getObjectFishingDef(object.getID(), click); if (owner.isBusy()) { return; @@ -1245,7 +1245,7 @@ public class ObjectAction implements PacketHandler { Instance.getDelayedEventHandler().add( new ShortEvent(owner) { public void action() { - ObjectFishDef def = Formulae.getFish( + ObjectFishDefinition def = Formulae.getFish( object.getID(), owner.getCurStat(10), click); if (def != null) { @@ -1299,7 +1299,7 @@ public class ObjectAction implements PacketHandler { private void handleWoodcutting(final int click, int passedvalue) { final int tries = --passedvalue; - final ObjectWoodcuttingDef def = EntityHandler + final ObjectWoodcuttingDefinition def = EntityHandler .getObjectWoodcuttingDef(object.getID()); if (owner.isBusy()) { return; diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/PrayerHandler.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/PrayerHandler.java index 83ab2a5..0b2e89a 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/PrayerHandler.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/PrayerHandler.java @@ -4,10 +4,10 @@ import org.apache.mina.common.IoSession; import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.connection.Packet; import org.moparscape.msc.gs.connection.RSCPacket; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.PrayerDef; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.skill.PrayerDefinition; import org.moparscape.msc.gs.phandler.PacketHandler; public class PrayerHandler implements PacketHandler { @@ -77,7 +77,7 @@ public class PrayerHandler implements PacketHandler { player.getActionSender().sendPrayers(); return; } - PrayerDef prayer = EntityHandler.getPrayerDef(prayerID); + PrayerDefinition prayer = EntityHandler.getPrayerDef(prayerID); switch (pID) { case 56: if (player.getMaxStat(5) < prayer.getReqLevel()) { diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/SpellHandler.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/SpellHandler.java index 1759044..186301b 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/SpellHandler.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/SpellHandler.java @@ -22,10 +22,6 @@ import org.moparscape.msc.gs.event.ObjectRemover; import org.moparscape.msc.gs.event.WalkMobToMobEvent; import org.moparscape.msc.gs.event.WalkToMobEvent; import org.moparscape.msc.gs.event.WalkToPointEvent; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.ItemSmeltingDef; -import org.moparscape.msc.gs.external.ReqOreDef; -import org.moparscape.msc.gs.external.SpellDef; import org.moparscape.msc.gs.model.GameObject; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Item; @@ -34,6 +30,10 @@ import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.Projectile; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.skill.ItemSmeltingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ReqOreDefinition; +import org.moparscape.msc.gs.model.definition.skill.SpellDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.model.landscape.PathGenerator; import org.moparscape.msc.gs.model.mini.Damage; @@ -76,7 +76,7 @@ public class SpellHandler implements PacketHandler { return true; } - private static boolean checkAndRemoveRunes(Player player, SpellDef spell) { + private static boolean checkAndRemoveRunes(Player player, SpellDefinition spell) { for (Entry e : spell.getRunesRequired()) { boolean skipRune = false; for (InvItem staff : getStaffs(e.getKey())) { @@ -135,7 +135,7 @@ public class SpellHandler implements PacketHandler { private Random r = new Random(); - private void finalizeSpell(Player player, SpellDef spell) { + private void finalizeSpell(Player player, SpellDefinition spell) { player.incExp(6, spell.getExp(), true); player.setLastCast(GameEngine.getTime()); player.getActionSender().sendSound("spellok"); @@ -176,7 +176,7 @@ public class SpellHandler implements PacketHandler { } } - private void handleGroundCast(Player player, SpellDef spell, int id) { + private void handleGroundCast(Player player, SpellDefinition spell, int id) { if (player.isAdmin()) { player.getActionSender().sendMessage("Spellid: " + id); } @@ -227,7 +227,7 @@ public class SpellHandler implements PacketHandler { } } - private void handleInvItemCast(Player player, SpellDef spell, int id, + private void handleInvItemCast(Player player, SpellDefinition spell, int id, InvItem affectedItem) { switch (id) { case 3: // Enchant lvl-1 Sapphire amulet @@ -278,13 +278,13 @@ public class SpellHandler implements PacketHandler { } break; case 21: // Superheat item - ItemSmeltingDef smeltingDef = affectedItem.getSmeltingDef(); + ItemSmeltingDefinition smeltingDef = affectedItem.getSmeltingDef(); if (smeltingDef == null) { player.getActionSender().sendMessage( "This spell cannot be used on this kind of item"); return; } - for (ReqOreDef reqOre : smeltingDef.getReqOres()) { + for (ReqOreDefinition reqOre : smeltingDef.getReqOres()) { if (player.getInventory().countId(reqOre.getId()) < reqOre .getAmount()) { if (affectedItem.getID() == 151) { @@ -314,7 +314,7 @@ public class SpellHandler implements PacketHandler { } InvItem bar = new InvItem(smeltingDef.getBarId()); if (player.getInventory().remove(affectedItem) > -1) { - for (ReqOreDef reqOre : smeltingDef.getReqOres()) { + for (ReqOreDefinition reqOre : smeltingDef.getReqOres()) { for (int i = 0; i < reqOre.getAmount(); i++) { player.getInventory().remove( new InvItem(reqOre.getId())); @@ -408,7 +408,7 @@ public class SpellHandler implements PacketHandler { } } - private void handleItemCast(Player player, final SpellDef spell, + private void handleItemCast(Player player, final SpellDefinition spell, final int id, final Item affectedItem) { player.setStatus(Action.CASTING_GITEM); Instance.getDelayedEventHandler().add( @@ -518,7 +518,7 @@ public class SpellHandler implements PacketHandler { player.resetFollowing(); owner.resetPath(); - SpellDef spell = EntityHandler.getSpellDef(spellID); + SpellDefinition spell = EntityHandler.getSpellDef(spellID); if (!canCast(owner) || affectedMob.getHits() <= 0 || !owner.checkAttack(affectedMob, true) || owner.getStatus() != Action.CASTING_MOB) { @@ -1249,7 +1249,7 @@ public class SpellHandler implements PacketHandler { + "): " + player.getX() + "/" + player.getY())); - SpellDef spell = EntityHandler.getSpellDef(idx); + SpellDefinition spell = EntityHandler.getSpellDef(idx); if (player.getCurStat(6) < spell.getReqLevel()) { player.setSuspiciousPlayer(true); player.getActionSender().sendMessage( @@ -1417,7 +1417,7 @@ public class SpellHandler implements PacketHandler { player.getActionSender().sendStat(6); }// System.out - private void handleTeleport(Player player, SpellDef spell, int id) { + private void handleTeleport(Player player, SpellDefinition spell, int id) { if (player.inCombat()) { return; diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/TradeHandler.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/TradeHandler.java index 9fa3db2..2ed95d9 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/TradeHandler.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/TradeHandler.java @@ -10,11 +10,11 @@ import org.moparscape.msc.gs.connection.Packet; import org.moparscape.msc.gs.connection.RSCPacket; import org.moparscape.msc.gs.core.GameEngine; import org.moparscape.msc.gs.db.DataManager; -import org.moparscape.msc.gs.external.ItemDef; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Inventory; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.entity.ItemDefinition; import org.moparscape.msc.gs.model.landscape.PathGenerator; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; @@ -374,7 +374,7 @@ public class TradeHandler implements PacketHandler { player.setRequiresOfferUpdate(true); continue; } - ItemDef def = tItem.getDef(); + ItemDefinition def = tItem.getDef(); if (!def.canTrade() && !player.isMod()) { player.getActionSender().sendMessage( def.getName() diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/WallObjectAction.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/WallObjectAction.java index 75779fe..91ba59d 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/WallObjectAction.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/WallObjectAction.java @@ -8,14 +8,14 @@ import org.moparscape.msc.gs.connection.RSCPacket; import org.moparscape.msc.gs.core.GameEngine; import org.moparscape.msc.gs.event.ShortEvent; import org.moparscape.msc.gs.event.WalkToPointEvent; -import org.moparscape.msc.gs.external.DoorDef; -import org.moparscape.msc.gs.external.EntityHandler; import org.moparscape.msc.gs.model.ChatMessage; import org.moparscape.msc.gs.model.GameObject; import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.extra.DoorDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.model.snapshot.Activity; import org.moparscape.msc.gs.phandler.PacketHandler; @@ -60,7 +60,7 @@ public class WallObjectAction implements PacketHandler { false) { public void arrived() { owner.resetPath(); - DoorDef def = object.getDoorDef(); + DoorDefinition def = object.getDoorDef(); if (owner.isBusy() || owner.isRanging() || !owner.nextTo(object) || def == null || owner.getStatus() != Action.USING_DOOR) { diff --git a/GameServer/src/org/moparscape/msc/gs/phandler/client/WieldHandler.java b/GameServer/src/org/moparscape/msc/gs/phandler/client/WieldHandler.java index 78a3f3c..14ee345 100644 --- a/GameServer/src/org/moparscape/msc/gs/phandler/client/WieldHandler.java +++ b/GameServer/src/org/moparscape/msc/gs/phandler/client/WieldHandler.java @@ -9,11 +9,11 @@ import org.moparscape.msc.config.Formulae; import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.connection.Packet; import org.moparscape.msc.gs.connection.RSCPacket; -import org.moparscape.msc.gs.external.EntityHandler; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.Script; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.EntityHandler; import org.moparscape.msc.gs.phandler.PacketHandler; import org.moparscape.msc.gs.quest.Quest; import org.moparscape.msc.gs.util.Logger; diff --git a/GameServer/src/org/moparscape/msc/gs/plugins/extras/Thieving.java b/GameServer/src/org/moparscape/msc/gs/plugins/extras/Thieving.java index b26dcec..7215fe7 100644 --- a/GameServer/src/org/moparscape/msc/gs/plugins/extras/Thieving.java +++ b/GameServer/src/org/moparscape/msc/gs/plugins/extras/Thieving.java @@ -8,7 +8,6 @@ import org.moparscape.msc.gs.event.FightEvent; import org.moparscape.msc.gs.event.MiniEvent; import org.moparscape.msc.gs.event.ShortEvent; import org.moparscape.msc.gs.event.WalkToMobEvent; -import org.moparscape.msc.gs.external.GameObjectDef; import org.moparscape.msc.gs.model.Bubble; import org.moparscape.msc.gs.model.ChatMessage; import org.moparscape.msc.gs.model.GameObject; @@ -17,6 +16,7 @@ import org.moparscape.msc.gs.model.Mob; import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Player; import org.moparscape.msc.gs.model.World; +import org.moparscape.msc.gs.model.definition.entity.GameObjectDefinition; import org.moparscape.msc.gs.model.landscape.ActiveTile; import org.moparscape.msc.gs.states.Action; import org.moparscape.msc.gs.util.Logger; @@ -122,7 +122,7 @@ public class Thieving { private int curDoor = -1; // given. private int curStall = -1; - private GameObjectDef def; + private GameObjectDefinition def; // Cur X, Cur Y, New X, New Y, Lvl, Exp private int[][] Doors = { { 586, 581, 585, 581, 10, 13 }, // Nat rune West @@ -1057,11 +1057,11 @@ public class Thieving { } } - public void setDef(GameObjectDef def) { + public void setDef(GameObjectDefinition def) { this.def = def; } - public GameObjectDef getDef() { + public GameObjectDefinition getDef() { return def; } diff --git a/GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java b/GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java index 9ade62e..f5013e6 100644 --- a/GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java +++ b/GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java @@ -5,12 +5,12 @@ import org.moparscape.msc.gs.Instance; import org.moparscape.msc.gs.core.GameEngine; import org.moparscape.msc.gs.event.ShortEvent; import org.moparscape.msc.gs.event.SingleEvent; -import org.moparscape.msc.gs.external.EntityHandler; -import org.moparscape.msc.gs.external.ObjectMiningDef; import org.moparscape.msc.gs.model.Bubble; import org.moparscape.msc.gs.model.GameObject; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Player; +import org.moparscape.msc.gs.model.definition.EntityHandler; +import org.moparscape.msc.gs.model.definition.skill.ObjectMiningDefinition; import org.moparscape.msc.gs.plugins.listeners.ObjectListener; import org.moparscape.msc.gs.tools.DataConversions; @@ -53,7 +53,7 @@ public class Mining implements ObjectListener { return; final GameObject newobject = Instance.getWorld() .getTile(object.getX(), object.getY()).getGameObject(); - final ObjectMiningDef def = EntityHandler.getObjectMiningDef(newobject + final ObjectMiningDefinition def = EntityHandler.getObjectMiningDef(newobject .getID()); if (def == null || def.getRespawnTime() < 1) { owner.getActionSender().sendMessage( diff --git a/GameServer/src/org/moparscape/msc/gs/plugins/quests/ImpCatcher.java b/GameServer/src/org/moparscape/msc/gs/plugins/quests/ImpCatcher.java index 4f7a87c..24c6ee6 100644 --- a/GameServer/src/org/moparscape/msc/gs/plugins/quests/ImpCatcher.java +++ b/GameServer/src/org/moparscape/msc/gs/plugins/quests/ImpCatcher.java @@ -1,9 +1,9 @@ package org.moparscape.msc.gs.plugins.quests; -import org.moparscape.msc.gs.external.EntityHandler; import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Npc; import org.moparscape.msc.gs.model.Player; +import org.moparscape.msc.gs.model.definition.EntityHandler; import org.moparscape.msc.gs.quest.Quest; import org.moparscape.msc.gs.quest.QuestAction; diff --git a/Modules/DataStore/BinaryUsingNIO/src/org/moparscape/msc/gs/persistence/impl/BinaryUsingNIO.java b/Modules/DataStore/BinaryUsingNIO/src/org/moparscape/msc/gs/persistence/impl/BinaryUsingNIO.java index 37153f1..2d73fdf 100644 --- a/Modules/DataStore/BinaryUsingNIO/src/org/moparscape/msc/gs/persistence/impl/BinaryUsingNIO.java +++ b/Modules/DataStore/BinaryUsingNIO/src/org/moparscape/msc/gs/persistence/impl/BinaryUsingNIO.java @@ -11,12 +11,42 @@ import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.Shop; import org.moparscape.msc.gs.model.TelePoint; -import org.moparscape.msc.gs.npchandler.NpcHandlerDef; +import org.moparscape.msc.gs.model.definition.entity.GameObjectDefinition; +import org.moparscape.msc.gs.model.definition.entity.GameObjectLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCLocationDefinition; +import org.moparscape.msc.gs.model.definition.extra.CerterDefinition; +import org.moparscape.msc.gs.model.definition.extra.DoorDefinition; +import org.moparscape.msc.gs.model.definition.extra.TileDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityCourseDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityDefinition; +import org.moparscape.msc.gs.model.definition.skill.FiremakingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemArrowHeadDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemBowStringDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCookingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCraftingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemDartTipDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemGemDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbSecondDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemLogCutDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmeltingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmithingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemUnIdentHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemWieldableDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectFishingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectMiningDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectWoodcuttingDefinition; +import org.moparscape.msc.gs.model.definition.skill.PrayerDefinition; +import org.moparscape.msc.gs.model.definition.skill.SpellDefinition; +import org.moparscape.msc.gs.npchandler.NpcHandlerDefinition; import org.moparscape.msc.gs.persistence.DataStore; import org.moparscape.msc.gs.persistence.impl.bun.CodecLookupService; import org.moparscape.msc.gs.persistence.impl.bun.FileLookupService; import org.moparscape.msc.gs.persistence.impl.bun.IO; -import org.moparscape.msc.gs.phandler.PacketHandlerDef; +import org.moparscape.msc.gs.phandler.PacketHandlerDefinition; @ThreadSafe public class BinaryUsingNIO implements DataStore { @@ -26,39 +56,39 @@ public class BinaryUsingNIO implements DataStore { } @Override - public PacketHandlerDef[] loadPacketHandlerDefs() throws Exception { - String cls = PacketHandlerDef.class.getName(); + public PacketHandlerDefinition[] loadPacketHandlerDefs() throws Exception { + String cls = PacketHandlerDefinition.class.getName(); File f = FileLookupService.lookup(cls); - return (PacketHandlerDef[]) CodecLookupService.lookup(cls).decode(IO.read(f)); + return (PacketHandlerDefinition[]) CodecLookupService.lookup(cls).decode(IO.read(f)); } @Override - public void savePacketHandlerDefs(PacketHandlerDef[] defs) throws Exception { + public void savePacketHandlerDefs(PacketHandlerDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public PacketHandlerDef[] loadLSPacketHandlerDefs() throws Exception { + public PacketHandlerDefinition[] loadLSPacketHandlerDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveLSPacketHandlerDefs(PacketHandlerDef[] defs) + public void saveLSPacketHandlerDefs(PacketHandlerDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public NpcHandlerDef[] loadNpcHandlers() throws Exception { + public NpcHandlerDefinition[] loadNpcHandlers() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveNpcHandlers(NpcHandlerDef[] defs) throws Exception { + public void saveNpcHandlers(NpcHandlerDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @@ -88,236 +118,236 @@ public class BinaryUsingNIO implements DataStore { } @Override - public Map loadCerterDefs() throws Exception { + public Map loadCerterDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveCerterDefs(Map certers) + public void saveCerterDefs(Map certers) throws Exception { // TODO Auto-generated method stub } @Override - public List loadGameObjectLocs() throws Exception { + public List loadGameObjectLocs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveGameObjectLocs(List locs) throws Exception { + public void saveGameObjectLocs(List locs) throws Exception { // TODO Auto-generated method stub } @Override - public List loadItemLocs() throws Exception { + public List loadItemLocs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemLocs(List locs) throws Exception { + public void saveItemLocs(List locs) throws Exception { // TODO Auto-generated method stub } @Override - public List loadNPCLocs() throws Exception { + public List loadNPCLocs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveNPCLocs(List locs) throws Exception { + public void saveNPCLocs(List locs) throws Exception { // TODO Auto-generated method stub } @Override - public TileDef[] loadTileDefs() throws Exception { + public TileDefinition[] loadTileDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveTileDefs(TileDef[] defs) throws Exception { + public void saveTileDefs(TileDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public GameObjectDef[] loadGameObjectDefs() throws Exception { + public GameObjectDefinition[] loadGameObjectDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveGameObjectDefs(GameObjectDef[] defs) throws Exception { + public void saveGameObjectDefs(GameObjectDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public DoorDef[] loadDoorDefs() throws Exception { + public DoorDefinition[] loadDoorDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveDoorDefs(DoorDef[] defs) throws Exception { + public void saveDoorDefs(DoorDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public ItemDef[] loadItemDefs() throws Exception { + public ItemDefinition[] loadItemDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemDefs(ItemDef[] defs) throws Exception { + public void saveItemDefs(ItemDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public PrayerDef[] loadPrayerDefs() throws Exception { + public PrayerDefinition[] loadPrayerDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void savePrayerDefs(PrayerDef[] defs) throws Exception { + public void savePrayerDefs(PrayerDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public SpellDef[] loadSpellDefs() throws Exception { + public SpellDefinition[] loadSpellDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveSpellDefs(SpellDef[] defs) throws Exception { + public void saveSpellDefs(SpellDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public NPCDef[] loadNPCDefs() throws Exception { + public NPCDefinition[] loadNPCDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveNPCDefs(NPCDef[] defs) throws Exception { + public void saveNPCDefs(NPCDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public ItemCraftingDef[] loadItemCraftingDefs() throws Exception { + public ItemCraftingDefinition[] loadItemCraftingDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemCraftingDefs(ItemCraftingDef[] defs) throws Exception { + public void saveItemCraftingDefs(ItemCraftingDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public ItemHerbSecond[] loadItemHerbSeconds() throws Exception { + public ItemHerbSecondDefinition[] loadItemHerbSeconds() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemHerbSeconds(ItemHerbSecond[] seconds) throws Exception { + public void saveItemHerbSeconds(ItemHerbSecondDefinition[] seconds) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadItemDartTipDefs() throws Exception { + public Map loadItemDartTipDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemDartTipDefs(Map defs) + public void saveItemDartTipDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadGemDefs() throws Exception { + public Map loadGemDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveGemDefs(Map defs) throws Exception { + public void saveGemDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadItemLogCutDefs() throws Exception { + public Map loadItemLogCutDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemLogCutDefs(Map defs) + public void saveItemLogCutDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadItemBowStringDefs() + public Map loadItemBowStringDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemBowStringDefs(Map defs) + public void saveItemBowStringDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadItemArrowHeadDefs() + public Map loadItemArrowHeadDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemArrowHeadDefs(Map defs) + public void saveItemArrowHeadDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadFiremakingDefs() throws Exception { + public Map loadFiremakingDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveFiremakingDefs(Map defs) + public void saveFiremakingDefs(Map defs) throws Exception { // TODO Auto-generated method stub @@ -337,41 +367,41 @@ public class BinaryUsingNIO implements DataStore { } @Override - public Map loadItemWieldableDefs() + public Map loadItemWieldableDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemWieldableDefs(Map defs) + public void saveItemWieldableDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadItemUnIdentHerbDefs() + public Map loadItemUnIdentHerbDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemUnIdentHerbDefs(Map defs) + public void saveItemUnIdentHerbDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadItemHerbDefs() throws Exception { + public Map loadItemHerbDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemHerbDefs(Map defs) + public void saveItemHerbDefs(Map defs) throws Exception { // TODO Auto-generated method stub @@ -391,60 +421,60 @@ public class BinaryUsingNIO implements DataStore { } @Override - public Map loadItemCookingDefs() throws Exception { + public Map loadItemCookingDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemCookingDefs(Map defs) + public void saveItemCookingDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadItemSmeltingDefs() + public Map loadItemSmeltingDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemSmeltingDefs(Map defs) + public void saveItemSmeltingDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public ItemSmithingDef[] loadItemSmithingDefs() throws Exception { + public ItemSmithingDefinition[] loadItemSmithingDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveItemSmithingDefs(ItemSmithingDef[] defs) throws Exception { + public void saveItemSmithingDefs(ItemSmithingDefinition[] defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadObjectMiningDefs() + public Map loadObjectMiningDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveObjectMiningDefs(Map defs) + public void saveObjectMiningDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadObjectWoodcuttingDefs() + public Map loadObjectWoodcuttingDefs() throws Exception { // TODO Auto-generated method stub return null; @@ -452,20 +482,20 @@ public class BinaryUsingNIO implements DataStore { @Override public void saveObjectWoodcuttingDefs( - Map defs) throws Exception { + Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadObjectFishDefs() + public Map loadObjectFishDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveObjectFishingDefs(Map defs) + public void saveObjectFishingDefs(Map defs) throws Exception { // TODO Auto-generated method stub @@ -485,26 +515,26 @@ public class BinaryUsingNIO implements DataStore { } @Override - public Map loadAgilityDefs() throws Exception { + public Map loadAgilityDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveAgilityDefs(Map defs) throws Exception { + public void saveAgilityDefs(Map defs) throws Exception { // TODO Auto-generated method stub } @Override - public Map loadAgilityCourseDefs() + public Map loadAgilityCourseDefs() throws Exception { // TODO Auto-generated method stub return null; } @Override - public void saveAgilityCourseDef(Map defs) + public void saveAgilityCourseDef(Map defs) throws Exception { // TODO Auto-generated method stub @@ -523,7 +553,7 @@ public class BinaryUsingNIO implements DataStore { } @Override - public Map loadDartTips() throws Exception { + public Map loadDartTips() throws Exception { // TODO Auto-generated method stub return null; } diff --git a/Modules/DataStore/BinaryUsingNIO/src/org/moparscape/msc/gs/persistence/impl/bun/codec/NpcDefCodec.java b/Modules/DataStore/BinaryUsingNIO/src/org/moparscape/msc/gs/persistence/impl/bun/codec/NpcDefCodec.java index 5c03bc3..be7219c 100644 --- a/Modules/DataStore/BinaryUsingNIO/src/org/moparscape/msc/gs/persistence/impl/bun/codec/NpcDefCodec.java +++ b/Modules/DataStore/BinaryUsingNIO/src/org/moparscape/msc/gs/persistence/impl/bun/codec/NpcDefCodec.java @@ -2,19 +2,19 @@ package org.moparscape.msc.gs.persistence.impl.bun.codec; import java.nio.ByteBuffer; -import org.moparscape.msc.gs.external.NPCDef; +import org.moparscape.msc.gs.model.definition.entity.NPCDefinition; import org.moparscape.msc.gs.persistence.impl.bun.ByteBufferUtil; import org.moparscape.msc.gs.persistence.impl.bun.Codec; -public class NpcDefCodec implements Codec { +public class NpcDefCodec implements Codec { @Override - public ByteBuffer encode(NPCDef[] t) { + public ByteBuffer encode(NPCDefinition[] t) { return null; } - private ByteBuffer encode(NPCDef d) { + private ByteBuffer encode(NPCDefinition d) { ByteBuffer buf = ByteBuffer.allocate(d.getName().length() + 1 + d.getDescription().length() + 1 + d.getCommand().length() + 2 + 4 * 2 + 2 + 13 + 8 + 8); ByteBufferUtil.putString(buf, d.getName()); @@ -25,7 +25,7 @@ public class NpcDefCodec implements Codec { } @Override - public NPCDef[] decode(ByteBuffer buf) { + public NPCDefinition[] decode(ByteBuffer buf) { // TODO Auto-generated method stub return null; } diff --git a/Modules/DataStore/XMLUsingXStream/src/org/moparscape/msc/gs/persistence/impl/XMLUsingXStream.java b/Modules/DataStore/XMLUsingXStream/src/org/moparscape/msc/gs/persistence/impl/XMLUsingXStream.java index 0a53727..87bb916 100644 --- a/Modules/DataStore/XMLUsingXStream/src/org/moparscape/msc/gs/persistence/impl/XMLUsingXStream.java +++ b/Modules/DataStore/XMLUsingXStream/src/org/moparscape/msc/gs/persistence/impl/XMLUsingXStream.java @@ -24,9 +24,39 @@ import org.moparscape.msc.gs.model.InvItem; import org.moparscape.msc.gs.model.Point; import org.moparscape.msc.gs.model.Shop; import org.moparscape.msc.gs.model.TelePoint; -import org.moparscape.msc.gs.npchandler.NpcHandlerDef; +import org.moparscape.msc.gs.model.definition.entity.GameObjectDefinition; +import org.moparscape.msc.gs.model.definition.entity.GameObjectLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemDefinition; +import org.moparscape.msc.gs.model.definition.entity.ItemLocationDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCDefinition; +import org.moparscape.msc.gs.model.definition.entity.NPCLocationDefinition; +import org.moparscape.msc.gs.model.definition.extra.CerterDefinition; +import org.moparscape.msc.gs.model.definition.extra.DoorDefinition; +import org.moparscape.msc.gs.model.definition.extra.TileDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityCourseDefinition; +import org.moparscape.msc.gs.model.definition.skill.AgilityDefinition; +import org.moparscape.msc.gs.model.definition.skill.FiremakingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemArrowHeadDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemBowStringDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCookingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemCraftingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemDartTipDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemGemDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemHerbSecondDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemLogCutDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmeltingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemSmithingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemUnIdentHerbDefinition; +import org.moparscape.msc.gs.model.definition.skill.ItemWieldableDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectFishingDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectMiningDefinition; +import org.moparscape.msc.gs.model.definition.skill.ObjectWoodcuttingDefinition; +import org.moparscape.msc.gs.model.definition.skill.PrayerDefinition; +import org.moparscape.msc.gs.model.definition.skill.SpellDefinition; +import org.moparscape.msc.gs.npchandler.NpcHandlerDefinition; import org.moparscape.msc.gs.persistence.DataStore; -import org.moparscape.msc.gs.phandler.PacketHandlerDef; +import org.moparscape.msc.gs.phandler.PacketHandlerDefinition; import org.moparscape.msc.gs.util.Logger; import com.thoughtworks.xstream.XStream; @@ -107,18 +137,18 @@ public class XMLUsingXStream implements DataStore { } @Override - public PacketHandlerDef[] loadPacketHandlerDefs() { - return (PacketHandlerDef[]) load("PacketHandlers.xml"); + public PacketHandlerDefinition[] loadPacketHandlerDefs() { + return (PacketHandlerDefinition[]) load("PacketHandlers.xml"); } @Override - public PacketHandlerDef[] loadLSPacketHandlerDefs() { - return (PacketHandlerDef[]) load("LSPacketHandlers.xml"); + public PacketHandlerDefinition[] loadLSPacketHandlerDefs() { + return (PacketHandlerDefinition[]) load("LSPacketHandlers.xml"); } @Override - public NpcHandlerDef[] loadNpcHandlers() { - return (NpcHandlerDef[]) load("NpcHandlers.xml"); + public NpcHandlerDefinition[] loadNpcHandlers() { + return (NpcHandlerDefinition[]) load("NpcHandlers.xml"); } @Override @@ -132,98 +162,98 @@ public class XMLUsingXStream implements DataStore { } @Override - public Map loadCerterDefs() { - return (Map) load("defs/extras/NpcCerters.xml.gz"); + public Map loadCerterDefs() { + return (Map) load("defs/extras/NpcCerters.xml.gz"); } @Override - public List loadGameObjectLocs() { - return (List) load("locs/GameObjectLoc.xml.gz"); + public List loadGameObjectLocs() { + return (List) load("locs/GameObjectLoc.xml.gz"); } @Override - public List loadItemLocs() { - return (List) load("locs/ItemLoc.xml.gz"); + public List loadItemLocs() { + return (List) load("locs/ItemLoc.xml.gz"); } @Override - public List loadNPCLocs() { - return (List) load("locs/NpcLoc.xml.gz"); + public List loadNPCLocs() { + return (List) load("locs/NpcLoc.xml.gz"); } @Override - public TileDef[] loadTileDefs() { - return (TileDef[]) load("defs/TileDef.xml.gz"); + public TileDefinition[] loadTileDefs() { + return (TileDefinition[]) load("defs/TileDef.xml.gz"); } @Override - public GameObjectDef[] loadGameObjectDefs() { - return (GameObjectDef[]) load("defs/GameObjectDef.xml.gz"); + public GameObjectDefinition[] loadGameObjectDefs() { + return (GameObjectDefinition[]) load("defs/GameObjectDef.xml.gz"); } @Override - public DoorDef[] loadDoorDefs() { - return (DoorDef[]) load("defs/DoorDef.xml.gz"); + public DoorDefinition[] loadDoorDefs() { + return (DoorDefinition[]) load("defs/DoorDef.xml.gz"); } @Override - public ItemDef[] loadItemDefs() { - return (ItemDef[]) load("defs/ItemDef.xml.gz"); + public ItemDefinition[] loadItemDefs() { + return (ItemDefinition[]) load("defs/ItemDef.xml.gz"); } @Override - public PrayerDef[] loadPrayerDefs() { - return (PrayerDef[]) load("defs/PrayerDef.xml.gz"); + public PrayerDefinition[] loadPrayerDefs() { + return (PrayerDefinition[]) load("defs/PrayerDef.xml.gz"); } @Override - public SpellDef[] loadSpellDefs() { - return (SpellDef[]) load("defs/SpellDef.xml.gz"); + public SpellDefinition[] loadSpellDefs() { + return (SpellDefinition[]) load("defs/SpellDef.xml.gz"); } @Override - public NPCDef[] loadNPCDefs() { - return (NPCDef[]) load("defs/NPCDef.xml.gz"); + public NPCDefinition[] loadNPCDefs() { + return (NPCDefinition[]) load("defs/NPCDef.xml.gz"); } @Override - public ItemCraftingDef[] loadItemCraftingDefs() { - return (ItemCraftingDef[]) load("defs/extras/ItemCraftingDef.xml.gz"); + public ItemCraftingDefinition[] loadItemCraftingDefs() { + return (ItemCraftingDefinition[]) load("defs/extras/ItemCraftingDef.xml.gz"); } @Override - public ItemHerbSecond[] loadItemHerbSeconds() { - return (ItemHerbSecond[]) load("defs/extras/ItemHerbSecond.xml.gz"); + public ItemHerbSecondDefinition[] loadItemHerbSeconds() { + return (ItemHerbSecondDefinition[]) load("defs/extras/ItemHerbSecond.xml.gz"); } @Override - public Map loadItemDartTipDefs() { - return (Map) load("defs/extras/ItemDartTipDef.xml.gz"); + public Map loadItemDartTipDefs() { + return (Map) load("defs/extras/ItemDartTipDef.xml.gz"); } @Override - public Map loadGemDefs() { - return (Map) load("defs/extras/ItemGemDef.xml.gz"); + public Map loadGemDefs() { + return (Map) load("defs/extras/ItemGemDef.xml.gz"); } @Override - public Map loadItemLogCutDefs() { - return (Map) load("defs/extras/ItemLogCutDef.xml.gz"); + public Map loadItemLogCutDefs() { + return (Map) load("defs/extras/ItemLogCutDef.xml.gz"); } @Override - public Map loadItemBowStringDefs() { - return (Map) load("defs/extras/ItemBowStringDef.xml.gz"); + public Map loadItemBowStringDefs() { + return (Map) load("defs/extras/ItemBowStringDef.xml.gz"); } @Override - public Map loadItemArrowHeadDefs() { - return (Map) load("defs/extras/ItemArrowHeadDef.xml.gz"); + public Map loadItemArrowHeadDefs() { + return (Map) load("defs/extras/ItemArrowHeadDef.xml.gz"); } @Override - public Map loadFiremakingDefs() { - return (Map) load("defs/extras/FiremakingDef.xml.gz"); + public Map loadFiremakingDefs() { + return (Map) load("defs/extras/FiremakingDef.xml.gz"); } @Override @@ -232,18 +262,18 @@ public class XMLUsingXStream implements DataStore { } @Override - public Map loadItemWieldableDefs() { - return (Map) load("defs/extras/ItemWieldableDef.xml.gz"); + public Map loadItemWieldableDefs() { + return (Map) load("defs/extras/ItemWieldableDef.xml.gz"); } @Override - public Map loadItemUnIdentHerbDefs() { - return (Map) load("defs/extras/ItemUnIdentHerbDef.xml.gz"); + public Map loadItemUnIdentHerbDefs() { + return (Map) load("defs/extras/ItemUnIdentHerbDef.xml.gz"); } @Override - public Map loadItemHerbDefs() { - return (Map) load("defs/extras/ItemHerbDef.xml.gz"); + public Map loadItemHerbDefs() { + return (Map) load("defs/extras/ItemHerbDef.xml.gz"); } @Override @@ -252,33 +282,33 @@ public class XMLUsingXStream implements DataStore { } @Override - public Map loadItemCookingDefs() { - return (Map) load("defs/extras/ItemCookingDef.xml.gz"); + public Map loadItemCookingDefs() { + return (Map) load("defs/extras/ItemCookingDef.xml.gz"); } @Override - public Map loadItemSmeltingDefs() { - return (Map) load("defs/extras/ItemSmeltingDef.xml.gz"); + public Map loadItemSmeltingDefs() { + return (Map) load("defs/extras/ItemSmeltingDef.xml.gz"); } @Override - public ItemSmithingDef[] loadItemSmithingDefs() { - return (ItemSmithingDef[]) load("defs/extras/ItemSmithingDef.xml.gz"); + public ItemSmithingDefinition[] loadItemSmithingDefs() { + return (ItemSmithingDefinition[]) load("defs/extras/ItemSmithingDef.xml.gz"); } @Override - public Map loadObjectMiningDefs() { - return (Map) load("defs/extras/ObjectMining.xml.gz"); + public Map loadObjectMiningDefs() { + return (Map) load("defs/extras/ObjectMining.xml.gz"); } @Override - public Map loadObjectWoodcuttingDefs() { - return (Map) load("defs/extras/ObjectWoodcutting.xml.gz"); + public Map loadObjectWoodcuttingDefs() { + return (Map) load("defs/extras/ObjectWoodcutting.xml.gz"); } @Override - public Map loadObjectFishDefs() { - return (Map) load("defs/extras/ObjectFishing.xml.gz"); + public Map loadObjectFishDefs() { + return (Map) load("defs/extras/ObjectFishing.xml.gz"); } @Override @@ -287,13 +317,13 @@ public class XMLUsingXStream implements DataStore { } @Override - public Map loadAgilityDefs() { - return (Map) load("defs/extras/AgilityDef.xml.gz"); + public Map loadAgilityDefs() { + return (Map) load("defs/extras/AgilityDef.xml.gz"); } @Override - public Map loadAgilityCourseDefs() { - return (Map) load("defs/extras/AgilityCourseDef.xml.gz"); + public Map loadAgilityCourseDefs() { + return (Map) load("defs/extras/AgilityCourseDef.xml.gz"); } @Override @@ -302,8 +332,8 @@ public class XMLUsingXStream implements DataStore { } @Override - public Map loadDartTips() { - return (HashMap) load("defs/extras/ItemDartTipDef.xml.gz"); + public Map loadDartTips() { + return (HashMap) load("defs/extras/ItemDartTipDef.xml.gz"); } @Override @@ -312,18 +342,18 @@ public class XMLUsingXStream implements DataStore { } @Override - public void savePacketHandlerDefs(PacketHandlerDef[] defs) throws Exception { + public void savePacketHandlerDefs(PacketHandlerDefinition[] defs) throws Exception { write("PacketHandlers.xml", defs); } @Override - public void saveLSPacketHandlerDefs(PacketHandlerDef[] defs) + public void saveLSPacketHandlerDefs(PacketHandlerDefinition[] defs) throws Exception { write("LSPacketHanlders.xml", defs); } @Override - public void saveNpcHandlers(NpcHandlerDef[] defs) throws Exception { + public void saveNpcHandlers(NpcHandlerDefinition[] defs) throws Exception { write("NpcHandlers.xml", defs); } @@ -338,102 +368,102 @@ public class XMLUsingXStream implements DataStore { } @Override - public void saveCerterDefs(Map certers) + public void saveCerterDefs(Map certers) throws Exception { write("defs/extras/NpcCerters.xml.gz", certers); } @Override - public void saveGameObjectLocs(List locs) throws Exception { + public void saveGameObjectLocs(List locs) throws Exception { write("locs/GameObjectLocs.xml.gz", locs); } @Override - public void saveItemLocs(List locs) throws Exception { + public void saveItemLocs(List locs) throws Exception { write("locs/ItemLoc.xml.gz", locs); } @Override - public void saveNPCLocs(List locs) throws Exception { + public void saveNPCLocs(List locs) throws Exception { write("locs/NpcLoc.xml.gz", locs); } @Override - public void saveTileDefs(TileDef[] defs) throws Exception { + public void saveTileDefs(TileDefinition[] defs) throws Exception { write("defs/TileDef.xml.gz", defs); } @Override - public void saveGameObjectDefs(GameObjectDef[] defs) throws Exception { + public void saveGameObjectDefs(GameObjectDefinition[] defs) throws Exception { write("defs/GameObjectDef.xml.gz", defs); } @Override - public void saveDoorDefs(DoorDef[] defs) throws Exception { + public void saveDoorDefs(DoorDefinition[] defs) throws Exception { write("defs/DoorDef.xml.gz", defs); } @Override - public void saveItemDefs(ItemDef[] defs) throws Exception { + public void saveItemDefs(ItemDefinition[] defs) throws Exception { write("defs/ItemDef.xml.gz", defs); } @Override - public void savePrayerDefs(PrayerDef[] defs) throws Exception { + public void savePrayerDefs(PrayerDefinition[] defs) throws Exception { write("defs/PrayerDef.xml.gz", defs); } @Override - public void saveSpellDefs(SpellDef[] defs) throws Exception { + public void saveSpellDefs(SpellDefinition[] defs) throws Exception { write("defs/SpellDef.xml.gz", defs); } @Override - public void saveNPCDefs(NPCDef[] defs) throws Exception { + public void saveNPCDefs(NPCDefinition[] defs) throws Exception { write("defs/NPCDef.xml.gz", defs); } @Override - public void saveItemCraftingDefs(ItemCraftingDef[] defs) throws Exception { + public void saveItemCraftingDefs(ItemCraftingDefinition[] defs) throws Exception { write("defs/extras/ItemCraftingDef.xml.gz", defs); } @Override - public void saveItemHerbSeconds(ItemHerbSecond[] seconds) throws Exception { + public void saveItemHerbSeconds(ItemHerbSecondDefinition[] seconds) throws Exception { write("defs/extras/ItemHerbSecond.xml.gz", seconds); } @Override - public void saveItemDartTipDefs(Map defs) + public void saveItemDartTipDefs(Map defs) throws Exception { write("defs/extras/ItemDartTipDef.xml.gz", defs); } @Override - public void saveGemDefs(Map defs) throws Exception { + public void saveGemDefs(Map defs) throws Exception { write("def/extras/ItemGemDef.xml.gz", defs); } @Override - public void saveItemLogCutDefs(Map defs) + public void saveItemLogCutDefs(Map defs) throws Exception { write("def/extras/ItemLogCutDefs.xml.gz", defs); } @Override - public void saveItemBowStringDefs(Map defs) + public void saveItemBowStringDefs(Map defs) throws Exception { write("defs/extras/ItemBowStringDef.xml.gz", defs); } @Override - public void saveItemArrowHeadDefs(Map defs) + public void saveItemArrowHeadDefs(Map defs) throws Exception { write("defs/extras/ItemArrowHeadDef.xml.gz", defs); } @Override - public void saveFiremakingDefs(Map defs) + public void saveFiremakingDefs(Map defs) throws Exception { write("defs/extras/FiremakingDef.xml.gz", defs); } @@ -445,19 +475,19 @@ public class XMLUsingXStream implements DataStore { } @Override - public void saveItemWieldableDefs(Map defs) + public void saveItemWieldableDefs(Map defs) throws Exception { write("defs/extras/ItemWieldableDef.xml.gz", defs); } @Override - public void saveItemUnIdentHerbDefs(Map defs) + public void saveItemUnIdentHerbDefs(Map defs) throws Exception { write("defs/extras/Item.UnIdentHerbDef.xml.gz", defs); } @Override - public void saveItemHerbDefs(Map defs) + public void saveItemHerbDefs(Map defs) throws Exception { write("defs/extras/ItemHerbDef.xml.gz", defs); } @@ -469,36 +499,36 @@ public class XMLUsingXStream implements DataStore { } @Override - public void saveItemCookingDefs(Map defs) + public void saveItemCookingDefs(Map defs) throws Exception { write("defs/extras/ItemCookingDef.xml.gz", defs); } @Override - public void saveItemSmeltingDefs(Map defs) + public void saveItemSmeltingDefs(Map defs) throws Exception { write("defs/extras/ItemSmeltingDef.xml.gz", defs); } @Override - public void saveItemSmithingDefs(ItemSmithingDef[] defs) throws Exception { + public void saveItemSmithingDefs(ItemSmithingDefinition[] defs) throws Exception { write("defs/extras/ItemSmithingDef.xml.gz", defs); } @Override - public void saveObjectMiningDefs(Map defs) + public void saveObjectMiningDefs(Map defs) throws Exception { write("defs/extras/ObjectMiningDef.xml.gz", defs); } @Override public void saveObjectWoodcuttingDefs( - Map defs) throws Exception { + Map defs) throws Exception { write("defs/extras/ObjectWoodcuttingDef.xml.gz", defs); } @Override - public void saveObjectFishingDefs(Map defs) + public void saveObjectFishingDefs(Map defs) throws Exception { write("defs/extras/ObjectFishingDef.xml.gz", defs); } @@ -510,12 +540,12 @@ public class XMLUsingXStream implements DataStore { } @Override - public void saveAgilityDefs(Map defs) throws Exception { + public void saveAgilityDefs(Map defs) throws Exception { write("defs/extras/AgilityDef.xml.gz", defs); } @Override - public void saveAgilityCourseDef(Map defs) + public void saveAgilityCourseDef(Map defs) throws Exception { write("defs/extras/AgilityCourseDef.xml.gz", defs); }