question

Yash Seth avatar image
Yash Seth asked

EntityToken Invalid,

I keep getting an error saying "EntityTokenInvalid". I am using a playfab ts wrapper.

  

PlayFabClient.LoginWithCustomID({
                CreateAccount: true,
                CustomId: tostring(plr.UserId),
            }).then(async (loginResult) => {
                const token = loginResult.EntityToken?.EntityToken;
                const ticket = loginResult.SessionTicket;
                if (ticket !== undefined && token !== undefined && loginResult.EntityToken?.Entity?.Id !== undefined) {
                    ID = ticket;
                    Entity = token;
                    
                    PlayFabMultiplayer.CreateMatchmakingTicket(ticket, {
                        QueueName: "Test",
                        GiveUpAfterSeconds: 60,
                        Creator: {
                            Entity: {
                                Id: loginResult.EntityToken?.Entity?.Id,
                                Type: loginResult.EntityToken.Entity.Type,
                            },
                        },
                    }).catch((reason) => {
                        print(reason);
                    });
                }
            });



,
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.

Seth Du avatar image Seth Du ♦ commented ·

Have you tried to print out the entity ID and entity type before it is used in the request of CreateMatchmakingTicket API call? besides of "EntityTokenInvalid" error, is there any other error messages contained in the callback?

In addition, though I am not familiar with ts, CreateMatchmakingTicket is an entity API, which will require an entity token, I don't think you should pass a session ticket.

0 Likes 0 ·

0 Answers

·

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.