Add message UUID and type names to hash and message defintion (#1409)

This commit is contained in:
Matt
2024-09-22 22:27:13 -04:00
committed by GitHub
parent 360298cc24
commit f33218c49c
43 changed files with 605 additions and 190 deletions

View File

@@ -85,7 +85,9 @@ class Packet:
for _ in range(numBytes):
intList.append(self._getNextByteAsInt())
# Interpret the bytes as a floating point number
# Interpret the bytes as the requested type.
# Note due to NT's byte order assumptions,
# we have to flip the order of intList
value = struct.unpack(unpackFormat, bytes(intList))[0]
return value
@@ -96,7 +98,7 @@ class Packet:
*
* @return A decoded byte from the packet.
"""
return self._decodeGeneric(">b", 1)
return self._decodeGeneric("<b", 1)
def decode16(self) -> int:
"""
@@ -104,7 +106,7 @@ class Packet:
*
* @return A decoded short from the packet.
"""
return self._decodeGeneric(">h", 2)
return self._decodeGeneric("<h", 2)
def decodeInt(self) -> int:
"""
@@ -112,7 +114,7 @@ class Packet:
*
* @return A decoded int from the packet.
"""
return self._decodeGeneric(">l", 4)
return self._decodeGeneric("<l", 4)
def decodeFloat(self) -> float:
"""
@@ -120,7 +122,7 @@ class Packet:
*
* @return A decoded float from the packet.
"""
return self._decodeGeneric(">f", 4)
return self._decodeGeneric("<f", 4)
def decodeLong(self) -> int:
"""
@@ -128,7 +130,7 @@ class Packet:
*
* @return A decoded int64 from the packet.
"""
return self._decodeGeneric(">q", 8)
return self._decodeGeneric("<q", 8)
def decodeDouble(self) -> float:
"""
@@ -136,7 +138,7 @@ class Packet:
*
* @return A decoded double from the packet.
"""
return self._decodeGeneric(">d", 8)
return self._decodeGeneric("<d", 8)
def decodeBoolean(self) -> bool:
"""