collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Persistent Whois cache with out-of-bot upgrading  (Read 54769 times)

0 Members and 2 Guests are viewing this topic.

Offline Dabaron

  • BeBot Apprentice
  • ***
  • Posts: 163
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #75 on: September 30, 2006, 12:14:20 am »
I made a database called aoglobal and put the whois table in there.  When I made the change that was suggested it now tries BeBot.aoglobal.whois instead of just aoglobal.whois.

Could it be because I added the info into the bot.php that you listed on the first page for the get_tablename?  I didn't think it would be linked to that since with the change that Glarawyn suggested it no longer references that function but I guess I could be wrong.

Offline neongen

  • BeBot User
  • **
  • Posts: 64
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #76 on: September 30, 2006, 05:10:06 am »
I'm trying to set this up with the .bat file but when i run the update.bat it display the text insted off execute it. even when i run the php w_update.php it only display the text insted off execute it.

I'm totally lost here  :-[

Offline Dabaron

  • BeBot Apprentice
  • ***
  • Posts: 163
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #77 on: September 30, 2006, 08:56:42 am »
Did you setup the correct info in the whois-update.conf?  It dosen't use the main bot settings, it uses whatever you have in there for the update.

Offline neongen

  • BeBot User
  • **
  • Posts: 64
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #78 on: September 30, 2006, 12:00:42 pm »
that was the first thing i did

Offline neongen

  • BeBot User
  • **
  • Posts: 64
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #79 on: September 30, 2006, 12:51:55 pm »
oki i found a way around it now  :)

just needed to do <?php insted of <?

and then add
Code: [Select]
extension=php_mysql.dll
extension_dir = "./"

as Alreadythere mentioned earlier

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #80 on: October 01, 2006, 12:27:08 pm »
oki i found a way around it now  :)

just needed to do <?php insted of <?
Guess you got strict mode (or whatever the name is) activated.
But going to change the tag in the next version I post, should be full tags anyways.

Offline neongen

  • BeBot User
  • **
  • Posts: 64
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #81 on: October 02, 2006, 10:39:43 pm »
hmm now i get annoyed over this, when i try to run to update file i get this error

oki first i got this error:
Quote
PHP Fatal error:   Maximum execution time of 60 seconds exceeded in C:\php\w_update.php on line 73
Quote
line 73:
mysql_query($query) or  die("Query failed : " . mysql_error());

then i tryed again and got this error insted
Quote
PHP Notice:   Undefined offset:   1 in C:\php\w_update.php on line 1
PHP Notice:   Undefined offset:   1 in C:\php\w_update.php on line 1
PHP Notice:   Undefined offset:   1 in C:\php\w_update.php on line 1
PHP Notice:   Undefined offset:   1 in C:\php\w_update.php on line 1
Query failed : Out of range value adjusted for column 'org_rank_id' at row 1
Quote
line 19:
$tmp = explode("</" . $tag . ">", $tmp[1]);

 ???

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #82 on: October 03, 2006, 12:10:17 am »
This toon with ' in lastname caused the whois update to fail: http://auno.org/ao/char.php?dimension=1&name=Lavisha

Fixed by adding lines in bold to the manual whois-update.php code.

line 41~
   $org = explode("<member>", $org);
   $org = str_replace("'", " ", $org);

line 91~
   $content = get_site("http://www.anarchy-online.com/character/bio/d/" . $dimension . "/name/" . strtolower($user['name']) . "/bio.xml");
   $content = str_replace("'", " ", $content);

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #83 on: October 03, 2006, 12:49:57 pm »
oki first i got this error:
Quote
PHP Fatal error:   Maximum execution time of 60 seconds exceeded in C:\php\w_update.php on line 73
Quote
line 73:
mysql_query($query) or  die("Query failed : " . mysql_error());
You have to set max execution time for your php parser I think (guess I should add it to the file). In many default settings php is only supposed to serve as webserver plugin. To stop bad code from running indefinitly php has a mechanism to abort after some pre-defined max execution time.[/]
I'll adapt the script as soon as I find time.

then i tryed again and got this error insted
Quote
PHP Notice:   Undefined offset:   1 in C:\php\w_update.php on line 1
PHP Notice:   Undefined offset:   1 in C:\php\w_update.php on line 1
PHP Notice:   Undefined offset:   1 in C:\php\w_update.php on line 1
PHP Notice:   Undefined offset:   1 in C:\php\w_update.php on line 1
Query failed : Out of range value adjusted for column 'org_rank_id' at row 1
Quote
line 19:
$tmp = explode("</" . $tag . ">", $tmp[1]);

 ???
Sadly got to admit I don't have a clue here, never had that problem myself.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #84 on: October 03, 2006, 12:56:00 pm »
This toon with ' in lastname caused the whois update to fail: http://auno.org/ao/char.php?dimension=1&name=Lavisha

Fixed by adding lines in bold to the manual whois-update.php code.

line 41~
   $org = explode("<member>", $org);
   $org = str_replace("'", " ", $org);

line 91~
   $content = get_site("http://www.anarchy-online.com/character/bio/d/" . $dimension . "/name/" . strtolower($user['name']) . "/bio.xml");
   $content = str_replace("'", " ", $content);
Never knew that you could use ' in names, so never bothered to escape the strings.

Best would be to mysql_escape_string() all strings in the update script as well as when adding entries in the bot module. Then when returning character information use stripslashes().

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #85 on: October 03, 2006, 05:30:20 pm »
* Best would be to mysql_escape_string() all strings in the update script as well as when adding entries in the bot module. Then when returning character information use stripslashes().

That's for your next version then Alreadythere :-)

-jj-

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #86 on: October 03, 2006, 05:32:34 pm »
Updated all files, links in first post:
  • set_time_limit(0); set, as long as save_mode isn't enabled the script won't be aborted due to too long execution time
  • update-script supports used defined addons after all updates are done, use the file whois-update.addon. As it's included it will create a warning if no file of the name exists, but it won't abort. Creating an empty file of the name will remove the warning.
  • mysql_escape_string() and stripslashes() added to remove errors with strange characters in names. First name, last name and org names are escaped.
  • Added some more information to the output when the update script is done
  • Modified the cache to use the same field names and order of fields in the table as the version shipped with the 0.3 branch. This is a purely database change, the names in the returned array haven't been changed. So no further modification to bebot files are needed besides replacing the WhoisCache.php. To avoid wrong behaviour of the cache you need to update the table! The SQL code below will do the actual updating, it's in a comment in the WhoisCache.phps file too. Replace whois with the name of your table. Depending on the size of the cache those update commands may take a few minutes to run.

Code: [Select]
ALTER IGNORE TABLE whois ADD id int(15) NOT NULL default '0' FIRST ;
ALTER IGNORE TABLE whois CHANGE name nickname VARCHAR(20) NOT NULL;
ALTER IGNORE TABLE whois ADD pictureurl VARCHAR(100) NOT NULL AFTER org_rank_id, ADD used BIGINT(25) NOT NULL AFTER pictureurl;
ALTER IGNORE TABLE whois ADD INDEX (used);
ALTER IGNORE TABLE whois ADD INDEX (updated);
« Last Edit: October 03, 2006, 06:23:51 pm by Alreadythere »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #87 on: October 03, 2006, 05:33:28 pm »
* Best would be to mysql_escape_string() all strings in the update script as well as when adding entries in the bot module. Then when returning character information use stripslashes().

That's for your next version then Alreadythere :-)
Lol, was just posting the update ;)

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #88 on: October 03, 2006, 06:19:14 pm »
Added line to add the ID field, missed that the old posted version didn't have that field yet.
Code: [Select]
ALTER IGNORE TABLE whois ADD id int(15) NOT NULL default '0' FIRST ;

Offline neongen

  • BeBot User
  • **
  • Posts: 64
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #89 on: October 03, 2006, 06:40:29 pm »
oki it is coming when i have one in my db there are not in an org

made a temporally fix where i set the org_rank_id to 7 if they are not in an org but it still comes with the error 4 times in a row
« Last Edit: October 03, 2006, 06:53:40 pm by neongen »

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 276
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal