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?
Solved Capture update availability
Discussion in 'Rust Development' started by TrustZan, Feb 9, 2015.
-
They come out on monday, just do a date check
-
-
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.
-
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(); } }