Skip to main content

Legal Agreement

Last updated on

Overview

The AccelByte Gaming Services (AGS) Starter’s Legal Agreements service has the power to manage legal documents, such as Terms of Service, Privacy Policy, End User License Agreement (EULA). It can even manage Marketing Preferences, such as whether a player would like to receive updates via email. You can create and manage documents with different versions and locales, then store them in the Admin Portal.

Legal Agreements can be uploaded to any game titles you own, for all countries or only specific ones. Players will only need to agree to them once, when creating their account for your platform.

To use AGS Starter's Legal Agreements service, first you must create a legal document in the Admin Portal. This document acts as a container that you can upload the actual contents of the document into. To create this document, follow the steps below:

  1. In the Admin Portal, go to the intended game title and expand Legal Agreements on the side menu.

  2. Click Legal Documents to see all of the existing legal documents.

  3. To create a new document, click Create Document.

    Legal Agreements

    The Create Document form appears.

    Legal Agreements

  4. Fill in the required fields:

    • Input a name for the legal document in the Document Name field. Only letters and spaces are allowed.
    • Choose the type of document you’re creating from the Document Type dropdown menu.
      • Choose Legal Document for legal documents such as Privacy Policies or Terms and Conditions.
      • Choose Marketing Preference for marketing preferences such as the option for players to sign up for a newsletter.
    • Use the Country dropdown menu to select the country or countries you want to create country-specific policies for. To create a default country code, add a country-specific policy for one country (usually the country you are in). That country’s policy will become the default for all countries that do not have their own country-specific policies.
    IMPORTANT

    You won't be able to delete countries later, so make sure your selections are correct before submitting this form.

    • Input a tag for the document in the Tag field. This field is optional. Tags can be used to further classify documents.
    • To assign this legal document to a specific IAM client, select the client from the Client dropdown menu. In the game titles, this could be the game client. If you leave the field blank, the legal document will not appear for any clients. You can select multiple clients.
    • Input a description of the document in the Description field.
  5. When you’re finished, click the Create button. The new document is added to the list.

Create a Country-Specific Policy

After creating a legal document, you can create a country-specific policy to hold versions of that document that are for a specific country. The countries that were entered when a legal document was created or edited will be listed as countries that require a specific version of that document. To add a new country-specific policy to that list, follow the steps below:

  1. In the intended game title of the Admin Portal, expand Legal Agreements and click Legal Documents go to Platform Configurations and click Legal Documents.

  2. On the Legal Documents page you can see a list of all existing Legal Documents. Choose the document to which you want to add a new country-specific policy and click View next to that document.

    Legal Agreements

  3. The Legal Document Details page appears. You can see the details of the selected Legal Document and the list of country-specific versions of that document.

  4. To create a new country-specific policy, click Add Policy.

    Legal Agreements

  5. The Add Policy form will appear. Choose a country from the dropdown menu and click Create to confirm.

    Legal Agreements

    The country-specific policy will be added to the list and you’ll be redirected to the country-specific policy page that you just created.

    Legal Agreements

    • To set this country as the default country for country-specific policies, click the Set as Default button in the upper-right corner.
    • If you want to require players to accept this policy before continuing to use the platform, select the Mandatory Update checkbox in the Policy Details section.
    • To create a new version of the legal document, see Create a New Version of a Document.

Create a Platform Client-Specific Policy

You can also create a platform client-specific policy to hold versions of a document for a specific platform (e.g., Xbox, PlayStation, etc.). To add a new platform client-specific policy to a legal document, follow the steps below:

NOTE

You must define the IAM Client for your target platform before proceeding.

  1. In the intended game title of the Admin Portal, expand Legal Agreements and click Legal Documents.

  2. On the Legal Documents page you can see a list of all your existing Legal Documents. Click View next to the intended document’s Action column.

    Legal Agreements

  3. On the Legal Document Details page you can see the details of your selected legal document and the clients associated with that document. To add a client, click Add more… in the Clients field. \

    Legal Agreements

  4. The Add New Client form will appear. Choose a client from the dropdown menu and click Add to confirm.

    Legal Agreements

    The platform client specific-policy is successfully created.

    NOTE

    If you want to create different legal documents for different platform clients, you will need to create separate legal documents for each client.

Create a New Version of a Document

After creating a country-specific policy, you can add a new version of that document any time it has been revised. To create a new version of a country-specific policy, follow the steps below:

  1. In the intended game title of the Admin Portal, expand Legal Agreements and click Legal Documents.

  2. On the Legal Documents page you can see a list of all existing Legal Documents. Click View next to the desired document.

    Legal Agreements

  3. The Legal Document Details page appears. You can see the details of the selected Legal Document and the list of country-specific versions of that document. Click View next to the intended country.

    Legal Agreements

    On the Country-Specific Policy page, you can see information about the policy and its existing versions.

  4. To create a new version of the document, click Add Version.

    Legal Agreements

  5. Enter a name for the new version in the Version Name field.

    Legal Agreements

  6. Once you have completed the fields, click the Create button. The new document version is created.

    Legal Agreements

  7. To add content to your new document version, click View in the Action column of that version.

    Legal Agreements

    On the Version Details page, you can see detailed information about the selected document version.

  8. To add content to this version, click Create New.

    Legal Agreements

  9. Select the language used in the document from the Locale dropdown menu.

  10. Click Browse to find the document on your computer. The file should be in .md format.

    Legal Agreements

  11. When you have finished, click the Create button. The selected file will be uploaded.

Edit a Document Version

You can edit the content of a legal document. To do so, follow the steps below:

  1. In the intended game title of the Admin Portal, expand Legal Agreements and click Legal Documents.

  2. On the Legal Documents page you can see a list of all existing Legal Documents. Click View next to the intended document.

    Legal Agreements

    in the Legal Document Details panel, you can see detailed information about the selected Legal Document and the list of country-specific versions of that document.

  3. To open one of these country-specific policies, click View next to it.

    Legal Agreements

    In the Policy Details panel for that country, you can see detailed information about the policy and existing versions of it.

  4. To edit a version, click View next to the version you want to edit.

    Legal Agreements

  5. On the Version Details page, use the text editor on the left side of the page to make your edits. The text box on the right side shows you how your changes will look after they’re published.

    Legal Agreements

  6. When you have finished, click Save.

Publish a Document Version

After you create a legal document, you can publish it for all players in the affected namespace. To do so, follow the steps below:

  1. In the intended game title of the Admin Portal, expand Legal Agreements and click Legal Documents.

  2. On the Legal Documents page you can see a list of all existing Legal Documents. Click View next to the intended document.

    Legal Agreements

    in the Legal Document Details panel, you can see detailed information about the selected Legal Document and the list of country-specific versions of that document.

  3. Click View next to the country-specific policy you want to publish.

    Legal Agreements

    On the Country-specific Policy page, you can see detailed information about the policy and existing versions of it.

  4. To publish a version, click Publish next to that version.

    Legal Agreements

    The Publish Version confirmation window appears.

  5. Type PUBLISH in all caps and select the checkbox if you want to notify players about the policy update via email.

    Legal Agreements

  6. When you’re finished, click Publish. The new version will be published.

The Legal Agreement API can be called by using the functions in AccelByte::FRegistry::Agreement.

Check Player Eligibilities

Check all players’ legal eligibility from a specified namespace. Use this function to check whether the player who is logged in has already agreed to the legal agreement. You can check the IsAccepted variable from the retrieving model to see if the current legal document has already been accepted by the player. If not, you can hide that document from the player.

AccelByte::FRegistry::Agreement.QueryLegalEligibilites(
/* specified namespace */,
THandler<TArray<FAccelByteModelsRetrieveUserEligibilitiesResponse>>::
CreateLambda(
[](TArray<FAccelByteModelsRetrieveUserElegibilitiesResponse> Result)
{
/* do something when succeeded */
}),
FError::CreateLambda([](int32 ErrorCode, FString ErrorMessage)
{
/* do something when fails */
})
);

Retrieve Policies

Retrieve all the latest active policies, based on the namespace from the game configuration and country code, from the user’s profile.

EAccelByteAgreementPolicyType AgreementPolicyType = EAccelByteAgreementPolicyType::LEGAL_DOCUMENT_TYPE;
bool DefaultOnEmpty = false;

FRegistry::Agreement.GetLegalPolicies(AgreementPolicyType, DefaultOnEmpty, THandler<TArray<FAccelByteModelsPublicPolicy>>::CreateLambda([](const TArray<FAccelByteModelsPublicPolicy>& Result)
{
// do something if GetLegalPolicies has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetLegalPolicies has an error
UE_LOG(LogTemp, Log, TEXT("Error GetLegalPolicies, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve List of Policies by Namespace

Retrieve all the latest active policies, fora specified namespace and country code, from the user’s profile.

FString Namespace = FString("MyAwesomeGame");
EAccelByteAgreementPolicyType AgreementPolicyType = EAccelByteAgreementPolicyType::LEGAL_DOCUMENT_TYPE;
bool DefaultOnEmpty = false;

FRegistry::Agreement.GetLegalPolicies(Namespace, AgreementPolicyType, DefaultOnEmpty, THandler<TArray<FAccelByteModelsPublicPolicy>>::CreateLambda([](const TArray<FAccelByteModelsPublicPolicy>& Result)
{
// Do something if GetLegalPolicies has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetLegalPolicies has an error
UE_LOG(LogTemp, Log, TEXT("Error GetLegalPolicies, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve List of Policies by Tag

Retrieve all latest active policies that have the specified tags, based on the namespace from game configuration and country code, from the user’s profile.

EAccelByteAgreementPolicyType AgreementPolicyType = EAccelByteAgreementPolicyType::LEGAL_DOCUMENT_TYPE;
TArray<FString> Tags;
Tags.Add("female");
Tags.Add("age20s");
bool DefaultOnEmpty = false;

FRegistry::Agreement.GetLegalPolicies(AgreementPolicyType,Tags, DefaultOnEmpty, THandler<TArray<FAccelByteModelsPublicPolicy>>::CreateLambda([](const TArray<FAccelByteModelsPublicPolicy>& Result)
{
// Do something if GetLegalPolicies has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetLegalPolicies has an error
UE_LOG(LogTemp, Log, TEXT("Error GetLegalPolicies, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve List of Policies by Country

Retrieve all the latest active policies, based on a specified country and namespace, from the game configuration.

FString CountryCode = FString("US");
EAccelByteAgreementPolicyType AgreementPolicyType = EAccelByteAgreementPolicyType::LEGAL_DOCUMENT_TYPE;
bool DefaultOnEmpty = false;

FRegistry::Agreement.GetLegalPoliciesByCountry(CountryCode, AgreementPolicyType, DefaultOnEmpty, THandler<TArray<FAccelByteModelsPublicPolicy>>::CreateLambda([](const TArray<FAccelByteModelsPublicPolicy>& Result)
{
// Do something if GetLegalPoliciesByCountry has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetLegalPoliciesByCountry has an error
UE_LOG(LogTemp, Log, TEXT("Error GetLegalPoliciesByCountry, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve List of Policies by Country and Tag

Retrieve all the latest active policies that have the specified tags, based on a specified country and the namespace, from game configuration.

FString CountryCode = FString("US");
EAccelByteAgreementPolicyType AgreementPolicyType = EAccelByteAgreementPolicyType::LEGAL_DOCUMENT_TYPE;
TArray<FString> Tags;
Tags.Add(FString("male"));
Tags.Add(FString("age5s"));
bool DefaultOnEmpty = false;

FRegistry::Agreement.GetLegalPoliciesByCountry(CountryCode, AgreementPolicyType, Tags, DefaultOnEmpty, THandler<TArray<FAccelByteModelsPublicPolicy>>::CreateLambda([](const TArray<FAccelByteModelsPublicPolicy>& Result)
{
// Do something if GetLegalPoliciesByCountry has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetLegalPoliciesByCountry has an error
UE_LOG(LogTemp, Log, TEXT("Error GetLegalPoliciesByCountry, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve a Document’s Content

Use this function to retrieve the content of the specified document. You can get the required url by calling the retrieving policies like the previous tutorial does.

FString Url = FString("SomeDocumentBaseURL");

FRegistry::Agreement.GetLegalDocument(Url, THandler<FString>::CreateLambda([](const FString& Result)
{
// Do something if GetLegalDocument has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetLegalDocument has an error
UE_LOG(LogTemp, Log, TEXT("Error GetLegalDocument, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Accept Policies

Accept a Policy

Use this function to accept a localized policy document by providing the localized policy version ID. You can get a localized policy version id by following the previous tutorial while retrieving policies.

FString LocalizedPolicyVersionId = FString("SomeLocalizedPolicyVersionId");

FRegistry::Agreement.AcceptPolicyVersion(LocalizedPolicyVersionId, FVoidHandler::CreateLambda([]()
{
// Do something if AcceptPolicyVersion has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if AcceptPolicyVersion has an error
UE_LOG(LogTemp, Log, TEXT("Error AcceptPolicyVersion, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Accept Policies in Bulk

Use this function to accept many localized policy documents at once.

TArray<FAccelByteModelsAcceptAgreementRequest> AgreementRequests;
FAccelByteModelsAcceptAgreementRequest AgreementRequest1;
AgreementRequest1.LocalizedPolicyVersionId = FString("SomeLocalizedPolicyVersionId1");
AgreementRequest1.IsAccepted = true;
AgreementRequest1.PolicyId = FString("SomePolicyId1");
AgreementRequest1.PolicyVersionId = FString("SomePolicyVersionId1");
AgreementRequests.Add(AgreementRequest1);
FAccelByteModelsAcceptAgreementRequest AgreementRequest2;
AgreementRequest2.LocalizedPolicyVersionId = FString("SomeLocalizedPolicyVersionId2");
AgreementRequest2.IsAccepted = true;
AgreementRequest2.PolicyId = FString("SomePolicyId");
AgreementRequest2.PolicyVersionId = FString("SomePolicyVersionId2");
AgreementRequests.Add(AgreementRequest2);

FRegistry::Agreement.BulkAcceptPolicyVersions(AgreementRequests, THandler<FAccelByteModelsAcceptAgreementResponse>::CreateLambda([](const FAccelByteModelsAcceptAgreementResponse& Result)
{
// Do something if BulkAcceptPolicyVersions has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if BulkAcceptPolicyVersions has an error
UE_LOG(LogTemp, Log, TEXT("Error BulkAcceptPolicyVersions, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));