fix: clean up activeShards on reconnection failure
Remove stale entries from the activeShards map when reconnectWithBackoff exhausts all attempts or detects room closure. Made-with: Cursor
This commit is contained in:
@@ -378,6 +378,7 @@ class EcastShardClient {
|
||||
reason: 'room_closed',
|
||||
finalPlayerCount: this.playerCount,
|
||||
});
|
||||
activeShards.delete(`${this.sessionId}-${this.gameId}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -397,6 +398,7 @@ class EcastShardClient {
|
||||
reason: 'connection_failed',
|
||||
finalPlayerCount: this.playerCount,
|
||||
});
|
||||
activeShards.delete(`${this.sessionId}-${this.gameId}`);
|
||||
return false;
|
||||
} finally {
|
||||
this.reconnecting = false;
|
||||
|
||||
Reference in New Issue
Block a user