[fix] bug

This commit is contained in:
建喵 2023-09-15 11:26:47 +08:00
parent 7f491ebddf
commit 4d9134d381

View File

@ -88,10 +88,15 @@ export default class Room {
const apiNum: number = conn === key ? 100 : 200; const apiNum: number = conn === key ? 100 : 200;
data = [(connData.state ?? EGameState.Ready) + apiNum]; data = [(connData.state ?? EGameState.Ready) + apiNum];
} }
} else {
if (state) {
target = <WsConnection<ServiceType>[]>this.conns.filter((filterConn) => filterConn === key);
data = [state];
} else { } else {
target = <WsConnection<ServiceType>[]>this.conns.filter((filterConn) => filterConn === key); target = <WsConnection<ServiceType>[]>this.conns.filter((filterConn) => filterConn === key);
data = [connData.state]; data = [connData.state];
} }
}
if (needData) { if (needData) {
data.push(connData.answer); data.push(connData.answer);
} }