piermesh/docs/Packets/HeaderPacket.md

1.2 KiB

Header packet: Metadata packet

class Packets.HeaderPacket.Header(packetsID: int, packetCount: int, sender: int, senderDisplayName: int, recipient: int, recipientNode: int, subpacket: bool = False, wantFullResponse: bool = False, packetsClass: int = 0, pAction: int = -1)

Metadata packet for messages

🔗 Source

sender

6 digit (maximum) node or peer ID

  • Type: int

senderDisplayName

3 digit (maximum) ID for mapping display names to a given user

  • Type: int

recipient

6 digit (maximum) node or peer ID

  • Type: int

recipientNode

6 digit (maximum) node ID to route the packet to

  • Type: int

subpacket

Whether this is a subpacket

  • Type: bool

wantFullResponse

Whether a response should be sent when the message completes reception (TODO)

  • Type: bool

pAction

3 digit (maximum) pAction ID for mapping precise actions within a protocol (TODO)

  • Type: int

dump()

Dump packet to msgpack encoded binary for transmission

usePreset(path: str)

Add preset fields to the packet