MiniDoom

src/i_net.ml

Bridges Doom's doomcom/ticcmd packets to the validated multiplayer UDP transport.

Package
(global)
Reachable
Yes

Imports

Declarations

_INet_DecodeToNetbuffer

function _INet_DecodeToNetbuffer(payload)

Deserializes payload bytes into global netbuffer fields.

ParameterTypeDefaultDescription
payloaddynamic—Payload value supplied to `_INet_DecodeToNetbuffer`.

View source

_INet_EncodeDoomData

function _INet_EncodeDoomData(d)

Serializes doomdata struct into network payload bytes.

ParameterTypeDefaultDescription
ddynamic—Divisor or direction value used by the operation.

View source

_INet_EnsureSlotMobj

function _INet_EnsureSlotMobj(slot)

Ensures active player slots have a spawned mobj in running level.

ParameterTypeDefaultDescription
slotdynamic—Slot value supplied to `_INet_EnsureSlotMobj`.

View source

_INET_MAGIC0

const _INET_MAGIC0 = 68

Defines inet magic0 for the i net subsystem.

View source

_INET_MAGIC1

const _INET_MAGIC1 = 78

Defines inet magic1 for the i net subsystem.

View source

_INET_MAGIC2

const _INET_MAGIC2 = 69

Defines inet magic2 for the i net subsystem.

View source

_INET_MAGIC3

const _INET_MAGIC3 = 84

Defines inet magic3 for the i net subsystem.

View source

_INet_ReadI32LE

inline function _INet_ReadI32LE(buf, off)

Reads a signed 32-bit integer from a byte buffer.

ParameterTypeDefaultDescription
bufdynamic—Buf value supplied to `_INet_ReadI32LE`.
offdynamic—Zero-based byte or element offset.

View source

_INet_RemoveSlotMobj

inline function _INet_RemoveSlotMobj(slot)

Removes mobj for inactive player slots.

ParameterTypeDefaultDescription
slotdynamic—Slot value supplied to `_INet_RemoveSlotMobj`.

View source

_INet_SlotIsActive

function _INet_SlotIsActive(activeSlots, slot)

Returns whether a slot index exists in the active slot list.

ParameterTypeDefaultDescription
activeSlotsdynamic—Active slots value supplied to `_INet_SlotIsActive`.
slotdynamic—Slot value supplied to `_INet_SlotIsActive`.

View source

_INet_SyncRuntimeFromPlatform

function _INet_SyncRuntimeFromPlatform()

Synchronizes doom net runtime globals from mp platform role/state.

View source

_INet_ToInt

function _INet_ToInt(v, fallback)

Converts values to integers with deterministic rounding.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.
fallbackdynamic—Value returned when the requested conversion or lookup is unavailable.

View source

_INet_WriteI32LE

inline function _INet_WriteI32LE(buf, off, v)

Writes a signed 32-bit integer to a byte buffer.

ParameterTypeDefaultDescription
bufdynamic—Buf value supplied to `_INet_WriteI32LE`.
offdynamic—Zero-based byte or element offset.
vdynamic—Value consumed by the operation.

View source

BindToLocalPort

function BindToLocalPort(sock, port)

Legacy compatibility stub that rejects external bind attempts to preserve mp_platform socket ownership.

ParameterTypeDefaultDescription
sockdynamic—Sock value supplied to `BindToLocalPort`.
portdynamic—Port value supplied to `BindToLocalPort`.

View source

GetLocalAddress

function GetLocalAddress()

Returns the IPv4 loopback identity used by the legacy single-host API surface.

View source

I_InitNetwork

function I_InitNetwork()

Resets doomcom and tic queues to deterministic single-player defaults before any MP role starts.

View source

I_NetCmd

function I_NetCmd()

Executes one Doom CMD_GET/CMD_SEND operation through the validated platform packet queue.

View source

PacketGet

function PacketGet(sock, nodeOut, dataOut, lengthOut)

Legacy compatibility stub that returns an empty receive result without touching caller payload storage.

ParameterTypeDefaultDescription
sockdynamic—Sock value supplied to `PacketGet`.
nodeOutdynamic—Node out value supplied to `PacketGet`.
dataOutdynamic—Data out value supplied to `PacketGet`.
lengthOutdynamic—Length out value supplied to `PacketGet`.

View source

PacketSend

function PacketSend(sock, node, data, length)

Legacy compatibility stub; callers must submit structured Doom packets through I_NetCmd.

ParameterTypeDefaultDescription
sockdynamic—Sock value supplied to `PacketSend`.
nodedynamic—Node value supplied to `PacketSend`.
datadynamic—Binary or structured data to process.
lengthdynamic—Number of bytes or elements in the associated value.

View source

UDPsocket

function UDPsocket()

Legacy compatibility stub; sockets are owned exclusively by mp_platform and no raw handle is exposed.

View source