mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 15:24:52 +09:00
Don't ping subspace_storage mod if master connection is down
The system for preventing items being sent without a connection to the master and (and thus voiding the items) is to only do so if a ping from the plugin has been received in the last 5 seconds of in-game time. Don't send pings without being fully connected to the master to make sure this system actually activates during connection downtime.
This commit is contained in:
1 parent
ddd1bde1b4
commit
3b659116db
1 file changed
+3
@@ -27,6 +27,9 @@ class InstancePlugin extends libPlugin.BaseInstancePlugin {
|
||||
|
||||
async onStart() {
|
||||
this.pingId = setInterval(() => {
|
||||
if (!this.slave.connected) {
|
||||
return; // Only ping if we are actually connected to the master.
|
||||
}
|
||||
this.sendRcon(
|
||||
"/sc __subspace_storage__ global.ticksSinceMasterPinged = 0", true
|
||||
).catch(err => this.unexpectedError(err));
|
||||
|
||||
Reference in new issue
Block a user