View unanswered posts | View active topics It is currently Sun May 26, 2013 8:11 am



Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
 News as of 1/31 
Author Message
The Team

Joined: Tue Nov 17, 2009 11:27 pm
Posts: 50
Post News as of 1/31
I apologize, its been a while. Was experimenting with some code on the bot. But nothing worth reporting, except for...

Auto-Update: As of right now I have a working demo and so far it's been working well. I've pretty much used the old version as a guide and rewrote both the server side and client side. Insead of using php's file_get_contents() function (I believe 100 files would open 100 connections) the update client will now push a bunch of file requests into a single connection. This should (hopefully) make the update server not work so hard. ;) Also did some reading up on Zlib, so now most of the files on the update server are gzip'd. (The 3.75meg items table is about 375k compressed.) The update client on the bot will download, decompress, (make backup if exists), and place the updated file where it has to go.

Only problem I still have to work out is managing several bots sharing the same directory. When a bot is updating, other bots should be blocked from the process. Also when the update is completed, might have to tell the other bots 'hey, go reboot!' because some updated files could be used immediately, and others wouldn't be used until the bot reboots.

Other then that, can't wait to see how well the update server can handle 100, or 300 or even 500 update requests. (Or 20 people with 500 updates! muhahaha) :twisted:

-Lucier


Mon Feb 01, 2010 3:59 am
Profile
Site Admin
User avatar

Joined: Tue Nov 17, 2009 7:11 am
Posts: 117
Location: Australia Mate :)
Post Re: News as of 1/31
:oops: eep! .. lol

_________________
Image
CaptainZero (RK1) - Level 220/22 Engineer
Zerocharm (RK1) - Level 205/12 Bureaucrat
-----------------------------
http://scifimmorpg.com
http://my-trivia.net


Mon Feb 01, 2010 4:06 pm
Profile
Site Admin

Joined: Mon Nov 23, 2009 11:19 pm
Posts: 229
Post Re: News as of 1/31
Lucier wrote:
Only problem I still have to work out is managing several bots sharing the same directory. When a bot is updating, other bots should be blocked from the process. Also when the update is completed, might have to tell the other bots 'hey, go reboot!' because some updated files could be used immediately, and others wouldn't be used until the bot reboots.


2 suggestions (remember from a non coder lol)

1/ Make one bot in the connections the 'LEAD' bot, that way only it does the update and then sends out instructions for reboots...

2/ Make a control bot (slightly different idea to my thinking), all it does is manage the databases and updates, again, it gives instructions to the others...


Mon Feb 01, 2010 11:14 pm
Profile
The Team

Joined: Sat Jan 09, 2010 1:32 am
Posts: 1543
Post Re: News as of 1/31
maybe a flag in the config.php.

$settings['enable_auto_update'] = true|false;

with instructions to the bot admin to only enable it on one bot per db.

Or if other things are gonna need only one bot doing them in the future, you could have a more generic setting that determines which bot is the lead bot, as snakebite suggested.

$settings['is_master_bot'] = true|false;

and only run the update when that is set to true, etc.

_________________
FC fail http://www.anarchy-online.biz/Tyrence1.html
"Nearly all men stand adversity, but if you want to test a man's character, give him power." — Abraham Lincoln
Budabot Releases and Downloads: http://code.google.com/p/budabot2/downloads/list


Tue Feb 02, 2010 12:51 am
Profile
The Team

Joined: Tue Nov 17, 2009 11:27 pm
Posts: 50
Post Re: News as of 1/31
Hmmm. one problem I see with that setup, is if you are running say.. 6+ bots, and some of them you don't care about as much as others. What if you forget that the bot you lost interest was, was the one you picked to do the auto-update? If you run multiple bots, you'd have to keep checking which bot is running the updates.

The dirty way I was thinking of doing this, was to throw a file into the update directory. (update directory holds the update.php file that runs the whole update deal, and would hold all the backup changes, and hold the gzip files it downloads to decompress em.) If when any bot starts the update, it will write a 'NOW_UPDATING_SO_DONT_UPDATE_PLEASE!.txt' file into the update directory. when other bots start to do an update, and see the file, they will get scared away and not update. heh That way, any bot that is running 'could' update on their own, and other bots would be blocked from doing it.

As for other bots rebooting when the update is finished..... I'm still planning that one out. I'm hoping that with each bot running, they can get their own PID (Process IDentifier) they can write it down in a file in their own config directory when they are running. Then the bot doing the auto-updater, can reset all other bots by checking those PID files and kill those bots.

Again, I still have to read up on getmypid() and posix_kill() and test them out or look for other similar functions.


Tue Feb 02, 2010 10:00 pm
Profile
Site Admin

Joined: Mon Nov 23, 2009 11:19 pm
Posts: 229
Post Re: News as of 1/31
All of those sound like they'd work...


Tue Feb 02, 2010 10:31 pm
Profile
The Team

Joined: Sat Jan 09, 2010 1:32 am
Posts: 1543
Post Re: News as of 1/31
I see what you are saying, and your idea would be more automatic for sure. But to implement it would be more work. You'd probably want to handle the case where the update times out or the bot gets reset in the middle of an update, or basically any case where that file that tells the other bots to not update doesn't get deleted like it should.

I would consider the amount of extra work to do it that way versus the amount of people who would benefit from it (eg, the people with 6+ bots).

Also, maybe we should think about the auto update itself and not make it "auto" and instead let it update in response to a command. Then people with 6 bots can just send the update command to whichever bot they want. And they can manually restart their bots when it's done.

It's not as cool, but I think people would not want their bots restarting automatically during a raid or whatever. And if someone went wrong, you'd want the bot admin there to get the bot running again.

My vote would be to have the update run in response to a command. Then a lot of these issues and questions we're having about it you wouldn't even have to deal with. You could even try it out without the automatic part, and then if you still want it automatically add it later. I don't think doing it in two steps like that would be any more work than doing it all at once.

_________________
FC fail http://www.anarchy-online.biz/Tyrence1.html
"Nearly all men stand adversity, but if you want to test a man's character, give him power." — Abraham Lincoln
Budabot Releases and Downloads: http://code.google.com/p/budabot2/downloads/list


Wed Feb 03, 2010 12:08 am
Profile
Site Admin

Joined: Mon Nov 23, 2009 11:19 pm
Posts: 229
Post Re: News as of 1/31
Ok, I dunno if this would work, but, as I see it, this is the most obvous system...

Henseforth, make all your bots run from the same root folder, in which is an update exe, hit the exe & it checks for an update, if there isn't one, nothing happens, if there is one then it updates all the bots in that folder.

Follows is a flow diagram of what I'm talking about...

Root Folder with controls and the update exe >>
Individual bot folders >>
Bot files


Wed Feb 03, 2010 11:32 pm
Profile
The Team

Joined: Sat Jan 09, 2010 1:32 am
Posts: 1543
Post Re: News as of 1/31
yeah, that's the same as my idea except in your case, you'd run an exe file (from windows) and in my case you'd send a command to a bot. but they'd both be manual as opposed to automatic...which I think would be best.

_________________
FC fail http://www.anarchy-online.biz/Tyrence1.html
"Nearly all men stand adversity, but if you want to test a man's character, give him power." — Abraham Lincoln
Budabot Releases and Downloads: http://code.google.com/p/budabot2/downloads/list


Thu Feb 04, 2010 12:44 am
Profile
Site Admin

Joined: Mon Nov 23, 2009 11:19 pm
Posts: 229
Post Re: News as of 1/31
I have to admit to never realy liking auto updates on my programs, they're ALL switched off lol.


Fri Feb 05, 2010 3:58 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
Translated by Maël Soucaze © 2009 phpBB.fr