コード例 #1
0
        public void LoadSkill(int id, string file)
        {
            if (!string.IsNullOrEmpty(file))
            {
                Dsl.DslFile dataFile = new Dsl.DslFile();
#if DEBUG
                try {
                    if (dataFile.Load(file, LogSystem.Log))
                    {
                        Load(id, dataFile);
                    }
                    else
                    {
                        LogSystem.Error("LoadSkill file:{0} failed", file);
                    }
                } catch (Exception ex) {
                    LogSystem.Error("LoadSkill file:{0} Exception:{1}\n{2}", file, ex.Message, ex.StackTrace);
                }
#else
                try {
                    dataFile.LoadBinaryFile(file, GlobalVariables.Instance.DecodeTable);
                    Load(id, dataFile);
                } catch {
                }
#endif
            }
        }
コード例 #2
0
        public static Dsl.DslFile LoadStory(string file)
        {
            if (!string.IsNullOrEmpty(file))
            {
                Dsl.DslFile dataFile = new Dsl.DslFile();
#if DEBUG
                try {
                    if (dataFile.Load(file, LogSystem.Log))
                    {
                        return(dataFile);
                    }
                    else
                    {
                        LogSystem.Error("LoadStory file:{0} failed", file);
                    }
                } catch (Exception ex) {
                    LogSystem.Error("LoadStory file:{0} Exception:{1}\n{2}", file, ex.Message, ex.StackTrace);
                }
#else
                try {
                    dataFile.LoadBinaryFile(file, GlobalVariables.Instance.DecodeTable);
                    return(dataFile);
                } catch {
                }
#endif
            }
            return(null);
        }
コード例 #3
0
        public void LoadStory(string file, int sceneId, string _namespace)
        {
            if (!string.IsNullOrEmpty(file))
            {
                Dsl.DslFile dataFile = new Dsl.DslFile();
#if DEBUG
                try {
                    if (dataFile.Load(file, LogSystem.Log))
                    {
                        Load(dataFile, sceneId, _namespace, file);
                    }
                    else
                    {
                        LogSystem.Error("LoadStory file:{0} scene:{1} failed", file, sceneId);
                    }
                } catch (Exception ex) {
                    LogSystem.Error("LoadStory file:{0} scene:{1} Exception:{2}\n{3}", file, sceneId, ex.Message, ex.StackTrace);
                }
#else
                try {
                    dataFile.LoadBinaryFile(file, GlobalVariables.Instance.DecodeTable);
                    Load(dataFile, sceneId, _namespace, file);
                } catch {
                }
#endif
            }
        }
コード例 #4
0
 public static Dsl.DslFile LoadStory(string file)
 {
     if (!string.IsNullOrEmpty(file))
     {
         Dsl.DslFile dataFile = new Dsl.DslFile();
         var         bytes    = new byte[Dsl.DslFile.c_BinaryIdentity.Length];
         using (var fs = File.OpenRead(file)) {
             fs.Read(bytes, 0, bytes.Length);
             fs.Close();
         }
         var id = System.Text.Encoding.ASCII.GetString(bytes);
         if (id == Dsl.DslFile.c_BinaryIdentity)
         {
             try {
                 dataFile.LoadBinaryFile(file, StoryConfigManager.ReuseKeyBuffer, StoryConfigManager.ReuseIdBuffer);
                 return(dataFile);
             }
             catch (Exception ex) {
                 var sb = new System.Text.StringBuilder();
                 sb.AppendFormat("[LoadStory] LoadStory file:{0} Exception:{1}\n{2}", file, ex.Message, ex.StackTrace);
                 sb.AppendLine();
                 Helper.LogInnerException(ex, sb);
                 LogSystem.Error("{0}", sb.ToString());
             }
         }
         else
         {
             try {
                 if (dataFile.Load(file, LogSystem.Log))
                 {
                     return(dataFile);
                 }
                 else
                 {
                     LogSystem.Error("LoadStory file:{0} failed", file);
                 }
             }
             catch (Exception ex) {
                 var sb = new System.Text.StringBuilder();
                 sb.AppendFormat("[LoadStory] LoadStory file:{0} Exception:{1}\n{2}", file, ex.Message, ex.StackTrace);
                 sb.AppendLine();
                 Helper.LogInnerException(ex, sb);
                 LogSystem.Error("{0}", sb.ToString());
             }
         }
     }
     return(null);
 }
コード例 #5
0
 static public int LoadBinaryFile(IntPtr l)
 {
     try {
         Dsl.DslFile   self = (Dsl.DslFile)checkSelf(l);
         System.String a1;
         checkType(l, 2, out a1);
         System.Collections.Generic.Dictionary <System.String, System.String> a2;
         checkType(l, 3, out a2);
         self.LoadBinaryFile(a1, a2);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #6
0
 public void LoadStory(string file, int sceneId, string _namespace)
 {
     if (!string.IsNullOrEmpty(file))
     {
         Dsl.DslFile dataFile = new Dsl.DslFile();
         var         bytes    = new byte[Dsl.DslFile.c_BinaryIdentity.Length];
         using (var fs = File.OpenRead(file)) {
             fs.Read(bytes, 0, bytes.Length);
             fs.Close();
         }
         var id = System.Text.Encoding.ASCII.GetString(bytes);
         if (id == Dsl.DslFile.c_BinaryIdentity)
         {
             try {
                 dataFile.LoadBinaryFile(file);
                 Load(dataFile, sceneId, _namespace, file);
             }
             catch (Exception ex) {
                 var sb = new System.Text.StringBuilder();
                 sb.AppendFormat("[LoadStory] LoadStory file:{0} scene:{1} Exception:{2}\n{3}", file, sceneId, ex.Message, ex.StackTrace);
                 sb.AppendLine();
                 Helper.LogInnerException(ex, sb);
                 LogSystem.Error("{0}", sb.ToString());
             }
         }
         else
         {
             try {
                 if (dataFile.Load(file, LogSystem.Log))
                 {
                     Load(dataFile, sceneId, _namespace, file);
                 }
                 else
                 {
                     LogSystem.Error("[LoadStory] LoadStory file:{0} scene:{1} failed", file, sceneId);
                 }
             }
             catch (Exception ex) {
                 var sb = new System.Text.StringBuilder();
                 sb.AppendFormat("[LoadStory] LoadStory file:{0} scene:{1} Exception:{2}\n{3}", file, sceneId, ex.Message, ex.StackTrace);
                 sb.AppendLine();
                 Helper.LogInnerException(ex, sb);
                 LogSystem.Error("{0}", sb.ToString());
             }
         }
     }
 }
コード例 #7
0
 public void LoadStory(string file, int sceneId, string _namespace)
 {
     if (!string.IsNullOrEmpty(file))
     {
         Dsl.DslFile dataFile = new Dsl.DslFile();
         var         bytes    = new byte[Dsl.DslFile.c_BinaryIdentity.Length];
         using (var fs = File.OpenRead(file)) {
             fs.Read(bytes, 0, bytes.Length);
             fs.Close();
         }
         var id = System.Text.Encoding.ASCII.GetString(bytes);
         if (id == Dsl.DslFile.c_BinaryIdentity)
         {
             try {
                 dataFile.LoadBinaryFile(file);
                 Load(dataFile, sceneId, _namespace, file);
             } catch (Exception ex) {
                 while (null != ex.InnerException)
                 {
                     ex = ex.InnerException;
                 }
                 LogSystem.Error("[LoadStory] LoadStoryText text:{0} scene:{1} Exception:{2}\n{3}", file, sceneId, ex.Message, ex.StackTrace);
             }
         }
         else
         {
             try {
                 if (dataFile.Load(file, LogSystem.Log))
                 {
                     Load(dataFile, sceneId, _namespace, file);
                 }
                 else
                 {
                     LogSystem.Error("[LoadStory] LoadStory file:{0} scene:{1} failed", file, sceneId);
                 }
             } catch (Exception ex) {
                 while (null != ex.InnerException)
                 {
                     ex = ex.InnerException;
                 }
                 LogSystem.Error("[LoadStory] LoadStoryText text:{0} scene:{1} Exception:{2}\n{3}", file, sceneId, ex.Message, ex.StackTrace);
             }
         }
     }
 }
コード例 #8
0
 public void LoadSkill(string file)
 {
     if (!string.IsNullOrEmpty(file)) {
         Dsl.DslFile dataFile = new Dsl.DslFile();
     #if DEBUG
         try {
             if (dataFile.Load(file, LogSystem.Log)) {
                 Load(dataFile);
             } else {
                 LogSystem.Error("LoadSkill file:{0} failed", file);
             }
         } catch (Exception ex) {
             LogSystem.Error("LoadSkill file:{0} Exception:{1}\n{2}", file, ex.Message, ex.StackTrace);
         }
     #else
     try {
       dataFile.LoadBinaryFile(file, GlobalVariables.Instance.DecodeTable);
       Load(dataFile);
     } catch {
     }
     #endif
     }
 }
コード例 #9
0
 public static Dsl.DslFile LoadStory(string file)
 {
     if (!string.IsNullOrEmpty(file))
     {
         Dsl.DslFile dataFile = new Dsl.DslFile();
         var         bytes    = new byte[Dsl.DslFile.c_BinaryIdentity.Length];
         using (var fs = File.OpenRead(file)) {
             fs.Read(bytes, 0, bytes.Length);
             fs.Close();
         }
         var id = System.Text.Encoding.ASCII.GetString(bytes);
         if (id == Dsl.DslFile.c_BinaryIdentity)
         {
             try {
                 dataFile.LoadBinaryFile(file);
                 return(dataFile);
             } catch {
             }
         }
         else
         {
             try {
                 if (dataFile.Load(file, LogSystem.Log))
                 {
                     return(dataFile);
                 }
                 else
                 {
                     LogSystem.Error("LoadStory file:{0} failed", file);
                 }
             } catch (Exception ex) {
                 LogSystem.Error("LoadStory file:{0} Exception:{1}\n{2}", file, ex.Message, ex.StackTrace);
             }
         }
     }
     return(null);
 }