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… )
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…
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.