Page 1 of 2
firepit - meat added 2x
Posted: Mon Aug 07, 2006 11:35 pm
by sky
added dung to project (133 grams)
added meat to project (150 grams)
meat (300 grams used of 150 grams needed)
dried dung (133 grams used of 133 grams needed)
ERROR: You need to use -150 grams of meat first.=
and I can't start to cook

Posted: Tue Aug 08, 2006 6:20 am
by Solutions Maximus
Cancel the project and start it again?
Posted: Tue Aug 08, 2006 6:23 am
by Spillages
Projects cannot be canceled when materials have been added.
Posted: Tue Aug 08, 2006 6:35 am
by Solutions Maximus
Oh, yeah, sorry. Completely didn't even think of that.
Posted: Tue Aug 08, 2006 6:42 am
by marol
Solutions Maximus wrote:Oh, yeah, sorry. Completely didn't even think of that.
LOL, you didn't work for your nick this time, did you...

Posted: Tue Aug 08, 2006 6:44 am
by Solutions Maximus
Um... yeah... that is to... keep people from being... jealous of me...?
And actually, the story behind the nick...
I originally meant to be Solutious Maximus, which I wanted for hidden comical reasons. But, of course, when I mis-typed (don't understand how I mis-typed so horribly, the different keys are on completely different rows) I decided to keep the nick because my dad says I have the solution to everything.

of course, he was being a jerk.
Posted: Tue Aug 08, 2006 6:53 am
by marol
When talking about your account details:
Location: 172.0.0.1
Didn't you mean 192.0.0.1?
Posted: Tue Aug 08, 2006 7:06 am
by Solutions Maximus
no... actually I meant 127.0.0.1
But, this also has a comedic history.
Posted: Tue Aug 08, 2006 8:08 am
by sky
Marol , any ideas?
I'm surprised that more meat can be added than the project calls for..... ....... would have thought there would be a restricting code or check for amount used not allowing more than the project requires to be added, something like:
(Pseudo Code)
If addedmeat > projectmeatgramsrequired then
"project only needs 150 grams"
else if addedmeat < projectmeatgramsrequired then
<add>
elseif addedmeat <1 then
"need to add minimum of 1 gram "
and so on.....
Perhaps there is a check like this and there is another reason for the glitch? First time I've seen more meat added than required.
Posted: Tue Aug 08, 2006 8:20 am
by marol
Sky, it seems simple for single user system. But in paralel systems two players can simultaneously use meat on project. So imagine such situation:
1. Player A - script checks if there's room for meat in project - yes, there is - continue.
2. Player B - script checks if there's room for meat in project - yes, there is - continue.
3. Player A - script adds 150 meat to the project.
4. Player B - scrpit adds 150 meat to the project.
See more of this probem here:
Wiki - Critial Section.
Posted: Tue Aug 08, 2006 8:26 am
by sky
I realize it can be complex.... the 'connection' was slower too so this also may be a factor. I did message Chris the details, should I message you my account details and character?
Posted: Tue Aug 08, 2006 8:54 am
by marol
You could have sent the details to me as well... Anyway - I fixed your project.
Posted: Tue Aug 08, 2006 9:03 am
by sky
Thanks Marol

Posted: Tue Aug 08, 2006 5:40 pm
by Antacid
Something like this happened to me once. I was grilling meat with dung, and I added the dung fine, and then added the meat, but when I went to work on it, it said I still needed to add the meat. I checked the project and it said that no meat was used on the project yet, even though in the events page it logged that I had added the meat. There weren't even any other meat grilling projects at that time. I didn't really care, I just added the meat again, since I had a ton, but it was kind of wierd.
Posted: Tue Aug 08, 2006 11:43 pm
by sem
marol wrote:Sky, it seems simple for single user system. But in paralel systems two players can simultaneously use meat on project. So imagine such situation:
1. Player A - script checks if there's room for meat in project - yes, there is - continue.
2. Player B - script checks if there's room for meat in project - yes, there is - continue.
3. Player A - script adds 150 meat to the project.
4. Player B - scrpit adds 150 meat to the project.
See more of this probem here:
Wiki - Critial Section.
Can't you lock the project before step 1? so the flow would become something like
1. Player A script acquires lock on project
2. Player A script checks if there's room for 150 meat in the project
3. Player B script waits on lock
4. Player A script adds 150 meat
5. Player A script releases lock
6. Player B script acquires lock
7. Player B script checks to see whether there's room for 150 meat - there isn't.
8. Player B script releases lock.
Or does the database not support transactions?