기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Multiplayer Services SDK

All Services

Multiplayer Services SDK

이 페이지는 선택한 언어로 제공되지 않습니다.
Multiplayer
​
​
Multiplayer Services SDK
  • Overview
  • Get started
  • Use multiplayer sessions
  • Manage sessions
  • Connect players through a relay
  • Networking
    • Ports and protocols
    • Locations and regions
    • Quality of service
    • Scaling
    • DTLS encryption
    • Advanced configuration
  • Matchmaking
  • Monitor and debug sessions
  • Tutorials
  • Reference
  1. Multiplayer Services SDK

Quality of service

Use Quality of Service (QoS) measurements to automatically select the best Relay region for your players.
읽는 시간 1분
최근 업데이트: 2달 전

참고
QoS currently doesn't work if you're using Relay with WebSockets/WebGL.
Relay’s quality of service (QoS) feature allows you to select a region automatically based on quality of service data by starting the NetworkDriver as a host player without selecting a target region.
Creating an allocation request without specifying a region triggers the allocations service to use quality of service data to select the best available region based on the quality of the connection between each region and the host. Relay considers both latency and packet loss.
The following code is an example of how to create an allocation request:
private async Task<string> StartRelayServer(){ // Initialize UGS and authenticate if not already signed in await UnityServices.InitializeAsync(); if (!AuthenticationService.Instance.IsSignedIn) { await AuthenticationService.Instance.SignInAnonymouslyAsync(); } // Request an allocation to the Relay service var relayMaxPlayers = 5; Allocation allocation; try { allocation = await RelayService.Instance.CreateAllocationAsync(relayMaxPlayers); } catch (Exception e) { Debug.LogError($"Create allocation request failed: {e.Message}"); return null; } // Request the join code to share with clients string joinCode; try { joinCode = await RelayService.Instance.GetJoinCodeAsync(allocation.AllocationId); } catch (Exception e) { Debug.LogError($"Create join code request failed: {e.Message}"); return null; } // Configure the transport with Relay server data using AllocationUtils NetworkManager.Singleton.GetComponent<UnityTransport>() .SetRelayServerData(AllocationUtils.ToRelayServerData(allocation, "dtls")); // Start the host (or use StartServer() for a dedicated server) return NetworkManager.Singleton.StartHost() ? joinCode : null;}

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

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

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


    이 페이지의 문제 보고