1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-21 16:13:55 +00:00

Added a configurable offline time limit, default 1 hour

This commit is contained in:
Acamaeda 2020-10-01 21:59:41 -04:00
parent 62edbcae09
commit 1a03a00321

View file

@ -673,6 +673,7 @@ var interval = setInterval(function() {
let now = Date.now() let now = Date.now()
let diff = (now - player.time) / 1e3 let diff = (now - player.time) / 1e3
if (player.offTime !== undefined) { if (player.offTime !== undefined) {
if (player.offTime.remain > modInfo.offlineLimit * 3600000) player.offlineTime.remain = modInfo.offlineLimit * 3600000
if (player.offTime.remain > 0) { if (player.offTime.remain > 0) {
let offlineDiff = Math.max(player.offTime.remain / 10, diff) let offlineDiff = Math.max(player.offTime.remain / 10, diff)
player.offTime.remain -= offlineDiff player.offTime.remain -= offlineDiff