allow cron to record user's current timezone offset in preferences.timezoneOffsetAtLastCron (initial stage of cron timezone fix for https://github.com/HabitRPG/habitrpg/issues/3806 )

This commit is contained in:
Alys
2016-03-29 19:06:15 +10:00
parent f4b43f55f0
commit ae9e6fbe30
3 changed files with 5 additions and 0 deletions

View File

@@ -36,6 +36,9 @@ module.exports = function(user, options) {
}
user.auth.timestamps.loggedin = new Date();
user.lastCron = now;
if (_.isFinite(+user.preferences.timezoneOffset)) {
user.preferences.timezoneOffsetAtLastCron = user.preferences.timezoneOffset;
}
if (user.items.lastDrop.count > 0) {
user.items.lastDrop.count = 0;
}