peng3dnet.packet.internal - Internal Packet Classes¶
This module contains various internal packets not intended for direct use.
These packets will be registered by the default implementations of client and
server classes with names starting with
peng3dnet:. Any other packets whose
name starts with
peng3dnet: may be processed incorrectly.
Additionally, packets within this module usually use reserved and static packet IDs below 16.
Note that if a custom connection type is used, any steps after step 3. may be left out.
- Server sends a
HelloPacketwith version information
- Client responds with
SetTypePacketcontaining connection type
- Server stores connection type and sends
HandshakePacketcontaining version and registry
- Client updates own registry based on packet and sends
- Server receives packet and calls event handler to signal a successful handshake
Note that this only applies to clean shutdowns caused by
close_connection() or its client-side equivalent.
CloseConnectionPacketis sent to peer and internal flag is set
- After packet has been fully sent, event handlers are called
- Peer receives packet and calls event handlers
- Server cleans up internal data structures
HelloPacket(reg, peer, obj=None)¶
Internal packet sent by the server to initialize a handshake.
This is usually the first packet transmitted by every connection. It contains version information for the client to check.
If the client does not support the given protocol version, the connection must be aborted with the reason
SetTypePacket(reg, peer, obj=None)¶
Internal packet sent by the client to indicate the connection type.
If the server does not recognize the connection type, the connection must be aborted with the reason
If no connection type is supplied,
HandshakePacket(reg, peer, obj=None)¶
Internal packet sent by the server to synchronize the registry.
Additionally, the version information is sent and checked.
net.registry.autosyncconfig value is true, the registry sent by the server will be adapted to the client.
Note that only IDs are synced to names, objects will not be affected.
HandshakeAcceptPacket(reg, peer, obj=None)¶
Internal packet sent by the client to indicate a successful handshake.
Once this packet has been sent or received, the connection is established and can be used.
CloseConnectionPacket(reg, peer, obj=None)¶
Internal packet to be sent to indicate that a connection is about to be closed.
Usually includes a reason in the
This packet can be sent at any time, regardless of connection state or type.