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?
August 29, 2008, 09:10:56 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 885 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: 684



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: 1018


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: 1018


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: 684



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: 1018


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

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

Gender: Male
Posts: 149



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: 684



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: 1018


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
Dont get any TowerAttack ...
by Ziodberg
[Today at 06:15:35 PM]

Org Relaying
by Nytridr
[Today at 03:43:06 PM]

Auto reinvite not setting...
by Temar
[Today at 02:12:59 PM]

Link 2 Guilds via 2 Bots?
by Nytridr
[Today at 01:19:39 PM]

Question about Logon.php
by Temar
[Today at 07:17:13 AM]

MOTD module from 2.x to 4...
by Karsta
[Today at 04:14:55 AM]

Upcoming Channels
by Temar
[Today at 04:00:07 AM]

Reducing the load on a se...
by Alreadythere
[August 28, 2008, 03:29:35 PM]

Ported Modules
by krommel
[August 28, 2008, 12:01:19 PM]

Communication between gui...
by Temar
[August 27, 2008, 08:28:49 PM]
Stats
Members
Total Members: 949
Latest: pobo
Stats
Total Posts: 10356
Total Topics: 1406
Online Today: 20
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 2
Guests: 30
Total: 32
chamoul
Chakki

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.509 seconds with 29 queries. (Pretty URLs adds 0.029s, 4q)
Loading...