wesnoth/wesnoth — pull request #148 by cbeck88 (2014-04-14 15:12:07+00:00)
Title: Fixup ready block

*** Experimental ***

gfgtdf reports a bug in which when a reloaded game occurs, if a reserved side is replaced manually with a network player, the ready button blocks "waiting for faction..." even though no one is choosing a faction. I believe that I tested this and it worked at an earlier version, nevertheless after reviewing the code I decided that I should try to make *exactly* the same test on the host as is used by the client when deciding whether to show the faction selection dialog, instead of what I was using which now seems to me as a hack. Specifically that means I should test whether "allow_changes = true".

Here's where the plot thickens. That doesn't fix the issue, and indeed debugging output inserted in the subsequent commits here shows that the host and clients don't actually agree about the value of "allow_changes" for the joining player! I have also made server-side debugging output to show exactly what the game config being passed to the clients is. It looks that it might be an issue that one side is perhaps reading from "snapshot" and the other from replay_start or some such thing? Anyways if anyone has an idea why they might be out of sync regarding "allow_changes" it would be helpful, I'm going to put this aside for a few days and perhaps come back to it.