🎮
Game Protocol
Your Game must be connected to the VXG servers at all time via WebSocket. See Communication Protocol for more details.
You must answer VXG requests to start a match.
data
value of the requests have the following values:event
: Internal name of the Gaming Pool, which has been specified in the dashboard.accounts
: Array containing accounts' data. If your game is using your own provider, it will contain the data you specified when connecting accounts. If your game is usingSteam
, it will containsteamID64
s of the users. If your game is usingLichess
, it will contain Lichess tokens withSend, accept and reject challenges
permissions. Note that players have to be placed in the teams in the same order as their accounts are given by VXG. For example, if team sizes specified in the Developer Dashboard are2, 2, 1
, then the first two first accounts from this array must be placed in the first team, the third and fourth account must be placed in the second team, and the last account must be placed in the third team.teams
: Array containing specified team sizes.matchId
: Match ID.
If, for some reason, a match could not be created, the response must have a single value
success
which must be false
. Otherwise, the response must have the following values:success
: Must betrue
.url
: A URL that can be used by players to join the match. It cannot exceed 256 characters.description
: An optional text that will be shown to the players. It cannot exceed 256 characters.timeout
: An optional timeout in miliseconds before users are allowed to join the match. It cannot exceed 15 seconds (15000
).
As soon as the match ends, you must send a
POST
request to https://app.vxgaming.org/api/match
to notify VXG about the match result. In the query string you must provide the following parameters:api-key
: API key obtained from the Developer Dashboard,match-id
: Match ID, provided by VXG while creating the match.
The body must be JSON-encoded and it must include a single value
teams
, which is an array of ones and zeros representing the match result. It must have the same length as the number of teams.- If the match ended with a draw, all values must be ones.
- Otherwise, if
i
-th team won the match, thei
-th element in the array must be1
, otherwise it must be0
. There can be more than one winner.
If the match result was acknowledged, VXG will send an empty response with status
200 OK
. Otherwise, an error will be provided in the body.Last modified 3mo ago