Bug: WOA

Post bugs or suggestions to the game here. Or discuss development topics.
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

Devari wrote:
Nuclear Raunch wrote: And does this thing happen often enough that I could experience it easily by creating a test account?
I've got a very sketchy guess that only accounts from the "original" WOA are affected. So a test account wouldn't do the trick.
Revive an old dead account from that time to use as a test account.
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

We did. They're all alive after some black magic. But my voodoo may have been mis-cast.
:wq
User avatar
Devari
Mr. -1
Posts: 3194
Joined: Wed Mar 10, 2004 5:02 am
Location: British Columbia, Canada

Post by Devari »

It seems like quite a few accounts got hit last night around 5:09 am PDT. I'm fairly sure it wasn't a case of everyone logging in at the same time...

I've got some test data that was emailed to me by the game. I need to get some more sleep now, though, so I'll deal with it when I get up. All the accounts affected are recorded in my email, though, so I'll figure out a fair way to reimburse everyone for turns lost.

An important note is that it did NOT just affect "revived" players.

But I'm too tired to type anymore right now. I'll take a shot at it in a few hours.
If you go down to the woods today, you better not go alone
It's a lovely day in the woods today, but safer to stay at home
BECAUSE EVIL FREEN IS KILLING ALL THE TEDDY BEARS AT THEIR PICNIC
User avatar
Devari
Mr. -1
Posts: 3194
Joined: Wed Mar 10, 2004 5:02 am
Location: British Columbia, Canada

Post by Devari »

A final note to self: One person affected was on vacation. Why are vacationed players getting turns, anyway? There seems to be no check against that in the code. That needs to be fixed.
If you go down to the woods today, you better not go alone
It's a lovely day in the woods today, but safer to stay at home
BECAUSE EVIL FREEN IS KILLING ALL THE TEDDY BEARS AT THEIR PICNIC
User avatar
Slasher
The FAF Forums SMEGHEAD!!! lol
Posts: 2635
Joined: Mon May 03, 2004 5:08 pm
Location: http://florida4us.com/
Contact:

Post by Slasher »

Yeah, I wondered that too, on BfR I have full turns, yet I am in vacation mode
I do not have a signature, you must be imagining

http://florida4us.com/

Image
User avatar
Ruddertail
Promi Diplomacy ate my homework...
Posts: 4510
Joined: Wed May 12, 2004 11:39 pm
Location: Chances are, playing FAF.
Contact:

Post by Ruddertail »

May 22 '07, 19:38

90 turns. If that helps.
Empires:
WOA: Attila the Hun(#13)
BFR: ?
Founder and Leader of Hungry Huns (HH)
User avatar
Nuclear Raunch
The Wanderer
Posts: 950
Joined: Tue May 24, 2005 4:30 am

Post by Nuclear Raunch »

Ruddertail wrote: May 22 '07, 19:38

90 turns. If that helps.
13:30-13:44 game time, 6:30-6:44 PST

The only other 2 incidents that I know of came around 8-8:30 PST, I was halfway wondering if it was lost packets somewhere since that's a busy internet time, still could be I guess since 6:30 PST still corresponds with a lot of East Coast people getting to work and checking their email etc...
I know the voices in my head arn't real but they usually have some pretty good ideas.
User avatar
Devari
Mr. -1
Posts: 3194
Joined: Wed Mar 10, 2004 5:02 am
Location: British Columbia, Canada

Post by Devari »

M'kay, another night's automated emails to me reveal the problem:

Somehow, for some reason, $config is undefined/zero for one run of the fakecron. When that happens, $user[turns] > $config[maxturns], so $user[turns] is set to $config[maxturns], which is actually 0. All the user's turns are then put into stored turns. Theoretically, they should be rounded off. And they are; to 0. All the accounts affected have absolutely 0 stored turns. Therefore, the problem must be that $config is actually completely undefined at some point.

Turn bank is not affected, insofar as I can see, for one good reason:

$times = floor(($time-$user['turns_last'])/(60*$config['bankperminutes']));

This just becomes division by zero, insofar as I can see, when $config is undefined. Therefore, $times will never by greater than 0, so it won't try and run any turnbank code. However,, the accounts that get hit with this strange bug might not get some turnbank turns that they should...

So, we know what the problem is that causes the turns to go to 0. But why does it occur? And why only on WOA? Is it because it's the first server? Is it due to the merging, for some reason? And why on earth is $config not defined for some runs of the fakecron?
If you go down to the woods today, you better not go alone
It's a lovely day in the woods today, but safer to stay at home
BECAUSE EVIL FREEN IS KILLING ALL THE TEDDY BEARS AT THEIR PICNIC
User avatar
Devari
Mr. -1
Posts: 3194
Joined: Wed Mar 10, 2004 5:02 am
Location: British Columbia, Canada

Post by Devari »

It comes to mind that a quick hack to stop the bug from actually killing all the turns of an account would be to simply only run the fakecron is $config is defined. But that's hardly the ideal solution...
If you go down to the woods today, you better not go alone
It's a lovely day in the woods today, but safer to stay at home
BECAUSE EVIL FREEN IS KILLING ALL THE TEDDY BEARS AT THEIR PICNIC
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

I would make this change as a test:

code: Select all

$times = floor(($time-$user['turns_last'])/(60*$perminutes));
Change to:

code: Select all

$times = floor(($time-$user['turns_last'])/(60*$config['perminutes']));
The reason being is that its not $config that is not being defined, but $perminutes.
User avatar
Kraken
MLR
Posts: 1522
Joined: Tue Apr 12, 2005 2:59 pm
Location: Tennessee USA hooah!
Contact:

Post by Kraken »

:(
all about FAVRE, come on...you know you want to click it

..."I'm sorry, but I really can't see anything redeeming in your philosophy other than that dinosaurs are cute."
~Beatles

The Kraken, which is found primarily in Scandinavian myth, was a huge sea creature. It was said to lie at the bottom of the sea for a long time and then it would rest at the surface....Like the Midgard serpent in the Norse myths, the Kraken was supposed to rise to the surface at the end of the world.
User avatar
Slasher
The FAF Forums SMEGHEAD!!! lol
Posts: 2635
Joined: Mon May 03, 2004 5:08 pm
Location: http://florida4us.com/
Contact:

Post by Slasher »

75 turns, Last run was over 14 hours ago, Currently logged in as Slasher is Back (#602)
I do not have a signature, you must be imagining

http://florida4us.com/

Image
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

Ah, I have it.

When the server argument is invalid, such as in:
http://frostnflame.org/?top10&srv=14

The game defaults to displaying server 1, but config.php is not called correctly. The game used to return a blank page in such cases, but I changed that behaviour for some reason. (I am sorry if I just wiped everyone's turns.)

Presumably some web crawler would occasionally hit an invalid URL such as that and break it. In the ME code, it might still be die()-ing correctly in that case. Now I am off to fix it.

[edit] OK, it should now be fixed. I'm off to give everyone max turns as a celebration and to fix anything I've messed up. Let's see if this takes care of market issues as well.

[edit2] Further proof, if necessary -- everyone now has 3 turns. I will add 447 to that. :)

A big thanks to Devari for tracking the issue down!
:wq
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

Good job Devari. That was a tough one to nail down.

User avatar
Devari
Mr. -1
Posts: 3194
Joined: Wed Mar 10, 2004 5:02 am
Location: British Columbia, Canada

Post by Devari »

Hurrah and huzzah! I'm just glad this bugger of a bug is finally fixed! :D
If you go down to the woods today, you better not go alone
It's a lovely day in the woods today, but safer to stay at home
BECAUSE EVIL FREEN IS KILLING ALL THE TEDDY BEARS AT THEIR PICNIC
Post Reply
  • Members connected in real time

    🔒 Close the panel of connected members