allow-reconnect #1

Merged
marco merged 1 commits from allow-reconnect into master 2023-12-09 20:03:50 +00:00
Owner

Another step towards allowing reconnections

  1. Implement thread-safe ringbuffer for websocket messages

This implements a ringbuffer that is used to decouple the raw websocket
connection from the messages that the game handler handles.

  1. Change websocket handling

With this commit, we stop waiting for the websocket connection to be
established before the game starts.
Now, the Connection type is responsible for waiting for the websocket
connection before writing.

Some bugs are still happening:
1. The rejoining client is not told the state of the board
2. Invalid moves are not handled by the client (not sure why though)
3. The still-connected client should be told, that the opponent
disconnected. Then the client should show the passphrase again

  1. Introduce method to send status of board and player

  2. Reconnect works (kind of)

With the right changes in the client, the reconnect works (but only for
the first time).

WARNING:
At the moment, we will create a new player whenever connection wants to
join a private game. This will also clear all the disconnect callbacks
that we set in the player.

Another step towards allowing reconnections 1. Implement thread-safe ringbuffer for websocket messages This implements a ringbuffer that is used to decouple the raw websocket connection from the messages that the game handler handles. 2. Change websocket handling With this commit, we stop waiting for the websocket connection to be established before the game starts. Now, the Connection type is responsible for waiting for the websocket connection before writing. Some bugs are still happening: 1. The rejoining client is not told the state of the board 2. Invalid moves are not handled by the client (not sure why though) 3. The still-connected client should be told, that the opponent disconnected. Then the client should show the passphrase again 3. Introduce method to send status of board and player 4. Reconnect works (kind of) With the right changes in the client, the reconnect works (but only for the first time). WARNING: At the moment, we will create a new player whenever connection wants to join a private game. This will also clear all the disconnect callbacks that we set in the player.
marco added 5 commits 2023-12-09 19:57:30 +00:00
26242424ed Implement thread-safe ringbuffer for websocket messages
This implements a ringbuffer that is used to decouple the raw websocket
connection from the messages that the game handler handles.
efefa4ced5 Change websocket handling
With this commit, we stop waiting for the websocket connection to be
established before the game starts.
Now, the Connection type is responsible for waiting for the websocket
connection before writing.
cce0aa8162 Handle reconnection
reconnection works now if the rejoining player enters the passphrase
again.

Some bugs are still happening:
1. The rejoining client is not told the state of the board
2. Invalid moves are not handled by the client (not sure why though)
3. The still-connected client should be told, that the opponent
   disconnected. Then the client should show the passphrase again
c29cdffbc2 Reconnect works (kind of)
With the right changes in the client, the reconnect works (but only for
the first time).

At the moment, we will create a new player whenever connection wants to
join a private game. This will also clear all the disconnect callbacks
that we set in the player.
marco force-pushed allow-reconnect from c29cdffbc2 to ae3e73f711 2023-12-09 20:03:35 +00:00 Compare
marco merged commit f61c2ae112 into master 2023-12-09 20:03:50 +00:00
marco deleted branch allow-reconnect 2023-12-09 20:03:55 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: marco/mchess-server#1
No description provided.