メインコンテンツまでスキップ

Unreal Engine Module - Run a Dedicated Server on AccelByte Multiplayer Server (AMS) - Setup a dedicated server IAM client

Last updated on January 13, 2024

About

IAM clients are used to give permissions to certain resources in AccelByte Gaming Services (AGS). In order for your game's dedicated server to be able to communicate with AccelByte Multiplayer Servers (AMS), you need to set up the correct IAM client permissions.

Create a server IAM client

The server IAM client is an IAM client that gives permissions for your game server. Sufficient permissions are needed for your game server so it can communicate with AccelByte Multiplayer Servers (AMS).

  1. Go to the AGS Demo Admin Portal dashboard and select your game namespace. Then, go to Authorizations > IAM Clients.

  2. On the IAM Clients page, click the Create New button to create a new server IAM client.

  3. Fill out the Create New IAM Client form. Keep in mind that a server IAM client should be set to Confidential, which means you'll need to enter the client's Secret (or generate one using Generate Client Secret).

    Warning

    The client Secret will not be shown again after this form is closed. Be sure to save this information.

  4. Click Create and your server IAM client information will be displayed.

    Server IAM client details tab

  5. Go to the Permissions tab on the page that appeared after creating the server IAM client and click on the Add button.

    Server IAM client Permissions tab

  6. Add the following permissions. These permissions are needed for your game server to manage matchmaking-related services.

    ResourcePermission
    NAMESPACE:{namespace}:DSM:SERVERUpdate
    NAMESPACE:{namespace}:SESSION:GAMECreate, Read, Update, Delete
    NAMESPACE:{namespace}:SESSION:GAME:PLAYERCreate
    NAMESPACE:{namespace}:SESSION:PARTYRead
    ADMIN:NAMESPACE:{namespace}:SESSION:GAMEUpdate
    ADMIN:NAMESPACE:{namespace}:SESSION:PARTYRead
    NAMESPACE:{namespace}:MATCHMAKING:BACKFILLCreate, Update, Delete

Your final server IAM client's permissions should look like this:

Server IAM client's completed Client Permissions tab

Congratulations! You have successfully created a new Server IAM Client.

Create an AMS CLI IAM client

The AMS CLI IAM client is an IAM Client that gives permission for you to upload your server to AMS. You will learn more about how to upload your server in later tutorials.

  1. Go to the AGS Demo Admin Portal dashboard and select your game namespace. Then, go to Authorizations > IAM Clients.

  2. On the IAM Clients page, click the Create New button to create a new CLI IAM client.

  3. Fill out the Create New IAM Client form. Keep in mind that a CLI IAM client should be set to Confidential, which means you'll need to enter the client's Secret (or generate one using Generate Client Secret).

    Warning

    The client Secret will not be shown again after this form is closed. Be sure to save this information.

  4. Click Create and your CLI IAM client information will be displayed.

    CLI IAM client details tab

  5. Go to the Permissions tab on the page that appeared after creating the CLI IAM client and click on the Add button.

    CLI IAM client Permissions tab

  6. Add the following permissions. These permissions will allow you to upload your server to AMS.

    ResourcePermission
    AMS:UPLOADCreate, Update

Your final CLI IAM client's permissions should look like this:

CLI IAM client's completed Client Permissions tab

Congratulations! You have successfully created a new AMS CLI IAM client.

Configure the Server SDK

Once your server IAM client is configured in the AGS Admin Portal, you'll need to configure the Server SDK in your game project. This section will guide you on how to configure the Server SDK so your game server is authorized to communicate with AccelByte Multiplayer Servers (AMS).

  1. Open the DefaultEngine.ini file located in Config folder of your Byte Wars project directory.

  2. Inside the file, find the [/Script/AccelByteUe4Sdk.AccelByteServerSettings] section and add the data as shown below, replacing the XXXXXXXX with the Client ID and Client Secret from Step 3 of the Create a server IAM client section. Then, flip the boolean for bManualRegisterServer and bServerUseAMS to true, lastly bump some log categories verbosity level to verbose under [Core.Log].

    [/Script/AccelByteUe4Sdk.AccelByteServerSettings]
    ClientId=XXXXXXXX
    ClientSecret=XXXXXXXX
    Namespace=bytewars
    PublisherNamespace=accelbyte
    RedirectURI="http://127.0.0.1"
    BaseUrl="https://demo.accelbyte.io"

    [OnlineSubsystemAccelByte]
    bManualRegisterServer=True

    [/Script/AccelByteUe4Sdk.AccelByteSettings]
    bServerUseAMS=True

    ; ByteWars tutorial module specific
    [/ByteWars/TutorialModule.DSEssentials]
    bServerUseAMS=true

    [Core.Log]
    LogAccelByte=Log
    LogAccelByteOSS=Verbose
    LogAccelByteAMS=Verbose
    LogAccelByteDSHub=Verbose
    Tips
    • ClientId is randomly generated and used to uniquely identify your server IAM client.
    • ClientSecret is the secret (password) for your server IAM client.
    • Namespace is the namespace ID of your game namespace. You created this in Module: Initial Setup
    • PublisherNamespace is the publisher ID of your publisher namespace. The default value is accelbyte.
    • RedirectURI is the URI that will redirect your game server after the server authorization is completed. The default value is http://127.0.0.1.
    • BaseUrl is the base URL of your AGS Admin Portal environment.
    • bManualRegisterServer a flag for dedicated server that allows server to manually tell AMS that we are ready to welcome players. This is to avoid issue where the server is still in the initialization state (loading assets, fetching some cloud save configuration, etc) but the players already trying to connect to the server.
    • bServerUseAMS a flag for game client to grab AMS available location using AccelByte SDK.
  3. Save the DefaultEngine.ini file and rebuild your Byte Wars project.

Reference