Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Sorc.Polgara on July 15, 2005, 08:07 PM

Title: Should I make multiple Hashes?
Post by: Sorc.Polgara on July 15, 2005, 08:07 PM
Ok, so I'm going to have like 2 bots try and connect simultaneously and they are both going to be locally hashing.  Since there is a chance that they will be hashing the files at the same thing, should I make two separate folders for hashes?

I'm thinking that there might be some conflict when each bot is trying to hash using the same files...

I'm in the process of thinking of all the possible mishaps that might occur in advanced.
Title: Re: Should I make multiple Hashes?
Post by: Tass on July 15, 2005, 08:13 PM
You can use hashes at the same time.. with one bot but I'd suggest making a object array of your winsocks and other things.
Title: Re: Should I make multiple Hashes?
Post by: Hdx on July 15, 2005, 08:14 PM
I haave never had any problems with this. I run, JBLS, TestBNCS, quite a few bots, all running off the same hashes (E:\Hashes\) You shouldnt get any errors, your just reading file, not writing to them or anything.
~-~(HDX)~-~
Title: Re: Should I make multiple Hashes?
Post by: Kp on July 15, 2005, 09:23 PM
Just remember to pass 0 for the third parameter to CreateFile when you open the files.
Title: Re: Should I make multiple Hashes?
Post by: Lenny on July 15, 2005, 11:17 PM
Would it be necessary to prohibit read access to a file while another handle is still open?
Title: Re: Should I make multiple Hashes?
Post by: MyndFyre on July 15, 2005, 11:22 PM
Quote from: Lenny on July 15, 2005, 11:17 PM
Would it be necessary to prohibit read access to a file while another handle is still open?

Only if the other file handle is open for write access.  You can cause synchronization issues if the file is being written-to.

I guess it's not a big deal in hashing scenarios (btw, for the record, FILES ARE NOT HASHES.  HASHES ARE VALUES CALCULATED BY PROCESSING THE FILES IN A PREDETERMINED MANNER.  It's like people are really Caboose (http://en.wikipedia.org/wiki/Red_Vs_Blue#Private_Michael_J._Caboose_.28Blue_Armor.29) and I just want to call them "Bluetard"), when you're just reading the files.
Title: Re: Should I make multiple Hashes?
Post by: Eric on July 15, 2005, 11:23 PM
If both bots are on the same server, you could simply cache the results from CheckRevision() and use them for the second bot.