创建辅助机器人时, 判断是否已经存在
This commit is contained in:
parent
896da3af52
commit
64d5184a53
@ -128,6 +128,8 @@ export class GeneralRoom extends Room {
|
||||
}
|
||||
|
||||
onDispose() {
|
||||
this.gameClock.clear();
|
||||
this.assistMap.clear();
|
||||
this.dispatcher.stop();
|
||||
}
|
||||
|
||||
@ -268,8 +270,10 @@ export class GeneralRoom extends Room {
|
||||
}
|
||||
|
||||
addAssistClient(sessionId: string) {
|
||||
let client = new RobotClient(sessionId, this.state, this['onMessageHandlers']);
|
||||
this.assistMap.set(sessionId, client);
|
||||
if (!this.assistMap.has(sessionId)) {
|
||||
let client = new RobotClient(sessionId, this.state, this['onMessageHandlers']);
|
||||
this.assistMap.set(sessionId, client);
|
||||
}
|
||||
}
|
||||
|
||||
getAssistClient(sessionId: string): RobotClient {
|
||||
|
Loading…
x
Reference in New Issue
Block a user