BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Agustino on March 15, 2007, 02:02:28 pm

Title: 2 bots, 1 db
Post by: Agustino on March 15, 2007, 02:02:28 pm
Hi.

I was woundring if it i possible to run 2 raid bots off the same database?

How much does the bot cache while running a raid (if it does at all)?

I guess I'm asking if anyone can see anythink that might corrupt the database while running 2 raid simultaneously?

\\ Agustino
Title: Re: 2 bots, 1 db
Post by: Alreadythere on March 15, 2007, 02:19:52 pm
With 0.3 you can share the same DB over several bots, using prefixes for tablenames.
Title: Re: 2 bots, 1 db
Post by: Blueeagle on March 16, 2007, 12:27:13 am
To elaborate on that.

In 0.3.svn you can specify a prefix for each bot. This prefix is used to all bot-spesific settings however the whois cache is shared by the two bots as is the color table (not the schema).

On 0.2 you need to create another database (if your hosts allow it) The alternative is to go trough all $this -> bot -> db ->* statements and change them to use different tables (NOT RECOMENDED)

If you attempt to run two 0.2 bots in the same database any members added to one bot will be added to the other bot aswell as it does not have a method of destinguishing which bot a member belongs to. Thus anything that's put into the db by one bot would be seen by the other bot as something it has put in there like raid points, alts and so on (if such applies to raid bots).

Hope that helps.
Title: Re: 2 bots, 1 db
Post by: Agustino on March 19, 2007, 10:52:18 am
What i relay want is to run raidbots with the extact same roster...

The idea is to have a backup bot on the same external database. So, 2 servers running one bot each, and an database running on a database server from, for example, a webhosting company that are reliable enough to be up 99.9% of the time.. That way you can have an up to date backup bot, and more importantly, raids run on the backup does not have to be manually entered in to the main bots database.

But my question is, how much is cached in memory on the server running the bot during a raid? and if one were to run raids on both bots at the same time could that corrupt the database?
Title: Re: 2 bots, 1 db
Post by: Blueeagle on March 19, 2007, 01:24:00 pm
Note: The following has not been tested but is what I have found by looking (briefly) at the code for 0.2 raid system.

In general very little is held in memory.

Raid points for time attended is allocated during the raid and written to the database every minute or so. MySQL has got inherent locks that prevents two bots to mix eachothers data up by opening the same table at the same time.

However the way the raid module works prohibits running two raids on different bots on the same database at once because:
A) The assumption has been made in code that only one raidbot is using the database
B) A participant in one raid while two raids are open in separate bots would recieve a double amount of raid points because of the way raidtime works.
C) When one of the two bots closes the raid all participants in the other raid will stop recieving points over time and may even be kicked from the other raid.

To allow two bots to run separate raids on the same database would require very much work. Especially for the 0.2 branch. The bot-prefixing of 0.3.svn would make this much easier because the attendant of each raid would be separate but the number of raidpoints could be held in a common table.

Note that I say _could_ because I don't see it as likely that this will be implemented in the nearest future.

I hope that helps.
SimplePortal 2.3.7 © 2008-2024, SimplePortal