This mod registers all the IPs used by individual players, and can ban the player when using any of them, even if he is not online at the moment.
See file 'LICENSE.txt'.
/xban
/xtempban
/xunban
The following options can be used to change the behavior of xban'. They must be set in your server's
minetest.conf'.
xban.kick_guests =
xban.ban_message =
xban.guest_kick_message =
Other mods can make use of xban functionality if desired. You just need to (opt)depend on xban.
xban.ban_player(name, time, reason)
Bans a given player
xban.unban_player(name) --> (true) or (nil, error)
Removes a player from the ban list. Returns true on success, or nil plus error message on error.
xban.find_entry(name_or_ip) --> (entry, index) or (nil)
Returns the database entry for the given player or IP. Please note that a single entry is shared by several IPs and several user names at the same time. See below for the format of entries. Also note that the table is not copied, so modifications will be saved to disk.
xban.entries
This is the list of entries in the database. See below for format.
This mod only modifies a single file named 'players.iplist.v2' in the world directory (and indirectly, 'ipban.txt'). The format is a serialized Lua table.
Each item in the table is in the following format:
{ names = { ["foo"] = true, -- To ban by name. ["123.45.67.89"] = true, -- To ban by IP. ... }, banned = "Because random.", -- If nil, user is not banned. expires = 123456, -- In time_t. If nil, user is permabanned. privs = { ... }, -- Player privileges before the ban. record = { -- Record of previous bans. { date = 123456, -- Date when the ban was issued. time = 4123, -- Ban time. This is nil if permabanned. reason = "asdf", -- Duh. }, ... }, }
The old players.iplist' DB format is still read at startup, and converted to the new format. In this case,
banned' is set to the default ban reason,
and `expires' is unset.