Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
ClosenetId | The NetworkID of the match to join. This is found through calling NetworkMatch.ListMatches and picking a result from the returned list of matches. |
matchPassword | The password of the match. Leave empty if there is no password for the match, and supply the text string password if the match was configured to have one of the NetworkMatch.CreateMatch request. |
publicClientAddress | The optional public client address. This value will be stored on the matchmaker and given to other clients listing matches. You should send this value if you want your players to be able to connect directly with each other over the internet. Alternatively you can pass an empty string and it will not affect the ability to interface with matchmaker or use relay server. |
privateClientAddress | The optional private client address. This value will be stored on the matchmaker and given to other clients listing matches. You should send this value if you want your players to be able to connect directly with each other over a Local Area Network. Alternatively you can pass an empty string and it will not affect the ability to interface with matchmaker or use relay server. |
eloScoreForClient | The Elo score for the client joining the match being created. If this number is set on all clients to indicate relative skill level, this number is used to return matches ordered by those that are most suitable for play given a listing player's skill level. This may be 0 on all clients, which would disable any Elo calculations in the MatchMaker. |
requestDomain | The request domain for this request. Only requests in the same domain can interface with each other. For example if a NetworkMatch.CreateMatch is made with domain 1, only ListMatches that also specify domain 1 will find that match. Use this value to silo different (possibly incompatible) client versions. |
callback | The callback to be invoked when this call completes. |
Coroutine This function is asynchronous and will complete at some point in the future, when the coroutine has finished communicating with the service backend.
The function used to tell MatchMaker the current client wishes to join a specific match.
This function should be called after getting results from a call to NetworkMatch.ListMatches and picking a match to join. Upon receiving this request, the MatchMaker will reserve a seat on the Relay server this match is talking through and fetch the info needed for this client to connect to that Relay server. Once the callback completes, this client will have the necessary to continue connecting to the chosen match. To do so you then should call StartClient() with the passed in MatchInfo.
using UnityEngine; using UnityEngine.Networking; using UnityEngine.Networking.Match; using UnityEngine.Networking.Types;
public class ExampleScript : MonoBehaviour { public NetworkID netId;
void Start() { NetworkManager.singleton.StartMatchMaker(); NetworkManager.singleton.matchMaker.JoinMatch(netId, "" , "", "", 0, 0, OnMatchJoined); }
public void OnMatchJoined(bool success, string extendedInfo, MatchInfo matchInfo) { // ... } }
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.