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 1674d17..93bd9b4 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 @@ -310,4 +310,218 @@ public class XMLUsingXStream implements DataStore { public void dispose() { } + + @Override + public void savePacketHandlerDefs(PacketHandlerDef[] defs) throws Exception { + write("PacketHandlers.xml", defs); + } + + @Override + public void saveLSPacketHandlerDefs(PacketHandlerDef[] defs) + throws Exception { + write("LSPacketHanlders.xml", defs); + } + + @Override + public void saveNpcHandlers(NpcHandlerDef[] defs) throws Exception { + write("NpcHandlers.xml", defs); + } + + @Override + public void saveTelePoints(Map points) throws Exception { + write("locs/extras/ObjectTelePoints.xml.gz", points); + } + + @Override + public void saveShops(List shops) throws Exception { + write("locs/Shops.xml.gz", shops); + } + + @Override + public void saveCerterDefs(Map certers) + throws Exception { + write("defs/extras/NpcCerters.xml.gz", certers); + } + + @Override + public void saveGameObjectLocs(List locs) throws Exception { + write("locs/GameObjectLocs.xml.gz", locs); + } + + @Override + public void saveItemLocs(List locs) throws Exception { + write("locs/ItemLoc.xml.gz", locs); + } + + @Override + public void saveNPCLocs(List locs) throws Exception { + write("locs/NpcLoc.xml.gz", locs); + } + + @Override + public void saveTileDefs(TileDef[] defs) throws Exception { + write("defs/TileDef.xml.gz", defs); + } + + @Override + public void saveGameObjectDefs(GameObjectDef[] defs) throws Exception { + write("defs/GameObjectDef.xml.gz", defs); + } + + @Override + public void saveDoorDefs(DoorDef[] defs) throws Exception { + write("defs/DoorDef.xml.gz", defs); + } + + @Override + public void saveItemDefs(ItemDef[] defs) throws Exception { + write("defs/ItemDef.xml.gz", defs); + } + + @Override + public void savePrayerDefs(PrayerDef[] defs) throws Exception { + write("defs/PrayerDef.xml.gz", defs); + } + + @Override + public void saveSpellDefs(SpellDef[] defs) throws Exception { + write("defs/SpellDef.xml.gz", defs); + } + + @Override + public void saveNPCDefs(NPCDef[] defs) throws Exception { + write("defs/NPCDef.xml.gz", defs); + } + + @Override + public void saveItemCraftingDefs(ItemCraftingDef[] defs) throws Exception { + write("defs/extras/ItemCraftingDef.xml.gz", defs); + } + + @Override + public void saveItemHerbSeconds(ItemHerbSecond[] seconds) throws Exception { + write("defs/extras/ItemHerbSecond.xml.gz", seconds); + } + + @Override + public void saveItemDartTipDefs(Map defs) + throws Exception { + write("defs/extras/ItemDartTipDef.xml.gz", defs); + } + + @Override + public void saveGemDefs(Map defs) throws Exception { + write("def/extras/ItemGemDef.xml.gz", defs); + } + + @Override + public void saveItemLogCutDefs(Map defs) + throws Exception { + write("def/extras/ItemLogCutDefs.xml.gz", defs); + } + + @Override + public void saveItemBowStringDefs(Map defs) + throws Exception { + write("defs/extras/ItemBowStringDef.xml.gz", defs); + } + + @Override + public void saveItemArrowHeadDefs(Map defs) + throws Exception { + write("defs/extras/ItemArrowHeadDef.xml.gz", defs); + } + + @Override + public void saveFiremakingDefs(Map defs) + throws Exception { + write("defs/extras/FiremakingDef.xml.gz", defs); + } + + @Override + public void saveItemAffectedTypes(Map types) + throws Exception { + write("defs/extras/ItemAffectedTypes.xml.gz", types); + } + + @Override + public void saveItemWieldableDefs(Map defs) + throws Exception { + write("defs/extras/ItemWieldableDef.xml.gz", defs); + } + + @Override + public void saveItemUnIdentHerbDefs(Map defs) + throws Exception { + write("defs/extras/Item.UnIdentHerbDef.xml.gz", defs); + } + + @Override + public void saveItemHerbDefs(Map defs) + throws Exception { + write("defs/extras/ItemHerbDef.xml.gz", defs); + } + + @Override + public void saveItemEdibleHeals(Map defs) + throws Exception { + write("defs/extras/ItemEdibleHeals.xml.gz", defs); + } + + @Override + public void saveItemCookingDefs(Map defs) + throws Exception { + write("defs/extras/ItemCookingDef.xml.gz", defs); + } + + @Override + public void saveItemSmeltingDefs(Map defs) + throws Exception { + write("defs/extras/ItemSmeltingDef.xml.gz", defs); + } + + @Override + public void saveItemSmithingDefs(ItemSmithingDef[] defs) throws Exception { + write("defs/extras/ItemSmithingDef.xml.gz", defs); + } + + @Override + public void saveObjectMiningDefs(Map defs) + throws Exception { + write("defs/extras/ObjectMiningDef.xml.gz", defs); + } + + @Override + public void saveObjectWoodcuttingDefs( + Map defs) throws Exception { + write("defs/extras/ObjectWoodcuttingDef.xml.gz", defs); + } + + @Override + public void saveObjectFishingDefs(Map defs) + throws Exception { + write("defs/extras/ObjectFishingDef.xml.gz", defs); + } + + @Override + public void saveSpellAgressiveLevel(Map defs) + throws Exception { + write("defs/extras/SpellAgressiveLvl.xml.gz", defs); + } + + @Override + public void saveAgilityDefs(Map defs) throws Exception { + write("defs/extras/AgilityDef.xml.gz", defs); + } + + @Override + public void saveAgilityCourseDef(Map defs) + throws Exception { + write("defs/extras/AgilityCourseDef.xml.gz", defs); + } + + @Override + public void saveKeyChestLoots(List[] loots) throws Exception { + write("defs/extras/KeyChestLoot.xml.gz", loots); + } } diff --git a/Modules/DataStore/src/org/moparscape/msc/gs/persistence/DataStore.java b/Modules/DataStore/src/org/moparscape/msc/gs/persistence/DataStore.java index 666d47c..d2621e8 100644 --- a/Modules/DataStore/src/org/moparscape/msc/gs/persistence/DataStore.java +++ b/Modules/DataStore/src/org/moparscape/msc/gs/persistence/DataStore.java @@ -16,93 +16,187 @@ import org.moparscape.msc.gs.phandler.PacketHandlerDef; * Any retrieval of unchanging data should be done through this interface. All * implementations should be only accessable by the * org.moparscape.msc.gs.persistence.impl package.
- * Implementations should also use JCIP annotations to specify their degree of thread - * saftey. + * Implementations should also use JCIP annotations to specify their degree of + * thread saftey. * * @author Joe Pritzel * */ public abstract interface DataStore { - public PacketHandlerDef[] loadPacketHandlerDefs(); + public PacketHandlerDef[] loadPacketHandlerDefs() throws Exception; - public PacketHandlerDef[] loadLSPacketHandlerDefs(); + public void savePacketHandlerDefs(PacketHandlerDef[] defs) throws Exception; - public NpcHandlerDef[] loadNpcHandlers(); + public PacketHandlerDef[] loadLSPacketHandlerDefs() throws Exception; - public Map loadTelePoints(); + public void saveLSPacketHandlerDefs(PacketHandlerDef[] defs) + throws Exception; - public List loadShops(); + public NpcHandlerDef[] loadNpcHandlers() throws Exception; - public Map loadCerterDefs(); + public void saveNpcHandlers(NpcHandlerDef[] defs) throws Exception; - public List loadGameObjectLocs(); + public Map loadTelePoints() throws Exception; - public List loadItemLocs(); + public void saveTelePoints(Map points) throws Exception; - public List loadNPCLocs(); + public List loadShops() throws Exception; - public TileDef[] loadTileDefs(); + public void saveShops(List shops) throws Exception; - public GameObjectDef[] loadGameObjectDefs(); + public Map loadCerterDefs() throws Exception; - public DoorDef[] loadDoorDefs(); + public void saveCerterDefs(Map certers) + throws Exception; - public ItemDef[] loadItemDefs(); + public List loadGameObjectLocs() throws Exception; - public PrayerDef[] loadPrayerDefs(); + public void saveGameObjectLocs(List locs) throws Exception; - public SpellDef[] loadSpellDefs(); + public List loadItemLocs() throws Exception; - public NPCDef[] loadNPCDefs(); + public void saveItemLocs(List locs) throws Exception; - public ItemCraftingDef[] loadItemCraftingDefs(); + public List loadNPCLocs() throws Exception; - public ItemHerbSecond[] loadItemHerbSeconds(); + public void saveNPCLocs(List locs) throws Exception; - public Map loadItemDartTipDefs(); + public TileDef[] loadTileDefs() throws Exception; - public Map loadGemDefs(); + public void saveTileDefs(TileDef[] defs) throws Exception; - public Map loadItemLogCutDefs(); + public GameObjectDef[] loadGameObjectDefs() throws Exception; - public Map loadItemBowStringDefs(); + public void saveGameObjectDefs(GameObjectDef[] defs) throws Exception; - public Map loadItemArrowHeadDefs(); + public DoorDef[] loadDoorDefs() throws Exception; - public Map loadFiremakingDefs(); + public void saveDoorDefs(DoorDef[] defs) throws Exception; - public Map loadItemAffectedTypes(); + public ItemDef[] loadItemDefs() throws Exception; - public Map loadItemWieldableDefs(); + public void saveItemDefs(ItemDef[] defs) throws Exception; - public Map loadItemUnIdentHerbDefs(); + public PrayerDef[] loadPrayerDefs() throws Exception; - public Map loadItemHerbDefs(); + public void savePrayerDefs(PrayerDef[] defs) throws Exception; - public Map loadItemEdibleHeals(); + public SpellDef[] loadSpellDefs() throws Exception; - public Map loadItemCookingDefs(); + public void saveSpellDefs(SpellDef[] defs) throws Exception; - public Map loadItemSmeltingDefs(); + public NPCDef[] loadNPCDefs() throws Exception; - public ItemSmithingDef[] loadItemSmithingDefs(); + public void saveNPCDefs(NPCDef[] defs) throws Exception; - public Map loadObjectMiningDefs(); + public ItemCraftingDef[] loadItemCraftingDefs() throws Exception; - public Map loadObjectWoodcuttingDefs(); + public void saveItemCraftingDefs(ItemCraftingDef[] defs) throws Exception; - public Map loadObjectFishDefs(); + public ItemHerbSecond[] loadItemHerbSeconds() throws Exception; - public Map loadSpellAgressiveLevel(); + public void saveItemHerbSeconds(ItemHerbSecond[] seconds) throws Exception; - public Map loadAgilityDefs(); + public Map loadItemDartTipDefs() throws Exception; - public Map loadAgilityCourseDefs(); + public void saveItemDartTipDefs(Map defs) + throws Exception; - public List[] loadKeyChestLoots(); + public Map loadGemDefs() throws Exception; - public HashMap loadDartTips(); + public void saveGemDefs(Map defs) throws Exception; + + public Map loadItemLogCutDefs() throws Exception; + + public void saveItemLogCutDefs(Map defs) + throws Exception; + + public Map loadItemBowStringDefs() + throws Exception; + + public void saveItemBowStringDefs(Map defs) + throws Exception; + + public Map loadItemArrowHeadDefs() + throws Exception; + + public void saveItemArrowHeadDefs(Map defs) + throws Exception; + + public Map loadFiremakingDefs() throws Exception; + + public void saveFiremakingDefs(Map defs) + throws Exception; + + public Map loadItemAffectedTypes() throws Exception; + + public void saveItemAffectedTypes(Map types) throws Exception; + + public Map loadItemWieldableDefs() + throws Exception; + + public void saveItemWieldableDefs(Map defs) throws Exception; + + public Map loadItemUnIdentHerbDefs() + throws Exception; + + public void saveItemUnIdentHerbDefs(Map defs) throws Exception; + + public Map loadItemHerbDefs() 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 void saveItemCookingDefs(Map defs) throws Exception; + + public Map loadItemSmeltingDefs() + throws Exception; + + public void saveItemSmeltingDefs(Map defs) throws Exception; + + public ItemSmithingDef[] loadItemSmithingDefs() throws Exception; + + public void saveItemSmithingDefs(ItemSmithingDef[] defs) throws Exception; + + public Map loadObjectMiningDefs() + throws Exception; + + public void saveObjectMiningDefs(Map defs) throws Exception; + + public Map loadObjectWoodcuttingDefs() + throws Exception; + + public void saveObjectWoodcuttingDefs(Map defs) throws Exception; + + public Map loadObjectFishDefs() + 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 void saveAgilityDefs(Map defs) throws Exception; + + public Map loadAgilityCourseDefs() + throws Exception; + + public void saveAgilityCourseDef(Map defs) throws Exception; + + public List[] loadKeyChestLoots() throws Exception; + + public void saveKeyChestLoots(List[] loots) throws Exception; + + public HashMap loadDartTips() throws Exception; public void dispose();