Example #1
0
        public void BackupWork()
        {
            SaveFilesHandlers sfh = new SaveFilesHandlers();

            // SaveMode is:  OVERWRITE    APPEND   ABORT
            SaveMode s = SaveMode.OVERWRITE;

            saveFileCnt = sfh.FileSaveCnt(KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder) + 1;
            string saveFileName = AddInfo(configuration.savePrefix, saveFileCnt, sceneReady, specialScene, precrash);

            string str = GamePersistence.SaveGame(saveFileName, HighLogic.SaveFolder, s);

            Log.Info("String: " + str);

            sfh.deleteOldestSaveFile(KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder, configuration.numToRotate, saveFileCnt, saveFileName);

            Log.Info("backup thread terminated");
        }
        public void BackupWork()
        {
            SaveFilesHandlers sfh  = new SaveFilesHandlers ();

            // SaveMode is:  OVERWRITE    APPEND   ABORT
            SaveMode s = SaveMode.OVERWRITE;

            saveFileCnt = sfh.FileSaveCnt(KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder) + 1;
            string saveFileName = AddInfo (configuration.savePrefix, saveFileCnt, sceneReady,  specialScene,  precrash);

            string str = GamePersistence.SaveGame (saveFileName, HighLogic.SaveFolder, s);
            Log.Info ("String: " + str);

            sfh.deleteOldestSaveFile (KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder, configuration.numToRotate, saveFileCnt, saveFileName);

            Log.Info ("backup thread terminated");
        }