回退项目心跳策略

This commit is contained in:
John Smith 2024-04-06 13:12:56 +08:00
parent 3ee3d4335f
commit f52a6f4ef9

View File

@ -24,10 +24,6 @@ export default class ChatClientDirectOpenLive extends ChatClientOfficialBase {
}
stop() {
if (this.gameHeartbeatTimerId) {
window.clearTimeout(this.gameHeartbeatTimerId)
this.gameHeartbeatTimerId = null
}
this.endGame()
super.stop()
@ -52,6 +48,11 @@ export default class ChatClientDirectOpenLive extends ChatClientOfficialBase {
content: '房间连接已断开'
}))
if (this.gameHeartbeatTimerId) {
window.clearTimeout(this.gameHeartbeatTimerId)
this.gameHeartbeatTimerId = null
}
super.onWsClose()
}