Inheritance: UnityEngine.MonoBehaviour
Ejemplo n.º 1
0
Archivo: U.cs Proyecto: Nonanti/openmod
        public void initialize()
        {
            if (Dedicator.isDedicated)
            {
                // OPENMOD PATCH: Remove late creation of gameObject
                rocketGameObject = gameObject;
                //END OPENMOD PATCH: Remove late creation of gameObject

                if (System.Environment.OSVersion.Platform == PlatformID.Unix || System.Environment.OSVersion.Platform == PlatformID.MacOSX)
#pragma warning disable CS0618
                {
                    Console = rocketGameObject.AddComponent <UnturnedConsole>();
                }
#pragma warning restore CS0618

                Logger.LogInformation("Rocket Unturned v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " for Unturned v" + Provider.APP_VERSION + "\n");

                // OPENMOD PATCH: extracted callbacks to methods
                R.OnRockedInitialized += OnRocketInitialized;

                Provider.onServerHosted += OnServerHosted;
                // END OPENMOD PATCH: extracted callbacks to methods

                // OPENMOD PATCH: fix rocket when om reloads if server is already loaded (issue: #232)
                if (Provider.isServer)
                {
                    OnServerHosted();
                }
                // END OPENMOD PATCH: fix rocket when om reloads if server is already loaded (issue: #232)
            }
        }
Ejemplo n.º 2
0
        public void initialize()
        {
            if (Dedicator.isDedicated)
            {
                rocketGameObject = new GameObject("Rocket");
                DontDestroyOnLoad(rocketGameObject);

                if (System.Environment.OSVersion.Platform == PlatformID.Unix || System.Environment.OSVersion.Platform == PlatformID.MacOSX)
#pragma warning disable CS0618
                {
                    Console = rocketGameObject.AddComponent <UnturnedConsole>();
                }
#pragma warning restore CS0618

                CommandWindow.Log("Rocket Unturned v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " for Unturned v" + Provider.APP_VERSION);

                IPluginAdvertising pluginAdvertising = PluginAdvertising.Get();
                pluginAdvertising.PluginFrameworkName = "rocket";

                R.OnRockedInitialized += () =>
                {
                    Instance.Initialize();
                };

                Provider.onServerHosted += () =>
                {
                    rocketGameObject.TryAddComponent <U>();
                    rocketGameObject.TryAddComponent <R>();
                };
            }
        }
Ejemplo n.º 3
0
        public void initialize()
        {
            SDG.Unturned.Player.onPlayerCreated += (SDG.Unturned.Player player) =>
            {
                player.transform.gameObject.TryAddComponent <HUD>();
            };

            if (Dedicator.isDedicated)
            {
                rocketGameObject = new GameObject("Rocket");
                DontDestroyOnLoad(rocketGameObject);


                if (System.Environment.OSVersion.Platform == PlatformID.Unix || System.Environment.OSVersion.Platform == PlatformID.MacOSX)
                {
                    Console = rocketGameObject.AddComponent <UnturnedConsole>();
                }

                System.Console.Clear();
                System.Console.ForegroundColor = ConsoleColor.Cyan;
                System.Console.WriteLine("Rocket Unturned v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " for Unturned v" + Provider.APP_VERSION + "\n");

                R.OnRockedInitialized += () =>
                {
                    Instance.Initialize();
                };

                Provider.onServerHosted += () =>
                {
                    rocketGameObject.TryAddComponent <U>();
                    rocketGameObject.TryAddComponent <R>();
                };
            }
        }
Ejemplo n.º 4
0
        public void initialize()
        {
            if (Dedicator.isDedicated)
            {
                rocketGameObject = new GameObject("Rocket");
                DontDestroyOnLoad(rocketGameObject);


                if (System.Environment.OSVersion.Platform == PlatformID.Unix || System.Environment.OSVersion.Platform == PlatformID.MacOSX)
                {
                    Console = rocketGameObject.AddComponent <UnturnedConsole>();
                }

                System.Console.Clear();
                System.Console.ForegroundColor = ConsoleColor.Cyan;
                System.Console.WriteLine($"Rocket Unturned v{Assembly.GetExecutingAssembly().GetName().Version.ToString()} for Unturned v{Provider.APP_VERSION}");
                System.Console.WriteLine("HyperRocket Edition by BowieD\n");

                R.OnRockedInitialized += () =>
                {
                    Instance.Initialize();
                };

                Provider.onServerHosted += () =>
                {
                    rocketGameObject.TryAddComponent <U>();
                    rocketGameObject.TryAddComponent <R>();
                };
            }
        }
        public RocketUnturnedHost(IDependencyContainer container)
        {
            string rocketDirectory = $"Servers/{Dedicator.serverID}/Rocket/";

            if (!Directory.Exists(rocketDirectory))
            {
                Directory.CreateDirectory(rocketDirectory);
            }

            Directory.SetCurrentDirectory(rocketDirectory);
            Console = new UnturnedConsole(container);
        }
Ejemplo n.º 6
0
        internal static void Splash()
        {
            rocketGameObject = new GameObject("Rocket");
            DontDestroyOnLoad(rocketGameObject);
#if LINUX
            Console = rocketGameObject.AddComponent <UnturnedConsole>();
#endif
            System.Console.Clear();
            System.Console.ForegroundColor = ConsoleColor.Cyan;
            System.Console.WriteLine("Rocket Unturned v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " for Unturned v" + Steam.Version + "\n");

            R.OnRockedInitialized += () =>
            {
                Instance.Initialize();
            };

            Steam.OnServerHosted += () =>
            {
                rocketGameObject.TryAddComponent <U>();
                rocketGameObject.TryAddComponent <R>();
            };
        }
Ejemplo n.º 7
0
        public void initialize()
        {
            if (Dedicator.isDedicated)
            {
                rocketGameObject = new GameObject("Rocket");
                DontDestroyOnLoad(rocketGameObject);

                if (System.Environment.OSVersion.Platform == PlatformID.Unix || System.Environment.OSVersion.Platform == PlatformID.MacOSX)
#pragma warning disable CS0618
                {
                    Console = rocketGameObject.AddComponent <UnturnedConsole>();
                }
#pragma warning restore CS0618

                Logger.LogInformation("Rocket Unturned v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " for Unturned v" + Provider.APP_VERSION + "\n");

                // OPENMOD PATCH: extracted callbacks to methods
                R.OnRockedInitialized += OnRocketInitialized;

                Provider.onServerHosted += OnServerHosted;
                // END OPENMOD PATCH: extracted callbacks to methods
            }
        }
Ejemplo n.º 8
0
        internal static void Splash()
        {
            rocketGameObject = new GameObject("Rocket");
            DontDestroyOnLoad(rocketGameObject);
#if LINUX
            Console = rocketGameObject.AddComponent<UnturnedConsole>();
#endif
            System.Console.Clear();
            System.Console.ForegroundColor = ConsoleColor.Cyan;
            System.Console.WriteLine("Rocket Unturned v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " for Unturned v" + Steam.Version + "\n");

            R.OnRockedInitialized += () =>
            {
                Instance.Initialize();
            };

            Steam.OnServerHosted += () =>
            {
                rocketGameObject.TryAddComponent<U>();
                rocketGameObject.TryAddComponent<R>();
            };
        }
Ejemplo n.º 9
0
        public void initialize()
        {
            SDG.Unturned.Player.onPlayerCreated += (SDG.Unturned.Player player) =>
            {
                player.transform.gameObject.TryAddComponent<HUD>();
            };

            if (Dedicator.isDedicated)
            {
                rocketGameObject = new GameObject("Rocket");
                DontDestroyOnLoad(rocketGameObject);
#if LINUX
    Console = rocketGameObject.AddComponent<UnturnedConsole>();
#endif
                System.Console.Clear();
                System.Console.ForegroundColor = ConsoleColor.Cyan;
                System.Console.WriteLine("Rocket Unturned v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " for Unturned v" + Provider.APP_VERSION + "\n");

                R.OnRockedInitialized += () =>
                {
                    Instance.Initialize();
                };

                Provider.onServerHosted += () =>
                {
                    rocketGameObject.TryAddComponent<U>();
                    rocketGameObject.TryAddComponent<R>();
                };
            }
        }