From 3e348c3d67b5c7ac66b960fb382fcb6cae4e602c Mon Sep 17 00:00:00 2001 From: PureCS Date: Fri, 29 Jun 2018 23:49:09 +0100 Subject: [PATCH] Updated Data Types (mediawiki) --- Data-Types.mediawiki | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Data-Types.mediawiki b/Data-Types.mediawiki index c7b982a..24ac813 100644 --- a/Data-Types.mediawiki +++ b/Data-Types.mediawiki @@ -102,18 +102,20 @@ null character \0 or 0 to support multi-line strings. | Old engine: write and finish with newline delimiter ("\n")
New engine: write and finish with null byte (value 0). |} -Additionally, RuneScape also uses two integers that are different from a big- or low endian order. Both byte orders are called middle endian. Their orders could be described as following: +Additionally, RuneScape also uses two endian orders for integers that are different from a big- or low endian order. Both byte orders are called middle-endian. -Middle endian big int: C3 D4 A1 B2 +Their orders could be described as following: -Middle endian small int: B2 A1 D4 C3 +Middle-endian big int: C3 D4 A1 B2 -(A1 smallest D4 biggest byte) +Middle-endian small int: B2 A1 D4 C3 + +Where A1 is the smallest byte (LSB), and D4 the biggest byte (MSB). == Bit Access == === Initiating Bit Access === -Whenever data is to be sent to the server or to the client using bits; the stream needs to be prepared by setting the bit position. The bit position can be calculated by grabbing the current buffer position and multiplying it by 8. This can be seen below. +Whenever data is to be sent to the server or to the client using bits; the stream needs to be prepared by setting the bit position. The bit position can be calculated by multiplying the current buffer position by 8. This is because each byte is comprised of 8 bits. - int bitPos = bufferPos * 8; \ No newline at end of file +Example: int bitPos = bufferPos * 8; \ No newline at end of file