Skip to content

Commit

Permalink
Fix connection state handling on disconnection event in WebSocketServ…
Browse files Browse the repository at this point in the history
…ice (#56)
  • Loading branch information
MiguelRipoll23 authored Dec 10, 2024
1 parent 5799d00 commit 7f8b547
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/websocket-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export class WebSocketService {

private handleDisconnection(event: CloseEvent): void {
console.log("Connection closed", event);
this.gameState.getGameServer().setConnected(false);

const payload = {
connectionLost: this.gameState.getGameServer().isConnected(),
Expand All @@ -93,6 +92,7 @@ export class WebSocketService {
);

this.eventProcessorService.addLocalEvent(localEvent);
this.gameState.getGameServer().setConnected(false);
}

private handleMessage(data: ArrayBuffer) {
Expand Down

0 comments on commit 7f8b547

Please sign in to comment.