Пример #1
0
        public void SaveQuests()
        {
            if (Quests.LoadingFailed)
            {
                return;
            }

            CreateBackupDirectory();

            SHQuestStringSaver stringSaver = new SHQuestStringSaver();

            stringSaver.Save(Quests, ref LocalXml.QuestString);


            // Backup
            File.Copy(SHGlobal.GetServerSystemFolder() + "\\quest.xml", Directory.GetCurrentDirectory() + "\\Backup\\quest." + DateTime.Now.ToString("yy-MM-dd-HHmmss") + ".xml", true);


            // Save
            SHQuestStringReplacer replacer = new SHQuestStringReplacer();

            replacer.ReplaceStringToKey(ref Quests);

            SHGlobal.Serialize <SHQuestsXml>(SHGlobal.GetClientSystemFolder() + "\\quest.xml", Quests, Encoding.UTF8);
            SHGlobal.Serialize <SHQuestsXml>(SHGlobal.GetServerSystemFolder() + "\\quest.xml", Quests, Encoding.UTF8);

            // 복구
            replacer.ReplaceKeyToString(ref Quests, ref LocalXml.QuestString, false);
        }
Пример #2
0
        public void LoadItems()
        {
            Items = SHGlobal.Deserialize <SHItemsXml>(SHGlobal.GetServerSystemFolder() + "\\xitem.xml", Encoding.UTF8);
            if (Items == null)
            {
                Items = new SHItemsXml();
                Items.LoadingFail();
            }

            foreach (SHItem item in Items.dataList)
            {
                string szKey = "ITEM_NAME_" + item.id.ToString();

                if (LocalXml.ItemNameString.IsValid(szKey))
                {
                    string szValue = LocalXml.ItemNameString[szKey].ToString();
                    item.name = szValue;
                }

                szKey = "ITEM_DESC_" + item.id.ToString();

                if (LocalXml.ItemNameString.IsValid(szKey))
                {
                    string szValue = LocalXml.ItemNameString[szKey].ToString();
                    item.desc = szValue;
                }
            }

            Items.Compile();
        }
Пример #3
0
 public void LoadItemConditions()
 {
     ItemConditions = SHGlobal.Deserialize <SHConditionsXml>(SHGlobal.GetServerSystemFolder() + "\\conditions_item.xml", Encoding.UTF8);
     if (ItemConditions == null)
     {
         ItemConditions = new SHConditionsXml();
         ItemConditions.LoadingFail();
     }
     ItemConditions.Compile();
 }
Пример #4
0
 public bool LoadLootings()
 {
     Lootings = SHGlobal.Deserialize <SHLootingsXml>(SHGlobal.GetServerSystemFolder() + "\\loot.xml", Encoding.UTF8);
     if (Lootings == null)
     {
         Lootings = new SHLootingsXml();
         Lootings.LoadingFail();
     }
     return(Lootings.Compile());
 }
Пример #5
0
        public void SaveLootings()
        {
            if (Lootings.LoadingFailed)
            {
                return;
            }

            CreateBackupDirectory();
            // Backup
            File.Copy(SHGlobal.GetServerSystemFolder() + "\\loot.xml", Directory.GetCurrentDirectory() + "\\Backup\\loot." + DateTime.Now.ToString("yy-MM-dd-HHmmss") + ".xml", true);
            // Save
            SHGlobal.Serialize <SHLootingsXml>(SHGlobal.GetServerSystemFolder() + "\\loot.xml", Lootings, Encoding.UTF8);
        }
Пример #6
0
        public void SaveItemConditions()
        {
            if (ItemConditions.LoadingFailed)
            {
                return;
            }

            CreateBackupDirectory();
            // Backup
            File.Copy(SHGlobal.GetServerSystemFolder() + "\\conditions_item.xml", Directory.GetCurrentDirectory() + "\\Backup\\conditions_item." + DateTime.Now.ToString("yy-MM-dd-HHmmss") + ".xml", true);
            // Save
            SHGlobal.Serialize <SHConditionsXml>(SHGlobal.GetClientSystemFolder() + "\\conditions_item.xml", ItemConditions, Encoding.UTF8);
            SHGlobal.Serialize <SHConditionsXml>(SHGlobal.GetServerSystemFolder() + "\\conditions_item.xml", ItemConditions, Encoding.UTF8);
        }
Пример #7
0
        public void LoadQuests()
        {
            Quests = SHGlobal.Deserialize <SHQuestsXml>(SHGlobal.GetServerSystemFolder() + "\\quest.xml", Encoding.UTF8);
            if (Quests == null)
            {
                Quests = new SHQuestsXml();
                Quests.LoadingFail();
            }

            SHQuestStringReplacer replacer = new SHQuestStringReplacer();

            replacer.ReplaceKeyToString(ref Quests, ref LocalXml.QuestString, true);

            Quests.Compile();
        }
Пример #8
0
        public void LoadDialogs()
        {
            Dialogs = SHGlobal.Deserialize <SHDialogsXml>(SHGlobal.GetServerSystemFolder() + "\\dialog.xml", Encoding.UTF8);
            if (Dialogs == null)
            {
                Dialogs = new SHDialogsXml();
                Dialogs.LoadingFail();
            }

            SHDialogStringReplacer replacer = new SHDialogStringReplacer();

            replacer.ReplaceKeyToString(ref Dialogs, ref LocalXml.DialogString, true);

            Dialogs.Compile();
        }
Пример #9
0
        public bool LoadNPCs()
        {
            NPCs = SHGlobal.Deserialize <SHNPCsXml>(SHGlobal.GetServerSystemFolder() + "\\npc.xml", Encoding.UTF8);
            if (NPCs == null)
            {
                NPCs = new SHNPCsXml();
                NPCs.LoadingFail();
            }

            foreach (SHNPC npc in NPCs.dataList)
            {
                string szKey = "NPC_NAME_" + npc.id.ToString();

                if (LocalXml.NPCNameString.IsValid(szKey))
                {
                    string szValue = LocalXml.NPCNameString[szKey].ToString();
                    npc.Name = szValue;
                }
            }
            SHGlobal.Serialize <SHNPCsXml>(SHGlobal.GetServerSystemFolder() + "\\npc_translated.xml", NPCs, Encoding.UTF8);
            SHGlobal.Serialize <SHNPCsXml>(SHGlobal.GetClientSystemFolder() + "\\npc_translated.xml", NPCs, Encoding.UTF8);
            return(NPCs.Compile());
        }
Пример #10
0
 public void LoadFieldList()
 {
     FieldList = SHGlobal.Deserialize <SHFieldListXml>(SHGlobal.GetServerSystemFolder() + "\\fieldlist.xml", Encoding.UTF8);
     FieldList.Compile();
 }
Пример #11
0
 public void LoadRecipe()
 {
     Recipe = SHGlobal.Deserialize <SHRecipeXml>(SHGlobal.GetServerSystemFolder() + "\\recipe.xml", Encoding.UTF8);
     Recipe.Compile();
 }
Пример #12
0
 public void LoadNPCShop()
 {
     NPCShop = SHGlobal.Deserialize <SHNPCShopXml>(SHGlobal.GetServerSystemFolder() + "\\npcshop.xml", Encoding.UTF8);
     NPCShop.Compile();
 }
Пример #13
0
 public void LoadCraft()
 {
     Craft = SHGlobal.Deserialize <SHCraftXml>(SHGlobal.GetServerSystemFolder() + "\\craft.xml", Encoding.UTF8);
     Craft.Compile();
 }
Пример #14
0
 public bool LoadTalents()
 {
     Talents = SHGlobal.Deserialize <SHTalentsXml>(SHGlobal.GetServerSystemFolder() + "\\talent.xml", Encoding.UTF8);
     return(Talents.Compile());
 }