- Home /
UNET Matchmaking Filter Issues
So I have been messing with the new matchmaking system through UNET and I am having some problems with the match attribute filters. I have set up the matchmaking system to a point whereas I can create a match successfully on a server and then pick up that match on another client. The CreateMatchRequest class has a Dictionary called matchAttributes that would appear to setup different attributes that the client can filter against. So I set that up with something like this:
CreateMatchRequest create = new CreateMatchRequest();
create.name = "GameName";
create.size = 4;
create.advertise = true;
create.password = string.Empty;
create.matchAttributes = new Dictionary<string, long>();
create.matchAttributes.Add("GameType", 1);
NetworkManager.singleton.matchMaker.CreateMatch(create, OnMatchCreate);
The whole creation pipe goes through fine with the "GameType" attribute presumably set to the value: 1. So after that I set up my request on the client with something like this:
ListMatchRequest request = new ListMatchRequest();
request.pageNum = 0;
request.pageSize = 20;
request.nameFilter = string.Empty;
request.matchAttributeFilterEqualTo = new Dictionary<string,long>();
request.matchAttributeFilterEqualTo.Add("GameType", 2);
networkMatch.ListMatches(request, OnMatchList);
I am using the matchAttributeFilterEqualTo dictionary which should match against the server's "GameType" attribute and and return false since they have different values. However, I am still getting that server from the ListMatches function. So I am just curious if I am using this system incorrectly or if there is some other issue here. Thank you in advance for your help.
Answer by SniperED007 · Jun 16, 2016 at 10:54 AM
Contrary to the Unity documentation, Unity actually doesn't support MatchAttributes yet (not in Unity 5.3 or even 5.4)
Is this really true? If so, the whole match making process is about useful as bag of sand on a desert island.
The whole point of match making is to make finding and $$anonymous$$ATCHING other games easy. Sure, it works if you're ai$$anonymous$$g for simple things like agar.io or slither.io where every game is just a duplicate of the same game.
But if you want to have things like game types as OP or different maps... the match making in its current form is utterly useless.
And as insult to injury, the create game feature does not support easy connecting with NAT punch thru making it impossible from say, Android to connect games hosted on PC.
Yet another Unity Disappointment(T$$anonymous$$)
Your answer
Follow this Question
Related Questions
UNET Player Object Creation Error: Failed to spawn server object 1 Answer
Automatic Match Joining for Networked Games 0 Answers
UNET NullReferenceException OnServerAddPlayer and questions about messages 0 Answers
How to record a webcam stream to a file on the server? 0 Answers
Unet Timeout Issues 4 Answers