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: 2 bots, 1 db  (Read 3121 times)

0 Members and 1 Guest are viewing this topic.

Offline Agustino

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
2 bots, 1 db
« 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

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: 2 bots, 1 db
« Reply #1 on: March 15, 2007, 02:19:52 pm »
With 0.3 you can share the same DB over several bots, using prefixes for tablenames.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: 2 bots, 1 db
« Reply #2 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.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Agustino

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: 2 bots, 1 db
« Reply #3 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?

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: 2 bots, 1 db
« Reply #4 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.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

 

* 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: 256
  • 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