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 #
- From the Limited Access tab.
- Under Access Mode, select the Limited radio button to turn on.
- Select the Everyone radio button to turn off.
Create and populate a player group #
- Select the Accounts tab.
- Select Groups from the side menu.
- Click the Create Player Group button. Enter a name and optional description for the Player Group, then click Create Group.
- You should see the newly created player group. Click the Add Players button.
- Select the wanted players for the group.
- Submit by clicking the Add Selected button.
- Click Groups in the side and verify that your group now has the selected players.
Remove an account from a group #
- Select the Accounts tab.
- Click on the relevant player name to view individual account information.
- Under the Groups section hover over the group you would like to remove.
- Click Remove and confirm.
Delete a player group #
- Select the Accounts tab.
- Click on Groups in the side menu.
- Click on the player group you’d like to delete.
- Click the Delete Group button.
Create a limited access event #
- Select the Limited Access tab.
- Click the Add Event button.
- Set up your event by naming it, adding an optional description, adding the player group, and scheduling starting and ending dates/times.
- 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.
- Create a player group.
- Select the Limited Access tab.
- Under Full Access List click the Add Group button.
- 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());
}
}));
}