Raised This Month: $ Target: $400
 0% 

MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]


Post New Thread Reply   
 
Thread Tools Display Modes
naris
AlliedModders Donor
Join Date: Dec 2006
Old 06-09-2008 , 20:07   Re: MySQL Banning - Single DB - Cover Multiple Servers
Reply With Quote #51

Quote:
Originally Posted by naris View Post
I modifed this plugin..
Oops -- I thought I attached the code to the message.

Here's the code:
Attached Files
File Type: sp Get Plugin or Get Source (mysql_bans.sp - 401 views - 25.3 KB)

Last edited by naris; 06-09-2008 at 20:14.
naris is offline
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 06-10-2008 , 04:43   Re: MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
Reply With Quote #52

updated and added notes to the first post!

Matt
__________________
MoggieX is offline
Send a message via Skype™ to MoggieX
bzz0
Senior Member
Join Date: Oct 2005
Location: Latvia, Riga
Old 06-10-2008 , 17:46   Re: MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
Reply With Quote #53

Nice one naris!

Anyone tested temp bans?
__________________
Let's make it better
bzz0 is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 06-12-2008 , 09:30   Re: MySQL Banning - Single DB - Cover Multiple Servers
Reply With Quote #54

Hi MoggieX,
nice to see you back again.

Quote:
Originally Posted by HSFighter View Post
HI @ all

PHP Code:
 DROP TABLE IF EXISTS `mysql_bans`;
CREATE TABLE IF NOT EXISTS `mysql_bans` (
  `
idint(11NOT NULL auto_increment,
  `
steam_idvarchar(32NOT NULL,
  `
player_namevarchar(65NOT NULL,
  `
ipaddrvarchar(24NOT NULL,
  `
ban_lengthint(1NOT NULL default '0',
  `
ban_reasonvarchar(100NOT NULL,
  `
banned_byvarchar(100NOT NULL,
  `
timestamptimestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,
  
PRIMARY KEY  (`id`),
  
UNIQUE KEY `steam_id` (`steam_id`)
ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=
I found 2 Problems with the Tablestructure!!

1.
steam_id is a UNIQUE KEY !!!
When i BAN 2 IP's on a LAN server the steam_id will be empty.
This is Impossible why the same steam_id can't wehre 2 time in the database even it is empty.
2 Times empty entry is with UNIQUE KEY is Impossible.

2.
there are "update CURRENT_TIMESTAMP" in the timestamp Column.
When i update a entry over a the webinterface the BAN date will switch to the current date.

I have fix the Database Tablestructure to this plugin in my Webinterface.
The Database will be automatic update to this changes when
your will install or Update the Webadmin to 1.9!
  • Delete "update CURRENT_TIMESTAMP"
  • Delete "UNIQUE KEY `steam_id` (`steam_id`)"
I hope the Plugin will run with this changes???
Can you change this in your Plugin and the SQL-Dumpfile?



-
__________________



Sorry for my very bad english
Greetings HSFighter
HSFighter is offline
Send a message via ICQ to HSFighter
naris
AlliedModders Donor
Join Date: Dec 2006
Old 06-12-2008 , 20:35   Re: MySQL Banning - Single DB - Cover Multiple Servers
Reply With Quote #55

Quote:
Originally Posted by HSFighter View Post
1.
steam_id is a UNIQUE KEY !!!
When i BAN 2 IP's on a LAN server the steam_id will be empty.
This is Impossible why the same steam_id can't wehre 2 time in the database even it is empty.
2 Times empty entry is with UNIQUE KEY is Impossible.
I also thought this was the case, until I checked thy mysql documentation http://dev.mysql.com/doc/refman/5.0/...ate-index.html and found that:

Quote:
A UNIQUE index creates a constraint such that all values in the index must be distinct. An error occurs if you try to add a new row with a key value that matches an existing row. This constraint does not apply to NULL values except for the BDB storage engine.
Quote:
Originally Posted by HSFighter View Post
there are "update CURRENT_TIMESTAMP" in the timestamp Column.
When i update a entry over a the webinterface the BAN date will switch to the current date.
THis isn't working for me. All my timestamps have been getting set to a date in 1969, I had to alter the code to specify CURRENT_TIMESTAMP in the INSERT statements (which I had to change to REPLACE so they work if you try to ban someone that had a temp ban before).
naris is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 06-13-2008 , 14:38   Re: MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
Reply With Quote #56

Quote:
A UNIQUE index creates a constraint such that all values in the index must be distinct.
An error occurs if you try to add a new row with a key value that matches an existing row.
This constraint does not apply to NULL values except for the BDB storage engine.
I found this Problem with importing ban's.
When i import 2 IP's the Steam cell is empty.
2 times empty give a SQL-Error on my webserver.
When it's set to NULL is it OK.

But :
Quote:
steam_id` varchar(32) NOT NULL,
I fix the problem simply to delete the index for steam_id
I will check @ delete the
NOT NULL I hope the Plugin can Handle NULL value in a cell???
__________________



Sorry for my very bad english
Greetings HSFighter

Last edited by HSFighter; 06-13-2008 at 14:42.
HSFighter is offline
Send a message via ICQ to HSFighter
naris
AlliedModders Donor
Join Date: Dec 2006
Old 06-15-2008 , 16:01   Re: MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
Reply With Quote #57

Quote:
Originally Posted by HSFighter View Post
I found this Problem with importing ban's.
When i import 2 IP's the Steam cell is empty.
2 times empty give a SQL-Error on my webserver.
When it's set to NULL is it OK.

But :
I fix the problem simply to delete the index for steam_id
I will check @ delete the
NOT NULL I hope the Plugin can Handle NULL value in a cell???
Actually you should delete the NOT NULL form the steam_id and ipaddr columns. Leave the index there.

The plugin should be OK with NULL values.
naris is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 06-15-2008 , 16:24   Re: MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
Reply With Quote #58

Quote:
Actually you should delete the NOT NULL form the steam_id and ipaddr columns. Leave the index there.

The plugin should be OK with NULL values.
OK
__________________



Sorry for my very bad english
Greetings HSFighter
HSFighter is offline
Send a message via ICQ to HSFighter
FredJed223
Senior Member
Join Date: Feb 2008
Old 06-25-2008 , 17:49   Re: MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
Reply With Quote #59

Hi when a banned player joins my server it notices they are banned, but does not kick them.. just says this with error checking on

Query String: <SELECT ban_reason, ban_length, TIME_TO_SEC(TIMEDIFF(ADDTIME(timestamp,SEC_TO _TIME(ban_length*60)),CURRENT_TIMESTAMP))/60 FROM mysql_bans WHERE steam_id = 'STEAM_
FredJed223 is offline
emotears
Junior Member
Join Date: Jun 2008
Old 06-29-2008 , 21:32   Re: MySQL Banning - Single DB - Cover Multiple Servers V3.0 [10 Jun 08]
Reply With Quote #60

i added the plugin works great, however i am having a problem, but not sure if its supported our not, but thought i would ask anyways.

the plugin and commands through the server work great, but with sourcemod webadmin if you delete or add bans from there it dosnt seem to be updating on the server to reflect the changes. Is there possibly something i have missed to get that part to work.

Last edited by emotears; 06-30-2008 at 01:57.
emotears 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 22:04.


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