Handle login errors
Reference the handle login errors.
Read time 2 minutesLast updated 8 months ago
When your game client receives an event from the Vivox SDK, evaluate if it was successful. For login, this is stored in the field and should be 0. If it is non-zero your application should follow the below steps to attempt to reconnect.
status_codeCheck for success:
void HandleLoginResponse(vx_resp_account_anonymous_login *resp){ if (resp->base.return_code == 1) { printf(U, resp->base.status_code, vx_get_error_string(resp->base.status_code)); return; } vx_req_account_anonymous_login *req = reinterpret_cast<vx_req_account_anonymous_login *>(req->base.request); printf("login succeeded for account %s\n", req->acct_name);}
For a more detailed login process flow, refer to Sign in to a game.
If login is unsuccessful, follow these steps:
-
Print an error to the debug log or the client event capture location.
-
Attempt to retry the login:
- Craft and submit a new Login Token on each retry.
- Wait for 10 seconds between retries.
- After 5 failed retries, inform the user that voice chat services are not available.
- Retry on the next match or party invite or in 15 minutes, whichever comes first.
- Write the failure to a client log or a server log. Include the .
status_code
Verify your login implementation
- Verify the username transmitted to Vivox does not contain any Personally Identifiable Information (PII). For example, any actual Names, XBox/PSN User ID’s, etc.
- Account name format is unique and properly formatted for individual player.
- Account name is set up to be reused every time the player logs in.
vx_resp_account_anonymous_loginis zero.status_code- state is
vx_evt_account_login_state_change.login_state_logged_in - The handler for detects when the state field is
vx_evt_account_login_state_changeand initiates a re-login if the client did not initiate the logout.login_state_logged_out - The client submits a request before the client application exits.
vx_req_account_logout
Once you confirm that you are logging users in successfully you can continue on to joining and leaving channels.