From d4da2b6d09c202f62284539aae61979d8c26498d Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 23 Jun 2019 18:00:54 +1000 Subject: [PATCH] Disabled the gold freeze --- public/news/2019-06-23-01.md | 8 ++++++++ server/profiles.js | 7 ++++--- server/statistics.js | 5 ++--- 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 public/news/2019-06-23-01.md diff --git a/public/news/2019-06-23-01.md b/public/news/2019-06-23-01.md new file mode 100644 index 0000000..a78fa0b --- /dev/null +++ b/public/news/2019-06-23-01.md @@ -0,0 +1,8 @@ +Time For A Thaw +--- +_23 June 2019_ + +I've unfrozen the gold tick, since the supply dropped enough to keep it even. This "drain mode" is still coded in, but needs to be activated manually by tweaking the code. For now, that's fine. I've also adjusted the default tick rates to 10, 20, 30 and 60 minutes based on the global gold supply. + +As for backend stuff, It's going really well! There's like 1200+ lines that I need to refactor, plus I need to write tests for pretty much everything, so it's going to take a long time. I'm going to power through for the next week in hopes that I can finish it sooner rather than later. + diff --git a/server/profiles.js b/server/profiles.js index 37eae65..f3faa97 100644 --- a/server/profiles.js +++ b/server/profiles.js @@ -477,11 +477,12 @@ const runGoldTick = (connection) => { connection.query(query, (err, results) => { if (err) throw err; + //TODO: automatic "drain mode" + //determine the correct tick rate based on the current gold average let tickRate = (() => { - return -60; //TMP: semi-freeze the tick rate - if (results[0].goldAverage < 120) return 5; - if (results[0].goldAverage < 130) return 15; + if (results[0].goldAverage < 120) return 10; + if (results[0].goldAverage < 130) return 20; if (results[0].goldAverage < 140) return 30; return 60; //slow it way down })(); diff --git a/server/statistics.js b/server/statistics.js index 15aed2f..69d0b0d 100644 --- a/server/statistics.js +++ b/server/statistics.js @@ -18,9 +18,8 @@ const statisticsRequest = (connection) => (req, res) => { //determine the correct tick rate based on the current gold average //NOTE: copy/pasted let tickRate = (() => { - return -60; //TMP: semi-freeze the tick rate - if (results[0].goldAverage < 120) return 5; - if (results[0].goldAverage < 130) return 15; + if (results[0].goldAverage < 120) return 10; + if (results[0].goldAverage < 130) return 20; if (results[0].goldAverage < 140) return 30; return 60; //slow it way down })();