Server Queue
Server Queue Flow
When joining a server, players will be entered into a queue that allows players to join gracefully and securely. This helps prevent any overloading of servers, allows us to accurately predict and scale servers as needed, and ensures that all players fairly get access to servers.
An average wait time will be displayed when players initialise joining, and for most servers, this will be less than 60 seconds.
Technical Specs
To ensure the queue is joined successfully, it’s important than the following flow is adhered to in your implementation:
- Issue join server as player clicks “join”: https://nodecraft-studio.readme.io/reference/joinserver
- If the server has a password, you will need to send this in the POST payload. This can be determined from the server listing endpoint’s
has_password
response.
- If the server has a password, you will need to send this in the POST payload. This can be determined from the server listing endpoint’s
- This will either return a queue token that is valid for ~6 minutes, such as
00000000-0000-0000-0000-000000000000
, or error if the password is incorrect, or other invalid states such as missing consent- If the password is incorrect, take user back to the server listing page, and inform them of the error.
- Refer to documentation on Player Consents for any consent-related errors.
- Otherwise, use this token to get information on the queue: https://nodecraft-studio.readme.io/reference/serverqueueget
- This will return information about the queue size, estimated wait time, and a
sessiono
. - Start rendering queue UI with this information, giving the player a clear indication of how long the estimated wait time is.
- This will return information about the queue size, estimated wait time, and a
- Every 10-15 seconds, long-poll for the queue via the same https://nodecraft-studio.readme.io/reference/serverqueueget endpoint
- If the
date_expires
is within 1 minute, issue a renew server queue: https://nodecraft-studio.readme.io/reference/serverqueuerenew - This will give you a new token, with a fresh 6 minutes expiration date, which you should then return to step 2a for
- If the
- At some point, the queue token will return a
session
, and this value with change fromnull
, to an object that includes atoken
,date_expires
, andserver_connection
.- This object can then be passed to the game to initiate the connection to the game server.
Updated 6 months ago
What’s Next