示例#1
0
        public static void DownloadAllCloudData()
        {
            bool cloudOnly = MonoMain.cloudOnly;
            bool cloud     = Options.Data.cloud;

            MonoMain.cloudOnly = true;
            Options.Data.cloud = true;
            foreach (string file in DuckFile.GetFiles(DuckFile.profileDirectory, "*.*", SearchOption.AllDirectories))
            {
                DuckFile.CreatePath(file);
                DuckFile.PrepareToLoadCloudFile(file);
            }
            foreach (string file in DuckFile.GetFiles(DuckFile.levelDirectory, "*.*", SearchOption.AllDirectories))
            {
                DuckFile.CreatePath(file);
                DuckFile.PrepareToLoadCloudFile(file);
            }
            foreach (string file in DuckFile.GetFiles(DuckFile.optionsDirectory, "*.*", SearchOption.AllDirectories))
            {
                DuckFile.CreatePath(file);
                DuckFile.PrepareToLoadCloudFile(file);
            }
            MonoMain.cloudOnly = cloudOnly;
            Options.Data.cloud = cloud;
        }
示例#2
0
 public static XDocument LoadXDocument(string path)
 {
     DuckFile.CreatePath(Path.GetDirectoryName(path));
     DuckFile.PrepareToLoadCloudFile(path);
     if (!File.Exists(path))
     {
         return((XDocument)null);
     }
     try
     {
         return(XDocument.Load(path));
     }
     catch
     {
         return((XDocument)null);
     }
 }
示例#3
0
 public static T LoadChunk <T>(string path) where T : BinaryClassChunk
 {
     DuckFile.CreatePath(Path.GetDirectoryName(path));
     DuckFile.PrepareToLoadCloudFile(path);
     return(!File.Exists(path) ? default(T) : BinaryClassChunk.FromData <T>(new BitBuffer(File.ReadAllBytes(path), 0, false)));
 }
示例#4
0
 public static LevelData LoadLevel(string path)
 {
     DuckFile.CreatePath(Path.GetDirectoryName(path));
     DuckFile.PrepareToLoadCloudFile(path);
     return(!File.Exists(path) ? (LevelData)null : DuckFile.LoadLevel(File.ReadAllBytes(path)));
 }