Raised This Month: $ Target: $400
 0% 

Ban disconnected players


Post New Thread Reply   
 
Thread Tools Display Modes
Cthen
Senior Member
Join Date: Aug 2012
Old 10-24-2012 , 03:43   Re: Ban disconnected players
Reply With Quote #61

Just added this one on my server. Working great. Thank you!
Cthen is offline
seat
New Member
Join Date: Feb 2012
Old 11-05-2012 , 17:47   Re: Ban disconnected players
Reply With Quote #62

This is LITERALLY my most used plugin. It works fantastically for L4D, which is fraught with toolboxes that come in, suicide, then leave. Thank you so much!
seat is offline
teol
Veteran Member
Join Date: Oct 2009
Location: Marbella
Old 11-09-2012 , 18:48   Re: Ban disconnected players
Reply With Quote #63

Is that sourcebans compatible?
teol is offline
PsyGaming
SourceMod Donor
Join Date: Sep 2012
Location: Germany
Old 01-27-2013 , 06:49   Re: Ban disconnected players
Reply With Quote #64

Someone can fix the problem with sourcebans when you ban someone and he appears with "Name not available"?
__________________
http://www.psy-gaming.de

Psy-Gaming.de - CS:GO Server Community
We have more than +30 Publicserver running!


PsyGaming is offline
Sketchy
Senior Member
Join Date: Nov 2010
Old 02-06-2013 , 09:27   Re: Ban disconnected players
Reply With Quote #65

Quote:
Originally Posted by PsyGaming View Post
Someone can fix the problem with sourcebans when you ban someone and he appears with "Name not available"?[in sourcebans]
A page or two back, someone posted a link that leads to this post here.
Quote:
Originally Posted by Groger View Post
Open /pages/page.banlist.php

Find (line 385):
PHP Code:
$data['ban_date'] = SBDate($dateformat,$res->fields['ban_created']); 
Before add
PHP Code:
if('' == stripslashes($res->fields['player_name']) && $nameschecked 3) {
                
$new_name GetCommunityName($res->fields['authid']);
                if(
'' == $new_name) {
                        
$new_name 'Name not available';
                } else {
                        
$new_name addslashes($new_name);
                }
                
$GLOBALS['db']->Execute("UPDATE ".DB_PREFIX."_bans SET
                name='" 
$new_name "'
                WHERE bid='" 
$res->fields['ban_id'] . "'
                LIMIT 1"
);
                if(!
$nameschecked) {
                        
$nameschecked 0;
                } else {
                        
$nameschecked++;
                }
                
$data['player'] =stripslashes($new_name);
        } else {
        
$data['player'] = stripslashes($res->fields['player_name']);
        } 
Find (line 386) and remove it:
PHP Code:
$data['player'] = stripslashes($res->fields['player_name']); 
Credits go to Peacemaker
http://forums.interwavestudios.com/t...h__1#entry2510
Now I wasn't sure what this meant at first but my admin friend Neptune used that code and it worked for us. I didnt find the above explanation all that great, not to mention the part at the end where it says to remove the line, that line was slightly different in my current copy of SB.

Bottom line is this. If you use SourceBans, you can fix the "Name not available" problem by editing one of your SourceBan pages; specifically ...<your sourcebans folder>/pages/page.banlist.php as mentioned in the post above.

Find the line
PHP Code:
$data['player'] = stripslashes($res->fields['player_name']); 
which for me in my version of SB was actually
PHP Code:
$data['player'] = addslashes($res->fields['player_name']); 
also, this was line 800 something. no where near 380.

Anyways, delete that line and replace it with the code i quoted above. ie, This code.
Code:
if('' == stripslashes($res->fields['player_name']) && $nameschecked < 3) { 
                $new_name = GetCommunityName($res->fields['authid']); 
                if('' == $new_name) { 
                        $new_name = 'Name not available'; 
                } else { 
                        $new_name = addslashes($new_name); 
                } 
                $GLOBALS['db']->Execute("UPDATE ".DB_PREFIX."_bans SET 
                name='" . $new_name . "' 
                WHERE bid='" . $res->fields['ban_id'] . "' 
                LIMIT 1"); 
                if(!$nameschecked) { 
                        $nameschecked = 0; 
                } else { 
                        $nameschecked++; 
                } 
                $data['player'] =stripslashes($new_name); 
        } else { 
        $data['player'] = addslashes($res->fields['player_name']); 
        }
Note: on my version here i changed the last line to addslashes rather then stripslashes to match SB tho it prolly works the other way as well..
Also, that first line $data['ban_date'] = SBDate($dateformat,$res->fields['ban_created']); might have to go after that code block, not sure. If it doesnt work one way, swap it and it'll work the other way. Thats it, voila!

What the code does is it uses the steamID from the ban, to get the persons name from steam using the GetCommunityName function. Basically. Like I said I don't understand this stuff the best. Anyways, it doesnt just fix future bans, it actually attempts to fix all your existing bans where the name is "Name not available" or whatever.

Anyways, Hats off to the coder, & thanx to the original guy who pointed out the link in the first place. I'm just trying to explain it in a simpler manner for people like me who need a bit more of an explanation

Last edited by Sketchy; 02-07-2013 at 10:03.
Sketchy is offline
PresidentEvil
AlliedModders Donor
Join Date: Jun 2012
Old 10-28-2013 , 18:40   Re: Ban disconnected players
Reply With Quote #66

edit: nvm
__________________

Last edited by PresidentEvil; 10-28-2013 at 18:41.
PresidentEvil is offline
Groger
Veteran Member
Join Date: Oct 2009
Location: Belgium
Old 10-29-2013 , 04:29   Re: Ban disconnected players
Reply With Quote #67

Quote:
Originally Posted by Sketchy View Post
A page or two back, someone posted a link that leads to this post here.


Now I wasn't sure what this meant at first but my admin friend Neptune used that code and it worked for us. I didnt find the above explanation all that great, not to mention the part at the end where it says to remove the line, that line was slightly different in my current copy of SB.

Bottom line is this. If you use SourceBans, you can fix the "Name not available" problem by editing one of your SourceBan pages; specifically ...<your sourcebans folder>/pages/page.banlist.php as mentioned in the post above.

Find the line
PHP Code:
$data['player'] = stripslashes($res->fields['player_name']); 
which for me in my version of SB was actually
PHP Code:
$data['player'] = addslashes($res->fields['player_name']); 
also, this was line 800 something. no where near 380.

Anyways, delete that line and replace it with the code i quoted above. ie, This code.
Code:
if('' == stripslashes($res->fields['player_name']) && $nameschecked < 3) { 
                $new_name = GetCommunityName($res->fields['authid']); 
                if('' == $new_name) { 
                        $new_name = 'Name not available'; 
                } else { 
                        $new_name = addslashes($new_name); 
                } 
                $GLOBALS['db']->Execute("UPDATE ".DB_PREFIX."_bans SET 
                name='" . $new_name . "' 
                WHERE bid='" . $res->fields['ban_id'] . "' 
                LIMIT 1"); 
                if(!$nameschecked) { 
                        $nameschecked = 0; 
                } else { 
                        $nameschecked++; 
                } 
                $data['player'] =stripslashes($new_name); 
        } else { 
        $data['player'] = addslashes($res->fields['player_name']); 
        }
Note: on my version here i changed the last line to addslashes rather then stripslashes to match SB tho it prolly works the other way as well..
Also, that first line $data['ban_date'] = SBDate($dateformat,$res->fields['ban_created']); might have to go after that code block, not sure. If it doesnt work one way, swap it and it'll work the other way. Thats it, voila!

What the code does is it uses the steamID from the ban, to get the persons name from steam using the GetCommunityName function. Basically. Like I said I don't understand this stuff the best. Anyways, it doesnt just fix future bans, it actually attempts to fix all your existing bans where the name is "Name not available" or whatever.

Anyways, Hats off to the coder, & thanx to the original guy who pointed out the link in the first place. I'm just trying to explain it in a simpler manner for people like me who need a bit more of an explanation
That code was from 2 years ago or something, sb has been updated since than hence the reason why the line number etc was different

Thanks for the new code
Groger is offline
freestylebr
New Member
Join Date: Dec 2013
Old 12-21-2013 , 03:09   Re: Ban disconnected players
Reply With Quote #68

Great plugin, can someone help me to make this plugin works with this https://forums.alliedmods.net/showthread.php?t=191283, making it store the bans in my database?
freestylebr is offline
matrixmark
Senior Member
Join Date: Jun 2010
Old 12-21-2013 , 07:30   Re: Ban disconnected players
Reply With Quote #69

Quote:
Originally Posted by freestylebr View Post
Great plugin, can someone help me to make this plugin works with this https://forums.alliedmods.net/showthread.php?t=191283, making it store the bans in my database?
Use Sourcebans

It automatically stores them
__________________


Last edited by matrixmark; 12-21-2013 at 07:31.
matrixmark is offline
freestylebr
New Member
Join Date: Dec 2013
Old 12-21-2013 , 10:44   Re: Ban disconnected players
Reply With Quote #70

Quote:
Originally Posted by matrixmark View Post
Use Sourcebans

It automatically stores them
had some problems with sourcebans =(, isnt there a way to do that?
freestylebr is offline
Reply



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:05.


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