Timetables have no GameScript API surface, so this implements real DoCommands over the game port (ClientCommand/ServerCommand) instead of the Admin GameScript relay used for list_vehicles(): change_timetable(), autofill_timetable(), set_timetable_start(), and set_vehicle_on_time() send commands, while get_vehicle_timetable() reconstructs state purely by observing ServerCommand broadcasts, since no query command exists. Includes the custom varuint wire codec these commands require, a full usage guide (docs/TIMETABLES.md), and a worked demo in main.py. Co-Authored-By: Claude Sonnet 5 <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.