The protocol used by the R-Type game is a simple UDP protocol. Binary data is sent and received in network byte order.
- The client connects to the defined server port.
- The client sends a
?to the client. - The server responds with the
id.
The id of the player is set on the first 2 bits.
Possible values are:
- Player 1: 0000 0000
- Player 2: 0100 0000
- Player 3: 1000 0000
- Player 4: 1100 0000
The movement of the player is set on 4 bits. That set the bit corresponding to the direction.
Example for Player 1:
- 0000 0000: No movement
- 0010 0000: Move up
- 0001 0000: Move down
- 0000 1000: Move left
- 0000 0100: Move right
The shooting of the player is set on the 7th bit.
Example for Player 1:
- 0000 0000: No shooting
- 0000 0010: Shooting
The collision of the player is set on the 8th bit.
Example for Player 1:
- 0000 0000: No collision
- 0000 0001: Collision