Sign In Register

How can we help you today?

Start a new topic
Answered

Match by match Name

 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!


Best 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

 


1 person has this question

Hi Javier,


Glad to hear you got this working. I'll mark this as answered.


Regards,

Liam

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

 

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

 

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
Login to post a comment