/*
         * 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");
        }
        /*
         * 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");
        }
Ejemplo 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");
        }