L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 06, 2008, 09:48:34 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Feedback and Suggestions > Topic: Broken blacklist table
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Broken blacklist table  (Read 900 times)
0 Members and 1 Guest are viewing this topic.
Tichy
Rookie
**
Offline Offline

Posts: 42



Broken blacklist table
« on: November 25, 2007, 07:33:56 PM »

The blacklist module contains a bad SQL statement on table creation. There is missing a comma:

Quote
CREATE TABLE blacklist (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30) NOT NULL,
noteid INT NOT NULL,
expire INT UNSIGNED DEFAULT 0,
INDEX expire (expire))");

On new bots, there will be no blacklist table created and the bot spams (as posted by Phan):

Code:
MySQL error (# 1) on query: SELECT * FROM ccbot_blacklist WHERE expire > 0 AND expire < 1195581650
Table '****_aobot.ccbot_blacklist' doesn't exist

Fixing just the create statement is not enough for new bots already started with the broken statement, the will never create a new table. So the attached patch defines a new table version and tries to create the table on upgrading from the last one. The new table update order is:

New bots           : 3
Broken 0.4.3 bots: 2 -> 3
Pre 0.4.3 bots     : (0->)1->3

Only broken 0.4.3 bots should do an upgrading on the old table version 2 by creating the missing table.
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 700



WWW
Re: Broken blacklist table
« Reply #1 on: November 25, 2007, 11:13:38 PM »

The table should try to create even if setting was saved
this is from 0.5.0 but im asuming it same
Code:
elseif (mysql_num_rows(mysql_query("SHOW TABLES LIKE '%blacklist'"))==0)
{
//in some cases the setting does exist even if the table does not so create the table and change the version
$this -> new_table();
$this -> bot -> log("BLACKLIST", "CREATE", "Created a table version 2.");
$this -> bot -> settings -> save("Blacklist", "table_version", 2);
}
Logged
Tichy
Rookie
**
Offline Offline

Posts: 42



Re: Broken blacklist table
« Reply #2 on: November 26, 2007, 03:55:34 AM »

This is a very bad idea to do it this way. I have multiple bots running on the same database (so they share at least the whois table). Every bot has his own blacklist table. If I run a 0.5 bot on the database once or have older bots already created a blacklist table, no missing tables for other bots will be created. To do it this way, there must not be an LIKE statement used.

But I think this is not the right way todo it, since the MySQL class should abstract the database interface.
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1022


Re: Broken blacklist table
« Reply #3 on: November 26, 2007, 04:27:29 AM »

Backported the trunk version for the moment, I just made sure that the full tablename is used in the like statement.
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1022


Re: Broken blacklist table
« Reply #4 on: November 26, 2007, 07:15:06 AM »

Streamlined the updating a bit.

Most current version, save as .php into modules/
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 700



WWW
Re: Broken blacklist table
« Reply #5 on: November 26, 2007, 01:01:57 PM »

how come this module if done so diferently?
all other module have a Create Table at top
and an update function if needed
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1022


Re: Broken blacklist table
« Reply #6 on: November 26, 2007, 01:07:12 PM »

Ask Glara, he wrote it.
Logged
clashbot
Experienced
****
Offline Offline

Gender: Male
Posts: 153



Re: Broken blacklist table
« Reply #7 on: January 26, 2008, 07:28:12 PM »

hey, probably a dumb questions, but how do I install the patch, got the bot up and running, and I am getting the spam about the blacklist table not there...but not sure what I need to do with the patch file.
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 700



WWW
Re: Broken blacklist table
« Reply #8 on: January 26, 2008, 11:50:32 PM »

Just remove the Module
and use !ban
it is already set as removed and wont be in next release
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1022


Re: Broken blacklist table
« Reply #9 on: January 27, 2008, 02:53:09 PM »

Quote from: clashbot on January 26, 2008, 07:28:12 PM
hey, probably a dumb questions, but how do I install the patch, got the bot up and running, and I am getting the spam about the blacklist table not there...but not sure what I need to do with the patch file.
The file got renamed in the SVN. Try the link below.

Most current version, save as Blacklist.php into modules/
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 391



Re: Broken blacklist table
« Reply #10 on: January 28, 2008, 11:53:03 AM »

Quote from: Alreadythere on November 26, 2007, 01:07:12 PM
Ask Glara, he wrote it.

I didn't write it, I tried to fix it and apparently failed along the way somewhere. Wink

I was going to remove it but that started a big debate on blacklist vs ban terminology....

 Grin
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Feedback and Suggestions > Topic: Broken blacklist table
« previous next »
 
Jump to:  

Recent
Security
by Alreadythere
[Today at 10:02:42 AM]

Probs with relay from gue...
by Temar
[Today at 09:03:06 AM]

Raid spam in guild chat
by Temar
[Today at 09:01:18 AM]

Org Relaying
by Nytridr
[Today at 01:34:35 AM]

Link 2 Guilds via 2 Bots?
by Temar
[September 05, 2008, 04:22:40 PM]

SVN download
by clashbot
[September 05, 2008, 05:12:59 AM]

TWC
by Temar
[September 05, 2008, 12:27:23 AM]

How to find the guild ID?...
by Irinir
[September 03, 2008, 02:58:54 PM]

Deactivate Autoadding mem...
by Temar
[September 03, 2008, 02:49:01 PM]

0.4 Modules in 0.5 -- fou...
by Temar
[September 03, 2008, 11:06:42 AM]
Stats
Members
Total Members: 961
Latest: daltarak
Stats
Total Posts: 10408
Total Topics: 1412
Online Today: 15
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 2
Guests: 19
Total: 21
GBH
Jlee

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.738 seconds with 29 queries. (Pretty URLs adds 0.119s, 4q)
Loading...