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

Bug Can't find a join code on Lobby

Discussion in 'Lobby' started by Soloden, Feb 24, 2023.

  1. Soloden

    Soloden

    Joined:
    Feb 15, 2023
    Posts:
    3
    Hi,
    I created a code that searches if there is a free lobby and if it finds it then connects to the first one it found, and if it doesn't find one then it creates a new lobby.
    When I run the code through ParrelSync from the first user, it immediately creates a lobby (obviously there are no free lobbies) and then I run it in the second user, it finds a lobby and then in "JoinAllocation a = await RelayService.Instance.JoinAllocationAsync(lobby.Data[JoinCodeKey].Value );" It gives an error "Unity.Services.Relay.RelayServiceException: Not Found: join code not found --->", I'm stuck on this for a week and I've tried many ways and checked the Data and the JoinCode many times and every time I get the same error, I hope It's great that it will reach someone who can help me.
    The code is below.
     

    Attached Files:

  2. MatanYamin

    MatanYamin

    Joined:
    Feb 2, 2022
    Posts:
    110
    That's weird because your code looks the same as mine and mine works just fine. The only difference is that I don't use "DataObject.IndexOptions.S1" when creating the Lobby. Can you try doing the same only without
    the extra IndexOptions just to see if something happens?
    Like so:
    Code (CSharp):
    1. var options = new CreateLobbyOptions
    2.             {
    3.                 Data = new Dictionary<string, DataObject> { { JoinCodeKey, new DataObject(DataObject.VisibilityOptions.Public, joinCode) } }
    4.             };
    and I recommend to double check Unity Dashboard to look that everything is set up correctly for your project.