diff --git a/.gitignore b/.gitignore index aa612a11..94d6d05f 100644 --- a/.gitignore +++ b/.gitignore @@ -48,7 +48,6 @@ saves !sharedPlugins/ sharedPlugins/* !sharedPlugins/inventoryImports/ -!sharedPlugins/UPSdisplay/ !sharedPlugins/researchSync/ !sharedPlugins/clusterioMod/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 303ffd78..59430008 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,8 @@ Version 2.0.0 - Removed info and shout command from globalChat plugin - Removed mirrorAllChat and enableCrossServerShout configuration options for globalChat plugin. +- Removed UPSdisplay plugin. UPS statistics is exported by the statistics + exporter plugin. ### Breaking Changes diff --git a/sharedPlugins/UPSdisplay/config.js b/sharedPlugins/UPSdisplay/config.js deleted file mode 100644 index 7abaacf9..00000000 --- a/sharedPlugins/UPSdisplay/config.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - Example config file for example Clusterio plugin -*/ - -module.exports = { - // Name of package. For display somewhere I guess. - name: "UPSdisplay", - version: "2.0.0", - description: "Internal clusterio plugin to get the worlds UPS and display it on master", - // We'll send everything in this file to your stdin. Beware. - scriptOutputFileSubscription: "UPSdisplay.txt", -} \ No newline at end of file diff --git a/sharedPlugins/UPSdisplay/index.js b/sharedPlugins/UPSdisplay/index.js deleted file mode 100644 index f15a4ea2..00000000 --- a/sharedPlugins/UPSdisplay/index.js +++ /dev/null @@ -1,45 +0,0 @@ -const needle = require("needle"); - - - -class UPSdisplay { - constructor(slaveConfig, msgInterface, extras){ - this.config = slaveConfig; - this.messageInterface = msgInterface; - this.socket = extras.socket; - this.slave = extras.slave; - - this.historicalTicks = []; - setInterval(() => { - this.messageInterface("/silent-command rcon.print(game.tick)", data => { - this.tick = Number(data); - this.historicalTicks[this.historicalTicks.length] = {tick:Number(data), timestamp:Date.now()}; - if(this.historicalTicks.length > 30){ - this.historicalTicks.shift(); // delete last element in array (position 0); - } - }); - },1000); - setInterval(() => { - if(this.historicalTicks && this.historicalTicks[0]){ - let timePeriod = this.historicalTicks[this.historicalTicks.length-1].timestamp - this.historicalTicks[0].timestamp; - let ticksInPeriod = this.historicalTicks[this.historicalTicks.length-1].tick - this.historicalTicks[0].tick; - let UPS = Math.round(ticksInPeriod / (timePeriod/1000)); - // console.log("UPS: " + UPS); - try{ - needle.post( - this.config.masterURL+'/api/editSlaveMeta', - {instanceID: this.config.unique, password: this.config.clientPassword, meta: {UPS:UPS, tick:this.tick}}, - {headers: {'x-access-token': this.config.masterAuthToken}}, - function(err, resp) { - // success? - } - ); - } catch (err){ - console.log(err); - } - } - }, 5000); - this.messageInterface("/silent-command game.print('UPSdisplay enabled')"); - } -} -module.exports = UPSdisplay; \ No newline at end of file diff --git a/sharedPlugins/UPSdisplay/test/missing.js b/sharedPlugins/UPSdisplay/test/missing.js deleted file mode 100644 index 923d82bf..00000000 --- a/sharedPlugins/UPSdisplay/test/missing.js +++ /dev/null @@ -1,4 +0,0 @@ -// These are libraries that does not have any units test, they are -// required here in order to track coverage for them. - -require('../index');