Esempio n. 1
0
#pragma warning restore 649

        private void DoLoadSession(string sessionPath)
        {
            if (!Path.IsPathRooted(sessionPath))
            {
                sessionPath = Path.Combine(MyFileSystem.SavesPath, sessionPath);
            }

            if (!Sandbox.Engine.Platform.Game.IsDedicated)
            {
                MySessionLoader.LoadSingleplayerSession(sessionPath);
                return;
            }
            MyObjectBuilder_Checkpoint checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out ulong checkpointSize);

            if (MySession.IsCompatibleVersion(checkpoint))
            {
                if (MyWorkshop.DownloadWorldModsBlocking(checkpoint.Mods, null).Success)
                {
                    // MySpaceAnalytics.Instance.SetEntry(MyGameEntryEnum.Load);
                    MySession.Load(sessionPath, checkpoint, checkpointSize);
                    _hostServerForSession(MySession.Static, MyMultiplayer.Static);
                }
                else
                {
                    MyLog.Default.WriteLineAndConsole("Unable to download mods");
                }
            }
            else
            {
                MyLog.Default.WriteLineAndConsole(MyTexts.Get(MyCommonTexts.DialogTextIncompatibleWorldVersion)
                                                  .ToString());
            }
        }
Esempio n. 2
0
 public static void GetModItems(List <MyObjectBuilder_Checkpoint.ModItem> mods, MyWorkshop.CancelToken cancelToken)
 {
     MyWorkshop.DownloadWorldModsBlocking(mods, cancelToken);
 }