로비에서 나가기
Learn how players can leave a lobby and what happens when they exit.
읽는 시간 1분최근 업데이트: 한 달 전
플레이어가 로비에서 나가면 해당 플레이어 ID는 플레이어 목록에서 제거됩니다. 호스트가 로비에서 나가면 무작위로 로비에 있는 다른 플레이어가 호스트로 선택됩니다. 호스트는 로비에서 다른 플레이어를 제거할 수도 있습니다. 두 경우 모두 호스트가 단순히 자신의 playerId 대신 다른 플레이어의 playerId를 지정하면 동일한 RemovePlayerAsync API 호출이 사용됩니다. 마지막 플레이어가 로비에서 나가면 로비는 자동으로 삭제됩니다. 다음 코드 샘플은 로비에서 플레이어를 제거하는 방법을 보여 줍니다. C#
try{ //Ensure you sign-in before calling Authentication Instance //See IAuthenticationService interface string playerId = AuthenticationService.Instance.PlayerId; await LobbyService.Instance.RemovePlayerAsync("lobbyId", playerId);}catch (LobbyServiceException e){ Debug.Log(e);}