--- description: Networking protocol compatibility and documentation rules alwaysApply: true --- # Protocol Rules When modifying the networking protocol: - Update protocol documentation whenever packet structure changes. - Treat new fields as optional on receive unless the change is intentionally breaking. - Use safe defaults when a field is missing. - Do not rename protocol fields unless specifically requested. - Preserve unknown JSON fields where possible. Preserve existing field names, including: - `type` - `playerId` - `x`, `y`, `z` - `angleZ` - `cellId` - `worldspaceId` - `movementType` - `clientTime` - `serverTime` - `isMoving` - `movementSpeed` - `isSprinting` - `isSneaking` - `isJumping` - `weaponDrawn` When adding a new protocol field, make sure: - The plugin sends it when appropriate. - Receivers parse it safely and tolerate it being absent. - The server preserves or relays it. - `server/fake_client.py` is updated if useful for testing. - Relevant protocol documentation is updated. Protocol changes should avoid breaking already-working transform sync unless the requested change explicitly requires it.