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',
|
reason: 'room_closed',
|
||||||
finalPlayerCount: this.playerCount,
|
finalPlayerCount: this.playerCount,
|
||||||
});
|
});
|
||||||
|
activeShards.delete(`${this.sessionId}-${this.gameId}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,6 +398,7 @@ class EcastShardClient {
|
|||||||
reason: 'connection_failed',
|
reason: 'connection_failed',
|
||||||
finalPlayerCount: this.playerCount,
|
finalPlayerCount: this.playerCount,
|
||||||
});
|
});
|
||||||
|
activeShards.delete(`${this.sessionId}-${this.gameId}`);
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
this.reconnecting = false;
|
this.reconnecting = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user