refactor much of the hodge-podge code into their own files
This commit is contained in:
@@ -47,7 +47,7 @@ strategies =
|
||||
options =
|
||||
domain: process.env.BASE_URL || 'http://localhost:3000'
|
||||
allowPurl: true
|
||||
schema: require('../app/schema').newUserObject()
|
||||
schema: require('../app/character').newUserObject()
|
||||
customAccessControl: habitrpgStore.customAccessControl
|
||||
|
||||
mongo_store = new MongoStore {url: process.env.NODE_DB_URI}, ->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
_ = require 'underscore'
|
||||
schema = require "../app/schema"
|
||||
character = require "../app/character"
|
||||
|
||||
module.exports.middleware = (req, res, next) ->
|
||||
model = req.getModel()
|
||||
@@ -33,7 +33,7 @@ module.exports.app = (appExports, model) ->
|
||||
Buy Reroll Button
|
||||
###
|
||||
appExports.buyReroll = (e, el, next) ->
|
||||
batch = new schema.BatchUpdate(model)
|
||||
batch = new character.BatchUpdate(model)
|
||||
obj = model.get('_user')
|
||||
batch.set 'balance', obj.balance-1
|
||||
_.each obj.tasks, (task) -> batch.set("tasks.#{task.id}.value", 0) unless task.type == 'reward'
|
||||
|
||||
Reference in New Issue
Block a user