I’m trying to create a multiplayer lobby, but I’m having difficulties with the connection.
I create a match at the host, then connect a client to that match.After only ~15 seconds, the client disconnects with a Timeout error, and I can’t do anything to avoid that. Host keeps connected ok.
This is the error I get:
MatchMakingClient DropConnection :https://mm.unet.unity3d.com/json/reply/DropConnectionRequest
ClientDisconnected due to error: Timeout
Just for the record, these are the operations I’m doing for this to happen:
Host:
StartMatchMaker();
matchMaker.CreateMatch("MatchName", 4, true, "", "", "", 0, 0, OnMatchCreate);
Client:
StartClient();
StartMatchMaker();
matchMaker.ListMatches(0, 6, "", true, 0, 0, OnGUIMatchList);
[...]
matchMaker.JoinMatch(mMatchNetworkID, "", "", "", 0, 0, OnMatchJoined);
I’ve configured ConnectionConfig like this at the Awake (I’m not sure if I need to do something more after this):
ConnectionConfig myConfig = new ConnectionConfig();
myConfig.NetworkDropThreshold = 50; //50%
myConfig.OverflowDropThreshold = 10; //10%
I’ve also tried making Command and RpcClient calls every x seconds in the LobbyPlayer that instantiates when joining a mtach, to keep messages coming, but client still disconnects after 15 seconds which is very little time.
What am I doing wrong? How can I keep the client connected to the match for enough time for the game to starts?
Thanks for your time!