this is a useless module that can get the filter ip list information
header file:
PHP Code:
/**
* Get the count of the banned ip list
*
* @return the count of the banned ip list
*/
native FT_GetFilterCount();
/**
* Get a ip from the filter list with the given index
*
* @param nIndex the index at the banned ip list, should be start at 0 and the last one is count - 1.
* @param ip store the ip with the nIndex
* @param maxLen the max length store the ip
* @return 1 on success, 0 on failed.
*/
native FT_GetFilterIP(nIndex, String:ip[], maxLen);
/**
* Whether the ip has been banned or not.
*
* @param ip the ip want to check whether is banned or not
* @param bantime If the IP is banned, it will save time to be banned
* @return 1:the ip has been banned, otherwise not
*/
native FT_GetBannedTime(const String:ip[], &Float:bantime);
/**
* Call when type "addip" command
*
* @note Ignore the return value.
*
* @param cmd always is "addip"
* @param bantime how long does the ip was banned
* @param ip the ip
*
*/
forward OnFillterAdd_Post(const String:cmd[], Float:bantime, const String:ip[]);
example code:
PHP Code:
#include <sourcemod>
#include <filter>
public Plugin:myinfo =
{
name = "New Plugin",
author = "LittleKu",
description = "<- Description ->",
version = "1.0",
url = "https://github.com/LittleKu/filter"
}
public OnPluginStart()
{
// Add your own code here...
RegConsoleCmd("test", ListIPCallback)
}
public Action:ListIPCallback(client, args)
{
new nCount = FT_GetFilterCount()
for (new i = 0; i < nCount; i++)
{
decl String:szIP[32]
new Float:iBanTime
FT_GetFilterIP(i, szIP, sizeof(szIP));
FT_GetBannedTime(szIP, iBanTime);
PrintToServer("bantime %f, ip %s", iBanTime, szIP)
}
return Plugin_Handled
}
public OnFillterAdd_Post(const String:cmd[], Float:bantime, const String:ip[])
{
PrintToServer("cmd ->\"%s\", bantime -> \"%f\", ip -> \"%s\"", cmd, bantime, ip)
}
Note:Only test on CS:GO Dedicated Server on Windows, but I think it should work on the other game with Source Engine, also the signature and offset only CS:GO, it will be better if someone can compile this for linux and mac
any feedback and suggestions are welcome
Source code
here