BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Glarawyn on May 01, 2007, 11:25:17 pm

Title: 0.2 to 0.3/0.4 upgrade
Post by: Glarawyn on May 01, 2007, 11:25:17 pm
Has anyone thought about how to go about importing a BeBot 0.2 database into BeBot 0.3/0.4?

A quick look at the tables in one of the org bots I run...
admin_groups
admin_members
alts
auto_msg
guests
logon
members
news
org_city
raid_points
settings
tower_attack
tower_result
whois

whois: If a whois table exists I think it would be best to drop it and recreate if it doesn't match the whois table schema for 0.3/0.4.

admin_groups & admin_members: This could possibly be imported into security, but given the huge change my vote is to have users recreate their security from scratch.

alts: This should be imported.

auto_msg: Safe to ignore.

guests: Could go either way.

logon: Should be imported, perhaps give logon messages a player note class instead of it's own table?

members: Safe to ignore for org bots, but raid bots would want this imported.

news: Import.

org_city: Import.

raid_points: Import.

settings: Ignore.

tower_attack & tower_result: Import. (Could these be global tables for all bots?
Title: Re: 0.2 to 0.3/0.4 upgrade
Post by: Blueeagle on May 02, 2007, 12:50:41 am
I am thinking about an upgrade/setup script and I've been toying with the idea. That way the only thing you need to configure out-of-bot is ao-username/password and owner. It is possible to specify and save values for all other settings using in-game interface(s).

Wether or not this would be easier is another matter.

I am thinking a sequence like this.

* User modifies settings.conf.php setting the bot username, password and owner.
* User starts the bot and the bots logs in using those credentials
* When bot logs in it detects that it has not been set up and sends a tell to owner with a basic information screen that guides the owner trough setting up the mysql host, user, password. DB prefixes and guild if it's a guild bot or flexible access control if it's a raid bot.

In the last step here it's possible to detect old db schemaes (ie. detect the format of the old bot.conf file or such) and backup and upgrade as appropriate.

For this we should probably have a separate setup folder as some custom modules would probably like to have dedicated configuration screens in the bot. I am thinking a structure like:

setup/firstrun
setup/firstrun/bot.php   <= handles bot setup like default access control and modules to load/not load at startup
setup/firstrun/mysql.php <= handles the database stuff
setup/upgrade
setup/upgrade/bot.php <= this will determine if the bot is started for the first time after an upgrade (or something like that)
setup/upgrade/whois.php <= upgrade db schema
setup/upgrade/tower_attack.php <= or some other modules that needs processing during an upgrade.
setup/modules
setup/modules/irc.php <= irc relay setup script
setup/modules/colors.php <= set up colors
setup/processed <= after a setup step is completed the setup script might be moved here for safe keeping. Or another flag could be raised to detect setup has been done for the module instead


This will require a lot of work, and at the current pace it will take atleast three to four months for this to be tested and somewhat stable. Thus I am thinking this might be best left to 0.4 -> 0.6 or so.

Title: Re: 0.2 to 0.3/0.4 upgrade
Post by: Alreadythere on May 02, 2007, 10:01:02 am
tower_attack & tower_result: Import. (Could these be global tables for all bots?
Yes it is possible, you just have to make sure only one bot adds entries to the tables.

Perhaps there should be some script moving the 0.2 tables to the 0.3/0.4 versions. For some tables (guest, members) a true conversion is needed, for others like alts, raid_points, logon, news, org_city the tables just need to be renamed to prefix_oldname.

Making a script converting guests and members and renaming other needed tables based on the bot config files wouldn't be that hard really.
Title: Re: 0.2 to 0.3/0.4 upgrade
Post by: Khalem on May 06, 2007, 12:52:07 am
I propose having a "master" setting for use when there are multiple bots in a shared database. I'm not sure if there is anything else than the tower module that would benefit offhand.
SimplePortal 2.3.7 © 2008-2024, SimplePortal