Custom Query Flood Check
Write custom protections against query flood
Info:
How to install:
Download the archive from Releases page and unpack it into your server directory. Then edit "server.cfg":
Write custom protections against query flood
Info:
- This plugin redirects all calls from the original query flood check function to a new function written by the server owner in PAWN.
- Here is the original query flood check function converted to PAWN. This function is responsible for detecting flooding and for blocking queries when server is spammed with multiple packets coming from a bunch of different IPs.
- You may tweak it or write a better flood detection algorithm.
- Here is a list of sample protection scripts.
- See kurta999's YSF for more info about SA-MP query mechanism.
- Installing this plugin will disable the built-in query flood check, so you must your own protection!
- Use this filterscript to reimplement the default check.
- For better performance, write the protection directly into plugin source code to avoid AMX overhead.
- Compatible with 0.3.7 R2-1 only.
PHP Code:
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.
*/
Download the archive from Releases page and unpack it into your server directory. Then edit "server.cfg":
- Windows:
Code:filterscripts fs-original-check # or write your own protection
plugins samp-custom-query-flood-check.dll
- Linux:
Code:filterscripts fs-original-check # or write your own protection
plugins samp-custom-query-flood-check.so