View Full Version : stealing oil I don't have
metal_noise
09-29-2005, 02:32 PM
Today I was attacked at the same time I bought some weapons, and ended up with negative 11,515,442 oil afterward.
oilfight
09-29-2005, 03:56 PM
the parts of the attack and buying functions that check how much money you had must have both run before either function deducted your money.
metal_noise
09-29-2005, 03:59 PM
Yes... do you consider that a problem?
oilfight
09-29-2005, 04:42 PM
I cant really imagine what I can do about it
it goes a little like this:
function 1:
1) this guy was attacked
2) hey how much money does this guy have
3) take away some of that money
function 2:
1) this guy wants to buy stuff
2) does he have enough money?
3) subtract that money
I don't really see where I can avoid this.
metal_noise
09-29-2005, 06:01 PM
I don't know exactly what environment the game is running under, but I'm sure there's something you could do with the database or semaphores or something to ensure that transactions are atomic. I've got a bit of programming experience, and if you think this is worth fixing I'd be happy to help out. Contact my by e-mail if you like.
Adam Bailey
oilfight
09-29-2005, 06:25 PM
I looked into it. There are two problems it seems.
First off you're right I could fix things by locking rows in the tables before using them.
Also, I found out that having > 2 billion oil doesnt work script-wide. It works in some parts and ****s up seriously in others. So until I can figure it out, I'm capping oil back at 2 billion.
sweetniterose_2005
09-30-2005, 09:18 PM
hahah..having negitve gold can actually work to your benifit as well, people who attack you will steal your dept, not oil.....therefor, in the long run your enemy has bought weapons for you. They also are a bit leary to visit you in the future! :evil: :evil:
quickplaya
10-01-2005, 12:46 PM
NO, this is not good. This opens up the possibility for cheating! I can get one of my STRONG friends to attack me at same time via the telephone! This needs to be changed.
*runs off to take advantage of bug*
*trips while running*
I think i will play the game right,,, but this won't stop other people.
oilfight
10-01-2005, 02:27 PM
is this still a problem?
I thought I got rid of the issue where you could steal massively negative amounts.
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.