From 3b659116dbc246464febd108360823e61481b4b9 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 11 Sep 2021 03:24:33 +0200 Subject: [PATCH] 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. --- plugins/subspace_storage/instance.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/subspace_storage/instance.js b/plugins/subspace_storage/instance.js index 985b6752..36cacd20 100644 --- a/plugins/subspace_storage/instance.js +++ b/plugins/subspace_storage/instance.js @@ -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));