Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • Bugs /
avatar image
Question by Markus H · Apr 12, 2021 at 08:32 AM · CloudScriptPlayer DataAccount Management

Server.DeletePlayer not working as expected

Hi there,

I want my players to be able to delete there account within the unity app. I have added a cloud script for that and call it with ExecuteCloudScript().


If executed, all goes well, the call is successful and the player (and the master player) vanishes from the PlayFab-Webinterface.

Now, I log in again with the credentials of the deleted player (or with a not unlinked custom id).

I expected the log in call to fail with an "AccountDeleted" error as specified here. But the log in succeeds and the player is visible in the playfab webinterface again. As if the deletion never happened.

Am I missing something? For me it looks like a bug. The server sets the account active again like if you delete a facebook account and log in again. But it should answer with the "AccountDeleted" error and delete the account some time in the future.

Cloud script:

handlers.DeletePlayer = function(args) {
    var request = {
        "PlayFabId" : currentPlayerId
    };
    var deletePlayerResult = server.DeletePlayer(request);
    log.info("Deleted player with result " + deletePlayerResult);
}

I am using the Unity-SDK 2.106.210406

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Citrus Yan · Apr 12, 2021 at 09:57 AM

To be clear, Server.DeletePlayer only deletes the player from a title, aka the title player account, therefore the master player account (publisher user account) won’t get deleted. To delete the master player account , you should use Admin/DeleteMasterPlayerAccount. And, regarding the issue “the server sets the account active again” you were talking about , mostly likely the previous title player account did get deleted (erased statistics, custom data, inventory, etc. ), I think you should be able to find that the new “active” account won’t have any data (statistics, custom data, etc. ) attached, sort of like a brand new account.

Comment

People who like this

0 Show 4 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Markus H · Apr 12, 2021 at 05:00 PM 0
Share

Well, yes the master account might not be deleted - for me it looks that way since it is not accessable through the web interface anymore. But that is only a side notice.

For the actual issue:

The spec says:

"Until the player data is fully deleted, attempts to recreate the player with the same user account in the same title will fail with the 'AccountDeleted' error."

So any log in attempt should fail after Server.DeletePlayer() has been called. Or am I wrong here.


Just for clarification, here are the steps to reproduce as pseudo code:

  1. clientAPI.LoginWithCustomID()
  2. clientAPI.AddUserNamePassword()
  3. (via cloud script) serverAPI.DeletePlayer()
  4. clientAPI.LoginWithEmailAddress()

Step 4. still succeeds but should not, should it? If step 4 creates a fresh player account that would be quite fatal in my opinion.

From a player perspective:

The player plays game A and game B from the same company.

If the player deletes its account from game A but still want to play game B from the same company, he would not expect the login to still work for game A until (s)he reregisters to game A.

Is there some additional way to unlink a master player account from a title?

avatar image Citrus Yan Markus H · Apr 13, 2021 at 07:23 AM 0
Share

>>Step 4. still succeeds but should not, should it? If step 4 creates a fresh player account that would be quite fatal in my opinion.

The time used for player deletion varies, sometimes it finishes right after Server.DeletePlayer() is called, therefore clientAPI.LoginWithEmailAddress() will succeed with a brand new title player account; however, sometimes it takes several minutes or more, therefore clientAPI.LoginWithEmailAddress() will return "AccountDeleted". Among my test cases, most login calls will succeed with a brand new account and some calls will return "AccountDeleted".

>>Is there some additional way to unlink a master player account from a title?

For a PlayFab account (uses email/username - password as credentials), there is no API for it, however, for credentials such customid, facebook account, there are APIs available:

Account Management - Unlink Custom ID (PlayFab Client) | Microsoft Docs

Account Management - Unlink Facebook Account (PlayFab Client) | Microsoft Docs

avatar image Markus H Citrus Yan · Apr 13, 2021 at 02:57 PM 0
Share

Ok, thanks. That is unfortunate. Could this behaviour be included in the API descrition, please?

I only stumbled about it by accident. I guess others might not even realise that the log in credentials of a user still work for the title the user was deleted from.

I guess I will simply specify the account deletion in the user help then. I am already planning to delete the master player automatically when the user deletes the last title-player.

Thanks again for the clarification!

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    PlayFab Player Query not working 1 Answer

    Using DisplayName parameter in registration request does not check if unique 1 Answer

    title_player_account PlayFabId does not work with cloud script 1 Answer

    CloudScript Error in Player Dashboard 2 Answers

    New Account created when success login with another account 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges