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

SourceBans 2.0 Alpha (2013/09/04)


Post New Thread Reply   
 
Thread Tools Display Modes
Sarabveer
Veteran Member
Join Date: Feb 2014
Old 02-17-2015 , 21:08   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #411

Quote:
Originally Posted by Phaiz View Post
This isn't a branch of 1.4.x - this is completely different.
I know this isn't a branch. I ain't stupid. This is more of a rewrite of SourceBans v2, and v2 was a rewrite of v1. 1.4.x branch of SourceBans is still the most reliable though. Peace-Maker is still updating the Google Code SVN from time to time.

Lets go back to watching anime.
__________________
Sarabveer is offline
Oo Alias oO
Member
Join Date: Apr 2010
Old 02-20-2015 , 17:41   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #412

Trying to figure out how to handle group community bans.

I can get the group information fine (users in their etc), and I could technically add bans to the database from there... However that only works for players at the time of adding, and still bans people who are no longer in the group if they leave.

I could store the group information too, and then for each user check whether they're in the group... However that means for each user connecting to the server, I'd have to query the steam servers rather than just the local database.

Any suggestions?
__________________

Last edited by Oo Alias oO; 02-20-2015 at 17:44.
Oo Alias oO is offline
JoB2C
AlliedModders Donor
Join Date: Jan 2014
Location: France
Old 02-20-2015 , 19:44   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #413

Quote:
Originally Posted by Oo Alias oO View Post
Trying to figure out how to handle group community bans.

I can get the group information fine (users in their etc), and I could technically add bans to the database from there... However that only works for players at the time of adding, and still bans people who are no longer in the group if they leave.

I could store the group information too, and then for each user check whether they're in the group... However that means for each user connecting to the server, I'd have to query the steam servers rather than just the local database.

Any suggestions?
I made this some times ago.

Here is how I did it:

- A simple MySQL database table storing a list of banned groups. The table just had an index, and the group ID (groupID64 form).
- PHP script taking a steam ID (steamID64 form) as a parameter. Printing nothing if the user does not belong to any banned group, printing the group name in the other case.
- A plugin querying the PHP script when a client connects, kicking him if he's a member of a banned group.

If you want the PHP script, here it is:

PHP Code:
<?php
$db_host 
"127.0.0.1";
$db_user "user";
$db_password "password";
$db_name "database";
$db_table "groupbans";

function 
findMemberInPage(&$url$uid) {
    
$xml simplexml_load_file($url);
    if (
$xml === FALSE || !property_exists($xml"members"))
        return (
FALSE);
    
$members = (array)$xml->members;
    if (!
array_key_exists("steamID64"$members) || !is_array($members['steamID64']))
        return (
FALSE);
    if (
in_array($_GET['uid'], $members['steamID64']) !== FALSE)
        return (
$xml->groupDetails->groupName);
    if (
property_exists($xml"nextPageLink"))
        
$url $xml->nextPageLink;
    return (
FALSE);
}

error_reporting(0);
header("Content-Type: text/plain");
if (empty(
$_GET['uid']))
    exit;
$database = new PDO('mysql:host='.$db_host.';dbname='.$db_name$db_user$db_password);
$query $database->query("SELECT `groupid` FROM `".$db_table."`;");
while ((
$result $query->fetch())) {
    
$groupName FALSE;
    
$url "http://steamcommunity.com/gid/".$result['groupid']."/memberslistxml/?xml=1&p=1";
    while (
$url !== FALSE) {
        
$groupName findMemberInPage($url$_GET['uid']);
        if (
$groupName !== FALSE)
            break;
    }
    if (
$groupName !== FALSE) {
        echo 
$groupName;
        break;
    }
}
$query->closeCursor();
$database null;
?>
This script currently does not support memberlist pagination, then on huge groups only 1000 players are considered.

I don't have the plugin anymore, but it's not a really big deal, you just need to convert the client's steamid to steamid64, use curl (or whatever) to query the PHP script (with the id as the 'uid' URL parameter) and fetch the result. If result if blank, do nothing. If not, you kick the client (and optionnaly use the group name in the kick reason).

PS: You could do everything from the PHP script directly in the plugin.

EDIT: I included a version which supports multiple pages. There are 0 optimizations, so it can be slow.

Since the steam ids seems to be returned in ascending order, an optimization to start with would be not to fetch pages in numerical order, but rather compare id values from the middle-page (would divide execution time by 2, no?).

Last edited by JoB2C; 02-21-2015 at 10:19.
JoB2C is offline
Oo Alias oO
Member
Join Date: Apr 2010
Old 02-21-2015 , 10:41   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #414

Quote:
Originally Posted by JoB2C View Post
I made this some times ago.

Here is how I did it:

- A simple MySQL database table storing a list of banned groups. The table just had an index, and the group ID (groupID64 form).
- PHP script taking a steam ID (steamID64 form) as a parameter. Printing nothing if the user does not belong to any banned group, printing the group name in the other case.
- A plugin querying the PHP script when a client connects, kicking him if he's a member of a banned group.

If you want the PHP script, here it is:

PHP Code:
<?php
$db_host 
"127.0.0.1";
$db_user "user";
$db_password "password";
$db_name "database";
$db_table "groupbans";

function 
findMemberInPage(&$url$uid) {
    
$xml simplexml_load_file($url);
    if (
$xml === FALSE || !property_exists($xml"members"))
        return (
FALSE);
    
$members = (array)$xml->members;
    if (!
array_key_exists("steamID64"$members) || !is_array($members['steamID64']))
        return (
FALSE);
    if (
in_array($_GET['uid'], $members['steamID64']) !== FALSE)
        return (
$xml->groupDetails->groupName);
    if (
property_exists($xml"nextPageLink"))
        
$url $xml->nextPageLink;
    return (
FALSE);
}

error_reporting(0);
header("Content-Type: text/plain");
if (empty(
$_GET['uid']))
    exit;
$database = new PDO('mysql:host='.$db_host.';dbname='.$db_name$db_user$db_password);
$query $database->query("SELECT `groupid` FROM `".$db_table."`;");
while ((
$result $query->fetch())) {
    
$groupName FALSE;
    
$url "http://steamcommunity.com/gid/".$result['groupid']."/memberslistxml/?xml=1&p=1";
    while (
$url !== FALSE) {
        
$groupName findMemberInPage($url$_GET['uid']);
        if (
$groupName !== FALSE)
            break;
    }
    if (
$groupName !== FALSE) {
        echo 
$groupName;
        break;
    }
}
$query->closeCursor();
$database null;
?>
This script currently does not support memberlist pagination, then on huge groups only 1000 players are considered.

I don't have the plugin anymore, but it's not a really big deal, you just need to convert the client's steamid to steamid64, use curl (or whatever) to query the PHP script (with the id as the 'uid' URL parameter) and fetch the result. If result if blank, do nothing. If not, you kick the client (and optionnaly use the group name in the kick reason).

PS: You could do everything from the PHP script directly in the plugin.

EDIT: I included a version which supports multiple pages. There are 0 optimizations, so it can be slow.

Since the steam ids seems to be returned in ascending order, an optimization to start with would be not to fetch pages in numerical order, but rather compare id values from the middle-page (would divide execution time by 2, no?).
Okay cheers - querying the steam servers each time though doesn't seem ideal.

Does anyone know what data can be sent when a player tries to connect? Or is it literally just their Steam ID? Also, does anyone know any users in 1k+ groups so I can test?
__________________

Last edited by Oo Alias oO; 02-21-2015 at 11:04.
Oo Alias oO is offline
Synthax
Member
Join Date: Mar 2015
Old 03-16-2015 , 03:51   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #415

So did this project die? It began 2 years ago and the latest update to the code was 7 months ago.
Synthax is offline
Sarabveer
Veteran Member
Join Date: Feb 2014
Old 03-16-2015 , 21:41   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #416

Its probably in limbo, cause I know the SB devs are active, they haven't updated this project yet.
__________________
Sarabveer is offline
SnapDragon
Member
Join Date: Feb 2015
Location: Under the bridge close t
Old 04-16-2015 , 06:50   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #417

Few ideas.
Not only bans, Add Kicks, Mutes, Gags, Warnings to this plugin and webpanel
IF you could add to this sourceban.sp to Temp. gags/mutes. [Ofcourse those also in webpanel]
Add Warnings. [And punishments are like kick, tempban.]
Also if you could make somekind of "Blocklist" so it will kick player with custom text.
In that text would be website where you can check your ban or if possible it show you how long are you still banned. Umm
Also like Bub bans. You can ban person for All your community servers. [Rootflag to this]

I hope you even read this. ;D
__________________
-----------------------------------------------
////////////////////////////////////////////////
<><><><><><><><><><><><><>
<><>Check bans.VikVek.com<><><><>
<><><><><><><><><><><><><>
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\
-----------------------------------------------

Last edited by SnapDragon; 04-16-2015 at 06:55. Reason: More stuff
SnapDragon is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-16-2015 , 07:12   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #418

Quote:
Originally Posted by SnapDragon View Post
Few ideas.
Not only bans, Add Kicks, Mutes, Gags, Warnings to this plugin and webpanel
IF you could add to this sourceban.sp to Temp. gags/mutes. [Ofcourse those also in webpanel]
Add Warnings. [And punishments are like kick, tempban.]
Also if you could make somekind of "Blocklist" so it will kick player with custom text.
In that text would be website where you can check your ban or if possible it show you how long are you still banned. Umm
Also like Bub bans. You can ban person for All your community servers. [Rootflag to this]

I hope you even read this. ;D
There is a sourcecomms port for sb2.0. For warnings, a plugin for sb 2.0 will be needed, kick and temp banning are possible via gameserver commands only for now.
__________________
WildCard65 is offline
Argos
Member
Join Date: Apr 2015
Old 04-30-2015 , 08:07   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #419

I have problems with the installation, the installer fails to create the administrative user. the database is created but the admin fails to be inserted. someone can help me to add this manually from phpmyadmin?
Argos is offline
shpakodin
Junior Member
Join Date: May 2015
Old 05-07-2015 , 05:45   Re: SourceBans 2.0 Alpha (2013/09/04)
Reply With Quote #420

I hope this project will rise again. But for now, is there any solution for ban and view steam profile from popup menu?
Are any other sourcebans stable versions available with all functions working (old or new)? Or maybe any other solution "like" sourcebans?

Last edited by shpakodin; 05-07-2015 at 05:46.
shpakodin 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 11:45.


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