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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

CreateOrJoinMatchRequest

Discussion in 'Multiplayer' started by danp, Jun 14, 2015.

  1. danp

    danp

    Joined:
    Jun 20, 2013
    Posts:
    21
    How does CreateOrJoinMatchRequest work? http://docs.unity3d.com/ScriptReference/Networking.Match.CreateOrJoinMatchRequest.html

    I have this and it works to create a match.

    Code (csharp):
    1. CreateOrJoinMatchRequest createOrJoin = new CreateOrJoinMatchRequest();
    2. createOrJoin.name = "matchname";
    3. createOrJoin.size = 2;
    4. createOrJoin.advertise = true;
    5. createOrJoin.password = "";
    6. networkMatch.CreateMatch(createOrJoin, OnMatchCreate);
    But how do I give it the onMatchJoined callback?
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
  3. ian_facepunch

    ian_facepunch

    Joined:
    Mar 16, 2015
    Posts:
    22
    I have the same question really. I want the matchmaker to auto connect two players without one of them specifying if they are the host and the other is the client. CreateOrJoinMatchRequest sounds like it should do the job but when I use it both players create a new match instead of the one called second joining the first.

    Should there be something like networkMatch.CreateOrJoinMatch ?

    Ian
     
  4. Vennril

    Vennril

    Joined:
    Jul 12, 2014
    Posts:
    7
    It looks like there is some missing functionality regarding CreateOrJoinMatchRequest.

    When you go to the declaration, you can see that it derives from CreateMatchRequest, but aside from that it's empty.
    And the only method that takes a CreateMatchRequest is NetworkMatch.CreateMatch().

    Is there something missing?
     
    isidro02139 likes this.
  5. redsend

    redsend

    Joined:
    Jun 3, 2013
    Posts:
    2
    Did you find a solution for this?