Пример #1
0
    private static void PerformSave(InProgressSave inProgress, Save save)
    {
        try
        {
            save.SaveToFile();
            inProgress.ReportStatus(true, TranslationServer.Translate("SAVING_SUCCEEDED"));
        }
        catch (Exception e)
        {
            // ReSharper disable HeuristicUnreachableCode ConditionIsAlwaysTrueOrFalse
            if (!Constants.CATCH_SAVE_ERRORS)
#pragma warning disable 162
            {
                throw;
            }
#pragma warning restore 162

            inProgress.ReportStatus(false, TranslationServer.Translate("SAVING_FAILED"),
                                    e.ToString());
            return;
        }

        if (inProgress.Type == SaveInformation.SaveType.AutoSave)
        {
            QueueRemoveExcessAutoSaves();
        }

        if (inProgress.Type == SaveInformation.SaveType.QuickSave)
        {
            QueueRemoveExcessQuickSaves();
        }
    }
Пример #2
0
    private static void PerformSave(InProgressSave inProgress, Save save)
    {
        try
        {
            save.SaveToFile();
            inProgress.ReportStatus(true, "Saving succeeded");
        }
        catch (Exception e)
        {
            inProgress.ReportStatus(false, "Saving failed! An exception happened", e.ToString());
            return;
        }

        if (inProgress.Type == SaveInformation.SaveType.QuickSave)
        {
            QueueRemoveExcessQuickSaves();
        }
    }
Пример #3
0
    private static bool PreventSavingIfExtinct(InProgressSave inProgress, Save save)
    {
        if (!save.SavedProperties.GameWorld.PlayerSpecies.IsExtinct)
        {
            return(false);
        }

        inProgress.ReportStatus(false, TranslationServer.Translate("SAVING_NOT_POSSIBLE"),
                                TranslationServer.Translate("PLAYER_EXTINCT"), false);
        return(true);
    }
Пример #4
0
    private static void PerformSave(InProgressSave inProgress, Save save)
    {
        try
        {
            save.SaveToFile();
            inProgress.ReportStatus(true, TranslationServer.Translate("SAVING_SUCCEEDED"));
        }
        catch (Exception e)
        {
            inProgress.ReportStatus(false, TranslationServer.Translate("SAVING_FAILED"),
                                    e.ToString());
            return;
        }

        if (inProgress.Type == SaveInformation.SaveType.AutoSave)
        {
            QueueRemoveExcessAutoSaves();
        }

        if (inProgress.Type == SaveInformation.SaveType.QuickSave)
        {
            QueueRemoveExcessQuickSaves();
        }
    }