question

Lothar avatar image
Lothar asked

Delete Player withoud Display name via Scheduled task

Hi,

I have in my title some players without Display Name.

Is it possible include it into a segment and after that delete it with a scheduled task?

thanks for the help.

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

·
Seth Du avatar image
Seth Du answered

It is possible, but will need a workaround. You may first create a scheduled task for all players and check the display name of each of them via API GetPlayerProfile, then call delete related API.

However, please be very careful when running tasks on All Players, I will suggest getting the number of players who don't have Display Name first, before you decide a batch deletion. To do this, you may call AddPlayerTag to add a specific tag instead of direct deletion. After the scheduled task is finished. Create another Segment where Tag name in the configuration equals to what you have defined in the Cloud Script/Azure function. Then you may create a scheduled task to delete all players in this segment.

Please note that if you are in a paid tier, there are no limits on the quantity of players in a title. Meanwhile, deleting is a process of profile writing, which will cost like normal profile modifying. It will cost a lot if the number is huge. (it will be fine if the title is still in development mode) Normally we won’t recommend batch deleting players. If you have concerns of inactive players, we suggest using last login(date) in the segment.

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

Lothar avatar image Lothar commented ·

Hi, thanks for the answer. I understood the high level of your workaround...but I've some difficoulties about the steps to follow. How I can invoke GetPlayerProfile? via cloud script? do you have an example for me?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Lothar commented ·

Here is a sample on checking the existence of display name. For other properties, please remember to define Profile constraints in the request -- PlayerProfileViewConstraints

handlers.test1 = function (args, context)
{
    var request = {
        "PlayFabId" : currentPlayerId
    };   
    var result = server.GetPlayerProfile(request);
    return result.PlayerProfile.hasOwnProperty('DisplayName');
}
0 Likes 0 ·
Lothar avatar image Lothar Seth Du ♦ commented ·

Super Thanks

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.