rooms ya no expiran para reconexion
This commit is contained in:
@@ -97,6 +97,8 @@ export class GameRoom extends Room<GameState> {
|
||||
}
|
||||
|
||||
onCreate(options: any) {
|
||||
// Keep room alive even if all clients disconnect (avoid auto-dispose during reconnection windows)
|
||||
try { (this as any).autoDispose = false; } catch {}
|
||||
this.setState(new GameState());
|
||||
this.state.roomId = this.roomId;
|
||||
// Expose status via metadata for lobby listing
|
||||
@@ -472,8 +474,9 @@ export class GameRoom extends Room<GameState> {
|
||||
}
|
||||
}
|
||||
|
||||
// Allow reconnection; when it happens, mark player connected and resume if both are present
|
||||
const reconnection = this.allowReconnection(client, 30);
|
||||
// Allow reconnection without a short timeout; give players ample time to return
|
||||
// (24 hours window to prevent unexpected room disposal due to short timeouts)
|
||||
const reconnection = this.allowReconnection(client, 60 * 60 * 24);
|
||||
reconnection.then((newClient) => {
|
||||
const p = this.state.players.get(client.sessionId);
|
||||
if (p) {
|
||||
|
||||
Reference in New Issue
Block a user