diff --git a/modules/structs/WebClient.go b/modules/structs/WebClient.go index cdbd79c..8cc4ff8 100644 --- a/modules/structs/WebClient.go +++ b/modules/structs/WebClient.go @@ -15,15 +15,15 @@ type WebClientDb struct { } type WebClient struct { - Uuid string - MobileConn *websocket.Conn - mobileConnMu sync.Mutex - VoiceConn *websocket.Conn - voiceConnMu sync.Mutex - MobileCmdIDs []int - mobileCmdMu sync.Mutex - VoiceCmdIDs []int - voiceCmdMu sync.Mutex + Uuid string + MobileConn *websocket.Conn + mobileConnMu sync.Mutex + VoiceConn *websocket.Conn + voiceConnMu sync.Mutex + MobileCmdIDs []int + mobileCmdIDMu sync.Mutex + VoiceCmdIDs []int + voiceCmdIDMu sync.Mutex } func (webClient *WebClient) SendBinaryMessage(conn *websocket.Conn, msg []byte) error { @@ -38,8 +38,8 @@ func (webClient *WebClient) SendBinaryMessage(conn *websocket.Conn, msg []byte) } func (webClient *WebClient) RemoveVoiceCmdID(cmdID int) { - webClient.voiceCmdMu.Lock() - defer webClient.voiceCmdMu.Unlock() + webClient.voiceCmdIDMu.Lock() + defer webClient.voiceCmdIDMu.Unlock() newArr, err := removeCmdIDFromList(webClient.VoiceCmdIDs, cmdID) @@ -51,8 +51,8 @@ func (webClient *WebClient) RemoveVoiceCmdID(cmdID int) { } func (webClient *WebClient) RemoveMobileCmdID(cmdID int) { - webClient.mobileCmdMu.Lock() - defer webClient.mobileCmdMu.Unlock() + webClient.mobileCmdIDMu.Lock() + defer webClient.mobileCmdIDMu.Unlock() newArr, err := removeCmdIDFromList(webClient.MobileCmdIDs, cmdID)