Skip to content

Commit

Permalink
Fixing unhandled event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
phillc committed May 24, 2015
1 parent c24ee27 commit ffcd2dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions lib/hearts/game.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ Engine = machina.Fsm.extend
if @finishedGame.length == 4
@game.finish()

"*": (message, args...) ->
[event, position] = message.split(".")
"*": (payload) ->
[event, position] = payload.inputType.split(".")
if event == "timeout"
logger.error "timeout received", position
@game.abort(position, {type: "timeout", message: "Your action took longer than allowed"})
Expand Down Expand Up @@ -229,6 +229,3 @@ Engine = machina.Fsm.extend
@finishedGame = []
aborted: {}
finished: {}



1 change: 0 additions & 1 deletion test/lib/hearts/gameTest.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -445,4 +445,3 @@ describe "Game", ->

# @game.handle "something.west"
it "moves to finished after everyone has checked in"

0 comments on commit ffcd2dc

Please sign in to comment.