diff --git a/kraSettings.sample.yaml b/kraSettings.sample.yaml index 93f8b86..e87f4b5 100644 --- a/kraSettings.sample.yaml +++ b/kraSettings.sample.yaml @@ -3,6 +3,7 @@ web_socket: protocol: ws host: 127.0.0.1 port: 50003 + ack_timeouts: [2, 3] web: voice_address: "https://dev.voice.krakatoa-roleplay.umbach.dev/" mongodb: diff --git a/serverCommunication/web.go b/serverCommunication/web.go index ef4b138..8a01201 100644 --- a/serverCommunication/web.go +++ b/serverCommunication/web.go @@ -29,8 +29,6 @@ func HandleWebMessage(isVoice bool, conn *websocket.Conn, uuid string, msg []byt status, cmdID, dest, cmdNumber, args := kraProtocol.DecodeWebMessage(msg) - // TODO: kraProtocol.StatusMessageAlreadyInQueue - if status == kraProtocol.StatusReply { if isVoice { for _, data := range webClient.VoiceCmdIDsByBackend { @@ -131,6 +129,14 @@ func HandleWebMessage(isVoice bool, conn *websocket.Conn, uuid string, msg []byt raw := kraProtocol.EncodeWebMessage(kraProtocol.StatusErrTryAgain, cmdID, cmdNumber, args) webClient.SendBinaryMessage(conn, raw) + + if status == kraProtocol.StatusGet { + if isVoice { + webClient.SendVoiceQueueMessages = append(webClient.SendVoiceQueueMessages, &structs.SendQueueMessage{MessageRaw: raw, CmdID: cmdID, TrySendCount: 0, Time: time.Now()}) + } else { + webClient.SendMobileQueueMessages = append(webClient.SendMobileQueueMessages, &structs.SendQueueMessage{MessageRaw: raw, CmdID: cmdID, TrySendCount: 0, Time: time.Now()}) + } + } } return } else { // web