Isle Modkit
Pages in this area

bans

Server

modkit.bans is a ban list the server plugin keeps on its own. It is stored in data\bans.json under the server root and survives restarts. A banned player is kicked when the server first sees them in the game, which is up to half a second after the join. The event playerRejected(player, reason) fires and playerConnected does not.

This list is separate from the game's own ban list. Bans you set in the game's admin panel do not show up here, and the other way round.

A banned player does not get past the launcher. Before it starts the game, the launcher asks the server whether the player may join, and a ban ends the join right there with the reason and, for a temporary ban, the end date. The same check runs when the client mod opens the script link, so a direct connect does not get around it either.

Isle Modkit keeps a global ban list on top of that, for cheaters. It works on the Steam ID and on hardware traits the launcher reports, so a fresh Steam account on the same PC stays out. The server plugin fetches that list every five minutes and applies it like its own bans. You cannot edit it. Report cheaters through the report window, see reports.

Every function that takes a player accepts a player table or a Steam ID string.

modkit.bans.add

modkit.bans.add(player [, reason [, hours]]) modkit.bans.add(player, options)

Parameter Type Description
player player table or string who to ban. The player does not have to be online.
reason string shown in the kick message, default "banned"
hours number length of the ban. 0 or nothing means forever.
options table reason, hours, name (player name for your records), by (who banned, default is the resource name)

Returns: true. If the player is online they are kicked right away. A Steam ID with anything but digits raises an error.

modkit.commands.add("ban", function(admin, steamId, hours, ...)
  local reason = table.concat({ ... }, " ")
  modkit.bans.add(steamId, { reason = reason, hours = tonumber(hours) or 0, by = admin.name })
  admin:message("Banned " .. steamId)
end, "moderation.ban")

modkit.bans.remove

modkit.bans.remove(player)

Returns: true when there was a ban.

modkit.bans.isBanned

modkit.bans.isBanned(player)

Returns: false, or true and the ban entry. An expired ban is removed by this call and counts as not banned.

Field Type Description
steamId, name, reason, by string
created integer Unix time
expires integer Unix time, 0 for a permanent ban
local banned, entry = modkit.bans.isBanned("76561198000000001")
if banned then print(entry.reason, os.date("%Y-%m-%d", entry.created)) end

modkit.bans.list

modkit.bans.list()

Returns: array of ban entries.

player:ban

player:ban([reason [, hours]]) bans and kicks the player in one call. See player.