Bump Draft

Help

Race servers

A machine where you start ACC and bdr gets the results, listing it on Go racing, the API without our agent, its history page, the older setup, and the ACC config download.

A race server is one ACC dedicated server that runs one race or lobby. This page explains machines where you start ACC yourself and bdr only gets the results, a server's history page, and how to download a split's ACC config.

Servers and machines

  • Servers bdr starts. On a machine with the host agent, bdr creates a server for each race or lobby by itself, named pool-<machine>-..., and stops it afterwards. You don't register these or do anything for them. They show on the machine's page and on the race, not on the Machines tab. See Machines.
  • A machine where you start ACC. You run ACC with your own tools and settings, on Windows or Linux, and a small results agent sends bdr the result files. This suits a rented server, or a PC where you can't run the host agent. On the Machines tab it is marked Results only.

The server page

Select History on a results-only machine on the Machines tab to open its page. A server bdr started is opened from its machine's page or from the race. It shows:

  • The status (Online or Offline) and what the server is doing, for example Idle or Running.
  • Last heartbeat, with the agent version. Never means the agent has not reported yet.
  • Sessions run, and Players online against the server's car limit.
  • Running now: the split it is running at the moment.
  • Session history: every split it ran, newest first, with drivers, state, start time and duration. "never started" means the split was given this server but it did not start.
  • Resource usage: for servers on a machine with the host agent, the container's CPU and memory over the last 6 hours. CPU is shown the way docker stats shows it, so 150 % means one and a half cores. If the page warns about throttling, the container had too little CPU and drivers would have felt lag. Below CPU and memory, the drivers on the server and ACC's late steps per minute follow on the same time axis. A few late steps per second are normal.

A machine where you start ACC shows No host agent on this machine under Resource usage. That is expected: nothing collects those figures for it.

Start ACC yourself, bdr gets the results

1. Add the machine

  1. On your community's Machines tab, under Add a machine, select Add my server under Your own ACC, results to BD.R.
  2. Fill in Name, Simulation and Region.
  3. Select Add.

There is no address and no ports to enter: bdr never connects to the machine, and drivers find your server in ACC as you set it up.

2. Create an API key

  1. Select API keys on the machine.
  2. Enter a key name, for example box-1, and select Create key.
  3. Copy the key. It is shown once, because bdr only stores a hash of it.

A key works for this one machine only. The key list shows when each key was created and last used. Select Revoke to stop a key working. Remove on the machine deletes it and all its keys.

3. Start the agent

On Linux, run the agent from the platform's ACC server image with BDR_MODE=results_only, and mount the folder your ACC server writes results to:

docker run -d --name acc-results \
  -e BDR_URL=<platform-url> \
  -e BDR_API_KEY=<your-api-key> \
  -e BDR_MODE=results_only \
  -e RESULTS_DIR=/results \
  -v <path-to-acc-results>:/results:ro \
  ghcr.io/larshei/bdr-acc-server:latest

On Windows, use the Windows agent: unzip it next to your server, copy bdr-agent.env.example to bdr-agent.env, fill in BDR_API_KEY and RESULTS_DIR, and double-click start.bat.

Within 30 seconds the machine should show Online on the Machines tab.

Running several ACC servers, or your own tools already? Skip the agent and send bdr the heartbeats and results yourself, with one key for all servers on the machine. See Without our agent: the API.

Note

The agent only connects out to bdr. Open the game ports to drivers, not to the platform.

Results only

A results-only server is yours: bdr does not start it, schedule it or change its settings. The agent watches the results folder and sends each new result file to bdr. It leaves the files where they are, and files that were already in the folder when it first started are not sent.

Every race the server finishes then:

  • Shows under Races received on the server's page. Each race links the practice and qualifying driven before it on the same server and track.
  • Is posted to your Discord's Race results channel, with the grid from the qualifying before it. See Community setup.
  • Never counts for ELO, Safety Rating or standings. bdr does not run the server, so it cannot vouch for the result.

A race counts for ratings only when bdr starts its server. To run ranked races, host them on a machine with the host agent, or on bdr's machines with a grant, and pick it under Where it runs. See Machines.

List your server

The servers you run yourself can be shown on Go racing, under Community servers, so drivers who don't know your community yet find them. It is off until you turn it on.

  1. Select Edit on the machine on the Machines tab.
  2. Tick List its servers on Go racing while they report in.
  3. Select Save. The machine shows On Go racing.

A server is listed under the name its heartbeat reports, as ACC's server list shows it (see the API below). There is nothing to type in on bdr: when you rename a server in ACC, the next heartbeat brings the new name. A server without a name in its heartbeat is not listed.

A server drops off about 2 minutes after its machine's heartbeats stop, at once when a heartbeat leaves it out, and when you pause the machine. Its card shows your community, the drivers on it and the name to search for, and is marked Community server. It never shows Ranked: bdr does not run the server, so nothing on it counts for ratings.

Only list servers anyone can join. Leave a server with a password out with "listed": false.

Without our agent: the API

You don't need our agent. Anything that can make an HTTPS request, such as a script next to your servers or your own website's backend, can send bdr the heartbeats and the results. Create an API key for the machine as above and send it as a bearer token.

Heartbeat

Send one at least every minute.

One key for all servers on a machine. List them in servers, each under an id you choose: letters, digits, ., _ and -, up to 64 characters. The servers reporting now show under the machine on the Machines tab.

curl -sS https://bumpdraft.racing/api/v1/agent/heartbeat \
  -H "Authorization: Bearer $BDR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"state": "running",
       "servers": [
         {"id": "gt3-1", "name": "My Community | GT3 Sprint", "players_online": 14,
          "max_players": 30, "track": "monza", "car_group": "GT3"},
         {"id": "league", "name": "My Community | League", "players_online": 0,
          "listed": false}
       ]}'

Each heartbeat replaces the last one completely: send every server with all its fields every time. A server you leave out is gone from Go racing at once. A machine reports at most 50 servers.

A machine with one server can leave out servers and send the same fields at the top level:

curl -sS https://bumpdraft.racing/api/v1/agent/heartbeat \
  -H "Authorization: Bearer $BDR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"state": "running", "name": "My Community | GT3 Sprint", "players_online": 12,
       "track": "monza", "car_group": "GT3"}'
Field Value
state Required at the top level. idle, starting, running, stopping or error. Optional per server, running if left out.
id Per server: your id for it.
name The server's name, as ACC's server list shows it. Shown as text, never as a link.
players_online Drivers on the server now.
max_players Per server: the most it takes.
track ACC's track key, as in event.json: barcelona, brands_hatch, cota, donington, hungaroring, imola, indianapolis, kyalami, laguna_seca, misano, monza, mount_panorama, nurburgring, nurburgring_24h, oulton_park, paul_ricard, red_bull_ring, silverstone, snetterton, spa, suzuka, valencia, watkins_glen, zandvoort, zolder.
car_group GT3, GT4, GT2, GTC, TCX or mixed.
listed Per server: false keeps it off Go racing.

track and car_group are optional; an unknown value is shown as not reported. A server without name is not listed. Our results agent sends none of these yet.

bdr keeps what the heartbeats say only in memory, not in its database. After an update of bdr, your servers are back on Go racing with your next heartbeat.

Results

Post each result file as ACC wrote it, base64-encoded, with the SHA-256 of the raw bytes. server_id is the id of the server it is from; leave it out on a machine with one server. The race then shows under Races received on the machine's History page, with that id.

FILE=results/251004_201500_R.json
curl -sS https://bumpdraft.racing/api/v1/agent/sessions \
  -H "Authorization: Bearer $BDR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"server_id\": \"gt3-1\",
       \"filename\": \"$(basename $FILE)\",
       \"sha256\": \"$(sha256sum $FILE | cut -d' ' -f1)\",
       \"content_base64\": \"$(base64 -w0 $FILE)\"}"

bdr answers 201 for a new session and 200 for one it already has, so sending a file twice does no harm. A 422 names what is wrong, for example a server_id with characters an id can't have; don't send that file again unchanged.

A wrong or revoked key gets 401. Too many of those from one address get 429 for a while.

Older setup

Before machines, a community could register a server whose agent also started ACC for bdr ("full service"). New machines can't be added that way any more, but existing ones keep working:

  • On the Machines tab they are listed as Results only, with the note "Older setup: its agent also starts ACC for races…".
  • Their Edit form still has Mode, to switch to results only, and the Public host name or IP, TCP port and UDP port drivers connect to.
  • The agent's BDR_MODE decides what it does, so it must match the Mode on bdr.
  • A series, single race or open server runs on them when you pick My own servers (older setup) under Where it runs. That choice only appears while your community has such a server.

The host agent does the same job better, with several servers on one machine at once. To move, add a machine under Your own hardware, run by BD.R (see Machines), then switch the old server to results only with Edit, or remove it.

How splits get servers in the older setup

When a race locks, 60 seconds before the start, each split is given a free server of your community:

  • The server must be for the same simulation, and have room for the split. A server you registered yourself holds 30 cars.
  • A server already busy with another race at that time is skipped. Online servers are chosen before offline ones.
  • A split with no free server waits. Until qualifying ends, bdr keeps trying to find it one, and also moves a split whose server goes offline or fails to start.

So you need one server for each split that races at the same time.

Download a split's ACC config

On the season page, after a race has locked, the Servers column lists each split's server with a download icon. It downloads a zip with the split's cfg folder: configuration.json, settings.json, event.json, eventRules.json, assistRules.json and entrylist.json, encoded as ACC expects.

You need it when you start a split's server yourself, for example a results-only server in the older setup:

  1. Lock the race. It locks by itself 60 seconds before the start. To get the files sooner, select Lock on the race earlier. This closes signups.
  2. Download the split's zip and copy its files into the ACC server's cfg folder.
  3. Start the server.

The entry list only lets the drivers seated in that split join, with their car and number. The server name in ACC's lobby is <community> | <series> | #<race>-<split>. The event file carries a tag that links the result file back to its split.

Warning

The zip contains the server's join and admin passwords. Don't share it.

If a result file never reached bdr, upload it on the season page with Upload. See Seasons and series.