Ban Accounts #

This guide covers how to ban an account, view ban history, and revoke bans from either the Social Operator Portal or the SDK.

Social Operator Portal #

Ban an account #

  1. Log into Pragma Engine’s Social Operator Portal. If you are running Pragma locally, you can access the Social Operator Portal at http://localhost:11200.
  2. Click on the relevant player name to view individual account information.
  3. Navigate to the Account Bans tab.
  4. Click the Ban button.
  5. Fill out the form.
  6. Confirm your options and click Ban.

View ban history #

  1. From the Social Operator Portal, click on the relevant player name to view individual account information.
  2. Click on the ban to view all relevant ban info.

Revoke a ban #

  1. From the Social Operator Portal, click on the relevant player name to view individual account information.
  2. Hover over the ban you’d like to revoke.
  3. Click the Revoke button that appears to the right of the row.
  4. Click Revoke Ban. The ban’s status should now show revoked.

SDK #

Ban an account #

Ban an account from all game servers:

Server->Session()->BansApi().BanAccountFromGameShard(
  SocialId, 
  AllGameShards,
  DurationInMillis, 
  BanReason,
  Comment,
  Delegate
);
server.BansApi.BanAccountFromGameShard(
  socialId, 
  allGameShards, 
  durationInMillis,
  comment,
  banReason,
  completeDelegate
);

To ban an account from a specific game server set allGameShards to false. This restricts the account only from the current game they’re connected to.

Ban an account from all social and game servers:

Server->Session()->BansApi().BanAccount(
  SocialId, 
  DurationInMillis, 
  BanReason,
  Comment,
  Delegate
);
server.BansApi.BanAccount(
  socialId, 
  durationInMillis,
  comment,
  banReason,
  completeDelegate
);

Handle ban notifications #

Once an account has been issued a ban, the currently connected player will receive a notification. The content of this message can be found in AccountRpc.BanV1Notification.

The player game client can receive ban notifications through the SDK. Here, you can implement custom behavior to manage how the ban is handled.

Player->Session()->BansApi().OnAccountBanned.AddLambda(
    [this](const FPragmaBan& Ban) {
        // handle ban event
    });
player.BansApi.OnAccountBanned += ban =>
{
    // handle ban event
};

Show a player their ban reason and duration on login #

When an account with active bans attempts to authenticate, the authenticateorcreate endpoint will respond with an AccountApplicationError which contains a list of associated active bans. You can use the list of associated active bans to customize what ban information (duration, reason) is shown to the player.

[optional] Create ban reason #

Pragma has already set an unspecified ban reason that you can use to ban players. If you want define specific reasons, you’ll need to create your own custom ban reasons.

  1. Update the ExtBanReason to have a custom enum value (EXT_BAN_REASON_DEMO):
AccountRpcExt.proto
enum ExtBanReason {
  option (unreal_enum_name) = "ExtBanReason";
  EXT_BAN_REASON_UNSPECIFIED = 0;  // do not use; this exists to support default value
  reserved 1 to 100; // Pragma supported Ban Reasons

  //  === EXTENSIONS (101+) === // Add your custom reasons here
  EXT_BAN_REASON_DEMO = 101;
}
  1. Run the following command to build the protos: ./pragma build project-protos.