Ejemplo n.º 1
0
        protected override bool SetupBasicGameInfo()
        {
            SpaceEngineersGame.SetupBasicGameInfo();
            m_startup = new MyCommonProgramStartup(m_args);

            var appDataPath = m_startup.GetAppDataPath();

            VRage.Platform.Windows.MyVRageWindows.Init(MyPerGameSettings.BasicGameInfo.ApplicationName, MySandboxGame.Log, appDataPath, false);
            MyInitializer.InvokeBeforeRun(AppId, MyPerGameSettings.BasicGameInfo.ApplicationName + "ModTool", MyVRage.Platform.System.GetAppDataPath());
            MyRenderProxy.Initialize((IMyRender) new MyNullRender());
            MyInitializer.InitCheckSum();

            if (m_startup.PerformColdStart())
            {
                return(false);
            }
            if (!m_startup.Check64Bit())
            {
                return(false);
            }

            m_steamService = VRage.Steam.MySteamGameService.Create(MySandboxGame.IsDedicated, AppId);
            MyServiceManager.Instance.AddService(m_steamService);
            MyServiceManager.Instance.AddService(VRage.Steam.MySteamUgcService.Create(AppId, m_steamService));

            if (m_useModIO)
            {
                MyLog.Default.WriteLineAndConsole("Using mod.io service, instead of Steam.");
                MyServiceManager.Instance.AddService(VRage.Mod.Io.MyModIoService.Create(MySandboxGame.IsDedicated, MyServiceManager.Instance.GetService <IMyGameService>(), ModIO_GameName, ModIO_GameID, ModIO_Key, ModIO_TestGameID, ModIO_TestKey, false));
            }

            SpaceEngineersGame.SetupPerGameSettings();
            ManuallyAddDLCs();
            return(true);
        }
Ejemplo n.º 2
0
        protected override bool SetupBasicGameInfo()
        {
            SpaceEngineersGame.SetupBasicGameInfo();
            m_startup = new MyCommonProgramStartup(m_args);

            var appDataPath = m_startup.GetAppDataPath();

            VRage.Platform.Windows.MyVRageWindows.Init(MyPerGameSettings.BasicGameInfo.ApplicationName, MySandboxGame.Log, appDataPath, false);
            MyInitializer.InvokeBeforeRun(AppId, MyPerGameSettings.BasicGameInfo.ApplicationName + "ModTool", MyVRage.Platform.System.GetAppDataPath());
            MyRenderProxy.Initialize((IMyRender) new MyNullRender());
            MyInitializer.InitCheckSum();

            if (m_startup.PerformColdStart())
            {
                return(false);
            }
            if (!m_startup.Check64Bit())
            {
                return(false);
            }

            m_steamService = MySteamGameService.Create(MySandboxGame.IsDedicated, AppId);
            MyServiceManager.Instance.AddService(m_steamService);
            MyServerDiscoveryAggregator serverDiscoveryAggregator = new MyServerDiscoveryAggregator();

            MySteamGameService.InitNetworking(false, m_steamService, MyPerGameSettings.BasicGameInfo.GameName, serverDiscoveryAggregator, true, true);

            // If user specified --modio, set that as the "default" (added first)
            var modioService = MyModIoService.Create(MyServiceManager.Instance.GetService <IMyGameService>(), ModIO_GameName, ModIO_GameID, ModIO_Key, ModIO_TestGameID, ModIO_TestKey, MyPlatformGameSettings.UGC_TEST_ENVIRONMENT, m_useModIO ? true : false);

            if (m_useModIO)
            {
                MyGameService.WorkshopService.AddAggregate(modioService);
            }
            MyGameService.WorkshopService.AddAggregate(MySteamUgcService.Create(AppId, m_steamService));

            if (!m_useModIO)
            {
                MyGameService.WorkshopService.AddAggregate(modioService);
            }

            SpaceEngineersGame.SetupPerGameSettings();
            ManuallyAddDLCs();
            return(true);
        }
Ejemplo n.º 3
0
        private void InitializeRender()
        {
            try
            {
                if (Game.IsDedicated)
                {
                    _renderer = new MyNullRender();
                }
                else
                {
                    var graphicsRenderer = MySandboxGame.Config.GraphicsRenderer;
                    if (graphicsRenderer == MySandboxGame.DirectX11RendererKey)
                    {
                        _renderer = new MyDX11Render();
                        if (!_renderer.IsSupported)
                        {
                            MySandboxGame.Log.WriteLine("DirectX 11 renderer not supported. No renderer to revert back to.");
                            _renderer = null;
                        }
                    }
                    if (_renderer == null)
                    {
                        throw new MyRenderException("The current version of the game requires a Dx11 card. \\n For more information please see : http://blog.marekrosa.org/2016/02/space-engineers-news-full-source-code_26.html", MyRenderExceptionEnum.GpuNotSupported);
                    }

                    MySandboxGame.Config.GraphicsRenderer = graphicsRenderer;
                }

                MyRenderProxy.Initialize(_renderer);
                MyRenderProxy.GetRenderProfiler().SetAutocommit(false);
                MyRenderProxy.GetRenderProfiler().InitMemoryHack("MainEntryPoint");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Render Initialization Failed");
                Environment.Exit(-1);
            }
        }
Ejemplo n.º 4
0
        private void Create()
        {
            bool dedicated = Sandbox.Engine.Platform.Game.IsDedicated;

            Environment.SetEnvironmentVariable("SteamAppId", _appSteamId.ToString());
            MyServiceManager.Instance.AddService <IMyGameService>(new MySteamService(dedicated, _appSteamId));
            if (dedicated && !MyGameService.HasGameServer)
            {
                _log.Warn("Steam service is not running! Please reinstall dedicated server.");
                return;
            }

            SpaceEngineersGame.SetupBasicGameInfo();
            SpaceEngineersGame.SetupPerGameSettings();
            MyFinalBuildConstants.APP_VERSION       = MyPerGameSettings.BasicGameInfo.GameVersion;
            MySessionComponentExtDebug.ForceDisable = true;
            MyPerGameSettings.SendLogToKeen         = false;
            // SpaceEngineersGame.SetupAnalytics();

            MyFileSystem.ExePath = Path.GetDirectoryName(typeof(SpaceEngineersGame).Assembly.Location);

            _tweakGameSettings();

            MyFileSystem.Reset();
            MyInitializer.InvokeBeforeRun(_appSteamId, _appName, _userDataPath);
            // MyInitializer.InitCheckSum();


            // Hook into the VRage plugin system for updates.
            _getVRagePluginList().Add(_torch);

            if (!MySandboxGame.IsReloading)
            {
                MyFileSystem.InitUserSpecific(dedicated ? null : MyGameService.UserId.ToString());
            }
            MySandboxGame.IsReloading = dedicated;

            // render init
            {
                IMyRender renderer = null;
                if (dedicated)
                {
                    renderer = new MyNullRender();
                }
                else
                {
                    MyPerformanceSettings preset = MyGuiScreenOptionsGraphics.GetPreset(MyRenderQualityEnum.NORMAL);
                    MyRenderProxy.Settings.User = MyVideoSettingsManager.GetGraphicsSettingsFromConfig(ref preset)
                                                  .PerformanceSettings.RenderSettings;
                    MyStringId graphicsRenderer = MySandboxGame.Config.GraphicsRenderer;
                    if (graphicsRenderer == MySandboxGame.DirectX11RendererKey)
                    {
                        renderer = new MyDX11Render(new MyRenderSettings?(MyRenderProxy.Settings));
                        if (!renderer.IsSupported)
                        {
                            MySandboxGame.Log.WriteLine(
                                "DirectX 11 renderer not supported. No renderer to revert back to.");
                            renderer = null;
                        }
                    }
                    if (renderer == null)
                    {
                        throw new MyRenderException(
                                  "The current version of the game requires a Dx11 card. \\n For more information please see : http://blog.marekrosa.org/2016/02/space-engineers-news-full-source-code_26.html",
                                  MyRenderExceptionEnum.GpuNotSupported);
                    }
                    MySandboxGame.Config.GraphicsRenderer = graphicsRenderer;
                }
                MyRenderProxy.Initialize(renderer);
                MyRenderProxy.GetRenderProfiler().SetAutocommit(false);
                MyRenderProxy.GetRenderProfiler().InitMemoryHack("MainEntryPoint");
            }

            // Loads object builder serializers. Intuitive, right?
            _log.Info("Setting up serializers");
            MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly);
            if (MyPerGameSettings.GameModBaseObjBuildersAssembly != null)
            {
                MyPlugins.RegisterBaseGameObjectBuildersAssemblyFile(MyPerGameSettings.GameModBaseObjBuildersAssembly);
            }
            MyPlugins.RegisterGameObjectBuildersAssemblyFile(MyPerGameSettings.GameModObjBuildersAssembly);
            MyPlugins.RegisterSandboxAssemblyFile(MyPerGameSettings.SandboxAssembly);
            MyPlugins.RegisterSandboxGameAssemblyFile(MyPerGameSettings.SandboxGameAssembly);
            //typeof(MySandboxGame).GetMethod("Preallocate", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null);
            MyGlobalTypeMetadata.Static.Init(false);
        }
Ejemplo n.º 5
0
        public static void MainBootstrap(string[] args)
        {
            var rootContentPath = args[0];

            MyLog.Default = new MyLog();
            MyFileSystem.Init(rootContentPath, "./");
            MyLanguage.Init();
            MyRenderProxy.Initialize(new MyNullRender());
            MyLog.Default.Init("converter.log", new StringBuilder());
            Workers.Init(new WorkerConfigurationFactory()
                         .AddGroup(new WorkerConfigurationFactory.Group
            {
                Id       = WorkerGroup.Background,
                Min      = 1,
                Priority = ThreadPriority.BelowNormal,
                Ratio    = .1f
            })
                         .AddGroup(new WorkerConfigurationFactory.Group
            {
                Id       = WorkerGroup.Logic,
                Min      = 1,
                Priority = ThreadPriority.Normal,
                Ratio    = .7f
            })
                         .AddGroup(new WorkerConfigurationFactory.Group
            {
                Id       = WorkerGroup.Render,
                Min      = 1,
                Priority = ThreadPriority.AboveNormal,
                Ratio    = .2f
            })
                         .SetDefault(WorkerGroup.Logic)
                         .Bake(32));

            MyMetadataSystem.LoadAssemblies(new[]
            {
                "VRage",
                "VRage.Game",
                "Sandbox.Graphics",
                "Sandbox.Game",
                "MedievalEngineers.ObjectBuilders",
                "MedievalEngineers.Game"
            }.Select(Assembly.Load));

            var config = (BlockVariantGeneratorConfig) new XmlSerializer(typeof(BlockVariantGeneratorConfig)).Deserialize(File.OpenText(args[1]));

            Console.WriteLine("Loading definitions...");

            MyDefinitionManagerSandbox.Static.LoadData(new ListReader <MyModContext>(new List <MyModContext>(config.ContentRoots.Select(contentPath =>
                                                                                                                                        new MyModContext(Path.GetFileNameWithoutExtension(contentPath), Path.GetFileNameWithoutExtension(contentPath), contentPath)))));
            MyFileSystem.SetAdditionalContentPaths(config.ContentRoots);
            Console.WriteLine("Processing definitions...");
            DefinitionObLoader.LoadObjectBuilders(MyDefinitionManagerSandbox.Static.DefinitionSet);

            Console.WriteLine("Translating definitions...");
            var translatedSet   = new DefinitionObSet();
            var modelTranslator = new ModelAssetTranslator(config.OutputDirectory, config.VariantName);
            Func <string, string> assetTranslator = (asset) =>
            {
                if (string.IsNullOrWhiteSpace(asset))
                {
                    return(asset);
                }
                if (config.AssetTranslations.TryGetValue(asset, out var assetTranslation))
                {
                    return(assetTranslation);
                }
                if (asset.EndsWith(".mwm", StringComparison.OrdinalIgnoreCase) && config.Changes != null)
                {
                    if (asset.Contains("GeneratedStoneEdge"))
                    {
                        Debugger.Break();
                    }
                    var modelMaterials = modelTranslator.GetMaterialsForModel(asset);
                    using (PoolManager.Get(out List <MyObjectBuilder_EquiModifierChangeMaterialDefinition.MaterialModifier> changes))
                    {
                        foreach (var x in config.Changes)
                        {
                            if (modelMaterials.Contains(x.Name))
                            {
                                changes.Add(x);
                            }
                        }
                        if (changes.Count > 0)
                        {
                            Console.WriteLine("Translating model " + asset);
                            using (var builder = MaterialEditsBuilder.Allocate())
                            {
                                foreach (var k in changes)
                                {
                                    var list = new List <MaterialEdit>();
                                    k.GetChanges(list);
                                    builder.Add(k.Name, list);
                                }

                                return(modelTranslator.CreateModel(asset, builder));
                            }
                        }
                    }
                }

                return(asset);
            };
            var translator = new DefinitionObTranslator(
                DefinitionObLoader.Loaded,
                translatedSet,
                assetTranslator,
                (displayName) => $"{displayName} ({config.VariantName})",
                "_" + config.VariantName,
                config.Translations);

            foreach (var id in config.DefinitionsToTranslate)
            {
                if (id.SubtypeName == "**any**")
                {
                    // Find and translate ALL with the given type ID, not forcing
                    foreach (var k in DefinitionObLoader.Loaded.AllDefinitions)
                    {
                        if (k.Id.TypeId == id.TypeId)
                        {
                            translator.Translate(k);
                        }
                    }
                }
                else if (id.SubtypeName == "**any_translated_model**")
                {
                    var ids = new HashSet <MyDefinitionId>();
                    foreach (var k in DefinitionObLoader.Loaded.AllDefinitions)
                    {
                        if (k.Id.TypeId == id.TypeId && k is MyObjectBuilder_PhysicalModelDefinition physModel)
                        {
                            var originalModel   = physModel.Model;
                            var translatedModel = assetTranslator(originalModel);
                            if (!originalModel.Equals(translatedModel))
                            {
                                ids.Add(k.Id);
                            }
                        }
                    }

                    // Include variants that contain the blocks
                    foreach (var k in DefinitionObLoader.Loaded.AllDefinitions.OfType <MyObjectBuilder_BlockVariantsDefinition>())
                    {
                        var good = false;
                        foreach (var e in k.Blocks)
                        {
                            if (ids.Contains(e))
                            {
                                good = true;
                                break;
                            }
                        }

                        if (good)
                        {
                            ids.Add(k.Id);
                        }
                    }

                    foreach (var sid in ids)
                    {
                        foreach (var def in DefinitionObLoader.Loaded.GetDefinitions(sid))
                        {
                            translator.Translate(def, true);
                        }
                    }
                }
                else
                {
                    var list = DefinitionObLoader.Loaded.GetDefinitions(id);
                    if (list.Count == 0)
                    {
                        Console.WriteLine("Couldn't find any definitions with ID " + id);
                    }
                    foreach (var def in list)
                    {
                        translator.Translate(def, true);
                    }
                }
            }

            var definitionSet = new MyObjectBuilder_Definitions
            {
                Definitions = new MySerializableList <MyObjectBuilder_DefinitionBase>(translatedSet.AllDefinitions.OrderBy(x => x.TypeId.ToString())
                                                                                      .ThenBy(x => x.SubtypeName))
            };

            XDocument doc;

            using (var baseWriter = new StringWriter())
            {
                var serializer = new XmlSerializer(typeof(MyObjectBuilder_Definitions));
                using (var writer = new XmlTextWriter(baseWriter))
                    serializer.Serialize(writer, definitionSet);
                doc = XDocument.Load(new StringReader(baseWriter.ToString()));
            }

            NullCleaner.Clean(doc);
            var translatedSbcPath = Path.Combine(config.OutputDirectory, "Data/Translated.sbc");

            Directory.CreateDirectory(Path.GetDirectoryName(translatedSbcPath));
            using (var writer = new XmlTextWriter(translatedSbcPath, Encoding.UTF8)
            {
                Formatting = Formatting.Indented,
                Indentation = 2
            })

                doc.WriteTo(writer);

            MyLog.Default.Dispose();
        }
Ejemplo n.º 6
0
        private void Create()
        {
            bool dedicated = true;

            Environment.SetEnvironmentVariable("SteamAppId", _appSteamId.ToString());
            SpaceEngineersGame.SetupBasicGameInfo();
            SpaceEngineersGame.SetupPerGameSettings();
            MyFinalBuildConstants.APP_VERSION       = MyPerGameSettings.BasicGameInfo.GameVersion;
            MySessionComponentExtDebug.ForceDisable = true;
            MyPerGameSettings.SendLogToKeen         = false;
            // SpaceEngineersGame.SetupAnalytics();

            //not implemented by keen.. removed in cross-play update
            //MyVRage.Platform.InitScripting(MyVRageScripting.Create());
            _ = MyVRage.Platform.Scripting;

            MyFileSystem.ExePath = Path.GetDirectoryName(typeof(SpaceEngineersGame).Assembly.Location);

            _tweakGameSettings();

            MyFileSystem.Reset();
            MyInitializer.InvokeBeforeRun(_appSteamId, _appName, _userDataPath);

            _log.Info("Loading Dedicated Config");
            // object created in SpaceEngineersGame.SetupPerGameSettings()
            MySandboxGame.ConfigDedicated.Load();
            MyPlatformGameSettings.CONSOLE_COMPATIBLE = MySandboxGame.ConfigDedicated.ConsoleCompatibility;

            //Type.GetType("VRage.Steam.MySteamService, VRage.Steam").GetProperty("IsActive").GetSetMethod(true).Invoke(service, new object[] {SteamAPI.Init()});
            _log.Info("Initializing network services");

            var isEos = TorchBase.Instance.Config.UgcServiceType == UGCServiceType.EOS;

            if (isEos)
            {
                _log.Info("Running on Epic Online Services.");
                _log.Warn("Steam workshop will not work with current settings. Some functions might not work properly!");
            }

            var aggregator = new MyServerDiscoveryAggregator();

            MyServiceManager.Instance.AddService <IMyServerDiscovery>(aggregator);

            IMyGameService service;

            if (isEos)
            {
                service = MyEOSService.Create();

                MyEOSService.InitNetworking(dedicated,
                                            "Space Engineers",
                                            service,
                                            "xyza7891A4WeGrpP85BTlBa3BSfUEABN",
                                            "ZdHZVevSVfIajebTnTmh5MVi3KPHflszD9hJB7mRkgg",
                                            "24b1cd652a18461fa9b3d533ac8d6b5b",
                                            "1958fe26c66d4151a327ec162e4d49c8",
                                            "07c169b3b641401496d352cad1c905d6",
                                            "https://retail.epicgames.com/",
                                            MyEOSService.CreatePlatform(),
                                            MySandboxGame.ConfigDedicated.VerboseNetworkLogging,
                                            Enumerable.Empty <string>(),
                                            aggregator,
                                            MyMultiplayer.Channels);

                var mockingInventory = new MyMockingInventory(service);
                MyServiceManager.Instance.AddService <IMyInventoryService>(mockingInventory);
            }
            else
            {
                service = MySteamGameService.Create(dedicated, _appSteamId);
                MyGameService.WorkshopService.AddAggregate(MySteamUgcService.Create(_appSteamId, service));
                MySteamGameService.InitNetworking(dedicated,
                                                  service,
                                                  "Space Engineers",
                                                  aggregator);
            }

            MyServiceManager.Instance.AddService(service);

            MyGameService.WorkshopService.AddAggregate(MyModIoService.Create(service, "spaceengineers", "264",
                                                                             "1fb4489996a5e8ffc6ec1135f9985b5b", "331", "f2b64abe55452252b030c48adc0c1f0e",
                                                                             MyPlatformGameSettings.UGC_TEST_ENVIRONMENT, true));

            if (!isEos && !MyGameService.HasGameServer)
            {
                _log.Warn("Network service is not running! Please reinstall dedicated server.");
                return;
            }

            _log.Info("Initializing services");
            MyServiceManager.Instance.AddService <IMyMicrophoneService>(new MyNullMicrophone());

            MyNetworkMonitor.Init();

            _log.Info("Services initialized");
            MySandboxGame.InitMultithreading();
            // MyInitializer.InitCheckSum();


            // Hook into the VRage plugin system for updates.
            _getVRagePluginList().Add(_torch);

            if (!MySandboxGame.IsReloading)
            {
                MyFileSystem.InitUserSpecific(dedicated ? null : MyGameService.UserId.ToString());
            }
            MySandboxGame.IsReloading = dedicated;

            // render init
            {
                IMyRender renderer = null;
                if (dedicated)
                {
                    renderer = new MyNullRender();
                }
                else
                {
                    MyPerformanceSettings preset = MyGuiScreenOptionsGraphics.GetPreset(MyRenderPresetEnum.NORMAL);
                    MyRenderProxy.Settings.User = MyVideoSettingsManager.GetGraphicsSettingsFromConfig(ref preset, false)
                                                  .PerformanceSettings.RenderSettings;
                    MyStringId graphicsRenderer = MySandboxGame.Config.GraphicsRenderer;
                    if (graphicsRenderer == MySandboxGame.DirectX11RendererKey)
                    {
                        renderer = new MyDX11Render(new MyRenderSettings?(MyRenderProxy.Settings));
                        if (!renderer.IsSupported)
                        {
                            MySandboxGame.Log.WriteLine(
                                "DirectX 11 renderer not supported. No renderer to revert back to.");
                            renderer = null;
                        }
                    }
                    if (renderer == null)
                    {
                        throw new MyRenderException(
                                  "The current version of the game requires a Dx11 card. \\n For more information please see : http://blog.marekrosa.org/2016/02/space-engineers-news-full-source-code_26.html",
                                  MyRenderExceptionEnum.GpuNotSupported);
                    }
                    MySandboxGame.Config.GraphicsRenderer = graphicsRenderer;
                }
                MyRenderProxy.Initialize(renderer);
                MyRenderProfiler.SetAutocommit(false);
                //This broke services?
                //MyRenderProfiler.InitMemoryHack("MainEntryPoint");
            }

            // Loads object builder serializers. Intuitive, right?
            _log.Info("Setting up serializers");
            MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly);
            if (MyPerGameSettings.GameModBaseObjBuildersAssembly != null)
            {
                MyPlugins.RegisterBaseGameObjectBuildersAssemblyFile(MyPerGameSettings.GameModBaseObjBuildersAssembly);
            }
            MyPlugins.RegisterGameObjectBuildersAssemblyFile(MyPerGameSettings.GameModObjBuildersAssembly);
            MyPlugins.RegisterSandboxAssemblyFile(MyPerGameSettings.SandboxAssembly);
            MyPlugins.RegisterSandboxGameAssemblyFile(MyPerGameSettings.SandboxGameAssembly);
            //typeof(MySandboxGame).GetMethod("Preallocate", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null);
            MyGlobalTypeMetadata.Static.Init(false);
        }
Ejemplo n.º 7
0
        // This is mostly copied from MyProgram.Main(), with UI stripped out.
        protected virtual void InitSandbox(string[] args)
        {
            m_args = args;
            // Infinario was removed from SE in update 1.184.6, but is still in ME
            var infinario = typeof(MyFakes).GetField("ENABLE_INFINARIO");

            if (infinario != null)
            {
                infinario.SetValue(null, false);
            }

            if (m_game != null)
            {
                m_game.Exit();
            }

            if (!SetupBasicGameInfo())
            {
                return;
            }

            // Init null render so profiler-enabled builds don't crash
            var render = new MyNullRender();

            MyRenderProxy.Initialize(render);
#if SE
            EmptyKeys.UserInterface.Engine engine = (EmptyKeys.UserInterface.Engine) new VRage.UserInterface.MyEngine();

            if (System.Diagnostics.Debugger.IsAttached)
            {
                m_startup.CheckSteamRunning();        // Just give the warning message box when debugging, ignore for release
            }
            if (!Sandbox.Engine.Platform.Game.IsDedicated)
            {
                MyFileSystem.InitUserSpecific(m_steamService.UserId.ToString());
            }
#endif

            try
            {
#if !SE
                MyRenderProxy.GetRenderProfiler().SetAutocommit(false);
                MyRenderProxy.GetRenderProfiler().InitMemoryHack("MainEntryPoint");
#endif
                // NOTE: an assert may be thrown in debug, about missing Tutorials.sbx. Ignore it.
                m_game = InitGame();

                // Initializing the workshop means the categories are available
                var initWorkshopMethod = m_game.GetType().GetMethod("InitSteamWorkshop", BindingFlags.NonPublic | BindingFlags.Instance);
                MyDebug.AssertRelease(initWorkshopMethod != null);

                if (initWorkshopMethod != null)
                {
                    var parameters = initWorkshopMethod.GetParameters();
                    MyDebug.AssertRelease(parameters.Count() == 0);
                }

                if (initWorkshopMethod != null)
                {
                    initWorkshopMethod.Invoke(m_game, null);
                }
                else
                {
                    MySandboxGame.Log.WriteLineAndConsole(string.Format(Constants.ERROR_Reflection, "InitSteamWorkshop"));
                }
            }
            catch (Exception ex)
            {
                // This shouldn't fail, but don't stop even if it does
                ex.Log("WARNING: An exception occured, ignoring: ");
            }

            AuthenticateWorkshop();
        }