mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 14:33:59 -04:00
Added teamSpells persistence
This commit is contained in:
parent
cc3b93a0f8
commit
0cbf669474
2 changed files with 9 additions and 2 deletions
|
@ -109,6 +109,10 @@ module.exports = class LevelBus extends Bus
|
|||
unless e.spell.spellKey in @teamSpellMap[spellTeam]
|
||||
@teamSpellMap[spellTeam].push e.spell.spellKey
|
||||
console.log "Assigned spell #{e.spell.spellKey} to team #{spellTeam}"
|
||||
@changedSessionProperties.teamSpells = true
|
||||
@session.set({'teamSpells': @teamSpellMap})
|
||||
@saveSession()
|
||||
|
||||
|
||||
|
||||
onScriptStateChanged: (e) ->
|
||||
|
@ -234,4 +238,7 @@ module.exports = class LevelBus extends Bus
|
|||
|
||||
setTeamSpellMap: (spellMap) ->
|
||||
@teamSpellMap = spellMap
|
||||
console.log @teamSpellMap
|
||||
console.log @teamSpellMap
|
||||
@changedSessionProperties.teamSpells = true
|
||||
@session.set({'teamSpells': @teamSpellMap})
|
||||
@saveSession()
|
|
@ -7,7 +7,7 @@ class LevelSessionHandler extends Handler
|
|||
modelClass: LevelSession
|
||||
editableProperties: ['multiplayer', 'players', 'code', 'completed', 'state',
|
||||
'levelName', 'creatorName', 'levelID', 'screenshot',
|
||||
'chat']
|
||||
'chat', 'teamSpells']
|
||||
|
||||
getByRelationship: (req, res, args...) ->
|
||||
return @sendNotFoundError(res) unless args.length is 2 and args[1] is 'active'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue