MiniDoom

src/mp_state.ml

Stores multiplayer runtime/config state and utility helpers for map lists and WAD checks.

Package
(global)
Reachable
Yes

Imports

Declarations

_MP_Clamp

function _MP_Clamp(v, lo, hi)

Clamps integer values.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.
lodynamic—Inclusive lower bound.
hidynamic—Inclusive upper bound.

View source

_MP_IsAllowedNameByte

inline function _MP_IsAllowedNameByte(c)

Validates player-name ASCII bytes.

ParameterTypeDefaultDescription
cdynamic—C value supplied to `_MP_IsAllowedNameByte`.

View source

_MP_StrContains

function _MP_StrContains(haystack, needle)

Checks if haystack contains needle.

ParameterTypeDefaultDescription
haystackdynamic—Haystack value supplied to `_MP_StrContains`.
needledynamic—Needle value supplied to `_MP_StrContains`.

View source

_MP_ToInt

function _MP_ToInt(v, fallback)

Converts values to int with safe fallback.

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

View source

_MP_ToUpperAscii

function _MP_ToUpperAscii(s)

Converts ASCII letters to uppercase.

ParameterTypeDefaultDescription
sdynamic—S value supplied to `_MP_ToUpperAscii`.

View source

_MP_TwoDigits

inline function _MP_TwoDigits(v)

Formats a number as two ASCII digits.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

MP_ClampSettings

function MP_ClampSettings()

Normalizes multiplayer configuration ranges.

View source

MP_DEFAULT_PORT

const MP_DEFAULT_PORT = 2342

Defines mp default port for the mp state subsystem.

View source

mp_dm_frag_limit

mp_dm_frag_limit

Tracks the mutable mp dm frag limit value used by the mp state subsystem.

View source

mp_dm_time_limit

mp_dm_time_limit

Tracks the mutable mp dm time limit value used by the mp state subsystem.

View source

MP_GetIwadPath

function MP_GetIwadPath()

Returns selected IWAD file path if available.

View source

MP_GetPlayerName

function MP_GetPlayerName()

Returns current multiplayer player name.

View source

MP_GetSelectedMap

function MP_GetSelectedMap()

Returns currently selected host map name.

View source

mp_host_max_players

mp_host_max_players

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

View source

mp_host_mode

mp_host_mode

Tracks the mutable mp host mode value used by the mp state subsystem.

View source

mp_host_port

mp_host_port

Tracks the mutable mp host port value used by the mp state subsystem.

View source

mp_host_skill

mp_host_skill

Tracks the mutable mp host skill value used by the mp state subsystem.

View source

mp_iwad_fnv1a_hex

mp_iwad_fnv1a_hex

Stores the mutable mp iwad fnv1a hex text used by the mp state subsystem.

View source

mp_iwad_path

mp_iwad_path

Stores the mutable mp iwad path text used by the mp state subsystem.

View source

mp_join_host

mp_join_host

Stores the mutable mp join host text used by the mp state subsystem.

View source

mp_join_port

mp_join_port

Tracks the mutable mp join port value used by the mp state subsystem.

View source

mp_map_index

mp_map_index

Tracks the mutable mp map index value used by the mp state subsystem.

View source

mp_map_list

mp_map_list

Stores the mp map list collection used by the mp state subsystem.

View source

MP_MAX_NAME_LEN

const MP_MAX_NAME_LEN = 25

Defines the maximum mp max name len accepted by the mp state subsystem.

View source

MP_MODE_COOP

const MP_MODE_COOP = 0

Defines mp mode coop for the mp state subsystem.

View source

MP_MODE_DEATHMATCH

const MP_MODE_DEATHMATCH = 1

Defines mp mode deathmatch for the mp state subsystem.

View source

mp_player_name

mp_player_name

Stores the mutable mp player name text used by the mp state subsystem.

View source

mp_preferred_map_name

mp_preferred_map_name

Stores the mutable mp preferred map name text used by the mp state subsystem.

View source

MP_RebuildMapList

function MP_RebuildMapList()

Rebuilds host-map selection list based on IWAD filename family.

View source

MP_SanitizeName

function MP_SanitizeName(name)

Sanitizes and trims player names to protocol constraints.

ParameterTypeDefaultDescription
namedynamic—Resource or object name to resolve.

View source

MP_SetMode

function MP_SetMode(mode)

Sets multiplayer host mode.

ParameterTypeDefaultDescription
modedynamic—Mode value supplied to `MP_SetMode`.

View source

MP_SetPlayerName

function MP_SetPlayerName(name)

Stores sanitized multiplayer player name.

ParameterTypeDefaultDescription
namedynamic—Resource or object name to resolve.

View source

MP_SetSelectedMapByName

function MP_SetSelectedMapByName(name)

Selects map by name if present and stores it as preferred map.

ParameterTypeDefaultDescription
namedynamic—Resource or object name to resolve.

View source

MP_SKILL_BABY

const MP_SKILL_BABY = 0

Defines mp skill baby for the mp state subsystem.

View source

MP_SKILL_EASY

const MP_SKILL_EASY = 1

Defines mp skill easy for the mp state subsystem.

View source

MP_SKILL_HARD

const MP_SKILL_HARD = 3

Defines mp skill hard for the mp state subsystem.

View source

MP_SKILL_MEDIUM

const MP_SKILL_MEDIUM = 2

Defines mp skill medium for the mp state subsystem.

View source

MP_SKILL_NIGHTMARE

const MP_SKILL_NIGHTMARE = 4

Defines mp skill nightmare for the mp state subsystem.

View source

MP_StepMap

function MP_StepMap(delta)

Moves selected map index by delta with wraparound.

ParameterTypeDefaultDescription
deltadynamic—Delta value supplied to `MP_StepMap`.

View source

MP_UpdateIwadFingerprint

function MP_UpdateIwadFingerprint()

Fingerprints every gameplay WAD in load order so host/client PWAD mismatches are rejected too.

View source