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