question

susanabuinhas avatar image
susanabuinhas asked

PlayerJoinedRequest is resulting in invalid input parameters

Hi!

I'm trying to register a player in a game session (PlayerJoinedRequest) when the player creates a new game, but the problem is that it returns the error "Invalid input parameters" when the request is made.

I've already put several breakpoints to check my code and the fields of the request (LobbyId and PlayFabId) seem to be filled and correct. The weirdest part is that, although it returns the error and never enters in my private success function (PlayerJoinedOnSuccess), sometimes the player is joined and it appears in "Players" of the "Active Games" section in Game Manager.

Why am I having this problem?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JayZuo avatar image
JayZuo answered

Are you creating your own custom matchmaking server? All APIs under PlayFab Matchmaker API is used for external match-making service in conjunction with PlayFab hosted Game Server instances. And for PlayerJoined, as you can see, it requires a LobbyId which must be a Game Server Instance started with the Matchmaker/StartGame API. And according to your code, it seems you are RegisterGame method to get the LobbyId. This might be why you got "Invalid input parameters" error.

RegisterGame is used for externally hosted game servers which doesn't work with custom matchmaking service. For externally hosted game servers, you will need to use PlayFab matchmaker as in this tutorial: https://api.playfab.com/docs/tutorials/external-game-servers.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

susanabuinhas avatar image susanabuinhas commented ·

Yes, I think that was the problem! With that tutorial I was able to do the exactly same thing in a much easier way :)

Thank you so much!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.