Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question If I use RemovePlayerAsync to remove all players and lobby autodeletes, what happens on the relay?

Discussion in 'Lobby' started by luniac, Nov 11, 2023.

  1. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    612
    I’m trying to handle manual disconnecting and returning to menu.

    I have a 1v1 game so only 2 players, host and client.

    when either one hits escape, I want the host to remove both itself and client from lobby.

    The docs say the empty lobby will be automatically deleted.

    do I have to then do something on the relay side, or can I just leave it be and when the player either:
    1)finds new lobby to join
    2)creates new lobby
    3)exits the app
    4)minimizes app for extended period

    will the existing relay connection simply time out and be cleaned up server side?

    I’m really struggling to understand how much I have to handle manually versus how much is handled automatically.