Skip to content

Commit

Permalink
Register an error event handler in the the client template
Browse files Browse the repository at this point in the history
  • Loading branch information
juho05 committed Jun 10, 2022
1 parent e971cbe commit fdcc433
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion new/client/templates/wrappers/main.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func main() {

fmt.Println("GameID:", game.Id)

// TODO register event listeners
game.OnCGErrorEvent(func(origin tictactoesimple.Player, data cg.ErrorEventData) {
fmt.Println("error:", data.Message)
})

game.Run()
}

0 comments on commit fdcc433

Please sign in to comment.