SaitoTech / saito-lite-rust

a version of the Saito-Lite client written for compatibility with the Saito Rust client and binary data format
24 stars 28 forks source link

Game Gets Stuck After a Player Get's Disconnected #832

Open noslrac27 opened 2 years ago

noslrac27 commented 2 years ago

The game gets stuck after at least one of the players gets an unstable Internet connection. This is a constant problem that sometimes gets resolved by refreshing the browser. Whenever this does not work, the game is just stuck which forces everyone to just abandon the game. When I say stuck, it means the players are just waiting for one another to do their turn because the game failed to recognized that one of the player got disconnected when the other one made the move.

This problem is easy to reproduce. I will just base it on what transpired in our Settlers game.:

  1. While playing a game (TS/Settlers/Poker/etc.), Player 3 gets disconnected.

  2. Upon getting the Internet stable, Player 3 is still waiting for his turn.

    Player 3 Settlers cant continue
  3. On the side of Player 1 and Player 2, it is supposed to be Player 3's turn already. Player 1 Point of View

  4. Player 3 refreshes the page but the game is still in the same state.

  5. Player 1 and Player 2 did the same but the game is still stuck.

Below steps are just bonus steps I tested out because there was an option to do so. In other games, there's no in game action to do anymore after getting stuck.

  1. Player 3 clicked on Offer Trade and the other players managed to get the offer.
  2. Player 1 accepted the offer and then it became stuck at Player 1 is considering your offer on Player 3's screen.

This issue happens when a player makes a move while the other player is not online or have an unstable connection. This problem is already happening since last year.

estapeluo commented 2 years ago

I believe you can also close the tab and have a Settlers stuck it, have you tested it?

Tuch-o commented 2 years ago

Confirmed. Same thing happening on my end.

trevelyan commented 2 years ago

We need to understand the state of the wallet / game-queues to deal with this kind of bug.

What was the last move that was made on the blockchain?

Was it received by all wallets?

Has one player made a move, reloaded and then made another move? (is this still permitted)

f8daniel commented 2 years ago

Okay, I think this is solved, but it would be good to get confirmation (thanks @trevelyan for the solution). I tried the tab closing trick immediately upon sending a move and when I reloaded the game it paused for a beat to rebroadcast last move, then synched back up with the other player.