#5199 closed defect (fixed)
Out-Of-Sync when doubleclicking on StartGame
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Release Blocker | Milestone: | Alpha 23 |
Component: | Network | Keywords: | |
Cc: | Patch: | Phab:D1558 Phab:D1562 |
Description
If clicking twice on StartGame
as a multiplayer host (one has to be really quick), then launchGame();
is executed twice.
The first call choses an rng seed, starts networked game and loading screen.
But launchGame
doesn't switch the GUI page, the networking code does that and that is delayed.
So the second click still has time to be executed.
A new RNG is set again, the different gamesettings are broadcasted again.
StartNetworkGame
is called again which doesn't execute code but throws this error:
ERROR: Net client: Error running FSM update (type=24 state=6) NMT_GAME_START while NCS_LOADING
If there are two clients connected, it can yield an instant OOS error.
temple considers that this could be the cause for the KunstRaucher Mainland OOS reported in #5162. The entities are serialized and deserialized properly, but a different RNG seed would generate a different terrain.
Change History (5)
comment:1 by , 6 years ago
Milestone: | Backlog → Alpha 23 |
---|---|
Patch: | → Phab:D1558 |
comment:2 by , 6 years ago
comment:3 by , 6 years ago
Patch: | Phab:D1558 → Phab:D1558 Phab:D1562 |
---|---|
Priority: | Must Have → Release Blocker |
Amazingly there is no OOS message on rejoin for arbitrary amount of time if the terrain is flat enough to not change the territory borders of players at gaia resources if units don't move.
But one can see that the mapgen terrain textures and elevation are different while the entities are deserialized and thus correct (most notably CC patch not below the CC).
One can
warn(uneval(g_GameAttributes));
after rejoin or gamestart and see that the Seed is in fact different too.So the terrain and entity effect are not only perfectly able to explain the KunstRaucher replay, but I'm inclined to say that this error must have been it, since the oos_dump.diff fingerprint exactly matches and every further rejoin was broken (whereas all other OOS issues we found and all other games we observer are in sync).
Reproducing yields exaclty those territory differences, and only for the rejoined client, not for the non-rejoined ones.
2nd Bug: This triggers a network FSM error, as the
StartGame
packet is not expected once it started. This FSM error was never reported afaics (would have been in #3199).3rd Bug: The playernames are copied from the assignments to the gameattributes in
launchGame()
. WhenlaunchGame
is called the second time, it writes them to the persistmatchsettings file. Then they appear after the next gamesetup instead of "Player 1" in the slot labels: #5206.