cygni / snakebot-client-dotnet

1 stars 7 forks source link

New message type: GameLinkEvent #1

Closed emilb closed 8 years ago

emilb commented 8 years ago

We've added a new event that contains an URL to the web-viewer of the game. This event comes directly after registering for a game (only training games for now).

It looks like this:

{
"gameId":"d1388638-2fcb-488b-893a-672a1182315c",
"url":"http://localhost:8090/#/viewgame?gameid=d1388638-2fcb-488b-893a-672a1182315c",
"receivingPlayerId":"ea1fd9ba-294d-4862-89c3-f8a65225cf2f",
"type":"se.cygni.snake.api.event.GameLinkEvent"
}

In the Java client we print this url to stdout like this: The game can be viewed at: http://localhost:8090/#/viewgame?gameid=d1388638-2fcb-488b-893a-672a1182315c

The idea is that a player easily can copy/paste this URL to a browser to start and watch the game. Please add similar functionality in this language binding!