UNET : The MatchMaker, having trouble with the room creations and getting the list

Hello all,

Now that i have a working prototype with unet, i need to make it more “user friendly”.
My prototype works in 1 v 1 right now.
What i would like to do is quite simple : Click the 1 v 1 button, the code checks if there is anyone waiting for an opponent. If not, create a room and wait for an opponent. All that happens in some kind of a lobby. Once the opponents gets in the same room, i load the scene.

So far, this is what i have :

public void Start1V1 ()
    {
        networkMatch.ListMatches(0, 1, "", OnMatchList);
    }


    public void OnMatchList(ListMatchResponse matchListResponse)
    {
        if (matchListResponse.success && matchListResponse.matches != null)
        {
            if (matchList.Count == 0)
            {
                Debug.Log("No Room Found, Creating a Room") ;

                CreateMatchRequest create = new CreateMatchRequest();
                create.name = "TestRoom";
                create.size = 2;
                create.advertise = true;
                create.password = "";
                networkMatch.CreateMatch(create, OnMatchCreate);    
            }
            else
            {
                Debug.Log("Found Room : " + matchList[0].name + "./n") ;    
            }
        }
    }

    public void OnMatchCreate(CreateMatchResponse matchResponse)
    {
        if (matchResponse.success)
        {
            Debug.Log("Room Created, Waiting For Opponent");
        }
    }

The main issue is that right now, a room gets created everytime.It does not see any room created… i can launch it on 2 - 3 computers a at the same time, it still sees no room… and i am not sure why. the unity cloud thiny does show the rooms ( currently 16 rooms created… it seems it takes some time to refresh… )

ANy help please ?

Once again, pulling my hair with this thing… Could seriously use a clear example…
Anyways…
I d like to figure out at least how to Start as Host … Just trying to make a simple ui button that starts as Host… really.
and… Networking.NetworkClient StartHost(); ( from documentation )… is not working… any idea ?

Alright Alright… getting Closeerrrr ! I found out that i need to call StartHost () from the my NetworkManager replacement. And that the NetworkManager also contains all the matchmaking thingies…now… it s matter of overriding everything i guess.

Still feels like i need to find a cat with only his color as description and his state as current location… That’s right Unity… that s how your non existent documentation makes nuubs to networking feel like…

http://docs.unity3d.com/ScriptReference/Networking.Match.CreateOrJoinMatchRequest.html

Maybe this will help?

        CreateOrJoinMatchRequest create = new CreateOrJoinMatchRequest();
        create.name = "NewRoom";
        create.size = 4;
        create.advertise = true;
        create.password = "";
     
        networkMatch.CreateMatch(create, OnMatchCreate);

I have not tested this!

Thanks Hullu, but i solved that specific issue already… Now i am stuck again right here :

Seems like i am not sending the proper things to the NetworkManager, and i dont get it… Now why would unity not provide a CLEAR example for creating a room, starting a host, and connect a client, is over me… i am gonna try on the IRC channel, see if i can get any help there. If not, i ll just switch to Forge.

Definitely too late for an answer but maybe it stays for posterity.
The best example Unity has for UNET related examples is checking their git account and the code that they have.
@MornFall You could check the NetworkManagerHUD.cs to see how they handle their connections either in LAN or WAN (using the relay server and matchmaker). Here’s the link:
https://bitbucket.org/Unity-Technologies/networking/src/78ca8544bbf4e87c310ce2a9a3fc33cdad2f9bb1/Runtime/NetworkManagerHUD.cs?at=5.3&fileviewer=file-view-default
Cheers.