Skip to content

Pou vs Pou (Overview)

Daniel López Guimaraes edited this page Jul 23, 2023 · 2 revisions

Pou vs Pou is the implementation of Pou for local multiplayer that allows users to play Pou games with nearby devices.

This game mode works over a peer-to-peer protocol, where the host handles the session and the participants receive information from the host. Pou will search for nearby devices to play Pou vs Pou over LAN or Bluetooth. Once a participant connects to the host, they will use the Pou vs Pou Protocol (TODO) for managing the session.

The session discovery works as follows:

LAN

The host will open UDP port 27110 and listen over the local network. When a client searches for Pou vs Pou sessions, it will send a broadcast packet (from port 17110 to 27110) with a JSON payload:

Request

Type Field Notes
int rN Random number used for validating sessions.
string mC PVPClientHash(rN)
int gI Game ID.

Once the host receives this packet, it will verify the MD5 hash and if the game ID matches with the game ID of the session. If it matches, it will send the following JSON payload to the client:

Response

Type Field Notes
string n Name of the session.
string mC PVPHostHash(rN from broadcast packet)

The client will verify the MD5 hash sent by the host, and if it's valid, it will display the session on the session list.

Bluetooth

TODO