       'spectate battle': @spectateBattle
       'join battle': @joinBattle
       'leave battle': @leaveBattle
+    @updateQueue = []
     @on 'remove', (model) ->
       PokeBattle.socket.send('leave battle', model.id)
 

      console.log "Received events for #{battleId}, but no longer in battle!"
      return
    battle.notify()
    @_updateBattle(battle, actions)

  _updateBattle: (battle, actions, wasAtBottom) =>
    view = battle.view
    if actions.length == 0
      view.renderUserInfo()
      if wasAtBottom || view.skip? then view.chatView.scrollToBottom()
      if view.skip?                then delete view.skip
      return
    wasAtBottom ||= view.chatView.isAtBottom()
    action = actions.shift()
    [ type, rest... ] = action
    protocol = (key  for key, value of Protocol when value == type)[0]
    console.log "Received protocol: #{protocol}"

    done = () =>
      return  if done.called
      done.called = true
      @_updateBattle.call(this, battle, wasAtBottom)

    try
      switch type
