/gamehub
Methods sent by client
Creates a game room with given options and associates creator to the room.
POST
https://chesswebapi20210509195304.azurewebsites.net/gamehub/CreateGameRoom
Returns the unique game key
Query Parameters
gameOptions*
object
{ "player1": "string", "player2": "string", "gameVarient": 0, "minutesPerSide": 60, "incrementInSeconds": 600, "side": 0 }
string
Associates sender to the game room with given name.
POST
https://chesswebapi20210509195304.azurewebsites.net/gamehub/JoinGame
Returns the game options of the game room.
Query Parameters
roomName*
String
{
"player1": "string",
"player2": "string",
"gameVarient": 0,
"minutesPerSide": 60,
"incrementInSeconds": 600,
"side": 0
}
Removes sender from the game room with given game room name.
POST
https://chesswebapi20210509195304.azurewebsites.net/gamehub/LeaveGame
After that send information "GameEnded" to all clients in game room.
If possible performs given move on board in the game room with given game room name.
POST
https://chesswebapi20210509195304.azurewebsites.net/gamehub/PerformMove
After move performed send information "PerformMove" to all clients in game room.
Query Parameters
roomName
String
move
object
{ "current": { "x": 0, "y": 0 }, "destination": { "x": 0, "y": 0 } }
Methods sent by server
Sent after game options in a game room changed.
GET
https://chesswebapi20210509195304.azurewebsites.net/gamehub/GameOptionsChanged
Query Parameters
roomName*
String
gameOptions*
object
{ "player1": "string", "player2": "string", "gameVarient": 0, "minutesPerSide": 60, "incrementInSeconds": 600, "side": 0 }
Sent after valid move performed.
GET
https://chesswebapi20210509195304.azurewebsites.net/gamehub/PerformMove
Query Parameters
roomName
String
move
objcet
{ "current": { "x": 0, "y": 0 }, "destination": { "x": 0, "y": 0 } }
clock1
object
{"started":true,"time":600000}
clock2
object
{"started":false,"time":600000}
Sent after game ended.
GET
https://chesswebapi20210509195304.azurewebsites.net/gamehub/GameEnded
Query Parameters
roomName
String
winner
int?
0 - white
1 - black
null - stalemate
Last updated