Commit 7792de02 authored by nanahira's avatar nanahira

fix

parent bad436fc
Pipeline #43470 passed with stages
in 4 minutes and 21 seconds
......@@ -385,15 +385,11 @@ export class Room {
}
async join(client: Client, toObserver = false) {
client.roomName = this.name;
const firstEmptyPlayerSlot = this.players.findIndex((p) => !p);
const isPlayer =
!toObserver &&
firstEmptyPlayerSlot >= 0 &&
this.duelStage === DuelStage.Begin;
client.isHost = this.noHost
? false
: isPlayer && !this.playingPlayers.length;
if (isPlayer) {
this.players[firstEmptyPlayerSlot] = client;
......@@ -406,6 +402,12 @@ export class Room {
client.pos = NetPlayerType.OBSERVER;
}
client.roomName = this.name;
client.isHost = this.noHost
? false
: isPlayer && !this.playingPlayers.length;
// send to client
await client.send(this.joinGameMessage);
await client.sendTypeChange();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment