From 8f0f2b36c6b210e2e732cc99f85b5ffddc248f08 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Mon, 22 Jun 2020 02:13:14 -0700 Subject: [PATCH] Fixed unsigned arithmetic --- server/netty/src/com/riiablo/net/reliable/Packet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/netty/src/com/riiablo/net/reliable/Packet.java b/server/netty/src/com/riiablo/net/reliable/Packet.java index 43aaa9e7..5e7e2f90 100644 --- a/server/netty/src/com/riiablo/net/reliable/Packet.java +++ b/server/netty/src/com/riiablo/net/reliable/Packet.java @@ -119,7 +119,7 @@ public abstract class Packet { return -1; } int sequenceDiff = bb.readUnsignedByte(); - ack = (short) (sequence - sequenceDiff); + ack = (sequence - sequenceDiff) & 0xFFFF; } else { if (bb.readableBytes() < 2) { logError("buffer too small for packet header (3)");