It works perfectly when I try to connect locally from my editor to my running build.
But after I start the server on my Android, and try to connect to it from my editor, it time outs:
As you can see, it finds the match, and then tries to join, but it can't.
If I try to do it from a build, the log says the following:
Log: cannot connect after {10} attempt address {::ffff:127.0.0.1:7777}
ClientDisconnected due to error: Timeout
Why does it tries localhost, when I obviously use the Matchmaking system?
When I tried it on 2 Android devices, the same happened.
Ps.: I know that it's going to be depracated, I just want to use it during a short term gift.
Thanks in advance!
Starting Matchmaker in a Start:
networkManager.StartMatchMaker();
networkManager.matchMaker.baseUri = new System.Uri("https://eu1-mm.unet.unity3d.com");
When the MatchScene ("Battle") is loaded:
if (this.isHost)
{
networkManager.StartHost();
}
else
{
networkManager.StartClient();
}
And the Play button's handle: (still same component)
public void Play()
{
networkManager.matchMaker.ListMatches(0, 1, string.Empty, true, 0, 0, OnMatchList);
}
void OnMatchList(bool success, string extendedInfo, List<MatchInfoSnapshot> matches)
{
if (matches.Count == 0)
{
networkManager.matchMaker.CreateMatch("match", 2, true, string.Empty, string.Empty, string.Empty, 0, 0, OnMatchCreate);
}
else
{
networkManager.matchMaker.JoinMatch(matches[0].networkId, string.Empty, string.Empty, string.Empty, 0, 0, OnMatchJoined);
}
}
void OnMatchCreate(bool success, string extendedInfo, MatchInfo matchInfo)
{
this.isHost = true;
this.networkId = matchInfo.networkId;
SceneManager.LoadScene("Battle");
}
void OnMatchJoined(bool success, string extendedInfo, MatchInfo matchInfo)
{
SceneManager.LoadScene("Battle");
}