コード例 #1
0
        public static void Run <T>(string[] args) where T : MyObjectBuilder_SessionSettings, new()
        {
            if (DedicatedServer.ProcessArgs(args))
            {
                return;
            }


            if (Environment.UserInteractive)
            {
                MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly);
                MyPlugins.RegisterSandboxAssemblyFile(MyPerGameSettings.SandboxAssembly);
                MyPlugins.RegisterSandboxGameAssemblyFile(MyPerGameSettings.SandboxGameAssembly);
                MyPlugins.RegisterFromArgs(args);
                MyPlugins.Load();
                ShowWindow(GetConsoleWindow(), SW_HIDE);
                MyConfigurator.Start <T>();
                MyPlugins.Unload();
                return;
            }
            else
            {
                MyServiceBase.Run(new WindowsService());
                return;
            }
        }
コード例 #2
0
        public static void Run <T>(string[] args) where T : MyObjectBuilder_SessionSettings, new()
        {
            if (DedicatedServer.ProcessArgs(args))
            {
                return;
            }


            if (Environment.UserInteractive)
            {
                MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly);
                MyPlugins.RegisterGameObjectBuildersAssemblyFile(MyPerGameSettings.GameModObjBuildersAssembly);
                MyPlugins.RegisterSandboxAssemblyFile(MyPerGameSettings.SandboxAssembly);
                MyPlugins.RegisterSandboxGameAssemblyFile(MyPerGameSettings.SandboxGameAssembly);
                MyPlugins.RegisterFromArgs(args);
                MyPlugins.Load();
                bool resultRegisterAssemblies = MyObjectBuilderType.RegisterAssemblies();
                Debug.Assert(resultRegisterAssemblies, "Registering object builders types from assemblies failed.");
                resultRegisterAssemblies = MyObjectBuilderSerializer.RegisterAssembliesAndLoadSerializers();
                Debug.Assert(resultRegisterAssemblies, "Registering object builders serializers from assemblies failed.");
                ShowWindow(GetConsoleWindow(), SW_HIDE);
                MyConfigurator.Start <T>();
                MyPlugins.Unload();
                return;
            }
            else
            {
                MyServiceBase.Run(new WindowsService());
                return;
            }
        }