From Bebot Wiki 2
Jump to navigationJump to search

In both AO and AOC, each character should be limited to 1000 contact in friend/buddy list.

This limitation is a problem :

- for a guildbot of an org with more than 1000 members

- for a raidbot with over 1000 subscribers

So how to bypass this issue ?

In Bebot 0.6.x :[edit]

- AOC => might use slaves module only (need testing)

- AO => can use slaves module OR AoCP solution (see below)

In short, you need to download file 02_Slaves.php within bot main folder and then add its config line(s) looking like :

    $slaves[] = array("account", "password", "Character);

More details in this archived topic

In Bebot 0.7.x :[edit]

- AO => must use AoCP solution ; in short, it's a scala proxy of several bots sharing bigger friendlist

- AOC => has a new tailored solution ; in short, each bot has a slave added to its config by a line looking like :

    $slave = "Character";

Both solution are detailed within 0.7 Readme from Git (official) or (sandbox)


If you choose this great solution, it may bring some rare but unwanted miscommunication issues, e.g. after a server downtime, that could occasionnally make the bot unable to speak with its proxy, or stucked at reboot, or proxy in error, etc.

The best way to fix any of these is to setup the bot and its proxy under a service each (linux prefered from far in this !) as explained on bottom of installation page

Once this is done and working, you should (1) set a module into the bot that helps proving it's is still online and alive plus (2) another croned server script that will check bot life proof every minute and possibly take measures in case of issue.

1: our suggested bot module is into Custom/Modules and is named HeartBeat.php ; just remove its initial _underscore to activate it and restart the serviced bot. From there the bot should update a .txt file of its own name at startup and then every 5 minutes.

2: from there you only need to cron the server life checker script. Cron would be like :

* * * * * /path/to/

And this executable (chmod +x) script should contain stuff as :

current=`date +%s`
last_modified=`stat -c "%Y" $file`
if [ $(($current-$last_modified)) -gt 999 ]; then
     /bin/systemctl stop botname.service;
     sleep 2;
     /bin/systemctl stop aocp.service;
     sleep 2;
     /bin/systemctl start aocp.service;
     sleep 2;
     /bin/systemctl start botname.service;

As you see, if after 16 minutes there's no proof of bot life, this script would cleanly close both bot then proxy, and then relaunch both proxy then bot (in that wanted stack order, with 2 seconds delay to make sure processes are loaded and ready to communicate).