logrus test

master
Alex 2022-01-31 20:33:31 +01:00
parent f3c90061d2
commit 5ecfc78b11
2 changed files with 5 additions and 4 deletions

View File

@ -24,6 +24,7 @@ type MinecraftClient struct {
func (mcClient *MinecraftClient) SendBinaryMessage(msg []byte) error {
mcClient.connMu.Lock()
defer mcClient.connMu.Unlock()
logger.Minecraft.Debugln("SendBinaryMessage")
return mcClient.Conn.WriteMessage(websocket.BinaryMessage, msg)
}

View File

@ -43,10 +43,6 @@ func AckHandler() {
for _, msg := range mcClient.SendQueueMessages {
logger.Minecraft.Println("msg", msg)
if msg.TrySendCount < 4 {
msg.TrySendCount++
}
logger.Minecraft.Println("ackHandler mc", msg.TrySendCount, kraSettingsConfig.Cfg.WebSocket.AckTimeouts[msg.TrySendCount], currentTime.UnixMilli()-msg.Time.UnixMilli())
if int(currentTime.UnixMilli())-int(msg.Time.UnixMilli()) > kraSettingsConfig.Cfg.WebSocket.AckTimeouts[msg.TrySendCount] {
@ -58,6 +54,10 @@ func AckHandler() {
logger.Minecraft.Println("ackHandler err sending msg", err)
}
}
if msg.TrySendCount < 4 {
msg.TrySendCount++
}
}
}
}