SmoothRestarter

Moved

Total Downloads: 5,594 - First Release: Apr 11, 2016 - Last Update: Dec 30, 2017

5/5, 22 likes
  1. Plugin isnt detecting new client release. Which means it's not auto restarting the sevrer.
     
  2. Correction of my former statement :p
    Did forget about i did implement it some day:
    Screenshot_14.jpg
     
  3. (02:31:48) | [SmoothRestart] Server will restart in 30 minutes!

    (02:31:48) | NetworkData.Write - no handler to write Facepunch.ObjectList -> Facepunch.ObjectList

    (02:31:48) | NetworkData.Write - no handler to write Facepunch.ObjectList -> Facepunch.ObjectList

    (02:31:48) | NetworkData.Write - no handler to write Facepunch.ObjectList -> Facepunch.ObjectList

    (02:31:48) | 92.109.146.243:56664/76561197999286293/Riddle disconnecting: RPC Error in AddUI
     
  4. Need to re-design the SimpleUI...until this it's not usable.
     
  5. I have never seen that in my game and the only way i know Oxide needs updating is by way of the CMD window.

    Can this program be used to restart the server at a certain time (auto shutdown)
     
    Last edited by a moderator: Oct 28, 2017
  6. Failed to call hook 'OnTick' on plugin 'SmoothRestart v1.2.1' (NullReferenceException: Object reference not set to an instance of an object)

    After the latest Rust updates getting this error in console.
     
  7. please add the scheduled execution of the console command

    for example TimedExecute

    "05:07:00": "weather.fog 0",

    Code:
    {
      "EnableInGameTime-Timer": false,
      "EnableRealTime-Timer": true,
      "EnableTimerOnce": false,
      "EnableTimerRepeat": false,
      "InGameTime-Timer": {
        "01:00": "weather rain",
        "12:00": "command 1",
        "15:00": "command 2"
      },
      "RealTime-Timer": {
        "05:00:00": "global.restart 60",
        "05:05:00": "spawns.config Spawns",
        "05:06:00": "server.radiation 0",
        "05:07:00": "weather.fog 0",
        "17:00:00": "global.restart 120",
        "17:06:00": "spawns.config Spawns",
        "17:07:00": "server.radiation 0",
        "17:08:00": "weather.fog 0"
      },
      "TimerOnce": {
        "command1 'msg'": 60,
        "command2 'msg'": 120,
        "command3 arg": 180,
        "reset.timeronce": 181
      },
      "TimerRepeat": {
        "command1 arg": 300,
        "command2 'msg'": 300
      }
    }
     
  8. Which "command"?
    The plugin has already a timer/schedule section!
     
  9. After restarting the server, I need to automatically call time commands

    "05:07:00": "weather.fog 0",

    Timed Execute | Oxide
     
  10. And what has this to do with SmoothRestarter??? Sorry, but i don't get it.
     
  11. Trying to understand how this plugin works, and i have 1 question: if i start the server outdated, with this plugin loaded, its will not detect the oxide update, right? Because always at the start, currentOxideBuild variable is being set to the value from the json response. That way we could easily miss the oxide update, if server was loading slowly, or by another means.

    Isn't it possible to change logic so it will set the currentOxideBuild from the result of o.version output instead? Or maybe there is a property somewhere in oxide, i dunno. I would be very thankful

    UPD: Just noted, that you are setting the serverOxideVersion var, but aren't using it for detecting the update, so i'd suggest to change your code to something like this:
    Code:
    if (currentOxideBuild == 0 || initCheckOxideBuild)
                    {
                        if ( buildNum != currentOxideBuild)
                        {
                            currentOxideBuild = buildNum;
                            Config["Checks", "currentOxideBuild"] = currentOxideBuild;
                            Config.Save();
                        }
                        if (initCheckOxideBuild)
                        {
                            if (currentOxideBuild != serverOxideVersion)
                                Puts($"Your servers Oxide build is older then the current build '{currentOxideBuild}'");
                            else
                                Puts($"Your servers Oxide build is up to date");
                        }
                        if (initCheckOxideBuild) initCheckOxideBuild = false;
                        return;
                    }
                    if (currentOxideBuild != buildNum)
                    {
                        currentOxideBuild = buildNum;
                        Config["Checks", "currentOxideBuild"] = currentOxideBuild;
                        Config.Save();
                    }
                    if (serverOxideVersion != currentOxideBuild)
                    {
                        Puts(StripTags(string.Format(lang.GetMessage("OxideBuildDetected", this), currentOxideBuild)));
                        if (notifyOnlineAdmins)
                            foreach (var player in BasePlayer.activePlayerList.Where(p => p.IsAdmin).ToList())
                                SendReply(player, string.Format(lang.GetMessage("OxideBuildDetected", this), currentOxideBuild));
                        newOxideBuildDetected = true;
                        if ( _oxideTimer == null || _oxideTimer.Destroyed)
                            return;
                        _oxideTimer.Destroy();
                        _oxideTimer = null;
                        CheckAutoRestart();
                    }
    UPD2: oh, i see, devblog updates has the same problem, which isn't possible to fix that way, so that plugin is a bit unsafe to use for autoupdates (in case of crashes, and restarts by another means), but i still would love to see the oxide fix in your plugin anyway
    UPD3: Well if you could use the idea from your another plugin: ProtocolKickInfo, plugin will keep the server always up to date (in case if server is got updated during startup). You just need to change the currentDevblog variable if someone is trying to connect with never rust version
    UPD4: Something like that.
    SmoothRestart.cs:
    Code:
    void NewDevblogDetected()
    {
        if (!newDevblogDetected)
            currentDevblog--;
    }
    ProtocolKickInfo.cs:
    Code:
    [PluginReference]
    private Plugin SmoothRestart;void OnClientAuth(Connection connection)
    {
        if (connection.protocol > serverProtocol)
        {
            // ...
            else
                quitTimer[connection.userid]++;        SmoothRestart?.Call("NewDevblogDetected");
            // ...
        }
        // ...
    }
     
    Last edited by a moderator: Nov 6, 2017
  12. Example Timed Execute | Oxide

    Code:
    "RealTime-Timer": {
        "05:00:00": "global.restart 60",
        "05:05:00": "spawns.config Spawns",
        "05:06:00": "server.radiation 0",
        "05:07:00": "weather.fog 0",
        "17:00:00": "global.restart 120",
        "17:06:00": "spawns.config Spawns",
        "17:07:00": "server.radiation 0",
        "17:08:00": "weather.fog 0"
      },"RealTime-Timer": {
        "16:00:00": "command1 arg",
        "16:30:00": "command2 arg",
        "17:00:00": "command3 arg",
        "18:00:00": "command4 arg"
      },
     
  13. Hi! does not seem to work after last update :/(
     
  14. Wulf

    Wulf Community Admin

    What exactly didn't work?
     
  15. Yea sorry i understand my post was rather stupid, no information at all. Basically it just unloaded plugins etc. then nothing, did not really restart and the server window had to be manually closed.
     
  16. Is it possible to change the shutdown message players get? It says Shutting Down, but it's actually restarting. I saw a server having that, but not sure how
     
  17. There's not any "shutdown" in the default "en" "SmoothRestart.json" ;)
    Code:
    {
      "RestartInit": "<color=orange>Server will restart in <color=red>{0}</color> minutes!</color>",
      "RestartInitPatch": "<color=red>Server Patch</color> <color=orange>restart in <color=red>{0}</color> minutes!</color>",
      "RestartInitSec": "<color=orange>Server will restart in <color=red>{0}</color> seconds!</color>",
      "RestartCancel": "<color=green>Server restart stopped!</color>",
      "ManualInit": "<color=silver>Manual countdown will start at next full minute</color>",
      "ManualCancel": "<color=silver>Manual Timer was canceled</color>",
      "DevblogDetected": "<color=orange>New DevBlog <color=green>{0}</color> detected !!!</color>",
      "OxideBuildDetected": "<color=orange>New OxideBuild <color=green>{0}</color> detected !!!</color>"
    }
    [DOUBLEPOST=1510432203][/DOUBLEPOST]
    It does technically only "quit" the server. This stops the process, and yes, does not close the window.

    Taken from plugin description >>>

    Additional info:
    (It does only restart when you are using a restart script or any other software that restarts the instance after shutdown)