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

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

Author Topic: Whois-cache update script  (Read 13714 times)

0 Members and 1 Guest are viewing this topic.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Whois-cache update script
« on: March 30, 2007, 01:29:53 pm »
This is a script that allows smart updating of the complete integrated whois cache in bebot 0.3 and higher. It will add and update the all members of all the orgs in the cache, as well as updating all orgless characters afterward. Stale entries that haven't been updated some time will be deleted.

After running the script outputs some statistical data.

To run the script put it into some directory (NOT the modules or core directories of the bot!), modify the .conf file to fit your needs and execute the script like every other php script (something along the lines of php whois-update.php. If there are entries in the cache it will update them. On empty caches it won't do anything.

The script to update the cache make sure this script is not in the modules or core directory!
Save as .php
The config file for the update script, add the infos here has to be in the same directory as the update script

PS: For a 0.2 version of this script and the cache check here

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Whois-cache update script
« Reply #1 on: March 30, 2007, 01:38:20 pm »
I've commited an optimized table structure for the whois cache to SVN today. It does exactly the same as before, just uses less memory to store the entries.

To update caches created with the old version use the following SQL query, just replace whois with the tablename you use if needed. Here is the ALTER query as text file for download.

Small warning: On large existing caches this query will take several minutes to run.
Code: [Select]
ALTER TABLE whois
DROP PRIMARY KEY,
DROP INDEX nickname,
ADD PRIMARY KEY (nickname),
CHANGE nickname nickname VARCHAR(15) NOT NULL DEFAULT '',
CHANGE firstname firstname VARCHAR(20) NOT NULL DEFAULT '',
CHANGE lastname lastname VARCHAR(20) NOT NULL DEFAULT '',
CHANGE level level TINYINT(3) UNSIGNED NOT NULL DEFAULT '1',
CHANGE gender gender ENUM('Female','Male','Neuter') NOT NULL DEFAULT 'Female',
CHANGE breed breed ENUM('Atrox','Nano','Opifex','Solitus') NOT NULL DEFAULT 'Atrox',
CHANGE faction faction ENUM('Clan','N/A','Neutral','Omni') NOT NULL DEFAULT 'Clan',
CHANGE profession profession ENUM('Adventurer','Agent','Bureaucrat','Doctor','Enforcer','Engineer','Fixer','Keeper','Martial Artist',
'Meta-Physicist','Nano-Technician','Shade','Soldier','Trader') NOT NULL DEFAULT 'Adventurer',
CHANGE defender_rank defender_rank ENUM('Able','Accomplished','Adept','Amateur','Backer','Beginner','Challenger','Champ','Common',
'Competent','Defender','Fair','Fledgling','Guardian','Hero','Intermediate','Medalist','Mediocre','Newcomer',
'None','Patron','Protector','Qualified','Starter','Student','Suited','Supporter','Talented','Trustworthy',
'Vanquisher','Vindicator') NOT NULL DEFAULT 'Able',
CHANGE defender_rank_id defender_rank_id ENUM('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19',
'20','21','22','23','24','25','26','27','28','29','30') NOT NULL DEFAULT '0',
CHANGE org_id org_id bigint(10) NOT NULL DEFAULT '0',
CHANGE org_name org_name VARCHAR(50) NOT NULL DEFAULT '',
CHANGE org_rank org_rank VARCHAR(20) NOT NULL DEFAULT '',
CHANGE org_rank_id org_rank_id ENUM('0','1','2','3','4','5','6','7','8','9','10') NOT NULL DEFAULT '0',
ADD KEY ID (ID),
ADD KEY Profession (profession),
ADD KEY Faction (faction),
ADD KEY OrgID (org_id),
ADD KEY Orgname (org_name),
ADD KEY Level (level),
ADD KEY Alienlevel (defender_rank_id);

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Whois-cache update script
« Reply #2 on: April 07, 2007, 03:30:06 am »
Suggest adding this to SVN along with usage instructions.
Should go into an extras/ folder :)
BeBot Founder and Fixer Kingpin

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Whois-cache update script
« Reply #3 on: April 07, 2007, 10:27:51 am »
Sure, I'll go add it with a README then.

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Whois-cache update script
« Reply #4 on: April 07, 2007, 11:18:51 am »
There's there could be a file containing upgrade instructions and version numbers.
To upgrade your bot you just locate your own version in the file and follow all instructions from that point to the version you're upgrading to

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Whois-cache update script
« Reply #5 on: April 07, 2007, 01:22:51 pm »
Sure, I'll go add it with a README then.
Perhaps it would be a good idea to update the wiki too.

Edit = I know I should preview before post.. :p
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Whois-cache update script
« Reply #6 on: April 08, 2007, 03:49:51 pm »
Added the script to SVN under extra/whois-update/ with a simple README file.

I'll try to get around to add a wiki entry too.

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


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 ]

* Who's Online
  • Dot Guests: 133
  • 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