1. When a Rust update comes out a message is periodically sent to the console saying an update is available (if you don't have -forceupdate)

    Is there a hook that can pick this up?
     
  2. They come out on monday, just do a date check
     
  3. hardly efficient and very inaccurate though, the idea is to have it send me an SMS the moment an update comes in
     
  4. Wulf

    Wulf Community Admin

    There isn't a hook that can capture that that I'm aware of. If it gets logged to file, you could easily write a script that tails the log and looks for it.
     
  5. I guess it would be possible to create a hook for it in the ServerHeartbeat class.

    Code:
        private void Awake()
        {
            base.InvokeRepeating("StartHeartbeat", UnityEngine.Random.Range((float) 0f, (float) 180f), 300f);
        }    private void StartHeartbeat()
        {
            GameConfig component = base.GetComponent<GameConfig>();
            if ((component != null) && component.isLoaded)
            {
                Realm.PushServer();
                int @int = component.json.GetInt("version", 0);
                if (this.doneFirstUpdate)
                {
                    if (@int != this.version)
                    {
                        UnityEngine.Debug.Log("New version detected!");
                        if (CommandLine.HasSwitch("-autoupdate"))
                        {
                            base.StopAllCoroutines();
                            base.StartCoroutine(this.DoRestart());
                            base.CancelInvoke("StartHeartbeat");
                        }
                        else
                        {
                            UnityEngine.Debug.Log(" ... no -autoupdate switch so not closing");
                        }
                    }
                }
                else
                {
                    this.doneFirstUpdate = true;
                    this.version = @int;
                }
                Realm.Pop();
            }
        }