Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Create a custom matchmaking only with Relay

Discussion in 'Relay' started by VKyuzel, Apr 5, 2023.

  1. VKyuzel

    VKyuzel

    Joined:
    Mar 6, 2022
    Posts:
    21
    Hello!

    As I wrote in the title, I would create an easy matchmaking where a player click the "quick play button" than **the Relay search if there is an existing code allocation**,
    if there is not code allocation:
    we proceed with the creation of an allocation and starting the host.
    if exist a code allocation:
    we get the allocation code, and starting the game as client
    The game is a 1vs1 card game

    I tried to ask to ChatGPT but it says:
    the RelayService class in Unity does not provide a method to retrieve a list of joinable relay codes. The RelayService is primarily used for managing the relay configuration for your project.
    If you want to retrieve a list of joinable relay codes, you will need to use a third-party matchmaking or lobby system that provides this functionality

    Honestly I don't wanna create a Lobby to retrieve the code...
    I am asking if there is a way where RelayService can gather the list of joinable codes. Thank you!



    Just to give a more deep lore of what is my state of work:
    Right now my players have to pass the join code upload_2023-4-5_17-5-17.png
    in this way, the first player create the "lobby" (but is the Relay) and the second player insert the code in the input text field and click Join By Code
     
  2. unity-ptrottier

    unity-ptrottier

    Unity Technologies

    Joined:
    Nov 2, 2021
    Posts:
    15
    Hello VKyuzel, there is no way to get a list of all Relay join codes.

    Lobby supports exactly this use case (it has quick join) and will prevent players from joining a full Lobby. With a mere list of join codes, you wouldn't know if a Relay is full or not.

    Cheers,
    Philippe
     
    VKyuzel likes this.
  3. VKyuzel

    VKyuzel

    Joined:
    Mar 6, 2022
    Posts:
    21
    Thank you so much