Raised This Month: $12 Target: $400
 3% 

[Solved] smac_kac_banlist


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eric0279
AlliedModders Donor
Join Date: May 2007
Old 04-23-2015 , 18:13   [Solved] smac_kac_banlist
Reply With Quote #1

Hello,

i have updated sourcemod to 1.7.1 and i have this error:
Quote:
L 04/23/2015 - 22:24:59: [SM] Native "ReadPackString" reported: DataPack operation is out of bounds.
L 04/23/2015 - 22:24:59: [SM] Displaying call stack trace for plugin "smac_kac_banlist.smx":
L 04/23/2015 - 22:24:59: [SM] [0] Line 124, C:\addons\sourcemod\scripting\smac_kac_banlis t.sp::OnSocketConnected()
smac_version= "0.8.5.1"

sm version:
Quote:
00:12:29 SourceMod Version Information:
SourceMod Version: 1.7.1
SourcePawn Engine: SourcePawn 1.7, jit-x86 (build 1.7.1)
SourcePawn API: v1 = 4, v2 = 6
Compiled on: Apr 18 2015 12:164
Built from: https://github.com/alliedmodders/sou...commit/cf9aa05
Build ID: 5189:cf9aa05
http://www.sourcemod.net/
Best regards,

Last edited by eric0279; 04-26-2015 at 20:09.
eric0279 is offline
TUSK3N1337
SourceMod Donor
Join Date: Dec 2013
Location: Sweden
Old 04-24-2015 , 05:00   Re: [ERROR] smac_kac_banlist
Reply With Quote #2

The ban list that kigen hosted is not longer up that is why you get a error.

The plugin is using this URL to check if one is banned or not and it just replies with _ERROR.

http://kigenac.com/api/check.php?id=

http://kigenac.com/api/check.php?id=STEAM_0:0:128073882



And I dont think kigen will update it very soon^^, just remove it.
__________________

Last edited by TUSK3N1337; 04-24-2015 at 05:00.
TUSK3N1337 is offline
Send a message via Skype™ to TUSK3N1337
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-24-2015 , 10:19   Re: [ERROR] smac_kac_banlist
Reply With Quote #3

Quote:
Originally Posted by TUSK3N1337 View Post
The ban list that kigen hosted is not longer up that is why you get a error.

The plugin is using this URL to check if one is banned or not and it just replies with _ERROR.

http://kigenac.com/api/check.php?id=

http://kigenac.com/api/check.php?id=STEAM_0:0:128073882



And I dont think kigen will update it very soon^^, just remove it.
First result on Google seems to fetch via a socket connection to master.kigenac.com, port 9652 where it just sends the Steam ID.

Code:
http://master.kigenac.com:9652/api/check.php?id=STEAM_0:0:128073882
http://master.kigenac.com:9652/STEAM_0:0:128073882
However, even bans that have previously existed according to Google searches on kigenac.com seems to return "_OK" through that...

So either way, yes, it seems like the whole thing have been discontinued, so there would be no reasons to keep that plugin on.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
allienaded
AlliedModders Donor
Join Date: Feb 2013
Old 04-25-2015 , 01:09   Re: [ERROR] smac_kac_banlist
Reply With Quote #4

Update to SMAC 0.8.6.0 dev version, it's the only one updated to work properly with sourcemod 1.7+. The KAC Banlist module has been completely removed from 0.8.6.0 because the banlist isn't working anymore.
allienaded is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 04-25-2015 , 09:01   Re: [ERROR] smac_kac_banlist
Reply With Quote #5

Quote:
Originally Posted by allienaded View Post
Update to SMAC 0.8.6.0 dev version, it's the only one updated to work properly with sourcemod 1.7+. The KAC Banlist module has been completely removed from 0.8.6.0 because the banlist isn't working anymore.
Wrong, the banlist works perfectly, The reason it was removed is because of the issues that happened with Kigen and the DMCA, The reason you are getting errors is because of the Datapack changes never got applied to the KAC Banlist due to it being removed.

Heres a repo where I'm just pushing small fixes and tweaks as needed. I have added back the KAC Banlist.

https://bitbucket.org/xCoderx/source...ng/?at=default
SM9 is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-25-2015 , 16:35   Re: [ERROR] smac_kac_banlist
Reply With Quote #6

Quote:
Originally Posted by xCoderx View Post
Wrong, the banlist works perfectly, The reason it was removed is because of the issues that happened with Kigen and the DMCA, The reason you are getting errors is because of the Datapack changes never got applied to the KAC Banlist due to it being removed.

Heres a repo where I'm just pushing small fixes and tweaks as needed. I have added back the KAC Banlist.

https://bitbucket.org/xCoderx/source...ng/?at=default
The plugin in the repository you linked to is sending its request for STEAM_0:1:2345 to the URL:
Code:
http://kigenac.com/api/check.php?id=STEAM_0:1:2345
That URL returns _ERROR for all Steam ID's, even the ones from his own forums (protest section) which are less than 3 months old saying "This ban is valid and won't be lifted".

Could you explain how your version of the plugin works, when the data feed it is using doesn't work at all?
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
allienaded
AlliedModders Donor
Join Date: Feb 2013
Old 04-26-2015 , 17:12   Re: [ERROR] smac_kac_banlist
Reply With Quote #7

Quote:
Originally Posted by xCoderx View Post
Wrong, the banlist works perfectly, The reason it was removed is because of the issues that happened with Kigen and the DMCA, The reason you are getting errors is because of the Datapack changes never got applied to the KAC Banlist due to it being removed.

Heres a repo where I'm just pushing small fixes and tweaks as needed. I have added back the KAC Banlist.

https://bitbucket.org/xCoderx/source...ng/?at=default
The KAC banlist isn't working anymore regardless of the reason it was originally removed, try it for yourself every single steam ID returns _ERROR (for example STEAM_0:0:0 used to return _BAN because it's an invalid ID and only a cracked client with a spoofed ID could ever have that)

Last edited by allienaded; 04-26-2015 at 21:17.
allienaded is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 04-26-2015 , 20:09   Re: [Solved] smac_kac_banlist
Reply With Quote #8

Thank you for answers
eric0279 is offline
allienaded
AlliedModders Donor
Join Date: Feb 2013
Old 04-27-2015 , 04:46   Re: [Solved] smac_kac_banlist
Reply With Quote #9

I was bored and since the KAC banlist seems down for good I decided to code a clone of it in PHP that returns the exact same messages and works with the smac_kac_banlist plugin straight away by only replacing the url's in the .sp file. The steam id's are read from a simple text file so no need for any fancy SQL setups and on top of a simple one Steam ID per line format (STEAM_0:0:1234567 or just 0:1234567) the banned_user.cfg file format (banid 0 STEAM_0:0:1234567) is also supported, just make sure the file has only one type of line endings (either Windows \r\n or UNIX/OSX \n, NOT both mixed). Oh and Steam "universe" is ignored so it doesn't matter wether you have ID's starting with STEAM_0, STEAM_1 or both the beginning of the ID is ignored.

PHP Code:
<?php
/*
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
*/

/* Version 1430123388 */


//File containing banned id's (read AND write permissions required unless $allowremote is true)
//ex. './bannedIDs.txt', './banned_user.cfg', 'http://example.com/banlist.txt'
$idlist './banned_user.cfg';

//Allow remote list locations (disable the need for write permissions)
//Note: If you enable this you MUST end the file in atleast a newline
//character or preferrably something like //end otherwise the last
//Steam ID on the list will be ignored!
$allowremote false//true or false

//Ban STEAM_ID_PENDING, STEAM_ID_LAN, VALVE_ID_PENDING, VALVE_ID_LAN?
$banpending false//true or false

//Disable Steam ID validity checking (NOT RECOMMENDED)
//Only do this if you are getting _INVALID on ID's you're 100% sure are valid
//Note: Disabling validity checking will also force $banpending to false. If
//you want to keep STEAM_ID_PENDING for example banned with validity cheking
//disabled you will have to add it to your banlist.
$noval false//true or false

//Enable PHP error messages for debugging reasons, otherwise just print _ERROR on errors
$enabledebug false//true or false


//Don't edit below unless you know what you're doing!
function myErrorHandler($errno$errstr$errfile$errline)
{
    if (!(
error_reporting() & $errno)) {
        return;
    }

    switch (
$errno) {
    default:
        echo 
'_ERROR';
        exit(
1);
        break;
    }
    
    return 
true;
}

if (
$enabledebug == false) {
    
set_error_handler("myErrorHandler");
}

if (isset(
$_GET['id'])) {
    
$id $_GET['id'];
} else {
    
$id '';
}
if (
$id == '') {
    
$id 'empty';
}

if (
$noval == false) {
    if (
strpos($id'_ID_PENDING') !== false && strlen($id) < 17 || strpos($id'_ID_LAN') !== false && strlen($id) < 13) {
        if (
$banpending == true) {
            echo 
'_BAN';
            exit;
        } else {
            echo 
'_OK';
            exit;
        }
    }
    if (
strpos($id'STEAM_') === false || is_numeric(substr($id10)) == false || strpos(substr($id10), '.') !== false || strlen($id) > 24) {
        echo 
'_INVALID';
        exit;
    }
}

$id preg_replace('/^STEAM_[0-9]:/i'''$id);

$banned false;
if (
$allowremote == false) {
    
$handle = @fopen($idlist'r+t');
    if (
$handle) {
        
fseek($handle0);
        if (
strpos(fgets($handle), "\r\n") !== false) {
            
$linebreak "\r\n";
            
fseek($handle, -2SEEK_END);
        } else {
            
$linebreak "\n";
            
fseek($handle, -1SEEK_END);
        }
        if (
strpos(fgets($handle), $linebreak) === false) {
            
fwrite($handle$linebreak);
        }
        
fseek($handle0);
        while ((
$line fgets($handle)) !== false) {
            if (
strpos($line$id $linebreak) !== false) {
                
$banned true;
                break;
            }
        }
    } else {
        
trigger_error("Unable to open file ($idlist) for reading and writing"E_USER_ERROR);
    }
    
fclose($handle);
} else {
    
$handle = @fopen($idlist'rt');
    if (
$handle) {
        if (
strpos(fgets($handle), "\r\n") !== false) {
            
$linebreak "\r\n";
        } else {
            
$linebreak "\n";
        }
        } else {
            
trigger_error("Unable to open file ($idlist) for reading"E_USER_ERROR);
        }
        
fclose($handle);
    
$handle = @fopen($idlist'rt');
    if (
$handle) {
        while ((
$line fgets($handle)) !== false) {
            if (
strpos($line$id $linebreak) !== false) {
                
$banned true;
                break;
            }
        }
    } else {
        
trigger_error("Unable to open file ($idlist) for reading"E_USER_ERROR);
    }
    
fclose($handle);
}

if (
$banned == true) {
    echo 
_BAN;
} else {
    echo 
_OK;
}
exit;
?>
My server I tested this on has PHP version 5.2.17 so that or anything newer should work. Older versions might work too but I can't quarantee anything. I also fixed (and renamed) the KAC banlist plugin so that it works with SMAC 0.8.6.0 and SourceMod 1.7+ and attached it the the .zip.

If anyone has any questions about this you're free to ask, even though I made this just for fun I might actually start using this myself as a sort of simple replacement for sourcebans

EDIT: I did some speedtests and it took on average 0.85 seconds to find the last ID (which takes the longest to find) on a list with 1 million entries (in the format: banid 0 STEAM_0:0:1234567) and a size of 27.1mb. This was on shared free hosting with very limited resources so speed shouldn't be an issue even with a massive banlist.

EDIT2: Tested the whole thing on my own server (self-hosted banlist + smac_custom_banlist.smx) and everything works perfectly. Even with my ID being the last on the 1 million entry list I still got kicked before I had time to even fully connect. The SMAC.log entries look like this:

Code:
L 04/27/2015 - 14:29:11: [smac_custom_banlist.smx | 0.8.6.0] Allienaded (ID: STEAM_1:0:12345678 | IP: 123.123.123.123) was kicked.
Mirror
Attached Files
File Type: zip check.zip (4.1 KB, 85 views)

Last edited by allienaded; 04-27-2015 at 07:38.
allienaded is offline
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 09:32.


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