From 570ce95091db85399053b3a9ccbd4815db83a3e8 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 29 Dec 2021 15:57:37 +0100 Subject: [PATCH] reply handling --- serverCommunication/minecraft.go | 7 +++---- serverCommunication/web.go | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/serverCommunication/minecraft.go b/serverCommunication/minecraft.go index 2b846c5..b40d335 100644 --- a/serverCommunication/minecraft.go +++ b/serverCommunication/minecraft.go @@ -11,15 +11,11 @@ import ( ) func HandleMinecraftMessage(conn *websocket.Conn, msg []byte) { - var raw []byte - var err error - status, cmdID, dest, playerUuid, cmdNumber, args := kraProtocol.DecodeJavaMessage(msg) mcClient := GetMinecraftClientByConn(conn) if mcClient == nil { - // TODO: when does this apply? Send error with conn? logger.Minecraft.Warnln("mcClient is nil") return } @@ -31,6 +27,9 @@ func HandleMinecraftMessage(conn *websocket.Conn, msg []byte) { return } + var raw []byte + var err error + if status == kraProtocol.StatusGet { // cmdID already in queue if isCmdIDInList(mcClient.CmdIDs, cmdID) { diff --git a/serverCommunication/web.go b/serverCommunication/web.go index 2d1f569..c04547b 100644 --- a/serverCommunication/web.go +++ b/serverCommunication/web.go @@ -23,7 +23,6 @@ func HandleWebMessage(isVoice bool, conn *websocket.Conn, uuid string, msg []byt webClient := getWebClientByConn(conn) if webClient == nil { - // TODO: when does this apply? Send error with conn? logger.Web.Debugln("webClient is nil") return }