Raised This Month: $32 Target: $400
 8% 

[Any]A module that can get filter ip list information


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 11-15-2014 , 13:30   [Any]A module that can get filter ip list information
Reply With Quote #1

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(nIndexString: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(clientargs)
{
    new 
nCount FT_GetFilterCount()
    for (new 
0nCounti++)
    {
        
decl String:szIP[32]
        new 
Float:iBanTime
        FT_GetFilterIP
(iszIPsizeof(szIP));
        
FT_GetBannedTime(szIPiBanTime);
        
PrintToServer("bantime %f, ip %s"iBanTimeszIP)
    }
    
    return 
Plugin_Handled
}

public 
OnFillterAdd_Post(const String:cmd[], Float:bantime, const String:ip[])
{
    
PrintToServer("cmd ->\"%s\", bantime -> \"%f\", ip -> \"%s\""cmdbantimeip)

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
Attached Files
File Type: dll filter.ext.dll (81.5 KB, 173 views)
__________________
QQ:116268742

Last edited by K.K.Lv; 11-24-2014 at 03:27.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode