[fix] bug

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

View File

@ -89,8 +89,13 @@ export default class Room {
data = [(connData.state ?? EGameState.Ready) + apiNum]; data = [(connData.state ?? EGameState.Ready) + apiNum];
} }
} else { } else {
target = <WsConnection<ServiceType>[]>this.conns.filter((filterConn) => filterConn === key); if (state) {
data = [connData.state]; target = <WsConnection<ServiceType>[]>this.conns.filter((filterConn) => filterConn === key);
data = [state];
} else {
target = <WsConnection<ServiceType>[]>this.conns.filter((filterConn) => filterConn === key);
data = [connData.state];
}
} }
if (needData) { if (needData) {
data.push(connData.answer); data.push(connData.answer);