question

kitchristopherpro avatar image
kitchristopherpro asked

Ideal Player Account Deletion

Hello, what is the best way to delete a player account completely from cloud code?

I looked into DeleteMasterPlayerAccount but apparently that cannot be called from cloud script. I tried var playerStatResult = server.DeletePlayer( { PlayFabId: currentPlayerId, }); but that did not seem to have an effect.

Thanks!

Account Management
10 |1200

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

Made Wang avatar image
Made Wang answered

Did you get the following error message (in Data->Data Explorer(basic)):

"apiError": {
                        "code": 400,
                        "status": "BadRequest",
                        "retryAfterSeconds": null,
                        "error": "APINotEnabledForGameServerAccess",
                        "errorCode": 1194,
                        "errorMessage": "This API must be enabled for server access in the Game Manager API Features settings",
                        "errorHash": null,
                        "errorDetails": null
                    }

You need to check Allow server to delete player accounts in Title settings->API Features first, and then try your code.

If it still doesn't work, please provide the error message.

If you want to delete player master accounts.You need to call the Admin API DeleteMasterPlayerAccount in the administrative tool.

10 |1200

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

kitchristopherpro avatar image
kitchristopherpro answered

Thanks Made Wang for your answer! Changing the API Features to allow server deletes worked, though how can I access the Admin API to delete the master player account?

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.

Made Wang avatar image Made Wang commented ·

You can call the admin API in Azure Function or your own server.

1 Like 1 ·

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.