Module net

Source
Expand description

This module manages the TCP server and how/where the packets are managed/sent.

Modulesยง

dispatch ๐Ÿ”’
The dispatch module contains functions that will change the state of the active Connection. Each function in dispatch corresponds not to a specific packet, but to a whole state. Each state has different packets, and a packet can be named the name but have different intent based on state.
packet
This module abstracts away a Minecraft packet, so that it can be used in a simple and standardized way.
slp
The module accountable for making the Server List Ping (SLP) protocol.

Structsยง

Connection ๐Ÿ”’
Object representing a TCP connection.

Enumsยง

ConnectionState ๐Ÿ”’
State of each connection. (e.g.: handshake, play, โ€ฆ)
NetError

Constantsยง

ADDRESS ๐Ÿ”’
Listening address TODO: Change this. Use config files.
IS_CRUEL ๐Ÿ”’

Functionsยง

handle_connection ๐Ÿ”’
Handles each connection. Receives every packet.
handle_packet ๐Ÿ”’
This function returns an appropriate response given the input buffer packet data.
human_bytes ๐Ÿ”’
listen
Listens for every incoming TCP connection.