Skip to main content

Player Punishment

1. Overview

Player Punishment means that the player is not allowed to use certain features for a specified period. It is a punishment implemented by the game to discipline players who engage in negative behaviors such as cheating or verbally abusing others. The game can manage (add/revoke) Player Punishment through the portal console or backend HTTP API. A Player Punishment has a deadline time, when the deadline time is reached, the punishment will be automatically lifted.

2. Manage on Portal

To manage player punishment, you should log in to the PGOS web porta console and go to Players > Query:

image-20240914150918027

Search the player you are Interested, click the player ID for player details:

image-20240914151138689

Click the Punishment tab to manage player punishment:

image-20240914150403158

2.1 Add Punishment

Click the Add New Punishment button to add punishments to the player:

image-20240914151633222

Field description:

  • Service: select the service you want to block the player from using. You can select multiple services at once.
  • Deadline: select when to lift this punishment.
  • Reason: fill in the reason why the player was punished. You will get this string from error message when you call the client SDK APIs of the relevant services.
  • Extra Data: optional, the extra data you want to store. You will get this data when you call the backend HTTP API QueryPlayersPunishItems.

Client the Submit button to make the punishments valid.

2.2 Revoke Punishment

If you want to end a player punishment early, you can click the Revoke button in the punishment list:

image-20240914153649287

3. View Logs on Portal

If you want to view the punishment logs of the player, click the Logs tab as below:

image-20240914154000403

4. Client SDK for Player Punishment

If the player get a punishment on the service X, when the player client call the client SDK APIs of the service X, it will get a service kBackendPlayerIsPunished = 5000 error, and the error message with be a json string of the punishment details, such as:

{
"punished_reason": "verbally abusing others",
"punished_deadline": "1726761600"
}

The punished_deadline field is a Unix timestamp in seconds.