In fog games, I can see the enemies' units before move one.
  • 7 posts
  • Page 1 of 1
jonasP wrote:
Hi,

since some weeks, I experience that games dont jump to the "begin turn" popup automatically after the last player joins (or I as the last player join).

Together with this, I experience a bug in 2-player fog games, which causes me to see the enemies' units at the beginning of the game.

I can reproduce it like this:

I join a 2-player fog game as second player. After joining, The map fills with my enemies' view of the map (which means I see his units, my units bordering to his units, but I can't see units of me which are not bordering to his territories).

After a manual refresh (or after some seconds) the map changes to my view, and the "begin turn" popup appears. From that point the game runs normally.

Browser: Chrome for Mac Version 33.0.1750.117. Didn't test it with other browsers.

Has anyone experienced the same or similar?
Matty wrote:
I'll try to fix this eventually (thanks for sending me a message about it), but right now I don't really have much spare time. Sorry.
"Strength doesn't lie in numbers, strength doesn't lie in wealth. Strength lies in nights of peaceful slumbers." ~Maria
jonasP wrote:
Thanks a lot. Just wanted to have you informed.

Tell me if you need more information.
Vexer wrote:
Matty this has to do with the randomizePlayerId function
Before the game starts his id is 2 but after randomizePlayerId it gets changed to 1.

The ajax play.php file is getting the player data for him the instant before randomizedPlayerId has set his new player id. So it thinks his id is still 2. But the divide territories randomly function somehow is able to finish before getTerriTroops is called and uses the old player id and shows him his opponents view.

Somehow he perfectly timed hitting the join game button milliseconds before the ajax update.

There's no obvious fix coming to mind. I'll have to think about it.
cbt711 wrote:
Is there a way to get feedback from the client side that turn order position has been assigned and the game has started, then you could hold the execution of ajax play.php back by a while loop, that breaks when said feedback satisfies some Boolean expression you can drive with the clientside feedback code.
(sorry for the laymen obviousness)
Vexer wrote:
Ok, I think I've fixed it now. The code was setting the game status from 'waiting for players' to 'active' as soon as the last player joined but before running the code to assign the turn order and divide the territories. I changed it to update the game status after doing those things so that if the game refreshes in between the time the last player has joined and the player id's have been reassigned it will still say the game hasn't yet started and show all question marks until the next refresh.

Thanks for the report, I just can't believe in all these years this is the first we've heard of it.
Matty wrote:
Thanks
"Strength doesn't lie in numbers, strength doesn't lie in wealth. Strength lies in nights of peaceful slumbers." ~Maria