Ban System

sWatch takes extra meassures befor banning a player.

Hooks

chevron-rightswatch_banbypass_onplayerbanhashtag

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

chevron-rightswatch_banbypass_cookieloadedhashtag

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

chevron-rightswatch_banbypass_checkhashtag

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

circle-info

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

chevron-rightsWatch.banPlayerhashtag

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"
)
chevron-rightsWatch.unbanPlayerhashtag

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

chevron-rightsWatch.kickPlayerhashtag

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

chevron-rightsWatch.isPlayerBannedhashtag

Check if a player was banned by sWatch

Arguments

  1. (SteamID|SteamID64|Player) player

Returns

  1. (Boolean) isBanned

chevron-rightsWatch.getAllBanshashtag

Get full table of all bans made by sWatch

Returns

  1. (Table) bans

chevron-rightsWatch.isFamilySharedhashtag

Arguments

  1. (Player) player

Returns

  1. (Boolean) isFamilyShared

chevron-rightsWatch.isOwnerBannedhashtag

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

Arguments

  1. (Player) player

Returns

  1. (Boolean) isOwnerBanned

chevron-rightsWatch.playerHasCookiehashtag

Used internal. Equals to sWatch.isTrusted.

Arguments

  1. (Player) player

Returns

  1. (Boolean) hasCookie

chevron-rightsWatch.getFingerprinthashtag

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

chevron-rightsWatch.getIndicatorshashtag

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