Networking

triangle-exclamation

Hooks

chevron-rightswatch_networking_playerauthenticatedhashtag

Called after player spawned and responded to the sWatch authentication.

After this you can use sWatch.sendLua.

Arguments

  1. (Player) player

chevron-rightswatch_networking_concommand_runhashtag

Called whenever a command is executed on the server. This only works with commands added with concommand.Add.

Arguments

  1. (Player) ply - Can be eighter player or NULL for console.

  2. (String) command

  3. (Any) arguments

  4. (String) argumentString

Returns

  1. (Boolean) block - false to block the command from running

chevron-rightswatch_networking_runconsolecommandhashtag

Called when RunConsoleCommand is executed serverside.

Arguments

  1. (String) command

  2. (Vararg) arguments

Returns

  1. (Boolean) block - false to block the command from running

chevron-rightswatch_networking_posthashtag

Called when http.Post is called.

Arguments

  1. (String) domain

  2. (String) url

  3. (Any) parameters

Returns

  1. (Boolean) block - false to block request

chevron-rightswatch_networking_fetchhashtag
chevron-rightswatch_networking_incominghashtag

Called before net.Receive. Used to block or log netmessages received by clients.

Arguments

  1. (Player) player

  2. (String) netmessageName

  3. (Number) length

Returns

  1. (Boolean) block - false to block message from being received in net.Receive

chevron-rightswatch_networking_incoming_posthashtag

Called after net.Receive has been executed. Used to log timing.

Arguments

  1. (Player) player

  2. (String) netmessageName

  3. (Number) deltaTime - time in ms it took to execute corresponding net.Recieve

Functions

chevron-rightsWatch.setQuarantinehashtag

All netmessages (except from sWatch) of a player in quarantine will get ignored.

Arguments

  1. (Player|SteamID32|SteamID64) player

  2. (Boolean) shouldQuarantine - false to remove from quarantine, true to quarantine

chevron-rightsWatch.isQuarantinedhashtag

Returns if a player is quarantined.

Arguments

  1. (Player|SteamID32|SteamID64) player

Returns

  1. (Boolean) isQuarantined

chevron-rightsWatch.queryIPScorehashtag

Arguments

  1. (String) IP-Address

  2. (Player) player (optional)

  3. (Function) callback

Example

You have to first specify an API-Key in the ingame settings. Read more about the callback return value in the official API-Documentation: https://www.ipqualityscore.com/documentation/proxy-detection/overview

chevron-rightsWatch.isPlayerAuthenticatedhashtag

A player is marked authenticated as soon as we receive our first response netmessage. This may took some time and happens after the PlayerInitialSpawn hook is called.

This can be used together with sWatch.sendLua (see a example in section below).

Arguments

  1. (Player|SteamID|SteamID64) player

Returns

  1. (Boolean) isAuthenticated

chevron-rightsWatch.sendLuahashtag

This addon is fileless for the client. So no code is visible via a conventional filestealer. Every code gets send over netmessages and is then run via RunString on the client. If protected is set true, the code is compiled, compressed and encrypted to prevent manipulation and no RunString is used.

Arguments

  1. (Player|SteamID32|SteamID64) player

  2. (String) code

  3. (Boolean) protected (optional, default=false) - protection against code manipulation

  4. (Boolean) cache (optional, default=false) - only necessary if protected=true. Makes protection faster for large payloads.

Example

chevron-rightsWatch.takeScreenshothashtag

This is usually called via admin menu. If you want to call it manually on the server, the screenshot will get saved in the data folder. See the ingame options under 'Networking' and 'Screenshot' for more details. Make sure to enable this feature in your settings.

Arguments

  1. (Player) player

  2. (Player) creator - nil if not called via admin menu)

chevron-rightsWatch.netmessagehashtag

This functions creates a netmessage. The real message name gets randomized.

We can restrict the netmessage to our groups ("staff", "protected). If we recieve a message by player that is not allowed to, the message will get blocked and he will get (depending on your settings) punished.

Only use this when necessary, as you have to send the ransomized message name to the client. It is idealy for admin menu and anticheat payload.

Arguments

  1. (String) messageName

  2. (String) restrictedTo - ("staff", "protected" or leave empty for no restrictions)

Returns

  1. (String) randomizedMessageName

Example

chevron-rightsWatch.getNetmessagehashtag

Returns the original name of a netmessage

Arguments

  1. (String) randomizedMessage

Returns

  1. (String) originalMessageName (first argument of sWatch.netmessage)

chevron-rightsWatch.isInternalNetmessagehashtag

Returns true if the message was created with sWatch.netmessage.

Arguments

  1. (String) netmessageName - can be eighter randomized or internal name

Returns

  1. (Boolean) isInternal

chevron-rightsWatch.getPlayerNetmessageshashtag

Returns a table of all netmessages received by a specific player. All internal and randomized messages of this addon will get translated to their original name.

Arguments

  1. (Player|SteamID32|SteamID64) player

Returns

  1. (Table) messages

chevron-rightsWatch.isFakenethashtag

If enabled in settings, we create fake backdoors and exploits to trick hackers/cheaters/scriptkids into using them.

Arguments

  1. (String) messagename

Returns

  1. (Boolean) isFakenet

chevron-rightsWatch.getExistingBackdoorshashtag

Returns a list of all real backdoors on your server. NOT FAKE BACKDOORS.

Returns

  1. (Table) backdoors

chevron-rightsWatch.getExistingExploitshashtag

Analogue to sWatch.getExistingBackdoors. Returns a list of all exploits on your server.

Returns

  1. (Table) exploits

chevron-rightsWatch.getPlayerCommandshashtag

Arguments

  1. (Player|SteamID32|SteamID64) player

Returns

  1. (Table) concommands

Last updated