Solved: Lobby ready-up desync

Started by Dullstar, January 28, 2024, 07:26:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dullstar

Also posted on Github as on one hand it seems like the most appropriate place to report bugs, but I thought it would be useful to post here too as I imagine people will be more active here than on the Github issues page.

Observed during 1/27/2024 lemforum session on central server.

A player dropped and rejoined. The other players in the lobby remained visibly readied up, but when all players were shown as ready, the game did not start. Appears there was a desync at some point. My client version is 0.10.18, compiled from source (I know I wasn't the only one affected, but I'm not sure what version everyone's client was or exactly how many players were affected; I want to say one or two people may have still been on 0.10.17).

I tried to reproduce this with a locally hosted server; the observed behavior was that a player leaving and rejoining would unready all players in the lobby. I need to do some further testing e,g. if the client crashes somehow. I don't know what version of the server is running on the central one; I'd assume it's probably up-to-date but have no way to confirm. The locally hosted one I used to test should be 0.10.18.




Edit Simon: Solved in Lix 0.10.19 with a client-side bugfix. This 0.10.19 and newer can still play with older 0.10s: If the game starts at all, it starts for everybody at the same time.

Simon

#1
Here are the entire 2 minutes, 20 seconds of encounting the bug and working around it:
https://www.lixgame.com/etc/everybody-ready-bug.mp4

Partial transcript:

Plastic crackles. "Nigh, King, I am dumb, so probfere". (Snacking on stream is nasty for listening. In the future, I'll enforce the rule of no snacking on stream. Whoever snacks or talks with a full mouth on stream: You'll get a friendly warning, and if you don't stop or mute yourself, I'll mute you locally.)

"Bug! Bug! Bug!"

"[Silken], have you tried that?" Silken leaves and tries. "Argh, now he's going back again ... Argh, let's play!"

"Ehm, Simon, I'm still readied outside."

"Question mark has selected 'Toying Around'."




Dullstar, thanks for starting the investigation!

Quotewhat version of the server is running on the central one; I'd assume it's probably up-to-date but have no way to confirm.

The server isn't necessarily new. It's been over a year at least. I should recompile it from a more up-to-date stable code version.

Still, I believe that the exact version isn't relevant as long as it's a 0.10.x, and it is. I believe this because none of these show anything relevant-looking:

git diff v0.10.0..v0.10.18 -- src/net
git diff v0.10.0..v0.10.18 -- src/server

-- Simon

Simon

Looks like the central server has been an ancient version of lixserv from around the final developments of 0.10.0. Still, the git diff output (see previous post) was the practically the same when I replaced 0.10.0 with what I had checked out on the server.

I've created a backup of the ~0.10.0 lixserv, then rebuilt lixserv from the 0.10.18 source and restarted lixserv.

I believe that the ancient lixserv behaves like the 0.10.18 lixserv w.r.t this bug. I'll scrutinize the video (see previous post).

-- Simon

Simon

#3
Repro against 0.10.18 lixserv:

1. Open 3 clients and have them all connect to the same server. Don't enter a room yet. Make the clients different colors, let's say, red, green, blue.

2. Red and green enter the same room.

Blue is waiting outside the room.

3. Red picks a level.

Now is the first time that anybody is even able to press ready. Blue is still outside.

4. Red presses ready.

You'll see that red and green agree on all ready statuses in the room: Both red and green believe that red is ready and that green is not ready yet.

5. Blue enters the room.

Here, we see the first desync: Blue believes that nobody is ready. Red believes that only red is ready. Green agrees that only red is ready. This is the heart of the bug: After you've entered a room of players with mixed readiness, the players in the room necessarily agree on who's ready.

6. Both green and blue press ready.

Here, both red and green see the topic's bug. Both red and green now think that everybody is ready, and they're surprised that the game won't start. Blue thinks that only green and blue are ready and that red isn't ready yet.

7. Red unreadies, then readies again.

This works around the bug. Now, the game starts. I believe that, after step 6, lixserv agreed with the blue player: Nobody was ready after blue entered the room, and to start a game, it wasn't enough for only green and blue to press ready.

-- Simon