Bans
Scripts' access to this server's own bans, the list KCDS-Admin keeps in bans.json in the resources folder. A ban names identifiers, such as "steam:7656...", "discord:..." or "hardware:...", and a reason, and a matching player is refused on connecting with "You are banned from this server: <reason>." A script's ban never ends by itself, so to ban for a set time, keep the end date and call Bans.remove. A ban is { id, identifiers, reason, by, at, until }. `by` is 'script' for a script's ban, `at` is when it was made, in milliseconds, and `until` is 0, or the end of a timed KCDS-Admin ban.
bans.add()
Bans.add(identifiers, reason = undefined)Bans identifiers, whether or not the player is online. A connected player they name leaves at once with the ban's text. Throws for an identifier that is not "kind:id", where kind is steam, epic, xbox, gog, discord, hardware or ip.
bans.remove()
Bans.remove(idOrIdentifier)Lifts a ban by its id, or all bans naming an identifier. Returns true if one was lifted.
bans.find()
Bans.find(identifierOrPlayer)The running ban naming this identifier, or any of this player's identifiers, otherwise null.
bans.list()
Bans.list()All bans, with running ones first.