Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.08 KB

File metadata and controls

51 lines (34 loc) · 1.08 KB

R-Type Protocol

The protocol used by the R-Type game is a simple UDP protocol. Binary data is sent and received in network byte order.

1. Authentication

  • The client connects to the defined server port.
  • The client sends a ? to the client.
  • The server responds with the id.

2. Player

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

Movement

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

Shooting

The shooting of the player is set on the 7th bit.

Example for Player 1:

  • 0000 0000: No shooting
  • 0000 0010: Shooting

Collision

The collision of the player is set on the 8th bit.

Example for Player 1:

  • 0000 0000: No collision
  • 0000 0001: Collision