A small Flask web app for manually entering race finishing order into an AMS2 Server Manager championship. Use this when a race session result is missing or corrupted and needs to be reconstructed by hand.
- Python 3.9+
- Flask
git clone https://github.com/dgbooth/ams2sm-manual-result-importer.git
cd ams2sm-manual-result-importer
pip install -r requirements.txtpython app.pyThen open http://localhost:5000 in your browser.
The server must be reachable from wherever the
store.jsonfolder lives. If you're running the importer directly on the race server,localhostis fine. If the store is on a remote machine, run the app there (or mount the path).
Enter the full path to the store.json folder (the directory with the .json extension, not a file inside it). It must contain a championships/ subdirectory.
/home/user/server-manager/store.json
Pick the championship you want to modify from the list.
Events are listed with their creation date and completion status. A badge shows whether a race result already exists — if one does, submitting will overwrite it (a timestamped backup is always created first).
Fill in the form:
| Field | Description |
|---|---|
| Race Date & Time | Pre-filled from the event's completion time. Treated as UTC. Sets Session.CompletedTime and Result.Date. |
| Car Model ID / Name | Auto-filled from existing results in the championship. Edit if wrong. |
| Track ID | Auto-filled from existing results. Cosmetic only — does not affect points. |
| Finishing Order | One driver per line, 1st to last. |
Finisher format — one driver per line:
Chiefyk
SecondDriver,76561198012345678
ThirdDriver 76561198087654321
Comma or tab separates the driver name from their optional Steam64 GUID. If a GUID is omitted, the app looks it up automatically from the driver's previous results in the same championship.
Known drivers from the championship's history appear as clickable chips below the textarea — click any name to append it to the list.
A summary of what was written is displayed. Restart the AMS2 Server Manager for the changes to take effect.
Before every write, the original championship file is copied to:
store.json/championships/<uuid>.json.bak.<YYYYMMDD_HHMMSS>
Backups are not cleaned up automatically. Remove old ones manually if needed.
Points not appearing after import — Two known causes:
-
Session.CompletedTimewas left as0001-01-01T00:00:00Z(Go's zero time). The server treats sessions with this timestamp as incomplete. This app always sets it to the submitted race datetime. -
Place.Classwas set to a non-empty string (e.g."Sprint Race"). This causes the server to create a separate sub-standings category instead of counting results in the main Drivers standings. This app always setsClassto""for single-class championships.
pip install pytest
python -m pytest test_app.py -v