Home docs pia protocols Station
Post

Station

The difference between the reliable and unreliable protocol is that the reliable protocol wraps messages in a reliable sliding window. The reliable protocol is not used by Pia however, and support for it was removed in version 5.6.

PortDescription
0Unreliable
1Reliable

The first byte of each packet indicates the message type.

TypeDescription
1Connection request
2Connection response
3Disconnection request
4Disconnection response
5Ack
6Relay connection request
7Relay connection response

Version numbers

Pia VersionVersion
3.3 - 3.62
3.7 - 3.103
4.5 - 4.105
5.2 - 5.67
5.7 - 5.98
5.10 - 5.189

In version 5.19, the StationProtocol was renamed to MeshStationProtocol and version numbers start at 0 again:

Pia VersionVersion
5.19 - 5.230
5.24 - 5.261
5.27 - 5.432

Connection Request

3.3 - 4.10:

TypeDescription
Uint8Message type (1)
Uint8Connection id
Uint8Version number
Uint8Is inverse connection request
StationConnectionInfoStation connection info
Uint32Ack id

5.2 - 5.6:

TypeDescription
Uint8Message type (1)
Uint8Connection id
Uint8Version number
Uint8Is inverse connection request
Uint64Target constant id
StationConnectionInfoStation connection info
Uint32Ack id

5.7 - 5.9:

TypeDescription
Uint8Message type (1)
Uint8Connection id
Uint8Version number
Uint8Is inverse connection request
Uint64Target constant id
Uint32Target variable id
Uint8Inverse connection id
StationConnectionInfoStation connection info
Uint32Ack id

5.10 - 5.18:

TypeDescription
Uint8Message type (1)
Uint8Connection id
Uint8Version number
Uint8Is inverse connection request
Uint64Target constant id
Uint32Target variable id
Uint8Inverse connection id
StationLocationStation location
Uint32Ack id

5.19 - 5.26:

TypeDescription
Uint8Message type (1)
Uint8Number of available protocols (N)
Uint8 (N*2)Protocol list
Uint8Connection id
Uint8Is inverse connection request
Uint64Target constant id
Uint32Target variable id
Uint8Inverse connection id
StationLocationStation location
Uint32Ack id

5.27 - 5.43:

TypeDescription
Uint8Message type (1)
Uint8Connection result (always 0)
Uint8Platform id
Uint64Target constant id
Uint32Target variable id
Uint8Number of available protocols (N)
Uint8 (N*2)Protocol list
Uint16Size of station location
StationLocationStation location
Uint8 (32)Identification token (ascii)
Uint32Session id
Uint8Number of players
Uint8Number of participants. This is either 1 or equal to the number of players, depending on whether each player should count as a participant in the session.
Uint8Number of player infos (P)
PlayerInfo (P)Player info
Uint32Ack id

Connection Response

A connection response can either accept or deny the connection request. This is indicated by the connection result.

Accepted

3.3 - 4.10:

TypeDescription
Uint8Message type (2)
Uint8Connection result (accepted)
Uint8Version number
Uint8Platform id
Uint8 (32)Identification token (ascii)
PlayerInfoPlayer info
Uint32Ack id

5.2 - 5.6:

TypeDescription
Uint8Message type (2)
Uint8Connection result (accepted)
Uint8Version number
Uint8Platform id
Uint8Fragment id
Uint8 (32)Identification token (ascii)
Uint32Session id
Uint8Number of players
Uint8Number of participants. This is either 1 or equal to the number of players, depending on whether each player should count as a participant in the session.
Uint8Number of player infos
PlayerInfo (2 or 4)Player info, may be fragmented.
Uint32Ack id

5.7 - 5.18:

TypeDescription
Uint8Message type (2)
Uint8Connection result (accepted)
Uint8Version number
Uint8Platform id
Uint8Fragment id
Uint64Target constant id
Uint32Target variable id
Uint8 (32)Identification token (ascii)
Uint32Session id
Uint8Number of players
Uint8Number of participants. This is either 1 or equal to the number of players, depending on whether each player should count as a participant in the session.
Uint8Number of player infos
PlayerInfo (2 or 4)Player info, may be fragmented.
Uint32Ack id

5.27 - 5.43:

TypeDescription
Uint8Message type (2)
Uint8Connection result (accepted)
Uint8Platform id
Uint64Target constant id
Uint32Target variable id
Uint8Number of available protocols (N)
Uint8 (N*2)Protocol list
Uint16Size of station location
StationLocationStation location
Uint8 (32)Identification token (ascii)
Uint32Session id
Uint8Number of players
Uint8Number of participants. This is either 1 or equal to the number of players, depending on whether each player should count as a participant in the session.
Uint8Number of player infos
PlayerInfo (2 or 4)Player info
Uint32Ack id

Denying

3.3 - 5.6:

TypeDescription
Uint8Message type (2)
Uint8Connection result
Uint8Version number
Uint8Always 0

5.7 - 5.18:

TypeDescription
Uint8Message type (2)
Uint8Connection result
Uint8Version number
Uint8Always 0
Uint8Always 0
Uint64Constant id
Uint32Variable id

5.19 - 5.23:

TypeDescription
Uint8Message type (2)
Uint8Connection result
Uint8Protocol id that has unexpected protocol version
Uint8Expected protocol version
Uint16Always 0
Uint64Constant id
Uint32Variable id

5.24 - 5.26:

TypeDescription
Uint8Message type (2)
Uint8Connection result
Uint8Protocol id that has unexpected protocol version
Uint8Expected protocol version
Uint16Always 0
Uint64Constant id
Uint32Variable id
Uint8Connection id

5.27 - 5.43:

TypeDescription
Uint8Message type (2)
Uint8Connection result
Uint8Always 0
Uint64Constant id
Uint32Variable id

Disconnection request

OffsetSizeDescription
0x01Message type

Disconnection response

OffsetSizeDescription
0x01Message type

Ack

OffsetSizeDescription
0x01Message type
0x13Padding
0x44Ack id

Platform ID

IDPlatform
3Wii U
4Switch

Connection Result

ValueDescription
0Accepted
1Connection denied
2Incompatible version

Fragment ID

In some Pia versions, the connection response may be fragmented, depending on the maximum payload size.

IDDescription
0The player info array contains all players.
1The player info array contains the first two players.
2The player info array contains the last two players.

Protocol List

The protocol list contains the following for every available protocol.

TypeDescription
Uint8Protocol id
Uint8Protocol version

Player Info

3.3 - 3.10:

TypeDescription
Uint16 (16)Player name (utf16)
Uint8Player name length
Uint8Language
Uint16Padding

4.5 - 4.10:

TypeDescription
Uint16 (16)Player name (utf16)
Uint8Player name length
Uint8Language
Uint32Unknown
Uint16Padding

5.2 - 5.6:

TypeDescription
Bytes (80)Player name
Uint8Player name encoding (1=utf8, 2=utf16)
Bytes (40)Account name
Uint8Account name encoding (1=utf8, 2=utf16)
Uint8Language
Bytes (64)Play history registration key

5.7 - 5.19:

TypeDescription
Bytes (80)Player name
Uint8Player name encoding (1=utf8, 2=utf16)
Bytes (40)Account name
Uint8Account name encoding (1=utf8, 2=utf16)
Uint8Language
Bytes (64)Play history registration key
Uint64Principal id

5.27 - 5.43:

TypeDescription
Uint8Player name encoding (1=utf8, 2=utf16)
Bytes (80)Player name
Uint8Account name encoding (1=utf8, 2=utf16)
Bytes (40)Account name
Uint8Language
Bytes (64)Play history registration key
Uint64Principal id
Contents