Ban System

sWatch takes extra meassures befor banning a player.

Hooks

swatch_banbypass_onplayerban

Called whenever a player gets banned. If player is online, there will be a delay after this hook has been called to still interact with him for a short time.

Arguments

  1. (String) steamID32

  2. (Table) banDetails

  3. (Boolean) onlineBan - true if player is online, false if player is offline

swatch_banbypass_cookieloaded

Called when server finished deciding/checking if a player should get a device cookie. From there we can tell if player is trusted or not.

Arguments

  1. (Player) player

swatch_banbypass_check

Called when sWatch checks if player is bypassing a ban. You can implement you own checks at any time, but this is the recommended timespan.

Arguments

  1. (Player) player

Functions

If a ban is in progress, the player is imune to kicks or bans with other reasons.

sWatch.banPlayer

Used to ban a online or offline player.

Player is offline: Offline player will be set to banned on sight. The next time the player enters the server he will be banned.

Player is online: We send different payloads to the client and after some seconds he will get banned.

Arguments

  1. (Player|SteamID) player

  2. (String) reason - Displayed to the banned client (leave empty for default reason)

  3. (String) comment - Add some details to the ban. Will only be visible for admins in the menu.

  4. (String) internalReason - use "admin_manual" or create a new detection in config/detections.lua file. If no internal reason is given, an error will occur.

  5. (Boolean) force (optional) - ignores if detection is disabled or invalid

Example

sWatch.banPlayer(
    "STEAM_0:1:1234567", 
    "Please just go", // Reason to display client
    "I didn't like him", // Internal comment
    "admin_manual"
)
sWatch.unbanPlayer

Player will bet set to unban on sight and unbanned as soon as he joins the server. Can be reverted by banning him again.

Arguments

  1. (SteamID) playerSteamID

sWatch.kickPlayer

Arguments

  1. (Player|SteamID|SteamID64) player

  2. (String) reason - Displayed to the client (leave empty for default reason)

  3. (String) internalReason - Same as internalReason in sWatch.banPlayer

sWatch.isPlayerBanned

Check if a player was banned by sWatch

Arguments

  1. (SteamID|SteamID64|Player) player

Returns

  1. (Boolean) isBanned

sWatch.getAllBans

Get full table of all bans made by sWatch

Returns

  1. (Table) bans

sWatch.isFamilyShared

Arguments

  1. (Player) player

Returns

  1. (Boolean) isFamilyShared

sWatch.isOwnerBanned

Check if the family sharing owner of this Garry’s Mod is banned by sWatch

Arguments

  1. (Player) player

Returns

  1. (Boolean) isOwnerBanned

sWatch.playerHasCookie

Used internal. Equals to sWatch.isTrusted.

Arguments

  1. (Player) player

Returns

  1. (Boolean) hasCookie

sWatch.getFingerprint

A Fingerprint is collected from every client. If a player gets banned, his fingerprint will get stored together with the ban to prevent a bypass. Fingerprint will get requested from client on swatch_networking_playerauthenticated and is avaliable after a few seconds.

Arguments

  1. (Player|SteamID|SteamID64) player

Returns

  1. (Table) fingerprint

sWatch.getIndicators

Like sWatch.getFingerprintwe collect typical indicators on players. (Newly installed game, use of developer commands, ...)

Arguments

  1. (Player|SteamID|SteamID64) player

Retruns

  1. (Table) indicators

Last updated