# _MP_Clamp
function _MP_Clamp(v, lo, hi)Clamps integer values.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
lo | dynamic | — | Inclusive lower bound. |
hi | dynamic | — | Inclusive upper bound. |
src/mp_state.mlStores multiplayer runtime/config state and utility helpers for map lists and WAD checks.
doomdef.ml → src/doomdef.mlm_argv.ml → src/m_argv.mlmp_fnv1a.ml → src/mp_fnv1a.mlstd/fs.ml as fs → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/fs.ml external dependencystd/math.ml → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/math.ml external dependencyfunction _MP_Clamp(v, lo, hi)Clamps integer values.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
lo | dynamic | — | Inclusive lower bound. |
hi | dynamic | — | Inclusive upper bound. |
inline function _MP_IsAllowedNameByte(c)Validates player-name ASCII bytes.
| Parameter | Type | Default | Description |
|---|---|---|---|
c | dynamic | — | C value supplied to `_MP_IsAllowedNameByte`. |
function _MP_StrContains(haystack, needle)Checks if haystack contains needle.
| Parameter | Type | Default | Description |
|---|---|---|---|
haystack | dynamic | — | Haystack value supplied to `_MP_StrContains`. |
needle | dynamic | — | Needle value supplied to `_MP_StrContains`. |
function _MP_ToInt(v, fallback)Converts values to int with safe fallback.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
fallback | dynamic | — | Value returned when the requested conversion or lookup is unavailable. |
function _MP_ToUpperAscii(s)Converts ASCII letters to uppercase.
| Parameter | Type | Default | Description |
|---|---|---|---|
s | dynamic | — | S value supplied to `_MP_ToUpperAscii`. |
inline function _MP_TwoDigits(v)Formats a number as two ASCII digits.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
function MP_ClampSettings()Normalizes multiplayer configuration ranges.
const MP_DEFAULT_PORT = 2342Defines mp default port for the mp state subsystem.
mp_dm_frag_limitTracks the mutable mp dm frag limit value used by the mp state subsystem.
mp_dm_time_limitTracks the mutable mp dm time limit value used by the mp state subsystem.
function MP_GetIwadPath()Returns selected IWAD file path if available.
function MP_GetPlayerName()Returns current multiplayer player name.
function MP_GetSelectedMap()Returns currently selected host map name.
mp_host_max_playersTracks the mutable mp host max players value used by the mp state subsystem.
mp_host_modeTracks the mutable mp host mode value used by the mp state subsystem.
mp_host_portTracks the mutable mp host port value used by the mp state subsystem.
mp_host_skillTracks the mutable mp host skill value used by the mp state subsystem.
mp_iwad_fnv1a_hexStores the mutable mp iwad fnv1a hex text used by the mp state subsystem.
mp_iwad_pathStores the mutable mp iwad path text used by the mp state subsystem.
mp_join_hostStores the mutable mp join host text used by the mp state subsystem.
mp_join_portTracks the mutable mp join port value used by the mp state subsystem.
mp_map_indexTracks the mutable mp map index value used by the mp state subsystem.
mp_map_listStores the mp map list collection used by the mp state subsystem.
const MP_MAX_NAME_LEN = 25Defines the maximum mp max name len accepted by the mp state subsystem.
const MP_MODE_COOP = 0Defines mp mode coop for the mp state subsystem.
const MP_MODE_DEATHMATCH = 1Defines mp mode deathmatch for the mp state subsystem.
mp_player_nameStores the mutable mp player name text used by the mp state subsystem.
mp_preferred_map_nameStores the mutable mp preferred map name text used by the mp state subsystem.
function MP_RebuildMapList()Rebuilds host-map selection list based on IWAD filename family.
function MP_SanitizeName(name)Sanitizes and trims player names to protocol constraints.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | dynamic | — | Resource or object name to resolve. |
function MP_SetMode(mode)Sets multiplayer host mode.
| Parameter | Type | Default | Description |
|---|---|---|---|
mode | dynamic | — | Mode value supplied to `MP_SetMode`. |
function MP_SetPlayerName(name)Stores sanitized multiplayer player name.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | dynamic | — | Resource or object name to resolve. |
function MP_SetSelectedMapByName(name)Selects map by name if present and stores it as preferred map.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | dynamic | — | Resource or object name to resolve. |
const MP_SKILL_BABY = 0Defines mp skill baby for the mp state subsystem.
const MP_SKILL_EASY = 1Defines mp skill easy for the mp state subsystem.
const MP_SKILL_HARD = 3Defines mp skill hard for the mp state subsystem.
const MP_SKILL_MEDIUM = 2Defines mp skill medium for the mp state subsystem.
const MP_SKILL_NIGHTMARE = 4Defines mp skill nightmare for the mp state subsystem.
function MP_StepMap(delta)Moves selected map index by delta with wraparound.
| Parameter | Type | Default | Description |
|---|---|---|---|
delta | dynamic | — | Delta value supplied to `MP_StepMap`. |
function MP_UpdateIwadFingerprint()Fingerprints every gameplay WAD in load order so host/client PWAD mismatches are rejected too.