run-sample-matchmaking - End to end testing - (Unreal Engine module)
Run sample matchmaking backend service locally
In this tutorial section, you will learn how to run the sample matchmaking backend service locally on your computer.
First, make sure you have cloned the sample matchmaking backend service project on your computer. You can refer to the Initial setup module on how to clone it.
The sample matchmaking backend service project is created using Python. Install Python 3.13.x if you haven't already.
Create a new PowerShell script named
run.ps1
and place it inside thematchmaking-server
folder of the cloned backend service project.Open the
run.ps1
file and add the code below. This code set environment variables forserver.py
and the run the Python script.- AGS Shared Cloud
- AGS Private Cloud
# Set env var
$env:AB_BASE_URL = "https://<game_namespace_id>.prod.gamingservices.accelbyte.io"
$env:AB_NAMESPACE = "<game_namespace_id>"
$env:AB_CLIENT_ID = "<ams_cliam_client_id>"
$env:AB_CLIENT_SECRET = "<ams_cliam_client_secret>"
$env:CLAIM_KEYS = "<ams_fleet_claim_key>"
$env:REGIONS = "<ams_fleet_active_regions>"
# Run python
& python ./server.pyinfo- AB_BASE_URL is the base URL made out of your game namespace ID combined with your Admin Portal environment.
- AB_NAMESPACE is the namespace ID of your game namespace.
- AB_CLIENT_ID is the client ID of the IAM client to claim dedicated servers. You can use the ByteWars-AMSClaim IAM client you created in Set up IAM client.
- AB_CLIENT_SECRET is the client secret of the IAM client to claim dedicated servers. You can use the ByteWars-AMSClaim IAM client you created in Set up IAM client.
- CLAIM_KEYS is the claim keys you set on your AMS fleet. The claim keys must be separated with coma without whitespaces, for example
claimkey1,claimkey2
. You refer to Upload the dedicated server to AMS for more information. - REGIONS is the active regions of your AMS fleet. The regions must be separated with coma without whitespaces, for example
ap-southeast-1,us-east-2
. You refer to Upload the dedicated server to AMS for more information.
# Set env var
$env:AB_BASE_URL = "https://<studio_name>.accelbyte.io"
$env:AB_NAMESPACE = "<game_namespace_id>"
$env:AB_CLIENT_ID = "<ams_cliam_client_id>"
$env:AB_CLIENT_SECRET = "<ams_cliam_client_secret>"
$env:CLAIM_KEYS = "unreal-ds-ams"
$env:REGIONS = "ap-southeast-1,us-east-2"
# Run python
& python ./server.pyinfo- AB_BASE_URL is the URL of your Admin Portal environment.
- AB_NAMESPACE is the namespace ID of your game namespace.
- AB_CLIENT_ID is the client ID of the IAM client to claim dedicated servers. You can use the ByteWars-AMSClaim IAM client you created in the previous section.
- AB_CLIENT_SECRET is the client secret of the IAM client to claim dedicated servers. You can use the ByteWars-AMSClaim IAM client you created in the previous section.
- CLAIM_KEYS is the claim keys you set on your AMS fleet. The claim keys must be separated with coma without whitespaces, for example
claimkey1,claimkey2
. Refer to Upload the dedicated server to AMS for more information. - REGIONS is the active regions of your AMS fleet. The regions must be separated with coma without whitespaces, for example
ap-southeast-1,us-east-2
. Refer to Upload the dedicated server to AMS for more information.
tipTo 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.
Open Windows Powershell from inside the
matchmaking-server
folder of the cloned repository and run therun.ps1
by entering the command below:./run.ps1
Now, the sample matchmaking backend service is running locally on your computer at
ws://127.0.0.1:8080
. You should see the below log, indicating that it has started. The log will be shown when you perform the matchmaking using game clients later.Matchmaking started