Search Unity

Resolved Allow two local player at the lobby

Discussion in 'Lobby' started by Ozgekocaoglu, May 23, 2022.

Thread Status:
Not open for further replies.
  1. Ozgekocaoglu

    Ozgekocaoglu

    Joined:
    Feb 13, 2019
    Posts:
    38
    Hello,

    My main problem is... Our game have local multiplayer also.
    So i should connect with 2 players with the same ip. But when i try this right now, i'm getting this error message:


    Code (CSharp):
    1.  
    2. Unity.Services.Lobbies.LobbyServiceException: player is already a member of the lobby ---> Unity.Services.Lobbies.Http.HttpException`1[Unity.Services.Lobbies.Models.ErrorStatus]: HTTP/1.1 409 Conflict
    3. at Unity.Services.Lobbies.Http.ResponseHandler.HandleAsyncResponse (Unity.Services.Lobbies.Http.HttpClientResponse response, System.Collections.Generic.Dictionary`2[TKey,TValue] statusCodeToTypeMap) [0x0006d] in. Could you help me about this? I check out everywhere, but i did not find anything.

    How can i allow same ip? Or how can i control lobby connection ip's?
     
  2. veleek_unity

    veleek_unity

    Ben Randall Unity Technologies

    Joined:
    Aug 25, 2021
    Posts:
    59
    That error does not occur when you have two players with the same IP, it means that you're trying to join the lobby when logged in with the same player (e.g. the same Unity Player Identification).

    Right now, unfortunately, you manage user login using
    AuthenticationService.Instance
    . This singleton object handles how the user is authenticated and it's not possible to be logged in simultaneously with multiple users. The Lobby service uses the player object from the AuthenticationService to call Lobby so it's not possible to override with a different user.

    Technically, it is possible, but you would need to hack up the Authentication SDK code to allow multiple different users to be signed in at the same time.
     
  3. Ozgekocaoglu

    Ozgekocaoglu

    Joined:
    Feb 13, 2019
    Posts:
    38
    I got it. Thank you! :)
     
  4. emilyryan

    emilyryan

    Unity Technologies

    Joined:
    Nov 22, 2019
    Posts:
    129
    Thanks for your question! We are going to close out this forum post, but feel free to create a new one if you have any other questions. Have a great day!
     
Thread Status:
Not open for further replies.