question

ignat-nee avatar image
ignat-nee asked

Playfab Matchmaking Player Joined error

Greetings!

I'm tried to join as player to room in playfab multiplayer game. I called PlayFabMatchmakerAPI.PlayerJoined method. Here is code:

PlayerJoinedRequest playerJoinedRequest = new PlayerJoinedRequest
{
    LobbyId = Server.ServerInformation.LobbyId,
    PlayFabId = userData.PlayFabUserAccountInfo.PlayFabId
};

PlayFabMatchmakerAPI.PlayerJoined(playerJoinedRequest, playerJoinedAction, RegisterPlayerError);

And i'm recieved such error: PlayFabError(ServiceUnavailable, 400 Bad Request, 400 BadRequest).
But whats more strange, if i'm open active games tab on playfab dashboard, i'm see than my player, who recieve error is sucessfully joined to room:

The question is - why i'm recieve 400 error if event player sucessfully joined to game.

Matchmaking
fadsf.png (25.2 KiB)
10 |1200

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

brendan avatar image
brendan answered

First, to make sure - are you using your own custom matchmaker? That's specifically what the Matchmaker API is for, to be clear. If you're using our matchmaker, you'll want to use the Server API call https://api.playfab.com/documentation/server/method/RedeemMatchmakerTicket - just pass the matchmaker ticket you get from the call to Matchmake to the server, and have the server use that call which verifies the player, retrieves the player details, and tells us that the player is in the session.

If you are using your own matchmaker, can you send us the complete error response? The response will also contain an errorMessage, which has the specifics on why the 400 was returned in this case.

4 comments
10 |1200

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

ignat-nee avatar image ignat-nee commented ·

Greeting. I recieved such error:

As you can see, there is no additional information.

0 Likes 0 ·
fsadfsdaf.png (24.6 KiB)
brendan avatar image brendan ignat-nee commented ·

The error in that case is ServiceUnavailable, which may indicate that your client isn't able to communicate with PlayFab at all in that call. Let me ask - are you using the Unity HTTP Web Request class? If so, can you please try switching to WWW? The Web Request class has some known issues that Unity needs to resolve which can cause timeouts.

0 Likes 0 ·
ignat-nee avatar image ignat-nee brendan commented ·

Nope, i'm using WWW as unity web request class.
There is listing of problem code:

PlayerJoinedRequest playerJoinedRequest = new PlayerJoinedRequest
            {
                LobbyId = Server.ServerInformation.LobbyId,
                PlayFabId = userData.PlayFabUserAccountInfo.PlayFabId
            };


            PlayFabMatchmakerAPI.PlayerJoined(playerJoinedRequest, playerJoinedAction, RegisterPlayerError);



And here are screenshot of my playfab settings:

0 Likes 0 ·
Show more comments
chenjd avatar image
chenjd answered

You should use PlayFabMatchmakerAPI.StartGame

not PlayFabClientAPI.StartGame

10 |1200

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

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.