BanInfoA ban entry's value: expiry + reason. until === 0 = permanent, else unix-second expiry.
until: numberreason: string@s2script/sdk/bans
engine-generic SteamID64 ban store + bans.json persistence. Resolved at runtime via globalThis.__s2pkg_bans; no game-specific symbols. Import: import { Bans } from "./bans"; The store is host-global in core, populated from addons/s2script/configs/bans.json via the config bridge. Enforcement is JS-driven: a ban plugin (e.g. @s2script/basebans) registers a Clients.onConnect handler that looks a connecting SteamID64 up here and, if banned, shows the reason then kicks (Client.kickWithReason) — a banned player is admitted, shown their reason, and kicked, not instant-rejected. A 3rd-party ban system registers its own onConnect against its own store.
import { BanInfo } from "@s2script/sdk/bans";Author-time types ship in the npm package; the engine injects the runtime at plugin load. Add @s2script/sdk to your plugin's dependencies.
Generated from the shipped type definitions.
BanInfoA ban entry's value: expiry + reason. until === 0 = permanent, else unix-second expiry.
until: numberreason: stringBanEntryA ban entry as listed by Bans.list(): the SteamID64 plus its value.
steamid: stringuntil: numberreason: stringBansThe ban API: add/remove bans, look up by SteamID64, list, and reload from bans.json.
import { Bans } from "@s2script/sdk/bans";
// Connect-time enforcement inside a Clients.onConnect handler.
const b = Bans.get(c.steamId);
if (b && (b.until === 0 || b.until > Date.now() / 1000)) c.kickWithReason(b.reason);add(steamId: string, minutes: number, reason?: string): voidminutes <= 0 = permanent.remove(steamId: string): booleanget(steamId: string): BanInfo | nulllist(): BanEntry[]reload(): void