Example #1
0
        void MainThreadStart(object obj)
        {
            string instanceName = String.IsNullOrWhiteSpace(UsedServiceName) ? "Service" : UsedServiceName;

            DedicatedServer.RunMain(instanceName, null, true);
            m_waitEvent.Set();
        }
Example #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.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;
            }
        }
Example #3
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;
            }
        }