MiniDoom

src/mp_platform.ml

Implements UDP multiplayer host/join handshake and runtime packet pump.

Package
(global)
Reachable
Yes

Imports

Declarations

_mp_client_game_in

_mp_client_game_in

Tracks the mutable mp client game in value used by the mp platform subsystem.

View source

_mp_client_game_out

_mp_client_game_out

Tracks the mutable mp client game out value used by the mp platform subsystem.

View source

_mp_client_host

_mp_client_host

Stores the mutable mp client host text used by the mp platform subsystem.

View source

_mp_client_host_name

_mp_client_host_name

Stores the mutable mp client host name text used by the mp platform subsystem.

View source

_mp_client_last_ping_ms

_mp_client_last_ping_ms

Tracks the mutable mp client last ping ms value used by the mp platform subsystem.

View source

_mp_client_last_ping_tx_ms

_mp_client_last_ping_tx_ms

Tracks the mutable mp client last ping tx ms value used by the mp platform subsystem.

View source

_mp_client_last_pong_ms

_mp_client_last_pong_ms

Tracks the mutable mp client last pong ms value used by the mp platform subsystem.

View source

_mp_client_last_seen_ms

_mp_client_last_seen_ms

Tracks the mutable mp client last seen ms value used by the mp platform subsystem.

View source

_mp_client_peer_id

_mp_client_peer_id

Tracks the mutable mp client peer id value used by the mp platform subsystem.

View source

_mp_client_ping_sent

_mp_client_ping_sent

Tracks the mutable mp client ping sent value used by the mp platform subsystem.

View source

_mp_client_ping_seq

_mp_client_ping_seq

Tracks the mutable mp client ping seq value used by the mp platform subsystem.

View source

_mp_client_pong_recv

_mp_client_pong_recv

Tracks the mutable mp client pong recv value used by the mp platform subsystem.

View source

_mp_client_port

_mp_client_port

Tracks the mutable mp client port value used by the mp platform subsystem.

View source

_mp_client_rtt_ms

_mp_client_rtt_ms

Tracks the mutable mp client rtt ms value used by the mp platform subsystem.

View source

_mp_client_slot

_mp_client_slot

Tracks the mutable mp client slot value used by the mp platform subsystem.

View source

_mp_client_slot_names

_mp_client_slot_names

Stores the mp client slot names collection used by the mp platform subsystem.

View source

_mp_debug_send_attempt

_mp_debug_send_attempt

Tracks the mutable mp debug send attempt value used by the mp platform subsystem.

View source

_mp_debug_send_err

_mp_debug_send_err

Tracks the mutable mp debug send err value used by the mp platform subsystem.

View source

_mp_debug_send_idxfail

_mp_debug_send_idxfail

Tracks the mutable mp debug send idxfail value used by the mp platform subsystem.

View source

_mp_debug_send_ok

_mp_debug_send_ok

Tracks the mutable mp debug send ok value used by the mp platform subsystem.

View source

_mp_game_queue_dropped

_mp_game_queue_dropped

Tracks the mutable mp game queue dropped value used by the mp platform subsystem.

View source

_mp_game_queue_head

_mp_game_queue_head

Tracks the mutable mp game queue head value used by the mp platform subsystem.

View source

_mp_game_queue_nodes

_mp_game_queue_nodes

Stores the mp game queue nodes collection used by the mp platform subsystem.

View source

_mp_game_queue_payloads

_mp_game_queue_payloads

Stores the mp game queue payloads collection used by the mp platform subsystem.

View source

_mp_game_queue_tail

_mp_game_queue_tail

Tracks the mutable mp game queue tail value used by the mp platform subsystem.

View source

_mp_host_frag_limit_cfg

_mp_host_frag_limit_cfg

Tracks the mutable mp host frag limit cfg value used by the mp platform subsystem.

View source

_mp_host_map_cfg

_mp_host_map_cfg

Stores the mutable mp host map cfg text used by the mp platform subsystem.

View source

_mp_host_max_players_cfg

_mp_host_max_players_cfg

Tracks the mutable mp host max players cfg value used by the mp platform subsystem.

View source

_mp_host_mode_cfg

_mp_host_mode_cfg

Tracks the mutable mp host mode cfg value used by the mp platform subsystem.

View source

_mp_host_next_peer_id

_mp_host_next_peer_id

Tracks the mutable mp host next peer id value used by the mp platform subsystem.

View source

_mp_host_peers

_mp_host_peers

Stores the mp host peers collection used by the mp platform subsystem.

View source

_mp_host_skill_cfg

_mp_host_skill_cfg

Tracks the mutable mp host skill cfg value used by the mp platform subsystem.

View source

_mp_host_time_limit_cfg

_mp_host_time_limit_cfg

Tracks the mutable mp host time limit cfg value used by the mp platform subsystem.

View source

_mp_peer_t struct

_mp_platform_event_log_path

_mp_platform_event_log_path

Stores the mutable mp platform event log path text used by the mp platform subsystem.

View source

_mp_platform_last_error

_mp_platform_last_error

Stores the mutable mp platform last error text used by the mp platform subsystem.

View source

_mp_platform_last_status

_mp_platform_last_status

Stores the mutable mp platform last status text used by the mp platform subsystem.

View source

_mp_role

_mp_role

Tracks the mutable mp role value used by the mp platform subsystem.

View source

_mp_sock

_mp_sock

Holds the optional mp sock resource used by the mp platform subsystem.

View source

_MPPLAT_ACC

const _MPPLAT_ACC = "ACC"

Defines the mpplat acc text used by the mp platform subsystem.

View source

_MPPLAT_CLIENT_HOST_TIMEOUT_MS

const _MPPLAT_CLIENT_HOST_TIMEOUT_MS = 10000

Defines mpplat client host timeout ms for the mp platform subsystem.

View source

_MPPLAT_CLIENT_PING_INTERVAL_MS

const _MPPLAT_CLIENT_PING_INTERVAL_MS = 1000

Defines mpplat client ping interval ms for the mp platform subsystem.

View source

_MPPLAT_CONTROL_MAX

const _MPPLAT_CONTROL_MAX = 512

Defines the maximum mpplat control max accepted by the mp platform subsystem.

View source

_MPPLAT_DEN

const _MPPLAT_DEN = "DEN"

Defines the mpplat den text used by the mp platform subsystem.

View source

_MPPLAT_FIONBIO

const _MPPLAT_FIONBIO = 2147772030

Defines mpplat fionbio for the mp platform subsystem.

View source

_MPPLAT_GAME_MAGIC0

const _MPPLAT_GAME_MAGIC0 = 77

Defines mpplat game magic0 for the mp platform subsystem.

View source

_MPPLAT_GAME_MAGIC1

const _MPPLAT_GAME_MAGIC1 = 68

Defines mpplat game magic1 for the mp platform subsystem.

View source

_MPPLAT_GAME_MAGIC2

const _MPPLAT_GAME_MAGIC2 = 71

Defines mpplat game magic2 for the mp platform subsystem.

View source

_MPPLAT_GAME_MAGIC3

const _MPPLAT_GAME_MAGIC3 = 49

Defines mpplat game magic3 for the mp platform subsystem.

View source

_MPPLAT_GAME_PAYLOAD_MAX

const _MPPLAT_GAME_PAYLOAD_MAX = 1391

Defines the maximum mpplat game payload max accepted by the mp platform subsystem.

View source

_MPPLAT_GAME_QUEUE_CHUNK

const _MPPLAT_GAME_QUEUE_CHUNK = 256

Defines mpplat game queue chunk for the mp platform subsystem.

View source

_MPPLAT_GAME_QUEUE_MAX

const _MPPLAT_GAME_QUEUE_MAX = 2048

Defines the maximum mpplat game queue max accepted by the mp platform subsystem.

View source

_MPPLAT_HOST_PEER_TIMEOUT_MS

const _MPPLAT_HOST_PEER_TIMEOUT_MS = 30000

Defines mpplat host peer timeout ms for the mp platform subsystem.

View source

_MPPLAT_HOST_PING_INTERVAL_MS

const _MPPLAT_HOST_PING_INTERVAL_MS = 1000

Defines mpplat host ping interval ms for the mp platform subsystem.

View source

_MPPLAT_LEAVE

const _MPPLAT_LEAVE = "LEAVE"

Defines the mpplat leave text used by the mp platform subsystem.

View source

_MPPLAT_MAX_PLAYERS

const _MPPLAT_MAX_PLAYERS = 4

Defines the maximum mpplat max players accepted by the mp platform subsystem.

View source

_MPPLAT_PING

const _MPPLAT_PING = "PING"

Defines the mpplat ping text used by the mp platform subsystem.

View source

_MPPLAT_PONG

const _MPPLAT_PONG = "PONG"

Defines the mpplat pong text used by the mp platform subsystem.

View source

_MPPLAT_PROTO

const _MPPLAT_PROTO = "MDMP1"

Defines the mpplat proto text used by the mp platform subsystem.

View source

_MPPLAT_PUMP_BUDGET_MS

const _MPPLAT_PUMP_BUDGET_MS = 4

Defines mpplat pump budget ms for the mp platform subsystem.

View source

_MPPLAT_PUMP_MAX_PACKETS

const _MPPLAT_PUMP_MAX_PACKETS = 192

Defines the maximum mpplat pump max packets accepted by the mp platform subsystem.

View source

_MPPLAT_PUMP_MIN_PACKETS

const _MPPLAT_PUMP_MIN_PACKETS = 48

Defines the minimum mpplat pump min packets accepted by the mp platform subsystem.

View source

_MPPLAT_RECV_MAX

const _MPPLAT_RECV_MAX = 1400

Defines the maximum mpplat recv max accepted by the mp platform subsystem.

View source

_MPPLAT_REQ

const _MPPLAT_REQ = "REQ"

Defines the mpplat req text used by the mp platform subsystem.

View source

_MPPLAT_ROLE_CLIENT

const _MPPLAT_ROLE_CLIENT = 2

Defines mpplat role client for the mp platform subsystem.

View source

_MPPLAT_ROLE_HOST

const _MPPLAT_ROLE_HOST = 1

Defines mpplat role host for the mp platform subsystem.

View source

_MPPLAT_ROLE_NONE

const _MPPLAT_ROLE_NONE = 0

Defines mpplat role none for the mp platform subsystem.

View source

_MPPLAT_SO_RCVTIMEO

const _MPPLAT_SO_RCVTIMEO = 4102

Defines mpplat so rcvtimeo for the mp platform subsystem.

View source

_MPPLAT_TIMEDOUT

const _MPPLAT_TIMEDOUT = 10060

Defines mpplat timedout for the mp platform subsystem.

View source

_MPPLAT_TIMEOUT_MS

const _MPPLAT_TIMEOUT_MS = 2500

Defines mpplat timeout ms for the mp platform subsystem.

View source

_MPPLAT_WOULDBLOCK

const _MPPLAT_WOULDBLOCK = 10035

Defines mpplat wouldblock for the mp platform subsystem.

View source

_MPPlatform_AllocHostPeerId

function _MPPlatform_AllocHostPeerId()

Allocates next available host-side peer id for a joining client.

View source

_MPPlatform_AllocHostSlot

inline function _MPPlatform_AllocHostSlot()

Allocates a free player slot [1..MAXPLAYERS-1] for a joining client.

View source

_MPPlatform_ClientHandlePacket

function _MPPlatform_ClientHandlePacket(payload, peerIp, peerPort)

Processes runtime client-side maintenance packets after join.

ParameterTypeDefaultDescription
payloaddynamic—Payload value supplied to `_MPPlatform_ClientHandlePacket`.
peerIpdynamic—Peer ip value supplied to `_MPPlatform_ClientHandlePacket`.
peerPortdynamic—Peer port value supplied to `_MPPlatform_ClientHandlePacket`.

View source

_MPPlatform_CloseSocketOnly

inline function _MPPlatform_CloseSocketOnly()

Closes active UDP socket if currently open.

View source

_MPPlatform_EnsurePeerTelemetry

inline function _MPPlatform_EnsurePeerTelemetry(p)

Ensures host peer struct has telemetry fields initialized.

ParameterTypeDefaultDescription
pdynamic—Object or data record consumed by the operation.

View source

_MPPlatform_ExpireHostPeers

function _MPPlatform_ExpireHostPeers()

Removes host peers that timed out and emits status updates.

View source

_MPPlatform_FindHostPeerBySlot

inline function _MPPlatform_FindHostPeerBySlot(slot)

Returns host peer index for a given slot, or -1 if not found.

ParameterTypeDefaultDescription
slotdynamic—Slot value supplied to `_MPPlatform_FindHostPeerBySlot`.

View source

_MPPlatform_FindHostPeerIndex

inline function _MPPlatform_FindHostPeerIndex(ip, port)

Finds existing host peer entry by ip/port tuple.

ParameterTypeDefaultDescription
ipdynamic—Ip value supplied to `_MPPlatform_FindHostPeerIndex`.
portdynamic—Port value supplied to `_MPPlatform_FindHostPeerIndex`.

View source

_MPPlatform_GameChecksum16

inline function _MPPlatform_GameChecksum16(payload, n)

Computes a lightweight 16-bit checksum across gameplay payload bytes.

ParameterTypeDefaultDescription
payloaddynamic—Payload value supplied to `_MPPlatform_GameChecksum16`.
ndynamic—Number of values to process.

View source

_MPPlatform_HostHandlePacket

function _MPPlatform_HostHandlePacket(payload, peerIp, peerPort)

Processes host-side incoming UDP packet for join/ping flow.

ParameterTypeDefaultDescription
payloaddynamic—Payload value supplied to `_MPPlatform_HostHandlePacket`.
peerIpdynamic—Peer ip value supplied to `_MPPlatform_HostHandlePacket`.
peerPortdynamic—Peer port value supplied to `_MPPlatform_HostHandlePacket`.

View source

_MPPlatform_HostSendAccept

function _MPPlatform_HostSendAccept(ip, port, slot, peerId)

Sends an accept packet with server-authoritative lobby settings.

ParameterTypeDefaultDescription
ipdynamic—Ip value supplied to `_MPPlatform_HostSendAccept`.
portdynamic—Port value supplied to `_MPPlatform_HostSendAccept`.
slotdynamic—Slot value supplied to `_MPPlatform_HostSendAccept`.
peerIddynamic—Peer id value supplied to `_MPPlatform_HostSendAccept`.

View source

_MPPlatform_HostSendDeny

inline function _MPPlatform_HostSendDeny(ip, port, reasonCode, reasonText, includeHash)

Sends a host-side join denial packet with optional server hash context.

ParameterTypeDefaultDescription
ipdynamic—Ip value supplied to `_MPPlatform_HostSendDeny`.
portdynamic—Port value supplied to `_MPPlatform_HostSendDeny`.
reasonCodedynamic—Reason code value supplied to `_MPPlatform_HostSendDeny`.
reasonTextdynamic—Reason text value supplied to `_MPPlatform_HostSendDeny`.
includeHashdynamic—Include hash value supplied to `_MPPlatform_HostSendDeny`.

View source

_MPPlatform_InitClientSlotNames

function _MPPlatform_InitClientSlotNames(localName)

Initializes deterministic client-side slot name cache.

ParameterTypeDefaultDescription
localNamedynamic—Local name value supplied to `_MPPlatform_InitClientSlotNames`.

View source

_MPPlatform_IsGamePacket

inline function _MPPlatform_IsGamePacket(payload)

Checks whether payload uses MiniDoom gameplay UDP frame format.

ParameterTypeDefaultDescription
payloaddynamic—Payload value supplied to `_MPPlatform_IsGamePacket`.

View source

_MPPlatform_IsPeerIdUsed

inline function _MPPlatform_IsPeerIdUsed(pid)

Checks whether a host peer id is already occupied.

ParameterTypeDefaultDescription
piddynamic—Pid value supplied to `_MPPlatform_IsPeerIdUsed`.

View source

_MPPlatform_IsSlotUsed

inline function _MPPlatform_IsSlotUsed(slot)

Checks whether a host player slot index is already used by a peer.

ParameterTypeDefaultDescription
slotdynamic—Slot value supplied to `_MPPlatform_IsSlotUsed`.

View source

_MPPlatform_IsWouldBlockError

inline function _MPPlatform_IsWouldBlockError(v)

Checks whether a net error maps to WSAEWOULDBLOCK.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_MPPlatform_LogEvent

function _MPPlatform_LogEvent(line)

Emits one machine-readable transport event to stdout and the configured process-local log.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.

View source

_MPPlatform_NormalizeIPv4

function _MPPlatform_NormalizeIPv4(value)

Validates dotted-decimal IPv4 input and returns the canonical form used by udpRecvFrom endpoints.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by the operation.

View source

_MPPlatform_PeerIngame

inline function _MPPlatform_PeerIngame(p)

Returns true when peer ingame marker is truthy (bool true or non-zero int).

ParameterTypeDefaultDescription
pdynamic—Object or data record consumed by the operation.

View source

_MPPlatform_PopGamePacket

function _MPPlatform_PopGamePacket()

Dequeues one gameplay packet as [node,payload], or void when empty.

View source

_MPPlatform_PushConsoleMessage

inline function _MPPlatform_PushConsoleMessage(msg)

Sends a short HUD message to the local console player when available.

ParameterTypeDefaultDescription
msgdynamic—Msg value supplied to `_MPPlatform_PushConsoleMessage`.

View source

_MPPlatform_QueueDepth

inline function _MPPlatform_QueueDepth()

Returns queued gameplay packet count waiting for d_net consumption.

View source

_MPPlatform_QueueEnsureCapacity

function _MPPlatform_QueueEnsureCapacity(required)

Grows game packet queue storage in chunks so enqueue stays O(1) in steady state.

ParameterTypeDefaultDescription
requireddynamic—Required value supplied to `_MPPlatform_QueueEnsureCapacity`.

View source

_MPPlatform_QueueGamePacket

function _MPPlatform_QueueGamePacket(node, payload)

Enqueues gameplay packet payload for d_net/i_net processing.

ParameterTypeDefaultDescription
nodedynamic—Node value supplied to `_MPPlatform_QueueGamePacket`.
payloaddynamic—Payload value supplied to `_MPPlatform_QueueGamePacket`.

View source

_MPPlatform_RemoveHostPeerByIndex

function _MPPlatform_RemoveHostPeerByIndex(idx, withMessage)

Removes host peer entry and emits leave status if requested.

ParameterTypeDefaultDescription
idxdynamic—Zero-based element or table index.
withMessagedynamic—With message value supplied to `_MPPlatform_RemoveHostPeerByIndex`.

View source

_MPPlatform_SanitizeField

inline function _MPPlatform_SanitizeField(s0)

Removes wire-delimiter/control bytes from textual packet fields.

ParameterTypeDefaultDescription
s0dynamic—S0 value supplied to `_MPPlatform_SanitizeField`.

View source

_MPPlatform_SendFields

inline function _MPPlatform_SendFields(sock, ip, port, fields)

Encodes and sends a textual UDP packet with field separators.

ParameterTypeDefaultDescription
sockdynamic—Sock value supplied to `_MPPlatform_SendFields`.
ipdynamic—Ip value supplied to `_MPPlatform_SendFields`.
portdynamic—Port value supplied to `_MPPlatform_SendFields`.
fieldsdynamic—Fields value supplied to `_MPPlatform_SendFields`.

View source

_MPPlatform_SetError

inline function _MPPlatform_SetError(msg)

Stores user-facing error text for multiplayer host/join operations.

ParameterTypeDefaultDescription
msgdynamic—Msg value supplied to `_MPPlatform_SetError`.

View source

_MPPlatform_SetNonBlocking

inline function _MPPlatform_SetNonBlocking(sock, enabled)

Configures UDP socket to non-blocking mode.

ParameterTypeDefaultDescription
sockdynamic—Sock value supplied to `_MPPlatform_SetNonBlocking`.
enableddynamic—Whether the requested feature should be enabled.

View source

_MPPlatform_SetRecvTimeout

inline function _MPPlatform_SetRecvTimeout(sock, timeoutMs)

Configures socket receive timeout in milliseconds.

ParameterTypeDefaultDescription
sockdynamic—Sock value supplied to `_MPPlatform_SetRecvTimeout`.
timeoutMsdynamic—Timeout ms value supplied to `_MPPlatform_SetRecvTimeout`.

View source

_MPPlatform_SetStatus

inline function _MPPlatform_SetStatus(msg)

Stores latest status string for menu/UI display.

ParameterTypeDefaultDescription
msgdynamic—Msg value supplied to `_MPPlatform_SetStatus`.

View source

_MPPlatform_ToBytesCopy

inline function _MPPlatform_ToBytesCopy(v)

Normalizes bytes/array payload values to bytes (fast-path avoids copy for bytes).

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_MPPlatform_ToInt

inline function _MPPlatform_ToInt(v, fallback)

Converts mixed numeric values to stable integer values.

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

View source

_MPPlatform_UnwrapGamePayload

function _MPPlatform_UnwrapGamePayload(packet)

Decodes gameplay frame and returns payload bytes.

ParameterTypeDefaultDescription
packetdynamic—Packet value supplied to `_MPPlatform_UnwrapGamePayload`.

View source

_MPPlatform_UpsertHostPeer

function _MPPlatform_UpsertHostPeer(ip, port, name)

Creates or refreshes a host peer entry and returns its assigned player slot (1..3).

ParameterTypeDefaultDescription
ipdynamic—Ip value supplied to `_MPPlatform_UpsertHostPeer`.
portdynamic—Port value supplied to `_MPPlatform_UpsertHostPeer`.
namedynamic—Resource or object name to resolve.

View source

_MPPlatform_WaitPulse

inline function _MPPlatform_WaitPulse()

Keeps GUI/audio responsive while host/join control flow waits on network I/O.

View source

_MPPlatform_WrapGamePayload

function _MPPlatform_WrapGamePayload(localSlot, payload)

Encodes gameplay payload in MiniDoom gameplay UDP frame format.

ParameterTypeDefaultDescription
localSlotdynamic—Local slot value supplied to `_MPPlatform_WrapGamePayload`.
payloaddynamic—Payload value supplied to `_MPPlatform_WrapGamePayload`.

View source

ioctlsocket

extern function ioctlsocket(s as ptr, cmd as i32, argp as bytes) from "ws2_32.dll" returns int

Toggles socket mode (blocking/non-blocking) for UDP polling.

ParameterTypeDefaultDescription
sptr—`ptr` value supplied as s to `ioctlsocket`.
cmdi32—`i32` value supplied as cmd to `ioctlsocket`.
argpbytes—`bytes` value supplied as argp to `ioctlsocket`.

Returns: Result returned by the native `ioctlsocket` binding as `int`.

View source

MP_PlatformGetActiveSlots

function MP_PlatformGetActiveSlots()

Returns array of currently active player slots (always includes host slot 0).

View source

MP_PlatformGetDebugOverlayText

function MP_PlatformGetDebugOverlayText()

Returns multiplayer debug text for in-game overlay rendering.

View source

MP_PlatformGetLastError

function MP_PlatformGetLastError()

Returns the last multiplayer platform error message.

View source

MP_PlatformGetLastStatus

function MP_PlatformGetLastStatus()

Returns latest multiplayer runtime status string.

View source

MP_PlatformGetLocalPlayerSlot

inline function MP_PlatformGetLocalPlayerSlot()

Returns local player slot index used by Doom net layer.

View source

MP_PlatformGetNodeCount

function MP_PlatformGetNodeCount()

Returns active doom net node count for local multiplayer role.

View source

MP_PlatformGetNumPlayers

function MP_PlatformGetNumPlayers()

Returns known active player count for local multiplayer role.

View source

MP_PlatformGetPlayerNameBySlot

function MP_PlatformGetPlayerNameBySlot(slot)

Resolves player display name for a given Doom slot index.

ParameterTypeDefaultDescription
slotdynamic—Slot value supplied to `MP_PlatformGetPlayerNameBySlot`.

View source

MP_PlatformGetSessionMap

function MP_PlatformGetSessionMap()

Returns server-confirmed map token for active session.

View source

MP_PlatformGetSessionMode

function MP_PlatformGetSessionMode()

Returns server-confirmed multiplayer mode for active session.

View source

MP_PlatformGetSessionSkill

function MP_PlatformGetSessionSkill()

Returns server-confirmed multiplayer skill for active session.

View source

MP_PlatformHostGame

function MP_PlatformHostGame(port, mode, skill, mapname, maxPlayers, fragLimit, timeLimit)

Starts a non-blocking UDP host endpoint for join handshakes.

ParameterTypeDefaultDescription
portdynamic—Port value supplied to `MP_PlatformHostGame`.
modedynamic—Mode value supplied to `MP_PlatformHostGame`.
skilldynamic—Skill value supplied to `MP_PlatformHostGame`.
mapnamedynamic—Mapname value supplied to `MP_PlatformHostGame`.
maxPlayersdynamic—Max players value supplied to `MP_PlatformHostGame`.
fragLimitdynamic—Frag limit value supplied to `MP_PlatformHostGame`.
timeLimitdynamic—Time limit value supplied to `MP_PlatformHostGame`.

View source

MP_PlatformIsClientConnected

inline function MP_PlatformIsClientConnected()

Returns true when local runtime has an active client connection.

View source

MP_PlatformIsHosting

inline function MP_PlatformIsHosting()

Reports whether local runtime is currently acting as UDP host.

View source

MP_PlatformJoinGame

function MP_PlatformJoinGame(host, port, playerName)

Sends UDP join request and waits with timeout for host response.

ParameterTypeDefaultDescription
hostdynamic—Host value supplied to `MP_PlatformJoinGame`.
portdynamic—Port value supplied to `MP_PlatformJoinGame`.
playerNamedynamic—Player name value supplied to `MP_PlatformJoinGame`.

View source

MP_PlatformNetRecv

inline function MP_PlatformNetRecv()

Pops one queued gameplay packet as [node,payload], or void if none.

View source

MP_PlatformNetSend

function MP_PlatformNetSend(node, payload)

Sends a gameplay packet payload to a Doom remote node.

ParameterTypeDefaultDescription
nodedynamic—Node value supplied to `MP_PlatformNetSend`.
payloaddynamic—Payload value supplied to `MP_PlatformNetSend`.

View source

MP_PlatformPump

function MP_PlatformPump()

Processes non-blocking UDP packets for host/client maintenance.

View source

MP_PlatformSetEventLogPath

function MP_PlatformSetEventLogPath(path)

Selects an optional per-process diagnostics file used by CLI loopback tests and support logs.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.

View source

MP_PlatformSetPlayerNameBySlot

function MP_PlatformSetPlayerNameBySlot(slot, name)

Updates one checked slot name in the host peer table or client-side authoritative cache.

ParameterTypeDefaultDescription
slotdynamic—Slot value supplied to `MP_PlatformSetPlayerNameBySlot`.
namedynamic—Resource or object name to resolve.

View source

MP_PlatformShutdown

function MP_PlatformShutdown()

Shuts down multiplayer UDP runtime state and closes sockets.

View source

setsockopt

extern function setsockopt(s as ptr, level as int, optname as int, optval as bytes, optlen as int) from "ws2_32.dll" symbol "setsockopt" returns int

Configures the receive timeout on the owned WinSock UDP handle.

ParameterTypeDefaultDescription
sptr—`ptr` value supplied as s to `setsockopt`.
levelint—`int` value supplied as level to `setsockopt`.
optnameint—`int` value supplied as optname to `setsockopt`.
optvalbytes—`bytes` value supplied as optval to `setsockopt`.
optlenint—`int` value supplied as optlen to `setsockopt`.

Returns: Result returned by the native `setsockopt` binding as `int`.

View source