Ejemplo n.º 1
0
        private void OnTick()
        {
            if (rustWeb == null)
            {
                if (RustWeb.Instance == null)
                {
                    logger.Write(LogType.Info, "Initializing RustWeb " + RustWeb.Version.ToString(3) + ", serving from '" + RootDir + "' ...");
                    rustWeb = new RustWeb(RootDir, DataDir);
                    rustWeb.AddEnvironmentVersion("oxide", Oxide.Core.OxideMod.Version.ToString());

                    /* foreach (var plugin in Interface.GetMod().RootPluginManager.GetPlugins()) {
                     *  rustWeb.AddEnvironmentVersion("oxide." + plugin.Name, plugin.Version.ToString());
                     * } */
                    rustWeb.OnLog += (sender, message) => {
                        logger.Write(LogType.Info, "[RustWeb] {0}", message);
                    };
                    rustWeb.OnError += (sender, e) => {
                        logger.WriteException("[RustWeb] ERROR: " + e.Message, e.Exception);
                    };
                    rustWeb.Start();
                }
                else
                {
                    logger.Write(LogType.Warning, "Reloading RustWeb has no effect. To update it, a server restart is inevitable.");
                    rustWeb = RustWeb.Instance;
                }
            }
            rustWeb.Tick();
        }
Ejemplo n.º 2
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            if (RustWeb.Instance == null)
            {
                logger.Write(LogType.Info, "Starting RustWeb " + RustWeb.Version.ToString(3) + ", serving from '" + RootDir + "' ...");
                rustWeb          = new RustWeb(RootDir, DataDir);
                rustWeb.OnError += (sender, e) => {
                    logger.WriteException("RustWeb error: " + e.Message, e.Exception);
                };
                rustWeb.Start();
            }
            else
            {
                logger.Write(LogType.Warning, "Reloading RustWeb has no effect. To update it, a server restart is inevitable.");
                rustWeb = RustWeb.Instance;
            }
        }
Ejemplo n.º 3
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
                return;
            serverInitialized = true;

            if (RustWeb.Instance == null) {
                logger.Write(LogType.Info, "Starting RustWeb " + RustWeb.Version.ToString(3) + ", serving from '" + RootDir + "' ...");
                rustWeb = new RustWeb(RootDir, DataDir);
                rustWeb.OnError += (sender, e) => {
                    logger.WriteException("RustWeb error: " + e.Message, e.Exception);
                };
                rustWeb.Start();
            } else {
                logger.Write(LogType.Warning, "Reloading RustWeb has no effect. To update it, a server restart is inevitable.");
                rustWeb = RustWeb.Instance;
            }
        }