Navigation Menu

Skip to content

Commit

Permalink
Fixes a bug regarding the battle timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
caseywebdev committed May 6, 2012
1 parent 88d6ced commit 19b36d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/socket.coffee
Expand Up @@ -18,6 +18,7 @@ _ = require 'underscore'
)[0]
opponent = battle.get('users').find (u) ->
u.get('name') isnt name
clearTimeout battle.get 'timeout'
battle.destroy()
opponent.set inBattle: false
@broadcast notice:
Expand Down Expand Up @@ -84,7 +85,7 @@ _ = require 'underscore'
@broadcast users: users.toJSON()
@emit 'battle', battle: battle.toJSON()
@io.sockets.socket(user1.get 'socketId').emit 'battle', battle: battle.toJSON()
setTimeout =>
battle.set timeout: setTimeout =>
user1.set inBattle: false
user2.set inBattle: false
@emit 'battleOver'
Expand Down
3 changes: 3 additions & 0 deletions stylus/app.coffee
Expand Up @@ -179,6 +179,9 @@
height: 210px
overflow-y: auto
padding: 10px
strong
color: #f66
#user2-container
float: right
Expand Down

0 comments on commit 19b36d1

Please sign in to comment.