Exemplo n.º 1
0
 /// <inheritdoc/>
 public virtual void Start()
 {
     Game.SignalStart();
     if (!Game.WaitFor(VRageGame.GameState.Running))
     {
         Log.Warn("Failed to wait for the game to be started");
     }
 }
Exemplo n.º 2
0
 /// <inheritdoc/>
 public virtual void Start()
 {
     Game.SignalStart();
     if (!Game.WaitFor(VRageGame.GameState.Running))
     {
         Log.Warn("Failed to wait for the game to be started");
     }
     Invoke(() => Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"));
 }
Exemplo n.º 3
0
        /// <inheritdoc />
        public virtual void Init()
        {
            Debug.Assert(!_init, "Torch instance is already initialized.");
            SpaceEngineersGame.SetupBasicGameInfo();
            SpaceEngineersGame.SetupPerGameSettings();
            ObjectFactoryInitPatch.ForceRegisterAssemblies();

            Debug.Assert(MyPerGameSettings.BasicGameInfo.GameVersion != null, "MyPerGameSettings.BasicGameInfo.GameVersion != null");
            GameVersion = new MyVersion(MyPerGameSettings.BasicGameInfo.GameVersion.Value);

            try
            {
                Console.Title = $"{Config.InstanceName} - Torch {TorchVersion}, SE {GameVersion}";
            }
            catch
            {
                // Running without a console
            }

#if DEBUG
            Log.Info("DEBUG");
#else
            Log.Info("RELEASE");
#endif
            Log.Info($"Torch Version: {TorchVersion}");
            Log.Info($"Game Version: {GameVersion}");
            Log.Info($"Executing assembly: {Assembly.GetEntryAssembly().FullName}");
            Log.Info($"Executing directory: {AppDomain.CurrentDomain.BaseDirectory}");

            Managers.GetManager <PluginManager>().LoadPlugins();
            Game = new VRageGame(this, TweakGameSettings, SteamAppName, SteamAppId, Config.InstancePath, RunArgs);
            if (!Game.WaitFor(VRageGame.GameState.Stopped))
            {
                Log.Warn("Failed to wait for game to be initialized");
            }
            Managers.Attach();
            _init = true;

            if (GameState >= TorchGameState.Created && GameState < TorchGameState.Unloading)
            {
                // safe to commit here; all important static ctors have run
                PatchManager.CommitInternal();
            }
        }