Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to remove disconnected player from allocation?

Discussion in 'Relay' started by bluepilkintonching, Jan 17, 2023.

  1. bluepilkintonching

    bluepilkintonching

    Joined:
    Nov 29, 2019
    Posts:
    30
    Hi there!
    I'm wondering how I can disconnect a player from both a relay & lobby allocation if they leave the game through any means. (Alt + f4, computer shutdown, disconnecting from a button in the game). At the moment, even after a player exits the game, they still take up space on the Relay & Lobby allocations, and when they try to reconnect, I get:
    Code (CSharp):
    1. [Lobby]: LobbyConflict, (16003). Message: player is already a member of the lobby
    Code (CSharp):
    1. HttpException`1: HTTP/1.1 409 Conflict
    How do I fix this issue?
    Thanks!
     
  2. thiagownt

    thiagownt

    Unity Technologies

    Joined:
    Jul 30, 2021
    Posts:
    22
    Hi,
    If lobby is being used with Relay it should detect the disconnection. This detection happens after about 10 seconds after the last packet was sent from the player to Relay.
    See https://docs.unity.com/lobby/leave-a-lobby.html for details on leaving/removing players from a Lobby.
     
  3. YalnizCanavar

    YalnizCanavar

    Joined:
    May 31, 2020
    Posts:
    10
    it does not detect, lobby players count still same when a client disconnects how we actually are supposed to remove player from lobby when they quit directly ?