diff --git a/G-Earth/src/main/java/gearth/services/packet_representation/PacketStringUtils.java b/G-Earth/src/main/java/gearth/services/packet_representation/PacketStringUtils.java index d93871a..c4cb2f0 100644 --- a/G-Earth/src/main/java/gearth/services/packet_representation/PacketStringUtils.java +++ b/G-Earth/src/main/java/gearth/services/packet_representation/PacketStringUtils.java @@ -58,7 +58,7 @@ public class PacketStringUtils { boolean fixLengthLater = false; if (format != HPacketFormat.EVA_WIRE) { - packet = replaceWithFormat(format, packet, "\\{s:(-?[0-9]+)}", (temp, value) -> temp.appendUShort(Short.parseShort(value))); + packet = replaceWithFormat(format, packet, "\\{u:(-?[0-9]+)}", (temp, value) -> temp.appendShort(Short.parseShort(value))); packet = replaceWithFormat(format, packet, "\\{i:(-?[0-9]+)}", (temp, value) -> temp.appendInt(Integer.parseInt(value))); packet = replaceWithFormat(format, packet, "\\{b:([Ff]alse|[Tt]rue)}", (temp, value) -> temp.appendBoolean(value.equalsIgnoreCase("true"))); diff --git a/G-Earth/src/test/java/TestPacketStringUtils.java b/G-Earth/src/test/java/TestPacketStringUtils.java index be693e0..e24df73 100644 --- a/G-Earth/src/test/java/TestPacketStringUtils.java +++ b/G-Earth/src/test/java/TestPacketStringUtils.java @@ -36,7 +36,7 @@ public class TestPacketStringUtils { public void testShockwaveOutgoingExpressions() throws InvalidPacketException { checkExpression(HPacketFormat.WEDGIE_OUTGOING, "{h:18}{b:false}", "@RH"); // GETFVRF checkExpression(HPacketFormat.WEDGIE_OUTGOING, "{h:52}{s:\"Hoi123\"}", "@t@FHoi123"); // CHAT - checkExpression(HPacketFormat.WEDGIE_OUTGOING, "{h:75}{s:10}{s:6}", "AK@J@F"); // MOVE + checkExpression(HPacketFormat.WEDGIE_OUTGOING, "{h:75}{u:10}{u:6}", "AK@J@F"); // MOVE } private void checkSame(String expected) throws InvalidPacketException {