Set up a limited access event #

Use limited access events to allow specified players to login during a scheduled time window.

Turn on limited access mode #

You need to turn on limited access mode to enable events. When on, only players in allowed groups can log in.

Turn on and off #

  1. From the Limited Access tab.
  2. Under Access Mode, select the Limited radio button to turn on.
  3. Select the Everyone radio button to turn off.

Create and populate a player group #

  1. Select the Accounts tab.
  2. Select Groups from the side menu.
  3. Click the Create Player Group button. Enter a name and optional description for the Player Group, then click Create Group.
  4. You should see the newly created player group. Click the Add Players button.
  5. Select the wanted players for the group.
  6. Submit by clicking the Add Selected button.
  7. Click Groups in the side and verify that your group now has the selected players.

Remove an account from a group #

  1. Select the Accounts tab.
  2. Click on the relevant player name to view individual account information.
  3. Under the Groups section hover over the group you would like to remove.
  4. Click Remove and confirm.

Delete a player group #

  1. Select the Accounts tab.
  2. Click on Groups in the side menu.
  3. Click on the player group you’d like to delete.
  4. Click the Delete Group button.

Create a limited access event #

  1. Select the Limited Access tab.
  2. Click the Add Event button.
  3. Set up your event by naming it, adding an optional description, adding the player group, and scheduling starting and ending dates/times.
  4. Click the Add Event button.

Create a full access player group #

To prevent accidental lockouts, create a dedicated “full access” player group that is always allowed to log in.

  1. Create a player group.
  2. Select the Limited Access tab.
  3. Under Full Access List click the Add Group button.
  4. Select the group and click OK.

Login Example #

If a player tries to login when limited access mode is turned on and they are not allowed into the event, the call will return a 403 and a LimitedAccessModeApplicationError.

Below is an example of calling login through the Unreal SDK and handling a LimitedAccessModeApplicationError.

void ANarwhalPlayerController::LogIn(const FString &Username) {
  Player->LogIn(
      EPragma_Account_IdProvider::UNSAFE, Username,
      Pragma::FPlayer::FLoggedInDelegate::CreateWeakLambda(
          this, [this, Username = Username](const TPragmaResult<> &Result) {
            if (Result.IsSuccessful()) {
              UE_LOG(LogTemp, Display, TEXT("Pragma -- Logged in as user %s."),
                     *Username);

            } else if (Result.IsTypedFailure() &&
                       Result.GetErrorType() ==
                           FPragma_Account_LimitedAccessModeApplicationError::
                               StaticStruct()) {

              const auto LimitedAccessModeApplicationError = Result.ReadError<
                  FPragma_Account_LimitedAccessModeApplicationError>();

              const auto EndTimeMillis =
                  LimitedAccessModeApplicationError.ActiveLimitedAccessEvents[0]
                      .LimitedAccessEventDetails.EndUnixTimeMs /
                  1000;
              const auto EndTime = FDateTime::FromUnixTimestamp(EndTimeMillis);

              UE_LOG(LogTemp, Error,
                     TEXT("-- Login failed - user does not have access at this "
                          "time. Try again at: %s"),
                     *EndTime.ToString())

            } else {
              UE_LOG(LogTemp, Error, TEXT("Pragma -- Login failed: %s"),
                     *Result.GetErrorAsString());
            }
          }));
}