mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-28 02:54:39 +00:00
revert
This commit is contained in:
+12
-19
@@ -593,22 +593,19 @@ export class GameServer {
|
||||
(c) => c.clientID !== client.clientID,
|
||||
);
|
||||
|
||||
if (!this._hasStarted) {
|
||||
// Remove persistentId if the game has not started to prevent going over max players
|
||||
this.persistentIdToClientId.delete(client.persistentID);
|
||||
// Close lobby when host leaves before game starts
|
||||
if (
|
||||
!this.isPublic() &&
|
||||
client.persistentID === this.creatorPersistentID
|
||||
) {
|
||||
this.log.info("Host left, closing lobby", {
|
||||
gameID: this.id,
|
||||
});
|
||||
for (const c of [...this.activeClients]) {
|
||||
this.kickClient(c.clientID, KICK_REASON_HOST_LEFT);
|
||||
}
|
||||
this._hasEnded = true;
|
||||
// Close lobby when host leaves before game starts
|
||||
if (
|
||||
!this._hasStarted &&
|
||||
!this.isPublic() &&
|
||||
client.persistentID === this.creatorPersistentID
|
||||
) {
|
||||
this.log.info("Host left, closing lobby", {
|
||||
gameID: this.id,
|
||||
});
|
||||
for (const c of [...this.activeClients]) {
|
||||
this.kickClient(c.clientID, KICK_REASON_HOST_LEFT);
|
||||
}
|
||||
this._hasEnded = true;
|
||||
}
|
||||
});
|
||||
client.ws.on("error", (error: Error) => {
|
||||
@@ -626,10 +623,6 @@ export class GameServer {
|
||||
this.activeClients = this.activeClients.filter(
|
||||
(c) => c.clientID !== client.clientID,
|
||||
);
|
||||
// Remove persistentId if the game has not started to prevent going over max players
|
||||
if (!this._hasStarted) {
|
||||
this.persistentIdToClientId.delete(client.persistentID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user