diff --git a/lib/app/index.js b/lib/app/index.js index 711715ccbf..1d2cfdd888 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -324,12 +324,8 @@ ready(function(model) { }); } }; - setTimeout(function() { - return poormanscron(); - }, 2000); - setInterval(function() { - return poormanscron(); - }, 3600000); + setTimeout(poormanscron, 2000); + setInterval(poormanscron, 3600000); return exports.endOfDayTally = function(e, el) { return scoring.tally(); }; diff --git a/lib/app/schema.js b/lib/app/schema.js index 92dcaff27b..c198b6851f 100644 --- a/lib/app/schema.js +++ b/lib/app/schema.js @@ -2,6 +2,7 @@ var userSchema; module.exports.userSchema = userSchema = { + balance: 2, stats: { money: 0, exp: 0, diff --git a/src/app/index.coffee b/src/app/index.coffee index 44fa635e8d..2faf09baca 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -262,12 +262,8 @@ ready (model) -> scoring.tally(tallyFor) # FIXME seems can't call poormanscron() instantly, have to call after some time (2s here) # Doesn't do anything otherwise. Don't know why... model not initialized enough yet? - setTimeout () -> # Run once on refresh - poormanscron() - , 2000 - setInterval () -> # Then run once every hour - poormanscron() - , 3600000 + setTimeout poormanscron, 2000 # Run once on refresh + setInterval poormanscron, 3600000 # Then run once every hour # ========== DEBUGGING ========== diff --git a/src/app/schema.coffee b/src/app/schema.coffee index 2da64f4ea3..abb11d21a2 100644 --- a/src/app/schema.coffee +++ b/src/app/schema.coffee @@ -1,5 +1,6 @@ -module.exports.userSchema = userSchema = { +module.exports.userSchema = userSchema = { + balance: 2 stats: { money: 0, exp: 0, lvl: 1, hp: 50 } items: { itemsEnabled: false, armor: 0, weapon: 0, rerollsRemaining: 5 } tasks: {} @@ -11,7 +12,7 @@ module.exports.userSchema = userSchema = { } module.exports.updateSchema = (model) -> - return + return # not using, will revisit this later # Reset history, remove inactive users model.fetch 'users', (err, users) -> _.each users.get(), (userObj) ->