Index
Modules:
modernnet
,
modernnet/buffer
,
modernnet/exceptions
,
modernnet/helpers
,
modernnet/io
,
modernnet/private/constants
,
modernnet/private/stew/endians2
,
modernnet/private/utils
,
modernnet/types
.
API symbols
`$`:
types: proc `$`(i: Identifier): string
Buffer:
buffer: type Buffer
buildServerListJson:
helpers: proc buildServerListJson(versionName: string; versionProtocol, maxPlayers, onlinePlayers: int; sample: seq[PlayerSample] = newSeq(0); description: string = ""; ext: JsonNode = nil): JsonNode
ContinueBit:
constants: const ContinueBit
deposit:
utils: proc deposit[T: SizedNum](value: T; oa: var openArray[byte])
extract:
utils: proc extract[T: SizedNum](oa: openArray[byte]; _: typedesc[T]): T
fromBE:
endians2: proc fromBE[T: SomeEndianInt](x: T): T
fromBytes:
endians2: proc fromBytes(T: typedesc[SomeEndianInt]; x: openArray[byte]; endian: Endianness = system.cpuEndian): T:type
fromBytesBE:
endians2: proc fromBytesBE(T: typedesc[SomeEndianInt]; x: openArray[byte]): T:type
fromBytesLE:
endians2: proc fromBytesLE(T: typedesc[SomeEndianInt]; x: openArray[byte]): T:type
fromJsonHook:
types: proc fromJsonHook(uuid: var UUID; node: JsonNode)
fromLE:
endians2: proc fromLE[T: SomeEndianInt](x: T): T
fromPos:
types: proc fromPos(pos: Position; format = XZY): int64
Identifier:
types: object Identifier
len:
buffer: proc len(b: Buffer): int
MnConnectionClosedError:
exceptions: object MnConnectionClosedError
MnEndOfBufferError:
exceptions: object MnEndOfBufferError
MnError:
exceptions: object MnError
MnInvalidIdentifierError:
exceptions: object MnInvalidIdentifierError
MnInvalidJsonError:
exceptions: object MnInvalidJsonError
MnInvalidPositionConstructionError:
exceptions: object MnInvalidPositionConstructionError
MnPacketConstructionError:
exceptions: object MnPacketConstructionError
MnPacketParsingError:
exceptions: object MnPacketParsingError
MnStringTooLongParsingError:
exceptions: object MnStringTooLongParsingError
new:
types: proc new(_: typedesc[Identifier]; identStr: string): Identifier
newBuffer:
buffer: proc newBuffer(data: openArray[byte] = newSeq()): Buffer
PlayerSample:
helpers: object PlayerSample
Position:
types: object Position
PositionFormat:
types: enum PositionFormat
RawPacket:
io: object RawPacket
readIdentifier:
buffer: template readIdentifier(b: Buffer): Identifier
readNum:
buffer: proc readNum[R: SizedNum](b: Buffer): R
readPosition:
buffer: template readPosition(b: Buffer; format = XZY): Position
readRawPacket:
io: proc readRawPacket(data: openArray[byte]): Result[ tuple[packet: RawPacket, bytesRead: int], int]
readString:
buffer: proc readString(b: Buffer; maxLength = 32767): string
readUUID:
buffer: proc readUUID(b: Buffer): UUID
readVar:
buffer: proc readVar[R: int32 | int64](b: Buffer): R
io: proc readVar[R: int32 | int64](data: openArray[byte]): Result[ tuple[num: R, bytesRead: int], int]
Result:
io: object Result
SegmentBits:
constants: const SegmentBits
SizedNum:
utils: type SizedNum
SomeEndianInt:
endians2: type SomeEndianInt
swapBytes:
endians2: proc swapBytes[T: SomeEndianInt](x: T): T
toBE:
endians2: proc toBE[T: SomeEndianInt](x: T): T
toBytes:
endians2: proc toBytes(x: SomeEndianInt; endian: Endianness = system.cpuEndian): array[ sizeof(x), byte]
toBytesBE:
endians2: proc toBytesBE(x: SomeEndianInt): array[sizeof(x), byte]
toBytesLE:
endians2: proc toBytesLE(x: SomeEndianInt): array[sizeof(x), byte]
toJsonHook:
types: proc toJsonHook(uuid: UUID): JsonNode
toLE:
endians2: proc toLE[T: SomeEndianInt](x: T): T
toPos:
types: proc toPos(val: int64; format = XZY): Position
VarIntBits:
constants: const VarIntBits
VarLongBits:
constants: const VarLongBits
writeIdentifier:
buffer: template writeIdentifier(b: Buffer; i: Identifier)
writeNum:
buffer: proc writeNum[R: SizedNum](b: Buffer; value: R)
writePosition:
buffer: template writePosition(b: Buffer; p: Position; format = XZY)
writeString:
buffer: proc writeString(b: Buffer; s: string)
writeUUID:
buffer: proc writeUUID(b: Buffer; uuid: UUID)
writeVar:
buffer: proc writeVar[R: int32 | int64](b: Buffer; value: R)
x:
types: proc x(pos: Position): int32
XYZ:
types: PositionFormat.XYZ
XZY:
types: PositionFormat.XZY
y:
types: proc y(pos: Position): int16
z:
types: proc z(pos: Position): int32