/*
         * BackupWork
         */
        public void BackupWork(AS asRef)
        {
            SaveFilesHandlers sfh  = new SaveFilesHandlers ();

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

            saveFileCnt = FileSaveCnt(KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder) + 1;
            string saveFileName = AS.AddInfo (AS.configuration.savePrefix, saveFileCnt,	asRef.isSceneReady(), asRef.isSpecialScene(), asRef.isPreCrash());

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

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

            Log.Info ("backup thread terminated");
        }
Exemplo n.º 2
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");
        }
Exemplo n.º 3
0
        /*
         * BackupWork
         */
        private void BackupWork(AS asRef)
        {
            SaveFilesHandlers sfh = new SaveFilesHandlers();

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

            saveFileCnt = FileSaveCnt() + 1;
            string saveFileName = AS.AddInfo(AS.configuration.savePrefix, saveFileCnt, asRef.isSceneReady(), asRef.isSpecialScene(), asRef.isPreCrash());

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

            Log.dbg("String: {0}", str);

            sfh.deleteOldestSaveFile(SAVEDIR, AS.configuration.numToRotate, saveFileCnt, saveFileName);

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