mcipc.server package

Submodules

mcipc.server.datastructures module

More complex data structures.

class mcipc.server.datastructures.Handshake(protocol: VarInt, address: str, port: int, next_state: State)

Bases: NamedTuple

Server-bound handshake packet.

address: str

Alias for field number 1

next_state: State

Alias for field number 3

port: int

Alias for field number 2

protocol: VarInt

Alias for field number 0

classmethod read(file: IO) Handshake

Reads a handshake object from a file-like object.

class mcipc.server.datastructures.SLPResponse(packet_id: VarInt, json: dict)

Bases: NamedTuple

A server list ping response.

json: dict

Alias for field number 1

packet_id: VarInt

Alias for field number 0

classmethod read(file: IO) SLPResponse

Read an SLP response from a file-like object.

mcipc.server.datatypes module

Data types for the server protocol.

class mcipc.server.datatypes.VarInt

Bases: int

Minecraft protocol VarInt type.

classmethod read(file: IO) VarInt

Reads a VarInt from a file-like object.

mcipc.server.enumerations module

Common enumerations.

class mcipc.server.enumerations.State(value)

Bases: VarInt, Enum

Protocol state.

HANDSHAKE = 0
LOGIN = 2
STATUS = 1

mcipc.server.functions module

Common functions.

mcipc.server.functions.rshift(integer: int, shift: int) int

Logical right binary shift.

mcipc.server.server module

The actual server.

class mcipc.server.server.StubServer(description: str, *, version: str = '1.18.1', max_players: int = 20, protocol: int = 753)

Bases: object

A stub minecraft server.

property slp_content: dict

Returns the content of an SLP response.

property slp_response: SLPResponse

Returns an SLP response.

spawn(address: str, port: int)

Spawns the server on the respective socket.

mcipc.server.server.get_response(text: str) bytes

Returns the response text message.

mcipc.server.stubsrv module

Stub server launcher.

mcipc.server.stubsrv.main()

Main program.

Module contents

Minecraft server protocol.

class mcipc.server.Handshake(protocol: VarInt, address: str, port: int, next_state: State)

Bases: NamedTuple

Server-bound handshake packet.

address: str

Alias for field number 1

next_state: State

Alias for field number 3

port: int

Alias for field number 2

protocol: VarInt

Alias for field number 0

classmethod read(file: IO) Handshake

Reads a handshake object from a file-like object.

class mcipc.server.SLPResponse(packet_id: VarInt, json: dict)

Bases: NamedTuple

A server list ping response.

json: dict

Alias for field number 1

packet_id: VarInt

Alias for field number 0

classmethod read(file: IO) SLPResponse

Read an SLP response from a file-like object.

class mcipc.server.State(value)

Bases: VarInt, Enum

Protocol state.

HANDSHAKE = 0
LOGIN = 2
STATUS = 1
class mcipc.server.StubServer(description: str, *, version: str = '1.18.1', max_players: int = 20, protocol: int = 753)

Bases: object

A stub minecraft server.

property slp_content: dict

Returns the content of an SLP response.

property slp_response: SLPResponse

Returns an SLP response.

spawn(address: str, port: int)

Spawns the server on the respective socket.

class mcipc.server.VarInt

Bases: int

Minecraft protocol VarInt type.

classmethod read(file: IO) VarInt

Reads a VarInt from a file-like object.

mcipc.server.get_response(text: str) bytes

Returns the response text message.