mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-22 00:21:32 +00:00
Added a configurable offline time limit, default 1 hour
This commit is contained in:
parent
62edbcae09
commit
1a03a00321
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue