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

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18365
  • 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 76656 times)

0 Members and 9 Guests are viewing this topic.

Offline lonillen

  • BeBot Rookie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #60 on: August 15, 2006, 09:41:33 am »
try reading http://bebot.link/index.php/topic,423.0.html

particularly you need to add the function define_tablename() to your Bot.php as Alreadythere mentioned there

Cheers

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #61 on: August 15, 2006, 09:44:50 am »
That's another of my functions for prefix and suffix for tablenames.

Add the following code behind the get_tablename function inside Bot.php, inside the Bot class:
Code: [Select]
function define_tablename($table, $pre, $suf)
{
  return $table;
}

It will solve the error.

And be sure to add the get_settings() function mentioned in my first post too.

Offline Jaqueme

  • BeBot Rookie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #62 on: August 15, 2006, 11:49:59 am »
Thanks for the help guys, I appreciate your patience   ;D

So I added the define_tablename function and put the module in the core folder. I also got a better handle on the correct syntax to search for, so was able to make the get_site changes as well.  The bot starts fine now, but when I do a whois from a tell or in orgchat I get the error:

[2006-08-15 09:31:45]   [TELL]  [INC]   Jaqueme: !whois cracknell

Fatal error: Cannot use string offset as an array in C:\BeBot2\core\WhoisCache.p
hp on line 68

C:\BeBot2>pause
Press any key to continue . . .


Did I miss a get_site entry?

Almost there...
« Last Edit: August 15, 2006, 02:23:07 pm by Jaqueme »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #63 on: August 17, 2006, 12:38:11 am »
I doubt that that error is in any relation to a get_site call.

I think it's an error or bug creaping up with arrays in some php version, because I have never seen that myself.

Sadly can't help you there myself, but I do remember it cropping up in some other modules too.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #64 on: August 17, 2006, 12:41:27 am »
Might be this
Eternalist
General of The Syndicate

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #65 on: August 17, 2006, 12:48:52 am »
Exactly that, yes.

Still using php4, so no experience there at all.

Offline Jaqueme

  • BeBot Rookie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #66 on: August 17, 2006, 06:58:17 am »
Ouch. Well, I tried re-building the bot with 4.1, but I get the php_sockets.dll not found error.  The standard fix for this is to upgrade to php5.1.4, which is what is causing the problem in the first place.  I tried editing the php.ini, but it returns the same error.  I tried flying the .dll's over from php5.1.4, but it won't recognise them because they are from php5.  And I am waaay too much of a noob to figure out how to code the corrections from the post Malosar referenced.

That sucks.  Several of the modules I was interested in depend on the Whois Cache.  The inability to communicate with IGN bots, however, is a severe limitation for my org.   :-[

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #67 on: August 17, 2006, 03:49:01 pm »
I've noticed the whois hasn't really been updating and the ingame command has been rather slow. So I checked the updatecache and found it was getting errors connecting to the AO site to pull down org member information. It was referencing community.anarchy.. etc however the main website references www.anarchy.... for the complete url to the xml of the org listing. So I changed it to that and it works fine.

btw if you plug the complete url with community.anarchy... etc then it times out with some python errors on the Ao site.
Eternalist
General of The Syndicate

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #68 on: August 17, 2006, 05:36:57 pm »
Thanks for that hint, modified the update script linked in the first post.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #69 on: August 21, 2006, 05:09:46 pm »
Seems either cname is having problems responding at times. I think FC might have put in temp blockers based on requests/sec possibly. I'm getting failures every night now. I'm increasing delaytime between requests from 100 to 1000msecs and see how it goes.
Eternalist
General of The Syndicate

Offline Dabaron

  • BeBot Apprentice
  • ***
  • Posts: 163
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #70 on: September 28, 2006, 12:14:42 am »
Ok, I've been using this for a while (love it by the way) and have done the adding stuff to the bot.php for the get_tablename stuff and everything, but not I'm wondering how you do it with multiple bots using one table (can either access from other bots database or setup a database for just the whois table and link them all, I don't care either way).

How exactly do I do that?  Been looking over the module and everything and I am just lost here

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #71 on: September 28, 2006, 08:45:26 am »
I've got all my bots using one database, so sharing the whois table is easy for me. My get_tablename("whois") simply returns "whois" in all bots. Of course one database only works for me as I have modified every single database call in the modules I use to get the names with get_tablename().

If you already got several bots running in different databases, you can just return dbname.whois, with dbname the name of the database containing your whois-cache.
If you only got one bot running yet I'd advise you to switch to bebot 0.3 branch, which does support prefixes for tablenames in default. The scheme used there is just slightly different to mine, but it will be supported in the future.

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #72 on: September 29, 2006, 05:23:33 pm »
It's really easy if you have bots with mutiple databases.

I created an aoglobal database for whereis and whois information.

All you need to do is grant your bot's MySQL username access to your aoglobal database, and edit Lines 60 and 104 in WhoisCache.php.

Code: [Select]
60: $lookup = $this -> bot -> db -> select("SELECT * FROM aoglobal.whoisRK1 WHERE nickname = '" . $name. "'");

104: $this -> bot -> db -> query("REPLACE INTO aoglobal.whoisRK1 (nickname, firstname, lastname, level, gender, breed, faction, profession,"

Some good ways to populate your whois cache quickly:
Run a large public raid bot. :p
Modify your tower attack module to use whois cache for whois data.

Offline Dabaron

  • BeBot Apprentice
  • ***
  • Posts: 163
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #73 on: September 29, 2006, 08:07:45 pm »
Yeah, my tower attack module is already setup to use it.  I have been using it for a while (have just over 56,000 entries in mine) but not wanting to use it for mutliple bots to save space/update time   ;)

This isn't working though.  Now when something tries to access the database it tries bebot.aoglobal.whois.  Its just appending the aoglobal.whois onto the bots current database so it isn't finding anything.
« Last Edit: September 29, 2006, 08:57:32 pm by Dabaron »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #74 on: September 29, 2006, 11:30:34 pm »
This isn't working though.  Now when something tries to access the database it tries bebot.aoglobal.whois.  Its just appending the aoglobal.whois onto the bots current database so it isn't finding anything.
Did you replace aoglobal with the database in which your whois cache is?

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 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: 369
  • 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