reply handling
parent
af8bcc06a5
commit
e66c116562
|
@ -71,6 +71,18 @@ func (webClient *WebClient) RemoveMobileCmdID(cmdID int) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (webClient *WebClient) RemoveVoiceCMDIDsByBackend(cmdID int) {
|
||||||
|
logger.Web.Debugln("before", webClient.VoiceCMDIDsByBackend)
|
||||||
|
for i, data := range webClient.VoiceCMDIDsByBackend {
|
||||||
|
if data.WebCmdID == cmdID {
|
||||||
|
newArr := append(webClient.VoiceCMDIDsByBackend[:i], webClient.VoiceCMDIDsByBackend[i+1:]...)
|
||||||
|
webClient.VoiceCMDIDsByBackend = newArr
|
||||||
|
logger.Web.Debugln("after", webClient.VoiceCMDIDsByBackend)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func removeCmdIDFromList(arr []int, cmdID int) ([]int, error) {
|
func removeCmdIDFromList(arr []int, cmdID int) ([]int, error) {
|
||||||
index := getCmdIDIndexFromList(arr, cmdID)
|
index := getCmdIDIndexFromList(arr, cmdID)
|
||||||
|
|
||||||
|
|
|
@ -53,11 +53,9 @@ func HandleWebMessage(isVoice bool, conn *websocket.Conn, uuid string, msg []byt
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove cmdID from VoiceCMDIDsByBackend list
|
// remove cmdID from VoiceCMDIDsByBackend list
|
||||||
//delete(webClient.VoiceCMDIDsByBackend, cmdID)
|
|
||||||
|
|
||||||
// remove cmdID from voiceCmdIDs
|
|
||||||
webClient.RemoveVoiceCmdID(cmdID)
|
|
||||||
|
|
||||||
|
// remove cmdID from minecraftCmdIDs
|
||||||
|
mcClient.RemoveCmdID(cmdID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue