1.6 KiB
1.6 KiB
Development and Debugging Mandates
To ensure technical integrity and accurate implementation of the OpenTTD network protocol (especially JGRPP-specific modifications), the following mandates must be followed by all agents.
1. Upstream Source Code Access
The JGRPP upstream repository MUST be available in the workspace for direct source code analysis. This is critical because the OpenTTD protocol is complex, version-specific, and often requires verifying C++ logic for packet structures, KDF (Key Derivation Function) ordering, and state machine transitions.
Requirement
If the folder OpenTTD-patches is missing, you MUST clone it immediately before performing any protocol-related tasks:
git clone --depth 1 -b jgrpp https://github.com/JGRennison/OpenTTD-patches OpenTTD-patches
2. Debugging Workflow
Before implementing or modifying networking code:
- Verify Packet IDs: Search
OpenTTD-patches/src/network/core/tcp_game.hfor thePacketGameTypeenum. - Verify Encryption Logic: Check
OpenTTD-patches/src/network/network_crypto.cppfor any changes to AEAD or PAKE handling. - Verify State Transitions: Analyze
OpenTTD-patches/src/network/network_server.cppandnetwork_client.cppto understand the expected sequence of packets (e.g., when to sendClientMapOkorClientAck).
3. Engineering Standards
- Binary Accuracy: Never guess packet structures. Always cross-reference with the
Recv_andSend_calls in the C++ source. - Protocol Documentation: If a new protocol detail is discovered, document it in
docs/PROTOCOL.md.