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

run-sample-matchmaking - End to end testing - (Unreal Engine module)

Last updated on March 12, 2025

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.

  1. 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.

  2. The sample matchmaking backend service project is created using Python. Install Python 3.13.x if you haven't already.

  3. Create a new PowerShell script named run.ps1 and place it inside the matchmaking-server folder of the cloned backend service project.

  4. Open the run.ps1 file and add the code below. This code set environment variables for server.py and the run the Python script.

    # 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.py
    備考
    • 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.
    ヒント

    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.

  5. Open Windows Powershell from inside the matchmaking-server folder of the cloned repository and run the run.ps1 by entering the command below:

    ./run.ps1
  6. 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