Server
dlmp.set_mode_text
Sets the mode the server list and the launcher show for this server, such as "Freeroam / TDM": printable UTF-8 of at most 32 bytes without leading or trailing spaces; otherwise returns nil, err. The last caller owns it until it sets "" or stops. May be called while the script loads.
Parameters
textstring
Returns ok boolean|nil, err string|nil
dlmp.mode_text
The mode text the server reports; "" when no resource has set one.
Returns text string
dlmp.set_server_password
Sets the password a new connection must prove it knows, like password in server.toml: up to 64 bytes of text without control characters; otherwise returns nil, err. nil or "" lets everyone in. Connected players stay. The launcher shows a lock from the next query; the password itself cannot be read back. Each new password costs the server one slow key derivation (tens of milliseconds) on the next join, so do not change it every tick.
Parameters
passwordstring|nil
Returns ok boolean|nil, err string|nil
dlmp.set_player_list_scope
Sets which players the built-in player list shows on every client: "all" (everyone on the server, the default), "world" (the viewer's virtual world, in any interior) or "stream" (the players shown to the viewer). The server filters, so a client never receives the rest. An unknown scope raises a Lua error. Server-wide: the setting persists after the resource stops.
Parameters
scope"all"|"world"|"stream"
Returns ok boolean|nil, err string|nil
dlmp.player_list_scope
Returns "all"|"world"|"stream"
dlmp.kick_player
Same as Player:kick.
Parameters
playerPlayerreason(optional)string
Returns ok boolean|nil, err string|nil
DlmpBan
Fields
ipstringreasonstringseconds_leftinteger|nil— whole seconds left, nil for a permanent ban
dlmp.ban_ip
Bans an IPv4 or IPv6 address for seconds (1..4294967295; nil bans permanently), replacing any existing ban on it, and kicks every player connected from it (player_disconnect reason "kicked"). The server stores bans in bans.toml next to resources, so they survive a restart. A new connection from the address is refused before it gets a player and before player_connecting, and the player sees reason and the time left. reason is printable UTF-8, up to 20 bytes, and may be empty. Each ban covers one address; ranges are not supported. A malformed address raises an error; returns nil, err for a reason or duration out of range, or when the server cannot write the ban file (nothing changes then).
Parameters
ipstringreason(optional)stringseconds(optional)integer
Returns ok boolean|nil, err string|nil
dlmp.ban_player
Same as Player:ban.
Parameters
playerPlayerreason(optional)stringseconds(optional)integer
Returns ok boolean|nil, err string|nil
dlmp.unban_ip
Lifts the ban on an address; returns nil, err when it has none (an expired ban counts as none).
Parameters
ipstring
Returns ok boolean|nil, err string|nil
dlmp.bans
Every active ban, by address.
Returns DlmpBan[]
