きれいなやり方はないかもしれません...
ご質問者さんのおっしゃるような、nameに追加情報を埋め込む手をとるのも止むを得ないのではないでしょうか。
MatchDesc MatchAttributes are always null | Unity Communityで(質問自体はMatchAttributesが意図通り受け渡しされないということについてのようですが)、JeremyUnityさんの回答の中でnameを使った追加情報伝達が紹介されていました。nameは長さに制限があり、使うべきでない文字もあるようですので、プレイヤーが入力した文字列をあらかじめチェックして、禁止文字は適宜エスケープ処理をしてから埋め込むのがよさそうです。
The other tool is the name field itself, and this is where we get into dirty hack territory. The name is a string who's max is 256 characters, which is admittedly on the short side but you can pack more data into it than just the name for now if you desire. For instance you could pack info in this manner "Name=Joe:MinLevel=3" etc. The one caveat i'd add for best results avoid the following characters since we do special escaping for them before our backend processes them
[ ] % _
Then in ListMatch when you specify a name you can specify an attribute, like "MinLevel=3" and you'll only get match results that contain that info. Additionally you can look through the matches returned after this high level filter and do additional local filtering to find exactly the match you want, so it's probably best to filter the name request against whatever will eliminate the greatest number of uninteresting matches and then do the local filtering based on those results.
もう一つのツールはnameフィールド自身で、ダーティーなハックの領域に足を突っ込むところです。nameは最大長256文字の文字列で明らかに短めですが、お望みなら単なる名前でなく、たとえば「Name=Joe:MinLevel=3」のような形式でもっとデータを詰めることができます。よい結果を得るための注意を一つ付け加えますと、以下の文字はバックエンドでの処理前に特殊なエスケープを行っていますので避けてください。
__[ ] % _ __
そしてListMatchでnameを指定する際に「MinLevel=3」のように属性を指定すれば、その情報を含んでいるマッチだけを取得できるでしょう。加えて、この高次のフィルタリングで得られた結果をみてさらにフィルタリングを行うことで目的のマッチを見つけることができます。ですので、不要なマッチを最も多く排除できるように最初のフィルタリングを行い、その結果について局所的フィルタリングを行うのが最善と思われます。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/11/19 10:01