I am making a multiplayer game and I want to ask you something. I am trying to match players by match name, so it would work like this:
- Player A creates a match by giving it a name. - Players B, C... enter that name to join the match.
I understand how skill matching works, but I cannot see how I would go about doing it by name instead of skill. I could use some help,
Thank you!
Best Answer
J
Javier Garrigues
said
over 5 years ago
Hi Liam,
Forget my last post. I added the skill parameter and it doesn't give me the error. It means that I have to add the skill parameter even though it says it is not required in the API, but now that I think about it, that is not an issue, I just force skill to 0 and that's it.
Even without the error it wasn't working as I wanted, but I changed the SetCustomQuery for SetMatchGroup and now it works perfectly...in case someone has the same problem.
So, no need for further assistance in this matter...for the moment hehe.
You should be able to achieve this by using matchData and a customQuery with the MatchMakingRequest. You can read more about this here. Have a read through that and if you require any further assistance just let us know.
Regards,
Liam
1 person likes this
J
Javier Garrigues
said
over 5 years ago
Hi Liam,
Thanks for the response. So I configured the MatchMakingRequest with a customQuery like this:
var reqData = new Dictionary<string, object>(); reqData.Add("matchName", "test");
Debug.Log("GSM| Attempting Matchmaking..."); new GameSparks.Api.Requests.MatchmakingRequest() .SetMatchShortCode("BUMPER_MATCH") .SetCustomQuery(new GameSparks.Core.GSRequestData(reqData)) .Send((response) => { if (response.HasErrors) { // check for errors Debug.LogError("GSM| MatchMaking Error \n" + response.Errors.JSON); } });
But I am getting this error: GSM| MatchMaking Error {"skill|action":"Must provide one of skill|action"}
I don't know why it is...is it because I need to add skill parameter? In your API says that skill is a "not required" field. I don't want to do the matchmaking by skill, but by match name instead...I'm quite lost. I would really appreciate some help, thank you guys!
Javier
J
Javier Garrigues
said
over 5 years ago
Answer
Hi Liam,
Forget my last post. I added the skill parameter and it doesn't give me the error. It means that I have to add the skill parameter even though it says it is not required in the API, but now that I think about it, that is not an issue, I just force skill to 0 and that's it.
Even without the error it wasn't working as I wanted, but I changed the SetCustomQuery for SetMatchGroup and now it works perfectly...in case someone has the same problem.
So, no need for further assistance in this matter...for the moment hehe.
Thank you!! I changed the customQuery
Customer Support
said
over 5 years ago
Hi Javier,
Glad to hear you got this working. I'll mark this as answered.
Javier Garrigues
Hi guys,
I am making a multiplayer game and I want to ask you something.
I am trying to match players by match name, so it would work like this:
- Player A creates a match by giving it a name.
- Players B, C... enter that name to join the match.
I understand how skill matching works, but I cannot see how I would go about doing it by name instead of skill. I could use some help,
Thank you!
Forget my last post. I added the skill parameter and it doesn't give me the error. It means that I have to add the skill parameter even though it says it is not required in the API, but now that I think about it, that is not an issue, I just force skill to 0 and that's it.
Even without the error it wasn't working as I wanted, but I changed the SetCustomQuery for SetMatchGroup and now it works perfectly...in case someone has the same problem.
So, no need for further assistance in this matter...for the moment hehe.
Thank you!!
I changed the customQuery
1 person has this question
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
HI Javier,
You should be able to achieve this by using matchData and a customQuery with the MatchMakingRequest. You can read more about this here. Have a read through that and if you require any further assistance just let us know.
Regards,
Liam
1 person likes this
Javier Garrigues
Thanks for the response. So I configured the MatchMakingRequest with a customQuery like this:
var reqData = new Dictionary<string, object>();
reqData.Add("matchName", "test");
Debug.Log("GSM| Attempting Matchmaking...");
new GameSparks.Api.Requests.MatchmakingRequest()
.SetMatchShortCode("BUMPER_MATCH")
.SetCustomQuery(new GameSparks.Core.GSRequestData(reqData))
.Send((response) => {
if (response.HasErrors)
{ // check for errors
Debug.LogError("GSM| MatchMaking Error \n" + response.Errors.JSON);
}
});
But I am getting this error:
GSM| MatchMaking Error
{"skill|action":"Must provide one of skill|action"}
I don't know why it is...is it because I need to add skill parameter? In your API says that skill is a "not required" field. I don't want to do the matchmaking by skill, but by match name instead...I'm quite lost.
I would really appreciate some help, thank you guys!
Javier
Javier Garrigues
Forget my last post. I added the skill parameter and it doesn't give me the error. It means that I have to add the skill parameter even though it says it is not required in the API, but now that I think about it, that is not an issue, I just force skill to 0 and that's it.
Even without the error it wasn't working as I wanted, but I changed the SetCustomQuery for SetMatchGroup and now it works perfectly...in case someone has the same problem.
So, no need for further assistance in this matter...for the moment hehe.
Thank you!!
I changed the customQuery
Customer Support
Hi Javier,
Glad to hear you got this working. I'll mark this as answered.
Regards,
Liam
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics