startPageNumber | 返されたすべての結果内で、リストし始めるページ |
resultPageSize | ページに含む該当したマッチの数。これによって、callback に渡すリストのマッチの最大数が決まります。 |
matchNameFilter | 文字列の名前フィルター。 これは、現在アクティブなマッチ名に対する部分的にワイルドカードの検索であり、* <matchNameFilter>* と同等のマッチングとして考えることができます。これによって考えられる文字列すべてが結果に含まれます。 |
filterOutPrivateMatchesFromResults | レスポンスがプライベートのマッチ (つまり、パスワードで保護されたマッチ) を含んでいるかどうかを示す bool 型。 |
eloScoreTarget | マッチリストの結果の Elo スコアのターゲットは、グループ化されます。 ですから、Elo スコアを使用する場合は、マッチをリストしたクライアントの Elo レベルに設定する必要があります。その結果、そのプレイヤーのスキルレベルに近い結果が得られます。 これを使わない場合は、 NetworkMatch.CreateMatch や NetworkMatch.JoinMatch などのファンクションの他の Elo もすべて 0 に設定されます。 |
requestDomain | このリクエストのリクエストドメイン。同じドメインのリクエストのみが互いに連動します。例えば、NetworkMatch.CreateMatch がドメイン 1 で作成された場合、ドメイン 1 を指定する ListMatches のみがそのマッチを見つけます。この値は、異なる (互換性がない場合もある) クライアントバージョンを区別するために使用します。 |
callback | マッチメーカーのこの呼び出しが終了したら、callback が発生します。 |
Coroutine この関数は非同期で、コルーチンがサービスバックエンドとの通信を終了したある時点で完了します。
マッチメーカーで現在行われているマッチを一覧にする関数です。
NetworkMatch.ListMatches 関数は、この関数に渡されたパラメーターに一致する現在アクティブなマッチのページベースの結果を返します。
最初に、0 で始まる startPageNumber と適当な resultPageSize (ページに含むマッチの数、例えば 10) でこの関数を呼び出します。あまり大きな resultPageSize にすると、一致した情報をダウンロードする速度が落ちます。callback はマッチ数として最大で resultPageSize で指定した数を格納します (例えば、startPageNumber が現在 3 で resultPageSize が 5 のとき、callback に渡されるデータは結果リストで 15-20 番目に当たるマッチになります)。その後、startPageNumber をインクリメントし、結果を半ば一定にするために resultPageSize と matchNameFilter を一定に保ち、この関数を繰り返し呼び出します (マッチは関数を呼び出している間も、作成されたり削除されたりする場合があり、結果にそれが反映される場合もあります)。
using UnityEngine; using UnityEngine.Networking; using UnityEngine.Networking.Match; using System.Collections.Generic;
public class ExampleScript : MonoBehaviour { void Start() { NetworkManager.singleton.StartMatchMaker(); NetworkManager.singleton.matchMaker.ListMatches(0, 10, "", true, 0, 0, OnMatchList); }
public void OnMatchList(bool success, string extendedInfo, List<MatchInfoSnapshot> matches) { // ... } }
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.