Set up AMS configuration - Game server integration - (Unity module)
About
AccelByte Multiplayer Servers (AMS) is a dynamic dedicated game server manager that enables you to serve dedicated game servers as close to your players as possible. You can learn more about what AMS has to offer in the AMS documentation.
To start using AMS, you need to create an AMS account and link your game namespace to it. You also need an IAM Client to manage your game server on AMS, such as upload your game server build and claim your dedicated servers from your fleet.
Create AMS IAM client
To manage your dedicated servers on AMS, such as uploading new server build and claiming dedicated servers from your backend, you need an IAM client with enough permission to do those actions. In this tutorial section, you learn how to create that IAM client.
- AGS Shared Cloud
- AGS Private Cloud
Log in to the Admin Portal and go to your game namespace dashboard.
Go to Game Setup > Games and Apps > IAM Clients and click Create IAM Clients.
On the new page, use the configuration below to create a new server IAM client.
- Create Options: the available options to create a new IAM client. Choose the Create Custom IAM Clients option to create a new IAM client from a scratch.
- Client Name: the name of the IAM client. Set it to ByteWars-AMS.
- Client Type: the confidentiality of the IAM client. Set it to Confidential.
- Secret: the secret or password for the IAM client. You can use your own secret or click the Generate button to generate a random one. Be sure to copy this.
- Redirect URI: the URI used to redirect once the IAM client authorization is successful. Set it to
http://127.0.0.1
.
warningThe Secret will not be shown again after you create the IAM client. Be sure to copy and save it before proceeding to the next step.
On the Permissions section, enable the permission below. This permission allow you to upload the game server build to AMS.
- AMS > Dedicated Server Toolkit: enable Read, Create, and Update permissions.
Once done, click on the Create button to create your IAM client.
Log in to the Admin Portal and go to your game namespace dashboard.
Go to Game Setup > Games and Apps > IAM Clients and click Create New.
On the new window, use the configuration below to create a new server IAM client.
- Client Type: the confidentiality of the IAM client. Since the server IAM client must be secret, set it to Confidential.
- Secret: the secret or password for the IAM client. You can use your own secret or just click the Generate Client Secret button to generate a random secret.
- Client Name: the name of the IAM client. Set it to ByteWars-AMS.
- Redirect URI: the URI used to redirect once the IAM client authorization is successful. Set it to
https://127.0.0.1
.
warningThe Secret will not be shown again after you create the IAM client. Be sure to copy and save it before proceeding to the next step.
Click the Create to create your server IAM client. After that, your can see your new IAM client information on the screen.
Go to the Permissions tab and click on the Add button to add new permissions. Then, add the permission below to allow you upload the game server build to AMS.
Resource Permission NAMESPACE:{namespace}:AMS:LOCALDS Create AMS:UPLOAD Create, Update Now, your IAM client setup is complete.
Configure the AccelByte Unity SDK
In order for your game server can be integrated with AMS, you need to add a few AccelByte Unity SDK configuration below.
Open Byte Wars in Unity Editor. In the Byte Wars project, there is an existing
Resources
folder. If you are using your own project, please create theResources
folder under theAssets
folder.In the
Resources
folder, create a new JSON file namedAccelByteServerSDKConfig.json
. Copy the code below and paste it into the file. Then, replace the values based on your AGS game namespace settings.- AGS Shared Cloud
- AGS Private Cloud
{
"Default":
{
"BaseUrl": "https://<game_namespace_id>.prod.gamingservices.accelbyte.io",
"RedirectUri": "http://127.0.0.1"
}
}備考- BaseUrl is the base URL made out of your game namespace ID combined with your Admin Portal environment.
{
"Default":
{
"BaseUrl": "https://<studio_name>.accelbyte.io",
"RedirectUri": "http://127.0.0.1"
}
}備考- BaseUrl is the URL of your Admin Portal environment.
ヒント- To find your game namespace ID, go to your Admin Portal and navigate to the Namespace page where your game namespaces are listed. Then, locate your game namespace under the GAMES section and click on the gear icon. On the new page, locate the Namespace ID property and there you can find your game namespace ID value.
Save the file and your AccelByte Unity SDK configuration is complete.