기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Multiplayer Services SDK

All Services

Multiplayer Services SDK

이 페이지는 선택한 언어로 제공되지 않습니다.
Multiplayer
​
​
Multiplayer Services SDK
  • Overview
  • Get started
  • Use multiplayer sessions
    • Integrate Multiplayer sessions
      • Initialize UGS and authenticate the player
      • Create a session
      • Create sessions in the Editor
      • Find and join a session
      • Matchmaking
      • Migrate session host
      • Leave a session
      • Get a list of joined sessions
      • Delete a session
      • Session configuration options
    • Game server hosting support
  • Manage sessions
  • Connect players through a relay
  • Networking
  • Matchmaking
  • Monitor and debug sessions
  • Tutorials
  • Reference
  1. Multiplayer Services SDK

Find and join a session

Implement ways for joining multiplayer sessions by entering a join code, browsing available sessions, or reconnecting after a disconnection.
읽는 시간 3분
최근 업데이트: 하루 전

A player can join a previously-created session in the following ways:
  • Join code
  • Browse sessions in a list
  • Reconnect to a session

Join code

await MultiplayerService.Instance.JoinSessionByCodeAsync(joinCode);
A unique and human-friendly join code is generated when a host starts a session. A host can then share this join code with other players to invite them to play the same session. The codes use a combination of letters and numbers and are designed to be short and easy to type or spell out loud.
Refer to JoinSessionByCodeAsync.

Browse multiplayer sessions

You can generate a list of sessions in your game for users to browse and join. Users may want to filter this list based on different parameters to help them find a session that best matches what they're looking for.
You can use a session query to list sessions.
await MultiplayerService.Instance.QuerySessionsAsync(queryOptions);
Query results include all non-full, public sessions a player can join. Players can select a session from a list displaying only public properties of the session (such as its name), and join directly by session ID.
Refer to JoinSessionByIdAsync. Refer to QuerySessionOptions for available options.
참고
You can use queries to discover a session as long as its IsPrivate property is set to false. A session's ID is not the same as its join code.

Reconnect to a session

If a player is disconnected from a session but remains a member of it, they can reconnect to the same session. Implement the following code in your game to handle the cases when a player disconnects.
참고
Reconnection is designed specifically for cases when a user hasn't yet been removed from the session by either the host or the service. If the player has already been removed, then they need to join the session again.
To reconnect a user, do the following:
  1. Fetch all the sessions the current user is part of using GetJoinedSessionIdsAsync:
    await MultiplayerService.Instance.GetJoinedSessionIdsAsync();
    참고
    If a session type was provided when creating and/or joining the session, you have to save the mapping between the session ID and the session type. The Multiplayer SDK does not save this information.
  2. To reconnect to the chosen session, call ReconnectAsync:
    await sessionManager.ReconnectAsync(sessionId);
You can add a custom network handler implementation to your reconnect request by specifying a
ReconnectSessionOptions
that uses your own network handler implementation:
await sessionManager.ReconnectAsync(sessionId,new ReconnectSessionOptions().WithNetworkHandler(customNetworkHandler));

Additional resources

  • Network connection management for details on network connection options.
  • QuerySessionsAsync for information about querying available sessions.
  • QuerySessionsOptions for information about the query options for the search.
  • QuerySessionsResults to return a list of available sessions from your query.
  • JoinSessionByIdAsync for information on joining a session by the session ID.
  • JoinSessionOptions for a list of available options.
  • GetJoinedSessionIdsAsync to return a list of sessions the current user is a member of.
  • ReconnectToSessionAsync to reconnect to a particular session.

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

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

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

  • 보고 있는 페이지
    • Join code

    • Browse multiplayer sessions

    • Reconnect to a session

    • Additional resources


이 페이지의 문제 보고