The MatchMaker has two methods, JoinMatch and CreateMatch, at the moment they can not work with each other (ie, when I called CreateMatch, I can not use JoinMatch (for me a little weird this behaviour)).
This is the main problem. If I try to delete an already created or drop a match (DestroyMatch it DropMatch) it does not give the desired effect, and then, when you try to call JoinMatch, I get next errors:
A connection has already been set as ready. There can only be one.
UnityEngine.Networking.NetworkIdentity: UNetStaticUpdate ()
ClientScene :: AddPlayer: playerControllerId of 0 already in use.
UnityEngine.Networking.NetworkIdentity: UNetStaticUpdate ()
How to properly Remove the match and then Join to another match?
Hi,
Matches will time out after 30 seconds even if you don’t call DropConnection() or DestroyMatch().
The typical flow is:
Client 1:
CreateMatch()
Call StartHost() from the create callback
Client 2:
ListMatch()
In the results from call you’ll have a list of open matches, pick one and then call JoinMatch() with the proper NetworkID
Call StartClient() From the MatchJoined callback
DropConnection() is the proper function to call if you don’t want to wait for the timeout. Once all clients in a match call that and no one is left the match is destroyed instantly.
I kow it, but my problem has another reason… unfourtunately I badly know English but I try to describe my problem!
Ideally behaviour:
Client 1:
StartMatchMaker
Create Match (this step is necessary for others see us, when call ListMatch)
Get Match List (ListMatch)
Display Match List
Accept invitation on game
or
Find favorite match and join on it
Client 2:
StartMatchMaker
Create Match (this step is necessary for others see us, when call ListMatch)
Get Match List (ListMatch)
Display Match List
Accept invitation on game
or
Find favorite match and join on it
BUT, JoinMatch method not work if call CreateMatch method before. So I try to destroy already created match and after that call JoinMatch, and I have this errors
1. A connection has already been set as ready. There can only be one.
UnityEngine.Networking.NetworkIdentity: UNetStaticUpdate ()
2. ClientScene :: AddPlayer: playerControllerId of 0 already in use.
UnityEngine.Networking.NetworkIdentity: UNetStaticUpdate ()
How correct it? I don’t know! If on client 2, skip step 2 (skip CreateMatch), then Client 2 may connect to Match, that was created Client 1, but other N clients will not see Client 2
Small Description: In my case all players entering a Lobby, must be visible for other players, and other players must be visible for this player too! For it works, I create a Match for each player that enter in Lobby, and all other Players can see them (after call MatchList)! But in that case JoinMatch method not work!
I think the misunderstanding is in the flow you describe. The client that does a CreateMatch does not need to ListMatch or JoinMatch, it’s already in a match it just made. You either call CreateMatch OR call ListMatch then JoinMatch. You’ll never call CreateMatch and JoinMatch on the same client.
When I call CreateMatch, I can call ListMatch, and receive actual list of rooms (Match), next I try to DestroyMatch (because how you write before
) for joining to any Match from receiveing list
In steps it looks that
StartMatchMaker
Create Match (this step is necessary for others see us, when call ListMatch)
Get Match List (ListMatch)
Display Match List
Accept invitation on game
or
Find favorite match
** DestroyMatch
**Join to favorite Match
In a previous post, I forget show moment where I destroy match
In other words
I need following things:
When player enters multiplayer mode, he become visible to other players online and at the same time, he might be able to see other players. Also after entering mp mode he might be able to connect to one of the visible players or wait for some player to connect to him.
For the initial post:
I have the same issue, too!!
1. A connection has already been set as ready. There can only be one.
UnityEngine.Networking.NetworkIdentity: UNetStaticUpdate ()
2. ClientScene :: AddPlayer: playerControllerId of 0 already in use.
UnityEngine.Networking.NetworkIdentity: UNetStaticUpdate ()
There’s just no docs that show how to properly leave/destroy a match. I’ve tried many things - destroyMatch, disconnect, StopMatchMaker … nothing seems to work:
Upon creating/joining a game, I cannot leave the game and join another without the errors above.