Editing (game port, OpenTTDClient): a core of JGRPP's scheduled dispatch DoCommands — set_scheduled_dispatch (enable/disable), add/remove schedule, add/remove/clear slots, and set duration/start date. Adds the command IDs to protocol.py. Viewing (admin, OpenTTDAdminClient.get_dispatch): the GameScript API has no dispatch support, so a new server patch (docker/patches/0002-*) adds read-only GSOrder.GetScheduledDispatch* / IsScheduledDispatchEnabled getters, an AdminBridge GameScript get_dispatch handler exposes them, and get_dispatch() returns the live schedules and slots (mirrors get_timetable). Note: set_dispatch_start_date values are normalised by the engine relative to current game time, so they read back offset from the requested value. Includes unit + e2e tests, a demo in main.py, and protocol/timetable docs. The AdminBridge GameScript and the patched OpenTTD-patches clone live outside this repo; the 0002 patch file is the durable source for the latter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Internal Package: openttd
This directory contains the core implementation of the OpenTTD network client.
Modules
__init__.py: Exposes the high-levelOpenTTDClientAPI.client.py: Implementation of theOpenTTDClientclass. Manages the connection lifecycle, PAKE state, map synchronization, and keep-alive.protocol.py: Implementation of theOpenTTDProtocolclass. Handles low-level binary packet serialization, AEAD stream encryption, and static packet parsing.
Design Goals
- Encapsulation: The user should never need to manually handle bytes or encryption keys.
- Robustness: Gracefully handle server errors and unknown packet types.
- Efficiency: Use
asynciofor non-blocking I/O andmonocypherfor fast cryptographic operations.