API reference
Thanks to modular architecture, our PlayPad can be easily swapped for a custom WebGL game hosting application. The custom solution has to satisfy the API described below.
Elympics SDK communicates with PlayPad (or its substitute) through so-called external communication interfaces described here.
The messaging protocol includes 3 types of communication possible between Elympics PlayPad SDK and PlayPad:
- request-response messages: requests from SDK to be acted upon and answered by PlayPad,
- void messages: one-way communication from SDK without a need for acknowledgement or response from PlayPad,
- Web messages: one-way communication from PlayPad, being a result of some match status- or Web3-related event.
Request-response messages
The communication flow is as follows: SDK -> PlayPad -> SDK.
Here, an action is requested by SDK. After PlayPad executes the action, it sends back an acknowledgement and return data (if applicable). Request-response pairs are identified by request type name and a ticket number.
The detailed structure of a generic request and response message is presented below:
- Request structure
- Request schema
- Example request
- Response structure
- Response schema
- Example response
class RequestMessage<T>
{
int ticket; // request number
string type; // request type
T? payload; // request arguments
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/RequestMessage",
"definitions": {
"RequestType": {
"type": "string",
"enum": ["Handshake", "GetPlayStatus", "ShowPlayPadModal", "GetAuthentication", "GetLeaderboard", "GetTournament", "GetUserHighScore"]
},
"RequestMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"$ref": "#/definitions/RequestType"
}
},
"required": [
"ticket",
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"ticket": 1234,
"type": "Handshake",
"payload": {
"gameId": "736c3b43-3657-4786-8215-a24d3afaeae8",
"gameName": "My Game",
"versionName": "rc2",
"sdkVersion": "0.15.3",
"lobbyPackageVersion": "1.5.2"
}
}
class ResponseMessage
{
int ticket; // request number
string type; // request type
Status status; // response status
string? response; // response return data as stringified JSON
}
enum Status
{
Success = 0,
UnknownMessage = 1,
AddressNotFound = 404,
NotImplementInWebGameComponent = 501,
UserRejected = 4001,
SendTransactionFailure = 502,
FeatureUnavailable = 600,
ModalUnavailable = 700,
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"RequestType": {
"type": "string",
"enum": ["Handshake", "GetPlayStatus", "ShowPlayPadModal", "GetAuthentication", "GetLeaderboard", "GetTournament", "GetUserHighScore"]
},
"Status": {
"type": "integer",
"enum": [0, 1, 404, 501, 502, 600, 700, 4001]
},
"ResponseMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"$ref": "#/definitions/RequestType"
},
"status": {
"$ref": "#/definitions/Status"
},
"response": {
"type": ["string", "null"],
"contentEncoding": "utf-8",
"contentMediaType": "application/json",
"contentSchema": {
"type": ["object", "null"],
}
}
},
"required": [
"ticket",
"type",
"status",
"response"
]
"additionalProperties": false
},
}
}
{
"ticket": 1234,
"type": "GetUserHighScore",
"status": 0,
"response": "{\"points\":\"2288\",\"endedAt\":\"2024-10-26T12:34:56.789Z\"}"
}
The type
field contains the request type name. Both in the request and response message, it is used to describe the request type. Possible type
values are listed later on.
Each possible type
is associated with a type of request payload (desribed above as a generic field payload
of type T
) and stringified response data (the response
field). The response
field stores untyped data as stringified JSON, allowing for its deserialization based on status
and expected response type.
Make sure the data sent back from your PlayPad implementation in the response
field is stringified JSON and not a nested object.
Such a requirement is caused by the way responses are handled using built-in Unity JsonUtility
tool.
The ticket
field allows for matching responses with requests.
Finally, response status
field indicates if the operation succeeded.
Possible type
values (divided into categories)
Initialization
Handshake
- initial exchange in which both the client and PlayPad identify themselves
General
GetPlayStatus
- allows for checking the status of match preparations or making it progressShowPlayPadModal
- causes a modal to be displayed; the response is sent when it gets closed
Features (available depending on the value of featuresAccess
handshake field)
GetAuthentication
- a request for Elympics authentication data (requiring theAuthentication
feature)GetLeaderboard
- a request for leaderboard data (requiring theLeaderboard
feature)GetTournament
- a request for tournament details (requiring theTournament
feature)GetUserHighScore
- a request for current user's high score (requiring theHighScore
feature)
GetAuthentication
Retrieves the current user's authentication data. Requires the Authentication
feature to be available.
There are several methods of authenticating players within Elympics. You can read about them in the related article.
- Request payload structure
- Request schema
- Example request
- Response payload structure
- Response schema
- Example response
class EmptyPayload
{ }
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/RequestMessage",
"definitions": {
"RequestMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"type": "string",
"const": "GetAuthentication"
},
"payload": {
"type": ["object", "null"],
"additionalProperties": false
}
},
"required": [
"ticket",
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"ticket": 1201,
"type": "GetAuthentication",
"payload": null
}
struct AuthenticationResponse
{
string jwt; // JSON Web Token storing authentication data
string userId; // Globally Unique Identifier of the current user
string nickname; // current user's nickname
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"Status": {
"type": "integer",
"enum": [0, 1, 404, 501, 502, 600, 700, 4001]
},
"AuthenticationResponse": {
"type": ["object", "null"],
"properties": {
"jwt": {
"type": "string"
},
"userId": {
"type": "string",
"format": "uuid"
},
"nickname": {
"type": "string"
}
},
"required": [
"jwt",
"userId",
"nickname"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"type": "string",
"const": "GetAuthentication"
},
"status": {
"$ref": "#/definitions/Status"
},
"response": {
"type": ["string", "null"],
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/AuthenticationResponse"
}
}
},
"required": [
"ticket",
"type",
"status",
"response"
],
"additionalProperties": false
},
}
}
{
"ticket": 1201,
"type": "GetAuthentication",
"status": 0,
"response": "{\"jwt\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIzZmI5OWJiOC05MTNjLTQwNTAtYmU2ZC0yYWE4NTA3ZTE1MzMiLCJhdXRoLXR5cGUiOiJjbGllbnQtc2VjcmV0IiwibmJmIjoxNzQzNzk5MzcyLCJleHAiOjE3NDM4ODU3NzIsImlhdCI6MTc0Mzc5OTM3Mn0.MNRrOUAxZDD8a9D4_W5Vqj4CyvL1IzPTv7kvhJPybrKb2Hna3zubRyiELlCcUfeQKSLFkNnL9LABhyCzHzWN4vAd9hl4WQd70F6NSmyZsTkP1sCe9BCEl1ceucL0gJBzq7h4_MIoNoMgQWRuKooQKsAm9o-8Tij_GD1Z6dfKUyyfVjOSFf_oh616FOj4CXgdrwjUB_xFqpQo9raNQCINjw8L_P7TQdMoga7HUbmm17JwwaWPfcb1LmT0QwVYap2GgBEl6jzB13seeDzDfykZi9yIUNla3cP9BfMv8-3ZV115A6Ps85Du4aAkwuALJ9y-GneRUX37bTFYi-wodKF8k0CbfM2rECjLlOUvBC2cePJhmPLInzTxjDdTuvBjZ8dxEe7Lxqxa7F_8ya35EhYf2wmdAAxYf2Yql5JT1ImVdSxiSnTJ6LgPScI9DAbXyGjAZiacdG6--JxdeOv2R20nksrapd0Na-I8TZTZYvbidmT9MBC8_FbBEIzVEo3ckB7E0UxJ2lmfaG94otR1xQUASkoGr_CdvCXwGLMuArp0VORBTMvIseYOqLYWQ3MSrFoW-kTlV6w9JtuI0JTlQHeqqGX-SHxxsnM32ouDj-RfHHawRzuYEzsQFiDk_gd8z2qtyVl0X6-6OltzoleM47PP0CG1sbZcmrpOFOCingVrjo0\",\"userId\":\"3fb99bb8-913c-4050-be6d-2aa8507e1533\",\"nickname\":\"Guest-46343\"}"
}
Any updates regarding authentication are to be reported to the SDK via AuthenticationUpdated
Web messages.
GetLeaderboard
Pulls the current leaderboard, i.e. a leaderboard associated with the currently selected tournament. Retrieves the leaderboard state. Requires the Leaderboard
feature to be implemented.
If you want to use Elympics game services for handling leaderboards, check out how to query our API here.
- Request payload structure
- Request schema
- Example request
- Response payload structure
- Response schema
- Example response
class EmptyPayload
{ }
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/RequestMessage",
"definitions": {
"RequestMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"type": "string",
"const": "GetLeaderboard"
},
"payload": {
"type": ["object", "null"],
"additionalProperties": false
}
},
"required": [
"ticket",
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"ticket": 1202,
"type": "GetLeaderboard",
"payload": null
}
struct LeaderboardResponse
{
Entry[] entries; // all leaderboard entries
Entry? userEntry; // the entry owned by the current user
int participants; // total number of users in the leaderboard
}
struct Entry
{
string userId; // Globally Unique Identifier of a user
string nickname; // nickname of a user
int position; // leaderboard position of the entry (counting from 1)
float score; // points scored by a user
string scoredAt; // the timestamp when the associated match ended (as ISO 8601 string)
string matchId; // Globally Unique Identifier of the related match
string tournamentId; // ID of the associated tournament
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"Status": {
"type": "integer",
"enum": [0, 1, 404, 501, 502, 600, 700, 4001]
},
"LeaderboardResponse": {
"type": ["object", "null"],
"properties": {
"entries": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/Entry"
}
},
"userEntry": {
"type": ["object", "null"],
"$ref": "#/definitions/Entry"
},
"participants": {
"type": "integer"
}
},
"required": [
"entries",
"userEntry",
"participants"
],
"additionalProperties": false
},
"Entry": {
"properties": {
"userId": {
"type": "string",
"format": "uuid"
},
"nickname": {
"type": "string"
},
"position": {
"type": "integer"
},
"score": {
"type": "number"
},
"scoredAt": {
"type": "string",
"format": "date-time"
},
"matchId": {
"type": "string",
"format": "uuid"
},
"tournamentId": {
"type": "string"
}
},
"required": [
"userId",
"nickname",
"position",
"score",
"scoredAt",
"matchId",
"tournamentId"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"type": "string",
"const": "GetLeaderboard"
},
"status": {
"$ref": "#/definitions/Status"
},
"response": {
"type": ["string", "null"],
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/LeaderboardResponse"
}
}
},
"required": [
"ticket",
"type",
"status",
"response"
],
"additionalProperties": false
},
}
}
{
"ticket": 1202,
"type": "GetLeaderboard",
"status": 0,
"response": "{\"entries\":[{\"userId\":\"92b964c7-0ca8-458b-bfe2-e65097d02c15\",\"nickname\":\"test-user\",\"position\":1,\"score\":1337.0,\"scoredAt\":\"2024-12-01T00:11:22.333Z\",\"matchId\":\"aab1ea06-b42a-459f-a1ca-2472df20a623\",\"tournamentId\":\"ual7jsdx\"},{\"userId\":\"c9916622-7c4f-4312-a2a1-3aba1a075bae\",\"nickname\":\"another-user\",\"position\":2,\"score\":3.14,\"scoredAt\":\"2024-12-01T22:11:00.999Z\",\"matchId\":\"a42a6ba2-eafe-48ef-83fd-95bfe7b2d537\",\"tournamentId\":\"ual7jsdx\"}],\"userEntry\":{\"userId\":\"92b964c7-0ca8-458b-bfe2-e65097d02c15\",\"nickname\":\"test-user\",\"position\":1,\"score\":1337.0,\"scoredAt\":\"2024-12-01T00:11:22.333Z\",\"matchId\":\"aab1ea06-b42a-459f-a1ca-2472df20a623\",\"tournamentId\":\"ual7jsdx\"},\"participants\":2}"
}
Any updates regarding leaderboards (entries being updated or another leaderboard being selected) are to be reported to the SDK via LeaderboardUpdated
Web messages.
GetPlayStatus
Retrieves the status of the match preparations along with a message to be displayed to the user (on the "Play" button). Depending on request arguments, it can be a read-only call (only checking the status) or it can push PlayPad to take action and try to advance the status automatically as far as possible.
- Request payload structure
- Request schema
- Example request
- Response payload structure
- Response schema
- Example response
struct CanPlayGameRequest
{
bool autoResolve; // should PlayPad try to automatically satisfy all remaining requirements for playing a game
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/RequestMessage",
"definitions": {
"CanPlayGameRequest": {
"type": "object",
"properties": {
"autoResolve": {
"type": "boolean"
}
},
"required": [
"autoResolve"
],
"additionalProperties": false
},
"RequestMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "integer"
},
"type": {
"type": "string",
"const": "GetPlayStatus"
},
"payload": {
"$ref": "#/definitions/CanPlayGameRequest"
}
},
"required": [
"ticket",
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"ticket": 1203,
"type": "GetPlayStatus",
"payload": {
"autoResolve": false
}
}
struct CanPlayGameResponse
{
string status; // "Play", "UserActionRequired", or "Blocked"
string labelMessage; // a human-readable message to be displayed on the "Play" button
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"Status": {
"type": "integer",
"enum": [0, 1, 404, 501, 502, 600, 700, 4001]
},
"CanPlayGameResponse": {
"type": ["object", "null"],
"properties": {
"status": {
"type": "string",
"enum": ["Play", "UserActionRequired", "Blocked"]
},
"labelMessage": {
"type": "string"
}
},
"required": [
"status",
"labelMessage"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "integer"
},
"type": {
"type": "string",
"const": "GetPlayStatus"
},
"status": {
"$ref": "#/definitions/Status"
},
"response": {
"type": ["string", "null"],
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/CanPlayGameResponse"
}
}
},
"required": [
"ticket",
"type",
"status",
"response"
],
"additionalProperties": false
},
}
}
{
"ticket": 1203,
"type": "GetPlayStatus",
"status": 0,
"response": "{\"status\":\"Play\",\"labelMessage\":\"Play\"}"
}
The status
field in the response payload indicates either that a match can be started (Play
), there are still some actions required to complete the preparation (UserActionRequired
), or a match cannot be started at all (Blocked
).
Starting a match can be blocked for example because the associated tournament has ended.
The labelMessage
field provides more details. Example values include the following:
- "Tournament ended",
- "Play",
- "Tournament not started",
- "Not available",
- "Tournament not found",
- "Connect wallet to play",
- "Enter",
- "Connect account with wallet".
Any updates regarding match preparations are to be reported to the SDK via PlayStatusUpdated
Web messages.
GetTournament
Retrieves the details regarding the currently chosen tournament. Requires the Tournament
feature.
If you want to use Elympics game services for setting up tournaments, check our API reference here.
- Request payload structure
- Request schema
- Example request
- Response payload structure
- Response schema
- Example response
class EmptyPayload
{ }
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/RequestMessage",
"definitions": {
"RequestMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "integer"
},
"type": {
"type": "string",
"const": "GetTournament"
},
"payload": {
"type": ["object", "null"],
"additionalProperties": false
}
},
"required": [
"ticket",
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"ticket": 1204,
"type": "GetTournament",
"payload": null
}
struct TournamentResponse
{
string id; // ID of the tournament
int leaderboardCapacity; // number of rewarded players: 1, 3, or 10 (solo, podium, or top 10 respectively)
string name; // a human-readable name of the tournament
PrizePoolResponse prizePool; // reward specifics
string ownerId; // Globally Unique Identifier of the creator of the tournament, can be null (which means it's a built-in one)
string startDate; // the timestamp when the tournament starts (as ISO 8601 string)
string endDate; // the timestamp when the atournament ends (as ISO 8601 string)
bool isDefault; // is the current tournament the default built-in one? (daily tournament)
}
struct PrizePoolResponse
{
string type; // e.g. "Respect", "ETH", "TON", "USDC"
string displayName; // human-readable name of the currency
string? image; // base64-encoded image representing the currency (optional)
float amount; // the amount of currency to be won
string description; // prize description
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"Status": {
"type": "integer",
"enum": [0, 1, 404, 501, 502, 600, 700, 4001]
},
"TournamentResponse": {
"type": ["object", "null"],
"properties": {
"id": {
"type": "string"
},
"leaderboardCapacity": {
"type": "integer",
"enum": [1, 3, 10]
},
"name": {
"type": "string"
},
"prizePool": {
"$ref": "#/definitions/PrizePoolResponse"
},
"ownerId": {
"type": ["string", "null"],
"format": "uuid"
},
"startDate": {
"type": "string",
"format": "date-time"
},
"endDate": {
"type": "string",
"format": "date-time"
},
"isDefault": {
"type": "boolean"
}
},
"required": [
"id",
"leaderboardCapacity",
"name",
"prizePool",
"ownerId",
"startDate",
"endDate",
"isDefault"
],
"additionalProperties": false
},
"PrizePoolResponse": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"displayName": {
"type": "string"
},
"image": {
"type": ["string", "null"],
"contentEncoding": "base64"
},
"amount": {
"type": "number"
},
"description": {
"type": "string"
}
},
"required": [
"type",
"displayName",
"image",
"amount",
"description"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "integer"
},
"type": {
"type": "string",
"const": "GetTournament"
},
"status": {
"$ref": "#/definitions/Status"
},
"response": {
"type": ["string", "null"],
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/TournamentResponse"
}
}
},
"required": [
"ticket",
"type",
"status",
"response"
],
"additionalProperties": false
},
}
}
{
"ticket": 1204,
"type": "GetTournament",
"status": 0,
"response": "{\"id\":\"ual7jsdx\",\"leaderboardCapacity\":1,\"name\":\"Daily tournament\",\"prizePool\":{\"type\":\"ETH\",\"displayName\":\"Ethereum\",\"image\":null,\"amount\":1.23,\"description\":\"Grand prize\"},\"ownerId\":null,\"startDate\":\"2025-01-01T00:00:00.000Z\",\"endDate\":\"2025-01-02T00:00:00.000Z\",\"isDefault\":true}"
}
The type
property of the prizePool
field in the response specifies the prize currency. Currently supported currency types are: "Respect", "BaseETH", "ETH", "TON", "TVM", "TMX", "USDC", "USDT", "NIKO", "DOGS", and "NOT".
The ownerId
field is either null
for default tournaments provided by Elympics or it contains the ID of the player who created the tournament. It is not forbidden for the creator to take part in their own tournament.
Any updates regarding tournaments (current tournament details being updated or another tournament being selected) are to be reported to the SDK via TournamentUpdated
Web messages.
GetUserHighScore
Retrieves user's all-time high score. Requires the HighScore
feature.
High score is not associated with any tournament, only with a specific game.
Elympics-provided high score service API is described here.
- Request payload structure
- Request schema
- Example request
- Response payload structure
- Response schema
- Example response
class EmptyPayload
{ }
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/RequestMessage",
"definitions": {
"RequestMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"type": "string",
"const": "GetUserHighScore"
},
"payload": {
"type": ["object", "null"],
"additionalProperties": false
}
},
"required": [
"ticket",
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"ticket": 1205,
"type": "GetUserHighScore",
"payload": null
}
struct UserHighScoreResponse
{
string points; // maximum number of points scored by the current user (as string)
string endedAt; // the timestamp when the associated match ended (as ISO 8601 string)
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"Status": {
"type": "integer",
"enum": [0, 1, 404, 501, 502, 600, 700, 4001]
},
"UserHighScoreResponse": {
"type": ["object", "null"],
"properties": {
"points": {
"type": "string",
"pattern": "-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?"
},
"endedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"points",
"endedAt"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"type": "string",
"const": "GetUserHighScore"
},
"status": {
"$ref": "#/definitions/Status"
},
"response": {
"type": ["string", "null"],
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/UserHighScoreResponse"
}
}
},
"required": [
"ticket",
"type",
"status",
"response"
],
"additionalProperties": false
},
}
}
{
"ticket": 1205,
"type": "GetUserHighScore",
"status": 0,
"response": "{\"points\":\"2288\",\"endedAt\":\"2024-10-26T12:34:56.789Z\"}"
}
Any updates regarding the high score are to be reported to the SDK via UserHighScoreUpdated
Web messages.
Handshake
In this message, client sends basic information about game version and SDK version.
PlayPad responds, specifying its capabilities as well as providing information about run conditions. This includes closest geographic region (ping wise), device type and environment type (debug/production, etc.).
- Request payload structure
- Request schema
- Example request
- Response payload structure
- Response schema
- Example response
struct HandshakeRequest
{
string gameId; // game ID
string gameName; // human-readable game name
string versionName; // human-readable game version number or name
string sdkVersion; // Elympics SDK version number
string lobbyPackageVersion; // Elympics PlayPad SDK version number
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/RequestMessage",
"definitions": {
"HandshakeRequest": {
"type": "object",
"properties": {
"gameId": {
"type": "string",
"format": "uuid"
},
"gameName": {
"type": "string"
},
"versionName": {
"type": "string"
},
"sdkVersion": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
},
"lobbyPackageVersion": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
}
},
"required": [
"gameId",
"gameName",
"versionName",
"sdkVersion",
"lobbyPackageVersion"
],
"additionalProperties": false
},
"RequestMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "integer"
},
"type": {
"type": "string",
"const": "Handshake"
},
"payload": {
"$ref": "#/definitions/HandshakeRequest"
}
},
"required": [
"ticket",
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"ticket": 1206,
"type": "Handshake",
"payload": {
"gameId": "736c3b43-3657-4786-8215-a24d3afaeae8",
"gameName": "My Game",
"versionName": "rc2",
"sdkVersion": "0.15.3",
"lobbyPackageVersion": "1.5.2"
}
}
struct HandshakeResponse
{
string? error; // human readable error string (optional)
string device; // run platform: "mobile" or "desktop"
string environment; // run environment type: "Prod" (production), "Stg" (staging), "Rc" (release candidate), or "Dev" (development)
Capabilities capabilities; // supported authentication methods
FeatureAccess featureAccess; // supported game features
string closestRegion; // closest (ping-wise) Elympics game server region name
}
enum Capabilities
{
None = 0,
Guest = 1,
Telegram = 2,
Ethereum = 4,
Ton = 8,
}
enum FeatureAccess
{
None = 0,
Authentication = 1,
Leaderboard = 2,
Tournament = 4,
HighScore = 8,
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"Status": {
"type": "integer",
"enum": [0, 1, 404, 501, 502, 600, 700, 4001]
},
"HandshakeResponse": {
"type": ["object", "null"],
"properties": {
"error": {
"type": ["string", "null"]
},
"device": {
"type": "string",
"enum": ["mobile", "desktop"]
},
"environment": {
"type": "string",
"enum": ["Prod", "Stg", "Rc", "Dev"]
},
"capabilities": {
"$ref": "#/definitions/Capabilities"
},
"featureAccess": {
"$ref": "#/definitions/FeatureAccess"
},
"closestRegion": {
"type": "string"
}
},
"required": [
"error",
"device",
"environment",
"capabilities",
"featureAccess",
"closestRegion"
],
"additionalProperties": false
},
"Capabilities": {
"type": "integer",
"minimum": 0,
"exclusiveMaximum": 16
},
"FeatureAccess": {
"type": "integer",
"minimum": 0,
"exclusiveMaximum": 16
},
"ResponseMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"type": "string",
"const": "Handshake"
},
"status": {
"$ref": "#/definitions/Status"
},
"response": {
"type": ["string", "null"],
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/HandshakeResponse"
}
}
},
"required": [
"ticket",
"type",
"status",
"response"
],
"additionalProperties": false
},
}
}
{
"ticket": 1206,
"type": "Handshake",
"status": 0,
"response": "{"error":null,"device":"mobile","environment":"Prod","capabilities":3,"featureAccess":15,"closestRegion":"warsaw"}"
}
Capabilities
flags are set by the PlayPad implementation depending on authentication methods it offers.
FeaturesAccess
flags are similarly set based on the list of game features made available by the PlayPad implementation.
The Authentication
feature should always be implemented. Players have to be authenticated in order to access basic Elympics endpoints, including starting a match.
ShowPlayPadModal
Causes a modal to be displayed. A response is expected to be received after the modal is closed. No more data should be included in the response.
If the modal name cannot be found (or it is a tournament modal, but the Tournament
feature is missing), the "ModalUnavailable" error response (status 700
) is to be returned.
- Request payload structure
- Request schema
- Example request
- Response payload structure
- Response schema
- Example response
struct ShowPlayPadModalRequest
{
string modalName; // e.g. "tournament/rewards", "tournaments/listing", or "game/tutorial"
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/RequestMessage",
"definitions": {
"ShowPlayPadModalRequest": {
"type": "object",
"properties": {
"modalName": {
"type": "string"
}
},
"required": [
"modalName"
],
"additionalProperties": false
},
"RequestMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "integer"
},
"type": {
"type": "string",
"const": "ShowPlayPadModal"
},
"payload": {
"$ref": "#/definitions/ShowPlayPadModalRequest"
}
},
"required": [
"ticket",
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"ticket": 1207,
"type": "ShowPlayPadModal",
"payload": {
"modalName": "tournaments/listing"
}
}
struct EmptyPayload
{ }
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"Status": {
"type": "integer",
"enum": [0, 1, 404, 501, 502, 600, 700, 4001]
},
"ResponseMessage": {
"type": "object",
"properties": {
"ticket": {
"type": "number",
"format": "integer"
},
"type": {
"type": "string",
"const": "ShowPlayPadModal"
},
"status": {
"$ref": "#/definitions/Status"
},
"response": {
"type": ["string", "null"],
"contentMediaType": "application/json",
"contentSchema": {
"type": ["object", "null"],
"additionalProperties": false
}
}
},
"required": [
"ticket",
"type",
"status",
"response"
],
"additionalProperties": false
},
}
}
{
"ticket": 1207,
"type": "ShowPlayPadModal",
"status": 0,
"response": null
}
Void messages
So-called void messages are sent from SDK to PlayPad without a need for acknowledgement or return data. The structure of the message is described below:
- Message structure
- Message schema
- Example message
class VoidMessage<T>
{
string type; // message type
T? payload; // message arguments
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/VoidMessage",
"definitions": {
"MessageType": {
"type": "string",
"enum": ["BreadcrumbMessage", "ElympicsStateUpdated", "HideSplashScreen", "NetworkStatusMessage", "SystemInfoData"]
},
"VoidMessage": {
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/MessageType"
}
},
"required": [
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"type": "ElympicsStateUpdated",
"payload": {
"previousState": 1,
"newState": 2
}
}
The type of each message is identified by the type
field. The field value maps into the concrete type that is to be used in the place of the generic T
type of the payload
field.
Possible type
values (divided into categories)
General
ElympicsStateUpdated
- an update regarding client-side game statusHideSplashScreen
- a request to hide splash screen
Logging
BreadcrumbMessage
- a log entry along with additional contextNetworkStatusMessage
- round-trip time history for a list of ticksSystemInfoData
- client hardware summary
BreadcrumbMessage
Forwards a log message from Elympics SDK along with its context.
Only messages coming from the SDK are forwarded. All other logs (coming from the game developer or external packages) are omitted.
- Message payload structure
- Message schema
- Example message
struct BreadcrumbMessage
{
LogLevel level; // the category of the log message
string message; // log message
MetaData data; // context
}
enum LogLevel
{
Log = 0,
Warning = 1,
Error = 2,
Exception = 3,
}
struct MetaData
{
string? sessionId; // session ID
string? app; // application name
string? version; // application version (SDK version)
string? gameId; // game ID
string? userId; // user's Elympics ID
string? authType; // authentication type: "None", "ClientSecret", "EthAddress", or "Telegram"
string? nickName; // user's nickname
string? walletAddress; // user's wallet address
string? time; // timestamp of the log message (as ISO 8601 string)
string? ip; // client IP (empty - to be filled in by PlayPad)
string? fleetId; // used fleet ID (empty - to be filled in by PlayPad)
string? region; // current region name
string? lobbyUrl; // URL used to connect to Elympics lobby
string? roomId; // current room ID
string? queueName; // the name of the queue used for starting current match
string? matchId; // current match ID
string? tcpUdpServerAddress; // the address of TCP/UDP interface of game server
string? webServerAddress; // the address of WebRTC interface of game server
string? capabilities; // "None" or a comma-separated list of supported authentication methods: "Guest", "Telegram", "Ethereum", "Ton"
string? tournamentId; // current tournament ID
string? featureAccess; // "None" or a comma-separated list of supported features: "Authentication", "Leaderboard", "Tournament", "HighScore"
string? context; // the name of the class responsible for emitting the log message
string? methodName; // the name of the method responsible for emitting the log message
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/VoidMessage",
"definitions": {
"BreadcrumbMessage": {
"type": "object",
"properties": {
"level": {
"$ref": "#/definitions/LogLevel"
},
"message": {
"type": "string"
},
"data": {
"$ref": "#/definitions/MetaData"
}
},
"required": [
"level",
"message",
"data"
],
"additionalProperties": false
},
"LogLevel": {
"type": "integer",
"enum": [0, 1, 2, 3]
},
"MetaData": {
"type": "object",
"properties": {
"sessionId": {
"type": ["string", "null"]
},
"app": {
"type": ["string", "null"]
},
"version": {
"type": ["string", "null"]
},
"gameId": {
"type": ["string", "null"],
"format": "uuid"
},
"userId": {
"type": ["string", "null"],
"format": "uuid"
},
"authType": {
"type": ["string", "null"]
},
"nickName": {
"type": ["string", "null"]
},
"walletAddress": {
"type": ["string", "null"]
},
"time": {
"type": ["string", "null"],
"format": "date-time"
},
"ip": {
"type": ["string", "null"]
},
"fleetId": {
"type": ["string", "null"],
"format": "uuid"
},
"region": {
"type": ["string", "null"]
},
"lobbyUrl": {
"type": ["string", "null"]
},
"roomId": {
"type": ["string", "null"]
},
"queueName": {
"type": ["string", "null"]
},
"matchId": {
"type": ["string", "null"],
"format": "uuid"
},
"tcpUdpServerAddress": {
"type": ["string", "null"]
},
"webServerAddress": {
"type": ["string", "null"]
},
"capabilities": {
"type": ["string", "null"]
},
"tournamentId": {
"type": ["string", "null"]
},
"featureAccess": {
"type": ["string", "null"]
},
"context": {
"type": ["string", "null"]
},
"methodName": {
"type": ["string", "null"]
}
},
"required": [
"sessionId",
"app",
"version",
"gameId",
"userId",
"authType",
"nickName",
"walletAddress",
"time",
"ip",
"fleetId",
"region",
"lobbyUrl",
"roomId",
"queueName",
"matchId",
"tcpUdpServerAddress",
"webServerAddress",
"capabilities",
"tournamentId",
"featureAccess",
"context",
"methodName"
],
"additionalProperties": false
},
"VoidMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "BreadcrumbMessage"
},
"payload": {
"$ref": "#/definitions/BreadcrumbMessage"
}
},
"required": [
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"type": "BreadcrumbMessage",
"payload": {
"level": 0,
"message": "[ElympicsSdk] Authentication completed.",
"data": {
"sessionId": null,
"app": null,
"version": "0.15.3",
"gameId": "3e7a03cf-7c2c-4e35-8eda-be73559f0967",
"userId": "33b0133c-4946-4c8e-813a-c37efe111c5b",
"authType": "ClientSecret",
"nickName": "test-user",
"walletAddress": null,
"time": "2025-01-01T12:04:16.8320000Z",
"ip": null,
"fleetId": null,
"region": "warsaw",
"lobbyUrl": "https://api.elympics.cc/v2/lobby",
"roomId": null,
"queueName": null,
"matchId": null,
"tcpUdpServerAddress": null,
"webServerAddress": null,
"capabilities": "Guest, Ethereum",
"tournamentId": null,
"featureAccess": "Authentication, Leaderboard, Tournament, HighScore",
"context": "ElympicsLobbyClient",
"methodName": "OnAuthenticatedWith"
}
}
}
ElympicsStateUpdated
Notifies about the status of the game being changed. There are 5 statuses available: from client being completely disconnected from Elympics services to a match being currently played.
- Message payload structure
- Message schema
- Example message
struct ElympicsStateUpdatedMessage
{
ElympicsState previousState; // previous status
ElympicsState newState; // current status
}
enum ElympicsState
{
Disconnected = 0,
Connecting = 1,
Connected = 2,
Matchmaking = 3,
PlayingMatch = 4,
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/VoidMessage",
"definitions": {
"ElympicsStateUpdatedMessage": {
"type": "object",
"properties": {
"previousState": {
"$ref": "#/definitions/ElympicsState"
},
"newState": {
"$ref": "#/definitions/ElympicsState"
}
},
"required": [
"previousState",
"newState"
],
"additionalProperties": false
},
"ElympicsState": {
"type": "integer",
"enum": [0, 1, 2, 3, 4]
},
"VoidMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "ElympicsStateUpdated"
},
"payload": {
"$ref": "#/definitions/ElympicsStateUpdatedMessage"
}
},
"required": [
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"type": "ElympicsStateUpdated",
"payload": {
"previousState": 1,
"newState": 2
}
}
HideSplashScreen
Reports that the game has finished loading. Used to hide the splash screen if it is still visible. No payload is required. If the splash screen has already disappeared, the message has no effect.
- Message payload structure
- Message schema
- Example message
struct EmptyPayload
{ }
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/VoidMessage",
"definitions": {
"VoidMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "HideSplashScreen"
},
"payload": {
"type": ["object", "null"],
"additionalProperties": false
}
},
"required": [
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"type": "HideSplashScreen",
"payload": null
}
NetworkStatusMessage
Provides statistics regarding the round-trip time on each game tick. Is sent perodically (in batches).
- Message payload structure
- Message schema
- Example message
struct NetworkStatusMessage
{
string matchId; // match ID
RttReceived[] data; // a series of RTT measurements
}
struct RttReceived
{
float rtt; // in miliseconds
long tick; // game tick number
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/VoidMessage",
"definitions": {
"NetworkStatusMessage": {
"type": "object",
"properties": {
"matchId": {
"type": "string",
"format": "uuid"
},
"data": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/RttReceived"
}
}
},
"required": [
"matchId",
"data"
],
"additionalProperties": false
},
"RttReceived": {
"type": "object",
"properties": {
"rtt": {
"type": "number"
},
"tick": {
"type": "integer"
}
},
"required": [
"rtt",
"tick"
],
"additionalProperties": false
},
"VoidMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "NetworkStatusMessage"
},
"payload": {
"$ref": "#/definitions/NetworkStatusMessage"
}
},
"required": [
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"type": "NetworkStatusMessage",
"payload": {
"matchId": "683d8366-8c0a-46b4-9013-49df494e2cd1",
"data": [
{
"rtt": 33.333,
"tick": 8123
},
{
"rtt": 1001.011,
"tick": 8124
},
{
"rtt": 24.533,
"tick": 8125
},
{
"rtt": 33.5,
"tick": 8126
},
{
"rtt": 33.477,
"tick": 8127
}
]
}
}
SystemInfoData
Diagnostic information regarding user hardware sent just after a match starts.
- Message payload structure
- Message schema
- Example message
struct SystemInfoDataMessage
{
string userId; // user's Elympics ID
string matchId; // started match ID
SystemInfoData systemInfoData; // user's hardware profile
}
// see: https://docs.unity3d.com/2021.3/Documentation/ScriptReference/SystemInfo.html
struct SystemInfoData
{
int systemMemorySize; // RAM size (in MB)
string operatingSystemFamily; // OS family name: "Other", "MacOSX", "Windows", or "Linux"
string operatingSystem; // OS name with version
int graphicsMemorySize; // VRAM size (in MB)
string graphicsDeviceVersion; // graphics API type and driver version
int graphicsDeviceVendorID; // GPU PCI vendor ID
string graphicsDeviceVendor; // GPU vendor name
string graphicsDeviceName; // GPU model name
int graphicsDeviceID; // GPU PCI device ID
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/VoidMessage",
"definitions": {
"SystemInfoDataMessage": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"format": "uuid"
},
"matchId": {
"type": "string",
"format": "uuid"
},
"systemInfoData": {
"$ref": "#/definitions/SystemInfoData"
}
},
"required": [
"userId",
"matchId",
"systemInfoData"
],
"additionalProperties": false
},
"SystemInfoData": {
"type": "object",
"properties": {
"systemMemorySize": {
"type": "integer"
},
"operatingSystemFamily": {
"type": "string"
},
"operatingSystem": {
"type": "string"
},
"graphicsMemorySize": {
"type": "integer"
},
"graphicsDeviceVersion": {
"type": "string"
},
"graphicsDeviceVendorID": {
"type": "integer"
},
"graphicsDeviceVendor": {
"type": "string"
},
"graphicsDeviceName": {
"type": "string"
},
"graphicsDeviceID": {
"type": "integer"
}
},
"required": [
"systemMemorySize",
"operatingSystemFamily",
"operatingSystem",
"graphicsMemorySize",
"graphicsDeviceVersion",
"graphicsDeviceVendorID",
"graphicsDeviceVendor",
"graphicsDeviceName",
"graphicsDeviceID"
],
"additionalProperties": false
},
"VoidMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "SystemInfoData"
},
"payload": {
"$ref": "#/definitions/SystemInfoDataMessage"
}
},
"required": [
"type",
"payload"
],
"additionalProperties": false
}
}
}
{
"type": "SystemInfoData",
"payload": {
"userId": "41ac1c9f-bf82-48c7-863d-1fa90bce7bfe",
"matchId": "704e7ba2-7c45-4da8-bd82-cb5687ac5283",
"systemInfoData": {
"systemMemorySize": 8192,
"operatingSystemFamily": "Windows",
"operatingSystem": "Windows 11 (10.0.22621) 64bit",
"graphicsMemorySize": 12288,
"graphicsDeviceVersion": "Direct3D 11.0 [level 11.1]",
"graphicsDeviceVendorID": 4318,
"graphicsDeviceVendor": "NVIDIA",
"graphicsDeviceName": "NVIDIA GeForce RTX 3060",
"graphicsDeviceID": 9351
}
}
}
Web messages
Web messages are emitted by PlayPad. Targetting SDK, they require no response from it.
- Message structure
- Message schema
- Example message
class WebMessage
{
string type; // message type
string? message; // message data as stringified JSON
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"MessageType": {
"type": "string",
"enum": ["AuthenticationUpdated", "LeaderboardUpdated", "PlayStatusUpdated", "RegionUpdated", "TournamentUpdated", "UserHighScoreUpdated", "WebGLKeyboardInputControl"]
},
"ResponseMessage": {
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/MessageType"
},
"message": {
"type": ["string", "null"],
"contentEncoding": "utf-8",
"contentMediaType": "application/json",
"contentSchema": {
"type": ["object", "null"],
}
}
},
"required": [
"type",
"message"
],
"additionalProperties": false
},
}
}
{
"type": "RegionUpdated",
"message": "{\"region\":\"tokyo\"}"
}
The message
field, being stringified JSON, is deserialized into an object in correspondence with the type identified by the type
field.
As in the case of request-response messages, the data sent by a PlayPad implementation in the message
field is stringified JSON and not a nested object.
Possible type
values (divided into categories)
General
PlayStatusUpdated
- an update regarding match preparations statusRegionUpdated
- an update regarding game server regionWebGLKeyboardInputControl
- a request for keyboard input control
Features (available depending on the value of featuresAccess
handshake field)
AuthenticationUpdated
- an update regarding authenticationLeaderboardUpdated
- an update regarding leaderboardTournamentUpdated
- an update regarding tournamentUserHighScoreUpdated
- an update regarding current user's high score
AuthenticationUpdated
Notifies SDK that authentication data has been updated. Only sent if PlayPad offers the Authentication
feature.
- Message payload structure
- Message schema
- Example message
struct AuthenticationUpdatedMessage
{
string jwt; // JSON Web Token storing authentication data
string userId; // Globally Unique Identifier of the current user
string nickname; // current user's nickname
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"AuthenticationUpdatedMessage": {
"type": "object",
"properties": {
"jwt": {
"type": "string"
},
"userId": {
"type": "string",
"format": "uuid"
},
"nickname": {
"type": "string"
}
},
"required": [
"jwt",
"userId",
"nickname"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "AuthenticationUpdated"
},
"response": {
"type": "string",
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/AuthenticationUpdatedMessage"
}
}
},
"required": [
"type",
"response"
],
"additionalProperties": false
},
}
}
{
"type": "AuthenticationUpdated",
"response": "{\"jwt\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIzZmI5OWJiOC05MTNjLTQwNTAtYmU2ZC0yYWE4NTA3ZTE1MzMiLCJhdXRoLXR5cGUiOiJjbGllbnQtc2VjcmV0IiwibmJmIjoxNzQzNzk5MzcyLCJleHAiOjE3NDM4ODU3NzIsImlhdCI6MTc0Mzc5OTM3Mn0.MNRrOUAxZDD8a9D4_W5Vqj4CyvL1IzPTv7kvhJPybrKb2Hna3zubRyiELlCcUfeQKSLFkNnL9LABhyCzHzWN4vAd9hl4WQd70F6NSmyZsTkP1sCe9BCEl1ceucL0gJBzq7h4_MIoNoMgQWRuKooQKsAm9o-8Tij_GD1Z6dfKUyyfVjOSFf_oh616FOj4CXgdrwjUB_xFqpQo9raNQCINjw8L_P7TQdMoga7HUbmm17JwwaWPfcb1LmT0QwVYap2GgBEl6jzB13seeDzDfykZi9yIUNla3cP9BfMv8-3ZV115A6Ps85Du4aAkwuALJ9y-GneRUX37bTFYi-wodKF8k0CbfM2rECjLlOUvBC2cePJhmPLInzTxjDdTuvBjZ8dxEe7Lxqxa7F_8ya35EhYf2wmdAAxYf2Yql5JT1ImVdSxiSnTJ6LgPScI9DAbXyGjAZiacdG6--JxdeOv2R20nksrapd0Na-I8TZTZYvbidmT9MBC8_FbBEIzVEo3ckB7E0UxJ2lmfaG94otR1xQUASkoGr_CdvCXwGLMuArp0VORBTMvIseYOqLYWQ3MSrFoW-kTlV6w9JtuI0JTlQHeqqGX-SHxxsnM32ouDj-RfHHawRzuYEzsQFiDk_gd8z2qtyVl0X6-6OltzoleM47PP0CG1sbZcmrpOFOCingVrjo0\",\"userId\":\"3fb99bb8-913c-4050-be6d-2aa8507e1533\",\"nickname\":\"Guest-46343\"}"
}
For more information, check the description of the request-response version of this message.
LeaderboardUpdated
Notifies SDK that leaderbord data has been updated. This can include the entries of the current leaderboard being updated or another leaderboard being set as the current one. Only sent if PlayPad offers the Leaderboard
feature.
- Message payload structure
- Message schema
- Example message
struct LeaderboardUpdatedMessage
{
Entry[] entries; // all leaderboard entries
Entry? userEntry; // entry related to the current user
int participants; // total number of users in the leaderboard
}
struct Entry
{
string userId; // Globally Unique Identifier of a user
string nickname; // nickname of a user
int position; // 1-based leaderboard index of the entry
float score; // points scored by a user
string scoredAt; // the timestamp when the associated match ended (as ISO 8601 string)
string matchId; // Globally Unique Identifier of a match
string tournamentId; // ID of the associated tournament
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"LeaderboardResponse": {
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/Entry"
}
},
"userEntry": {
"type": ["object", "null"],
"$ref": "#/definitions/Entry"
},
"participants": {
"type": "integer"
}
},
"required": [
"entries",
"userEntry",
"participants"
],
"additionalProperties": false
},
"Entry": {
"properties": {
"userId": {
"type": "string",
"format": "uuid"
},
"nickname": {
"type": "string"
},
"position": {
"type": "integer"
},
"score": {
"type": "number"
},
"scoredAt": {
"type": "string",
"format": "date-time"
},
"matchId": {
"type": "string",
"format": "uuid"
},
"tournamentId": {
"type": "string"
}
},
"required": [
"userId",
"nickname",
"position",
"score",
"scoredAt",
"matchId",
"tournamentId"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "LeaderboardUpdated"
},
"response": {
"type": "string",
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/LeaderboardResponse"
}
}
},
"required": [
"type",
"response"
],
"additionalProperties": false
},
}
}
{
"type": "LeaderboardUpdated",
"response": "{\"entries\":[{\"userId\":\"92b964c7-0ca8-458b-bfe2-e65097d02c15\",\"nickname\":\"test-user\",\"position\":1,\"score\":1337.0,\"scoredAt\":\"2024-12-01T00:11:22.333Z\",\"matchId\":\"aab1ea06-b42a-459f-a1ca-2472df20a623\",\"tournamentId\":\"ual7jsdx\"},{\"userId\":\"c9916622-7c4f-4312-a2a1-3aba1a075bae\",\"nickname\":\"another-user\",\"position\":2,\"score\":3.14,\"scoredAt\":\"2024-12-01T22:11:00.999Z\",\"matchId\":\"a42a6ba2-eafe-48ef-83fd-95bfe7b2d537\",\"tournamentId\":\"ual7jsdx\"}],\"userEntry\":{\"userId\":\"92b964c7-0ca8-458b-bfe2-e65097d02c15\",\"nickname\":\"test-user\",\"position\":1,\"score\":1337.0,\"scoredAt\":\"2024-12-01T00:11:22.333Z\",\"matchId\":\"aab1ea06-b42a-459f-a1ca-2472df20a623\",\"tournamentId\":\"ual7jsdx\"},\"participants\":2}"
}
For more information, check the description of the request-response version of this message.
PlayStatusUpdated
Notifies SDK that match preparations have progressed. For example, a required Ethereum transaction may have been detected having been performed by the player.
- Message payload structure
- Message schema
- Example message
struct CanPlayUpdatedMessage
{
string status; // "Play", "UserActionRequired", or "Blocked"
string labelMessage; // a human-readable message to be displayed on the "Play" button
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"CanPlayUpdatedMessage": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": ["Play", "UserActionRequired", "Blocked"]
},
"labelMessage": {
"type": "string"
}
},
"required": [
"status",
"labelMessage"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "PlayStatusUpdated"
},
"response": {
"type": "string",
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/CanPlayUpdatedMessage"
}
}
},
"required": [
"type",
"response"
],
"additionalProperties": false
},
}
}
{
"type": "PlayStatusUpdated",
"response": "{\"status\":\"Play\",\"labelMessage\":\"Play\"}"
}
For more information, check the description of the request-response version of this message.
RegionUpdated
Reports another region of the game server being selected.
- Message payload structure
- Message schema
- Example message
struct RegionUpdatedMessage
{
string region; // chosen Elympics game server region name
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"RegionUpdatedMessage": {
"type": "object",
"properties": {
"region": {
"type": "string"
}
},
"required": [
"region"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "RegionUpdated"
},
"response": {
"type": "string",
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/RegionUpdatedMessage"
}
}
},
"required": [
"type",
"response"
],
"additionalProperties": false
},
}
}
{
"type": "RegionUpdated",
"response": "{\"region\":\"tokyo\"}"
}
TournamentUpdated
Sent when the current tournament is switched or it updates. Only sent if PlayPad offers the Tournament
feature.
- Message payload structure
- Message schema
- Example message
struct TournamentUpdatedMessage
{
string id; // ID of the tournament
int leaderboardCapacity; // number of rewarded players: 1, 3, or 10 (solo, podium, or top 10 respectively)
string name; // a human-readable name of the tournament
PrizePoolResponse prizePool; // reward specifics
string ownerId; // Globally Unique Identifier of the creator of the tournament, can be null (which means it's a built-in one)
string startDate; // the timestamp when the tournament starts (as ISO 8601 string)
string endDate; // the timestamp when the atournament ends (as ISO 8601 string)
bool isDefault; // is the current tournament the default built-in one? (daily tournament)
}
struct PrizePoolMessage
{
string type; // e.g. "Respect", "ETH", "TON", "USDC"
string displayName; // human-readable name of the currency
string? image; // base64-encoded image representing the currency (optional)
float amount; // the amount of currency to be won
string description; // prize description
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"TournamentUpdatedMessage": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"leaderboardCapacity": {
"type": "integer",
"enum": [1, 3, 10]
},
"name": {
"type": "string"
},
"prizePool": {
"$ref": "#/definitions/PrizePoolResponse"
},
"ownerId": {
"type": ["string", "null"],
"format": "uuid"
},
"startDate": {
"type": "string",
"format": "date-time"
},
"endDate": {
"type": "string",
"format": "date-time"
},
"isDefault": {
"type": "boolean"
}
},
"required": [
"id",
"leaderboardCapacity",
"name",
"prizePool",
"ownerId",
"startDate",
"endDate",
"isDefault"
],
"additionalProperties": false
},
"PrizePoolResponse": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"displayName": {
"type": "string"
},
"image": {
"type": ["string", "null"],
"contentEncoding": "base64"
},
"amount": {
"type": "number"
},
"description": {
"type": "string"
}
},
"required": [
"type",
"displayName",
"image",
"amount",
"description"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "TournamentUpdated"
},
"response": {
"type": "string",
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/TournamentUpdatedMessage"
}
}
},
"required": [
"type",
"response"
],
"additionalProperties": false
},
}
}
{
"type": "TournamentUpdated",
"response": "{\"id\":\"ual7jsdx\",\"leaderboardCapacity\":1,\"name\":\"Daily tournament\",\"prizePool\":{\"type\":\"ETH\",\"displayName\":\"Ethereum\",\"image\":null,\"amount\":1.23,\"description\":\"Grand prize\"},\"ownerId\":null,\"startDate\":\"2025-01-01T00:00:00.000Z\",\"endDate\":\"2025-01-02T00:00:00.000Z\",\"isDefault\":true}"
}
For more information, check the description of the request-response version of this message.
UserHighScoreUpdated
Notifies SDK about player setting a new high score. This message is only sent if PlayPad offers the HighScore
feature.
- Message payload structure
- Message schema
- Example message
struct UserHighScoreUpdatedMessage
{
string points; // maximum number of points scored by the current user (as string)
string endedAt; // the timestamp when the associated match ended (as ISO 8601 string)
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"RegionUpdatedMessage": {
"type": "object",
"properties": {
"points": {
"type": "string",
"pattern": "-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?"
},
"endedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"points",
"endedAt"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "UserHighScoreUpdated"
},
"response": {
"type": "string",
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/UserHighScoreUpdatedMessage"
}
}
},
"required": [
"type",
"response"
],
"additionalProperties": false
},
}
}
{
"type": "UserHighScoreUpdated",
"response": "{\"points\":\"2288\",\"endedAt\":\"2024-10-26T12:34:56.789Z\"}"
}
For more information, check the description of the request-response version of this message.
WebGLKeyboardInputControl
Requests the game application to release or re-take control over the keyboard input.
The main use case is when a PlayPad implementation displays a text field to be filled by the player. By default, it is impossible as launched game application captures all keyboard input (see the official Unity docs). Making the application release the keyboard input allows the player to fill the field.
- Message payload structure
- Message schema
- Example message
struct WebGLKeyboardInputControlMessage
{
bool isKeyboardControlRequested; // should the keyboard input be released by the game application?
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/ResponseMessage",
"definitions": {
"RegionUpdatedMessage": {
"type": "object",
"properties": {
"isKeyboardControlRequested": {
"type": "boolean"
}
},
"required": [
"isKeyboardControlRequested"
]
},
"ResponseMessage": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "WebGLKeyboardInputControl"
},
"response": {
"type": "string",
"contentMediaType": "application/json",
"contentSchema": {
"$ref": "#/definitions/WebGLKeyboardInputControlMessage"
}
}
},
"required": [
"type",
"response"
],
"additionalProperties": false
},
}
}
{
"type": "WebGLKeyboardInputControl",
"response": "{\"isKeyboardControlRequested\":true}"
}