DoFileFlagging() public static method

public static DoFileFlagging ( string filePath ) : void
filePath string
return void
Esempio n. 1
0
 private static void LogText(string logString)
 {
     File.AppendAllText(GetLogPath(), logString);
     if (new System.IO.FileInfo(GetLogPath()).Length > deleteThreshhold)
     {
         File.Delete(GetLogPath());
     }
     SenseixSession.DoFileFlagging(GetLogPath());
 }
Esempio n. 2
0
        static public void CopyFailsafeOver()
        {
            string failsafeFileName    = "failsafe";
            string failsafeDestination = System.IO.Path.Combine(Application.persistentDataPath, failsafeFileName + SEED_FILE_EXTENSION);

            TextAsset failsafeAsset = Resources.Load <TextAsset>(failsafeFileName);

            byte[] failsafeContents = failsafeAsset.bytes;

            try
            {
                FileStream newFile = System.IO.File.Create(failsafeDestination);
                SenseixSession.DoFileFlagging(failsafeDestination);
                newFile.Close();
                System.IO.File.WriteAllBytes(failsafeDestination, failsafeContents);
            }
            catch
            {
                ThinksyPlugin.ShowEmergencyWindow("An error occurred while creating a failsafe seed file in " + failsafeDestination);
            }
        }
Esempio n. 3
0
        static private void ReplaceSeed(Message.Problem.ProblemGetResponse reply)
        {
            Logger.BasicLog("Replacing seed file.");
            MemoryStream            stream           = new MemoryStream();
            ThinksyProtosSerializer customSerializer = new ThinksyProtosSerializer();

            customSerializer.Serialize(stream, reply);

            byte[] replacementBytes = stream.ToArray();
            try
            {
                FileStream newFile = System.IO.File.Create(PlayerSeedPath());
                SenseixSession.DoFileFlagging(PlayerSeedPath());
                newFile.Close();
            }
            catch
            {
                ThinksyPlugin.ShowEmergencyWindow("An error occurred while creating a seedfile in " + PlayerSeedPath());
            }
            stream.Close();
            System.IO.File.WriteAllBytes(SeedFilePath(), replacementBytes);
            SenseixSession.DoFileFlagging(SeedFilePath());
        }