spmn / samp-custom-query-flood-check

Write custom protections against query flood in PAWN

Home Page:http://forum.sa-mp.com/showthread.php?t=640162

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Query Flood Check (CQFC plugin)

Write custom protections against query flood

WARNING

  • Installing this plugin will disable the built-in query flood check, so you must your own protection!
  • Use this filterscript to reimplement the default query flood check. (not recommended - it is susceptible to query flood attack)
  • For better performance, implement the protection directly into plugin source code to avoid AMX overhead.

Callback

forward OnQueryFloodCheck(queryType, binaryAddress); 
/*
 * Info:
 *  - called when a query is received
 *
 * Parameters:
 *  - queryType     : a single character corresponding to the packet identifier as explained here: http://wiki.sa-mp.com/wiki/Query_Mechanism#Opcodes
 *  - binaryAddress : IP address of requester as a 32-bit unsigned integer
 *
 * Returns:
 *  -   0 (ZERO)    : process the query
 *  - !=0 (NONZERO) : don't process the query
 *
 * Notes:
 *  - If any script returns NONZERO in this callback, then current query won't get processed.
 *  - If this callback is missing from all loaded scripts, then the plugin will **PROCESS ALL QUERIES** and will print a warning message in server log. 
 */

How to install

Download the archive from Releases page and unpack it into your server directory. Then edit "server.cfg":

  • Windows
filterscripts fs-original-check # or write your own protection
plugins samp-custom-query-flood-check.dll
  • Linux
filterscripts fs-original-check # or write your own protection
plugins samp-custom-query-flood-check.so

About

Write custom protections against query flood in PAWN

http://forum.sa-mp.com/showthread.php?t=640162

License:GNU General Public License v3.0


Languages

Language:C++ 54.3%Language:Pawn 21.0%Language:SourcePawn 14.7%Language:Makefile 10.1%