Run sample matchmaking backend service - End-to-end testing - (Unity module)
Run sample matchmaking backend service locally
In this tutorial section, you 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. Thus, make sure you have install Python 3.13.x on your computer.
Once you have the previous requirements ready, open the sample matchmaking backend service project. Then, create a new PowerShell script named
run.ps1
and place it in 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 = "unity-ds-ams"
$env:REGIONS = "ap-southeast-1,us-east-2"
# 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 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 the previous module 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 the previous module 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 = "<ams_fleet_claim_key>"
$env:REGIONS = "<ams_fleet_active_regions>"
# 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
. You refer to the previous module 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 the previous module 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.
Finally, run the
run.ps1
using Windows PowerShell. Make sure to run it frommatchmaking-server
folder of the cloned sample matchmaking backend service, otherwise Windows PowerShell won't able to find the file../run.ps1
Now, the sample matchmaking backend service is running locally on your computer at
ws://127.0.0.1:8080
. You can also see the log indicating that the service is started.matchmaker started