mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +01:00
Change shockwave short packet expression from s to u
This is used in g-python so this should make it less confusing
This commit is contained in:
parent
deec521ab1
commit
b6689ffcea
@ -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")));
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user