Ejemplo n.º 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);
        }
Ejemplo n.º 2
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();
        }