기술 자료

Development

User Acquisition

Monetization

산업 분야

Vivox Core SDK

Vivox Core SDK

이 페이지는 선택한 언어로 제공되지 않습니다.
Vivox
​
​
Vivox Core SDK
  • Overview
  • Before you begin
  • Get started
  • Release notes
  • Developer Guide
    • Client SDK basics
      • Initialize the Vivox SDK
      • Handle messages
      • Message types
      • Character encoding
      • Requests and responses
      • Create the connector object
      • Sign in to a game
      • Sign out of a game
      • Uninitialize the Vivox SDK
    • Channels
    • Presence management
    • Messaging
    • Manage audio
    • Couch co-op
    • Android app development
    • iOS app development
    • macOS app development
    • Windows app development
    • Real-time recording
    • Speech-to-text audio transcription
    • Text-to-speech
    • Troubleshooting
  • Reference
  • Privacy overview
  1. Vivox Core SDK documentation

Sign in to a game

How to sign in a player to Vivox services.
읽는 시간 4분
최근 업데이트: 8달 전

After you initialize the Vivox SDK, you can sign a user in to the Vivox instance assigned to your game by using an account name that is selected by the game. For the account name:
  1. Create a one-to-one mapping between an account name and a player.
  2. Use the same account name for the same player every time they play the game.
  3. Player account names must be unique for each play and be anonymous.
참고
It’s recommended that you re-use player account names to facilitate the use of Vivox features such as cross-mute and blocking. It will also become a requirement for using future safety features designed for reducing toxicity and fostering more positive communities.
The following criteria applies to account names:
  • Maximum of 127 bytes
  • Must start and end with a period (.)
  • No adjacent spaces
  • Can use only the following characters:
  • Alphanumerics

    0-9, A-Z, a-z

    0x30-0x39, 0x41-0x5A, 0x61-0x7A

    Exclamation mark
    ' ! '
    0x21
    Open parenthesis
    ' ( '
    0x28
    Close parenthesis
    ' ) '
    0x29
    Plus
    ' + '
    0x2B
    Minus
    ' - '
    0x2D
    Period
    ' . '
    0x2E
    Equals
    ' = '
    0x3D
    Underscore
    ' _ '
    0x5F
    Tilde
    ' ~ '
    0x7E
    Percent
    ' % '
    0x7F
    참고
    You can only use the percent sign for URL encoding. Follow the percent sign by two uppercase hex characters.
참고
The account name and channel names must include a reference to the token issuer.
The game uses the
vx_req_account_anonymous_login
message to sign users in to Vivox. After the game receives a successful
vx_resp_account_anonymous_login
message, the user is signed in.
참고
Every sign in request must have an access token that authorizes that game instance to sign in as the specified account.
For more information, refer to the Access Token Developer Guide.
If you do not want to use a unique account name per player, or if you do not want to expose the username to the network, then use one of the following options:
  • A hash of the unique username
  • A universally unique identifier (UUID)
The game sets a display name for the account by using UTF-8 encoding. This name is visible to all users in the channel; they receive it as the displayname field in the
vx_evt_buddy_presence
and
vx_evt_participant_added
events.
  • The display name is only valid for the current session and does not persist in the Vivox network.
  • The maximum display name length is 127 bytes, plus a null terminator.
  • The display name is set in the
    displayname
    field of the
    vx_req_account_anonymous_login
    request.
참고
The Vivox SDK does not perform checks on the display name. It is the game developer's responsibility to ensure that the display name follows the rules of the game, that the font characters are supported by the in-game renderer, and that the name is checked for duplication, obscenity, and impersonation. We recommend that you check display names by using some out-of-band means (such as the game server), and not by using the game client.
The following code is an example of how to initiate the sign in process:
. . .vx_req_account_anonymous_login_t *req;vx_req_account_anonymous_login_create(&req);req->connector_handle = vx_strdup("c1");req->acct_name = vx_strdup(".issuer-w-dev.mytestaccountname.");req->displayname = vx_strdup("John Doe");req->account_handle = vx_strdup(req->acct_name);req->access_token = vx_strdup(_the_access_token_generated_by_the_game_server);vx_issue_request3(&req->base, &request_count);. . .
The following code is an example of how to handle the sign in response:
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);}
In addition to handling the
vx_resp_account_anonymous_login
message, the game must also handle
vx_evt_account_login_state_change
events that have the state field set to
login_state_logged_out
. The Vivox SDK sends this message when the connection to Vivox is lost unexpectedly (such as from network connectivity issues).
The following code is an example of the connection state change messaging process:
void HandleLoginStateChange(vx_evt_account_login_state_change *evt){ if (evt->state == login_state_logged_in) { printf("%s is logged in\n", evt->account_handle); } else if (evt->state == login_state_logged_out) { if (evt->status_code !=0) { printf("%s logged out with status %d:%s\n", evt->status_code, vx_get_error_string(evt->status_code)); } else { printf("%s is logged out\n", evt->acct_name); } }}
After the game receives the
vx_resp_connector_create
message, the game can sign in to Vivox. For more information, refer to Create the connector object.

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.


    이 페이지의 문제 보고
    ​
    ​