LoadCheckpoint() public method

Loads checkpoint file.
public LoadCheckpoint ( bool snapshot = false ) : void
snapshot bool
return void
コード例 #1
0
ファイル: SelectWorldModel.cs プロジェクト: elidiak/SEToolbox
        internal static WorldResource LoadSession(string savePath)
        {
            if (Directory.Exists(savePath))
            {
                var userPath = Path.GetDirectoryName(savePath);

                var saveResource = new WorldResource
                {
                    Savename = Path.GetFileName(savePath),
                    UserName = Path.GetFileName(userPath),
                    Savepath = savePath,
                    DataPath = UserDataPath.FindFromSavePath(savePath)
                };

                saveResource.LoadCheckpoint();

                return(saveResource);
            }

            return(null);
        }
コード例 #2
0
        internal static bool LoadSession(string savePath, out WorldResource saveResource, out string errorInformation)
        {
            if (Directory.Exists(savePath))
            {
                var userPath = Path.GetDirectoryName(savePath);

                saveResource = new WorldResource
                {
                    Savename = Path.GetFileName(savePath),
                    UserName = Path.GetFileName(userPath),
                    Savepath = savePath,
                    DataPath = UserDataPath.FindFromSavePath(savePath)
                };

                return(saveResource.LoadCheckpoint(out errorInformation));
            }

            saveResource     = null;
            errorInformation = Res.ErrorDirectoryNotFound;
            return(false);
        }
コード例 #3
0
ファイル: SelectWorldModel.cs プロジェクト: elidiak/SEToolbox
        internal static WorldResource FindSaveSession(string baseSavePath, string findSession)
        {
            if (Directory.Exists(baseSavePath))
            {
                var userPaths = Directory.GetDirectories(baseSavePath);

                foreach (var userPath in userPaths)
                {
                    var lastLoadedFile = Path.Combine(userPath, SpaceEngineersConsts.LoadLoadedFilename);

                    // Ignore any other base Save paths without the LastLoaded file.
                    if (File.Exists(lastLoadedFile))
                    {
                        var savePaths = Directory.GetDirectories(userPath);

                        // Still check every potential game world path.
                        foreach (var savePath in savePaths)
                        {
                            var saveResource = new WorldResource
                            {
                                Savename = Path.GetFileName(savePath),
                                UserName = Path.GetFileName(userPath),
                                Savepath = savePath,
                                DataPath = UserDataPath.FindFromSavePath(savePath)
                            };

                            saveResource.LoadCheckpoint();

                            if (saveResource.Savename.ToUpper() == findSession || saveResource.SessionName.ToUpper() == findSession)
                            {
                                return(saveResource);
                            }
                        }
                    }
                }
            }

            return(null);
        }
コード例 #4
0
        internal static bool FindSaveSession(string baseSavePath, string findSession, out WorldResource saveResource, out string errorInformation)
        {
            if (Directory.Exists(baseSavePath))
            {
                var userPaths = Directory.GetDirectories(baseSavePath);

                foreach (var userPath in userPaths)
                {
                    // Ignore any other base Save paths without the LastLoaded file.
                    if (Directory.Exists(userPath))
                    {
                        var savePaths = Directory.GetDirectories(userPath);

                        // Still check every potential game world path.
                        foreach (var savePath in savePaths)
                        {
                            saveResource = new WorldResource
                            {
                                Savename = Path.GetFileName(savePath),
                                UserName = Path.GetFileName(userPath),
                                Savepath = savePath,
                                DataPath = UserDataPath.FindFromSavePath(savePath)
                            };

                            saveResource.LoadWorldInfo();
                            if (saveResource.IsValid && (saveResource.Savename.ToUpper() == findSession || saveResource.SessionName.ToUpper() == findSession))
                            {
                                return(saveResource.LoadCheckpoint(out errorInformation));
                            }
                        }
                    }
                }
            }

            saveResource     = null;
            errorInformation = Res.ErrorGameNotFound;
            return(false);
        }
コード例 #5
0
ファイル: SelectWorldModel.cs プロジェクト: Stevolk/SEToolbox
        internal static WorldResource LoadSession(string savePath)
        {
            if (Directory.Exists(savePath))
            {
                var userPath = Path.GetDirectoryName(savePath);

                var saveResource = new WorldResource
                {
                    Savename = Path.GetFileName(savePath),
                    UserName = Path.GetFileName(userPath),
                    Savepath = savePath,
                    DataPath = UserDataPath.FindFromSavePath(savePath)
                };

                saveResource.LoadCheckpoint();

                return saveResource;
            }

            return null;
        }
コード例 #6
0
ファイル: SelectWorldModel.cs プロジェクト: Stevolk/SEToolbox
        internal static WorldResource FindSaveSession(string baseSavePath, string findSession)
        {
            if (Directory.Exists(baseSavePath))
            {
                var userPaths = Directory.GetDirectories(baseSavePath);

                foreach (var userPath in userPaths)
                {
                    var lastLoadedFile = Path.Combine(userPath, SpaceEngineersConsts.LoadLoadedFilename);

                    // Ignore any other base Save paths without the LastLoaded file.
                    if (File.Exists(lastLoadedFile))
                    {
                        var savePaths = Directory.GetDirectories(userPath);

                        // Still check every potential game world path.
                        foreach (var savePath in savePaths)
                        {
                            var saveResource = new WorldResource
                            {
                                Savename = Path.GetFileName(savePath),
                                UserName = Path.GetFileName(userPath),
                                Savepath = savePath,
                                DataPath = UserDataPath.FindFromSavePath(savePath)
                            };

                            saveResource.LoadCheckpoint();

                            if (saveResource.Savename.ToUpper() == findSession || saveResource.SessionName.ToUpper() == findSession)
                            {
                                return saveResource;
                            }
                        }
                    }
                }
            }

            return null;
        }