question

Kim Strasser avatar image
Kim Strasser asked

CloudScript: How can I mark suspicious players?

I always check the player's scores in CloudScript before I add the values to the leaderboards.

For example, I check in CloudScript if the player's scores are higher than the maximum values. If one of the player's scores is above, then I want to mark the player somehow as a suspicious player. I just want to mark the player as a suspicious player, I don't want to ban the player immediately.

From time to time, I want to find out if my title has any marked players and I want to see the player's score that has led to the marking.

How can I mark a suspicious player and how can I get a list with all marked players and their suspicious scores?

Should I use server API WritePlayerEvent to mark a player or should I do the marking differently?

How long is the PlayStream event stored? I won't check my title every day for suspicious players. But I want to ban a marked player if I'm sure that he has cheated.

CloudScriptPlayStream
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

There are 2 options for you to mark suspicious players. As you have implement the Cloud Script to verify the value, you may either add tag via AddPlayerTag API call, or call ReportPlayer API to generate a PlayStream Event in your title.

  • Add a tag. You may define a segment for any players that have this tag so that it will be easy to check each players in a segment. However, you may not see how many times a player is reported as a suspicious players.
  • ReportPlayer. As it generates PlayStream Events, you may query all these events in Data Explorer(advanced), and group by PlayFab ID and count the total number for each player. Please note that PlayStream events by default have the retention of 30 days. You may routinely run the query to check the result, otherwise, if necessary, you may export the data to external storage, such as Azure Blob Storage, using Event Export feature.
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.

Kim Strasser avatar image Kim Strasser commented ·

I use ReportPlayer in CloudScript but I don't have a ReporterId because it is not another player that makes the report.

Which PlayFabId should I use for ReporterId? Should I create a new PlayFab player account that I only use for this purpose?

var reportcomment = "Playerscore: " + playerscore;
var result = server.ReportPlayer({ReporteeId: currentPlayerId, ReporterId: , Comment: reportcomment});

In addition, is it possible to display the player's score or the Comment in Data Explorer(advanced)?

I have tried it with this code but it doesn't show the player's score:

['events.all']
| where FullName_Name == 'player_reported_as_abusive'
| extend d=parse_json(EventData) 
| summarize count() by Entity_Id

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Kim Strasser commented ·

ReportPlayer API doesn't require an actual PlayFab ID in the ReporteeId and ReporterId, simply input title id for ReporterId.

>>is it possible to display the player's score or the Comment in Data Explorer

If additonal information is required, you may write a custom event via WritePlayerEvent API call so that you may log any data when current user is marked as a suspicious player.

0 Likes 0 ·
Kim Strasser avatar image Kim Strasser Seth Du ♦ commented ·

I found out that I can get all required informations if I use this code:

['events.all']
| where FullName_Name == 'player_reported_as_abusive'
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.