diff --git a/src/main/java/BitmapFont.java b/src/main/java/BitmapFont.java
index dfc2d22..5409e9b 100644
--- a/src/main/java/BitmapFont.java
+++ b/src/main/java/BitmapFont.java
@@ -17,29 +17,29 @@ public class BitmapFont extends Draw2D {
public boolean aBoolean1499 = false;
public BitmapFont(boolean flag, String s, FileArchive archive) {
- Buffer buffer = new Buffer(archive.read(s + ".dat", null));
- Buffer buffer_1 = new Buffer(archive.read("index.dat", null));
- buffer_1.position = buffer.get2U() + 4;
- int k = buffer_1.get1U();
+ Packet packet = new Packet(archive.read(s + ".dat", null));
+ Packet packet_1 = new Packet(archive.read("index.dat", null));
+ packet_1.position = packet.get2U() + 4;
+ int k = packet_1.get1U();
if (k > 0) {
- buffer_1.position += 3 * (k - 1);
+ packet_1.position += 3 * (k - 1);
}
for (int l = 0; l < 256; l++) {
- anIntArray1494[l] = buffer_1.get1U();
- anIntArray1495[l] = buffer_1.get1U();
- int i1 = anIntArray1492[l] = buffer_1.get2U();
- int j1 = anIntArray1493[l] = buffer_1.get2U();
- int k1 = buffer_1.get1U();
+ anIntArray1494[l] = packet_1.get1U();
+ anIntArray1495[l] = packet_1.get1U();
+ int i1 = anIntArray1492[l] = packet_1.get2U();
+ int j1 = anIntArray1493[l] = packet_1.get2U();
+ int k1 = packet_1.get1U();
int l1 = i1 * j1;
aByteArrayArray1491[l] = new byte[l1];
if (k1 == 0) {
for (int i2 = 0; i2 < l1; i2++) {
- aByteArrayArray1491[l][i2] = buffer.get1();
+ aByteArrayArray1491[l][i2] = packet.get1();
}
} else if (k1 == 1) {
for (int j2 = 0; j2 < i1; j2++) {
for (int l2 = 0; l2 < j1; l2++) {
- aByteArrayArray1491[l][j2 + (l2 * i1)] = buffer.get1();
+ aByteArrayArray1491[l][j2 + (l2 * i1)] = packet.get1();
}
}
}
diff --git a/src/main/java/Censor.java b/src/main/java/Censor.java
index 772bf63..bc8b025 100644
--- a/src/main/java/Censor.java
+++ b/src/main/java/Censor.java
@@ -13,65 +13,65 @@ public class Censor {
public static int[] anIntArray625;
public static void method487(FileArchive archive) {
- Buffer buffer = new Buffer(archive.read("fragmentsenc.txt", null));
- Buffer buffer_1 = new Buffer(archive.read("badenc.txt", null));
- Buffer class30_sub2_sub2_2 = new Buffer(archive.read("domainenc.txt", null));
- Buffer buffer_3 = new Buffer(archive.read("tldlist.txt", null));
- method488(buffer, buffer_1, class30_sub2_sub2_2, buffer_3);
+ Packet packet = new Packet(archive.read("fragmentsenc.txt", null));
+ Packet packet_1 = new Packet(archive.read("badenc.txt", null));
+ Packet class30_sub2_sub2_2 = new Packet(archive.read("domainenc.txt", null));
+ Packet packet_3 = new Packet(archive.read("tldlist.txt", null));
+ method488(packet, packet_1, class30_sub2_sub2_2, packet_3);
}
- public static void method488(Buffer buffer, Buffer buffer_1, Buffer class30_sub2_sub2_2, Buffer buffer_3) {
- method490(buffer_1);
+ public static void method488(Packet packet, Packet packet_1, Packet class30_sub2_sub2_2, Packet packet_3) {
+ method490(packet_1);
method491(class30_sub2_sub2_2);
- method492(buffer);
- method489(buffer_3);
+ method492(packet);
+ method489(packet_3);
}
- public static void method489(Buffer buffer) {
- int i = buffer.get4();
+ public static void method489(Packet packet) {
+ int i = packet.get4();
aCharArrayArray624 = new char[i][];
anIntArray625 = new int[i];
for (int j = 0; j < i; j++) {
- anIntArray625[j] = buffer.get1U();
- char[] ac = new char[buffer.get1U()];
+ anIntArray625[j] = packet.get1U();
+ char[] ac = new char[packet.get1U()];
for (int k = 0; k < ac.length; k++) {
- ac[k] = (char) buffer.get1U();
+ ac[k] = (char) packet.get1U();
}
aCharArrayArray624[j] = ac;
}
}
- public static void method490(Buffer buffer) {
- int j = buffer.get4();
+ public static void method490(Packet packet) {
+ int j = packet.get4();
aCharArrayArray621 = new char[j][];
aByteArrayArrayArray622 = new byte[j][][];
- method493(buffer, aCharArrayArray621, aByteArrayArrayArray622);
+ method493(packet, aCharArrayArray621, aByteArrayArrayArray622);
}
- public static void method491(Buffer buffer) {
- int i = buffer.get4();
+ public static void method491(Packet packet) {
+ int i = packet.get4();
aCharArrayArray623 = new char[i][];
- method494(aCharArrayArray623, buffer, -490);
+ method494(aCharArrayArray623, packet, -490);
}
- public static void method492(Buffer buffer) {
- anIntArray620 = new int[buffer.get4()];
+ public static void method492(Packet packet) {
+ anIntArray620 = new int[packet.get4()];
for (int i = 0; i < anIntArray620.length; i++) {
- anIntArray620[i] = buffer.get2U();
+ anIntArray620[i] = packet.get2U();
}
}
- public static void method493(Buffer buffer, char[][] ac, byte[][][] abyte0) {
+ public static void method493(Packet packet, char[][] ac, byte[][][] abyte0) {
for (int j = 0; j < ac.length; j++) {
- char[] ac1 = new char[buffer.get1U()];
+ char[] ac1 = new char[packet.get1U()];
for (int k = 0; k < ac1.length; k++) {
- ac1[k] = (char) buffer.get1U();
+ ac1[k] = (char) packet.get1U();
}
ac[j] = ac1;
- byte[][] abyte1 = new byte[buffer.get1U()][2];
+ byte[][] abyte1 = new byte[packet.get1U()][2];
for (int l = 0; l < abyte1.length; l++) {
- abyte1[l][0] = (byte) buffer.get1U();
- abyte1[l][1] = (byte) buffer.get1U();
+ abyte1[l][0] = (byte) packet.get1U();
+ abyte1[l][1] = (byte) packet.get1U();
}
if (abyte1.length > 0) {
abyte0[j] = abyte1;
@@ -79,14 +79,14 @@ public class Censor {
}
}
- public static void method494(char[][] ac, Buffer buffer, int i) {
+ public static void method494(char[][] ac, Packet packet, int i) {
if (i >= 0) {
return;
}
for (int j = 0; j < ac.length; j++) {
- char[] ac1 = new char[buffer.get1U()];
+ char[] ac1 = new char[packet.get1U()];
for (int k = 0; k < ac1.length; k++) {
- ac1[k] = (char) buffer.get1U();
+ ac1[k] = (char) packet.get1U();
}
ac[j] = ac1;
}
diff --git a/src/main/java/Component.java b/src/main/java/Component.java
index c4f2682..467cede 100644
--- a/src/main/java/Component.java
+++ b/src/main/java/Component.java
@@ -74,86 +74,86 @@ public class Component {
public static void method205(FileArchive archive, BitmapFont[] aclass30_sub2_sub1_sub4, FileArchive archive_1) {
aCache_238 = new LRUCache(50000);
- Buffer buffer = new Buffer(archive.read("data", null));
+ Packet packet = new Packet(archive.read("data", null));
int i = -1;
- int j = buffer.get2U();
+ int j = packet.get2U();
aComponentArray210 = new Component[j];
- while (buffer.position < buffer.data.length) {
- int k = buffer.get2U();
+ while (packet.position < packet.data.length) {
+ int k = packet.get2U();
if (k == 65535) {
- i = buffer.get2U();
- k = buffer.get2U();
+ i = packet.get2U();
+ k = packet.get2U();
}
Component component = aComponentArray210[k] = new Component();
component.anInt250 = k;
component.anInt236 = i;
- component.anInt262 = buffer.get1U();
- component.anInt217 = buffer.get1U();
- component.anInt214 = buffer.get2U();
- component.anInt220 = buffer.get2U();
- component.anInt267 = buffer.get2U();
- component.aByte254 = (byte) buffer.get1U();
- component.anInt230 = buffer.get1U();
+ component.anInt262 = packet.get1U();
+ component.anInt217 = packet.get1U();
+ component.anInt214 = packet.get2U();
+ component.anInt220 = packet.get2U();
+ component.anInt267 = packet.get2U();
+ component.aByte254 = (byte) packet.get1U();
+ component.anInt230 = packet.get1U();
if (component.anInt230 != 0) {
- component.anInt230 = ((component.anInt230 - 1) << 8) + buffer.get1U();
+ component.anInt230 = ((component.anInt230 - 1) << 8) + packet.get1U();
} else {
component.anInt230 = -1;
}
- int i1 = buffer.get1U();
+ int i1 = packet.get1U();
if (i1 > 0) {
component.anIntArray245 = new int[i1];
component.anIntArray212 = new int[i1];
for (int j1 = 0; j1 < i1; j1++) {
- component.anIntArray245[j1] = buffer.get1U();
- component.anIntArray212[j1] = buffer.get2U();
+ component.anIntArray245[j1] = packet.get1U();
+ component.anIntArray212[j1] = packet.get2U();
}
}
- int k1 = buffer.get1U();
+ int k1 = packet.get1U();
if (k1 > 0) {
component.anIntArrayArray226 = new int[k1][];
for (int l1 = 0; l1 < k1; l1++) {
- int i3 = buffer.get2U();
+ int i3 = packet.get2U();
component.anIntArrayArray226[l1] = new int[i3];
for (int l4 = 0; l4 < i3; l4++) {
- component.anIntArrayArray226[l1][l4] = buffer.get2U();
+ component.anIntArrayArray226[l1][l4] = packet.get2U();
}
}
}
if (component.anInt262 == 0) {
- component.anInt261 = buffer.get2U();
- component.aBoolean266 = buffer.get1U() == 1;
- int i2 = buffer.get2U();
+ component.anInt261 = packet.get2U();
+ component.aBoolean266 = packet.get1U() == 1;
+ int i2 = packet.get2U();
component.anIntArray240 = new int[i2];
component.anIntArray241 = new int[i2];
component.anIntArray272 = new int[i2];
for (int j3 = 0; j3 < i2; j3++) {
- component.anIntArray240[j3] = buffer.get2U();
- component.anIntArray241[j3] = buffer.get2();
- component.anIntArray272[j3] = buffer.get2();
+ component.anIntArray240[j3] = packet.get2U();
+ component.anIntArray241[j3] = packet.get2();
+ component.anIntArray272[j3] = packet.get2();
}
}
if (component.anInt262 == 1) {
- component.unusedInt = buffer.get2U();
- component.unusedBool = buffer.get1U() == 1;
+ component.unusedInt = packet.get2U();
+ component.unusedBool = packet.get1U() == 1;
}
if (component.anInt262 == 2) {
component.anIntArray253 = new int[component.anInt220 * component.anInt267];
component.anIntArray252 = new int[component.anInt220 * component.anInt267];
- component.aBoolean259 = buffer.get1U() == 1;
- component.aBoolean249 = buffer.get1U() == 1;
- component.aBoolean242 = buffer.get1U() == 1;
- component.aBoolean235 = buffer.get1U() == 1;
- component.anInt231 = buffer.get1U();
- component.anInt244 = buffer.get1U();
+ component.aBoolean259 = packet.get1U() == 1;
+ component.aBoolean249 = packet.get1U() == 1;
+ component.aBoolean242 = packet.get1U() == 1;
+ component.aBoolean235 = packet.get1U() == 1;
+ component.anInt231 = packet.get1U();
+ component.anInt244 = packet.get1U();
component.anIntArray215 = new int[20];
component.anIntArray247 = new int[20];
component.aImageArray209 = new Image24[20];
for (int j2 = 0; j2 < 20; j2++) {
- int k3 = buffer.get1U();
+ int k3 = packet.get1U();
if (k3 == 1) {
- component.anIntArray215[j2] = buffer.get2();
- component.anIntArray247[j2] = buffer.get2();
- String s1 = buffer.getString();
+ component.anIntArray215[j2] = packet.get2();
+ component.anIntArray247[j2] = packet.get2();
+ String s1 = packet.getString();
if ((archive_1 != null) && (s1.length() > 0)) {
int i5 = s1.lastIndexOf(",");
component.aImageArray209[j2] = method207(Integer.parseInt(s1.substring(i5 + 1)), archive_1, s1.substring(0, i5));
@@ -162,102 +162,102 @@ public class Component {
}
component.aStringArray225 = new String[5];
for (int l3 = 0; l3 < 5; l3++) {
- component.aStringArray225[l3] = buffer.getString();
+ component.aStringArray225[l3] = packet.getString();
if (component.aStringArray225[l3].length() == 0) {
component.aStringArray225[l3] = null;
}
}
}
if (component.anInt262 == 3) {
- component.aBoolean227 = buffer.get1U() == 1;
+ component.aBoolean227 = packet.get1U() == 1;
}
if ((component.anInt262 == 4) || (component.anInt262 == 1)) {
- component.aBoolean223 = buffer.get1U() == 1;
- int k2 = buffer.get1U();
+ component.aBoolean223 = packet.get1U() == 1;
+ int k2 = packet.get1U();
if (aclass30_sub2_sub1_sub4 != null) {
component.aFont_243 = aclass30_sub2_sub1_sub4[k2];
}
- component.aBoolean268 = buffer.get1U() == 1;
+ component.aBoolean268 = packet.get1U() == 1;
}
if (component.anInt262 == 4) {
- component.aString248 = buffer.getString();
- component.aString228 = buffer.getString();
+ component.aString248 = packet.getString();
+ component.aString228 = packet.getString();
}
if ((component.anInt262 == 1) || (component.anInt262 == 3) || (component.anInt262 == 4)) {
- component.anInt232 = buffer.get4();
+ component.anInt232 = packet.get4();
}
if ((component.anInt262 == 3) || (component.anInt262 == 4)) {
- component.anInt219 = buffer.get4();
- component.anInt216 = buffer.get4();
- component.anInt239 = buffer.get4();
+ component.anInt219 = packet.get4();
+ component.anInt216 = packet.get4();
+ component.anInt239 = packet.get4();
}
if (component.anInt262 == 5) {
- String s = buffer.getString();
+ String s = packet.getString();
if ((archive_1 != null) && (s.length() > 0)) {
int i4 = s.lastIndexOf(",");
component.aImage_207 = method207(Integer.parseInt(s.substring(i4 + 1)), archive_1, s.substring(0, i4));
}
- s = buffer.getString();
+ s = packet.getString();
if ((archive_1 != null) && (s.length() > 0)) {
int j4 = s.lastIndexOf(",");
component.aImage_260 = method207(Integer.parseInt(s.substring(j4 + 1)), archive_1, s.substring(0, j4));
}
}
if (component.anInt262 == 6) {
- int l = buffer.get1U();
+ int l = packet.get1U();
if (l != 0) {
component.anInt233 = 1;
- component.anInt234 = ((l - 1) << 8) + buffer.get1U();
+ component.anInt234 = ((l - 1) << 8) + packet.get1U();
}
- l = buffer.get1U();
+ l = packet.get1U();
if (l != 0) {
component.anInt255 = 1;
- component.anInt256 = ((l - 1) << 8) + buffer.get1U();
+ component.anInt256 = ((l - 1) << 8) + packet.get1U();
}
- l = buffer.get1U();
+ l = packet.get1U();
if (l != 0) {
- component.anInt257 = ((l - 1) << 8) + buffer.get1U();
+ component.anInt257 = ((l - 1) << 8) + packet.get1U();
} else {
component.anInt257 = -1;
}
- l = buffer.get1U();
+ l = packet.get1U();
if (l != 0) {
- component.anInt258 = ((l - 1) << 8) + buffer.get1U();
+ component.anInt258 = ((l - 1) << 8) + packet.get1U();
} else {
component.anInt258 = -1;
}
- component.anInt269 = buffer.get2U();
- component.anInt270 = buffer.get2U();
- component.anInt271 = buffer.get2U();
+ component.anInt269 = packet.get2U();
+ component.anInt270 = packet.get2U();
+ component.anInt271 = packet.get2U();
}
if (component.anInt262 == 7) {
component.anIntArray253 = new int[component.anInt220 * component.anInt267];
component.anIntArray252 = new int[component.anInt220 * component.anInt267];
- component.aBoolean223 = buffer.get1U() == 1;
- int l2 = buffer.get1U();
+ component.aBoolean223 = packet.get1U() == 1;
+ int l2 = packet.get1U();
if (aclass30_sub2_sub1_sub4 != null) {
component.aFont_243 = aclass30_sub2_sub1_sub4[l2];
}
- component.aBoolean268 = buffer.get1U() == 1;
- component.anInt232 = buffer.get4();
- component.anInt231 = buffer.get2();
- component.anInt244 = buffer.get2();
- component.aBoolean249 = buffer.get1U() == 1;
+ component.aBoolean268 = packet.get1U() == 1;
+ component.anInt232 = packet.get4();
+ component.anInt231 = packet.get2();
+ component.anInt244 = packet.get2();
+ component.aBoolean249 = packet.get1U() == 1;
component.aStringArray225 = new String[5];
for (int k4 = 0; k4 < 5; k4++) {
- component.aStringArray225[k4] = buffer.getString();
+ component.aStringArray225[k4] = packet.getString();
if (component.aStringArray225[k4].length() == 0) {
component.aStringArray225[k4] = null;
}
}
}
if ((component.anInt217 == 2) || (component.anInt262 == 2)) {
- component.aString222 = buffer.getString();
- component.aString218 = buffer.getString();
- component.anInt237 = buffer.get2U();
+ component.aString222 = packet.getString();
+ component.aString218 = packet.getString();
+ component.anInt237 = packet.get2U();
}
if ((component.anInt217 == 1) || (component.anInt217 == 4) || (component.anInt217 == 5) || (component.anInt217 == 6)) {
- component.aString221 = buffer.getString();
+ component.aString221 = packet.getString();
if (component.aString221.length() == 0) {
if (component.anInt217 == 1) {
component.aString221 = "Ok";
diff --git a/src/main/java/FileArchive.java b/src/main/java/FileArchive.java
index 9e95fb6..46c6b85 100644
--- a/src/main/java/FileArchive.java
+++ b/src/main/java/FileArchive.java
@@ -16,33 +16,33 @@ public class FileArchive {
}
public void load(byte[] src) {
- Buffer buffer = new Buffer(src);
+ Packet packet = new Packet(src);
- int unpackedSize = buffer.get3();
- int packedSize = buffer.get3();
+ int unpackedSize = packet.get3();
+ int packedSize = packet.get3();
if (packedSize != unpackedSize) {
data = new byte[unpackedSize];
BZip2.decompress(data, unpackedSize, src, 6, packedSize);
- buffer = new Buffer(data);
+ packet = new Packet(data);
unpacked = true;
} else {
data = src;
unpacked = false;
}
- fileCount = buffer.get2U();
+ fileCount = packet.get2U();
fileHash = new int[fileCount];
fileSizeInflated = new int[fileCount];
fileSizeDeflated = new int[fileCount];
fileOffset = new int[fileCount];
- int offset = buffer.position + (fileCount * 10);
+ int offset = packet.position + (fileCount * 10);
for (int file = 0; file < fileCount; file++) {
- fileHash[file] = buffer.get4();
- fileSizeInflated[file] = buffer.get3();
- fileSizeDeflated[file] = buffer.get3();
+ fileHash[file] = packet.get4();
+ fileSizeInflated[file] = packet.get3();
+ fileSizeDeflated[file] = packet.get3();
fileOffset[file] = offset;
offset += fileSizeDeflated[file];
}
diff --git a/src/main/java/FloType.java b/src/main/java/FloType.java
index 032b408..e01dece 100644
--- a/src/main/java/FloType.java
+++ b/src/main/java/FloType.java
@@ -22,8 +22,8 @@ public class FloType {
}
public static void method260(FileArchive archive) {
- Buffer buffer = new Buffer(archive.read("flo.dat", null));
- anInt387 = buffer.get2U();
+ Packet packet = new Packet(archive.read("flo.dat", null));
+ anInt387 = packet.get2U();
if (aTypeArray388 == null) {
aTypeArray388 = new FloType[anInt387];
}
@@ -31,33 +31,33 @@ public class FloType {
if (aTypeArray388[j] == null) {
aTypeArray388[j] = new FloType();
}
- aTypeArray388[j].method261(buffer);
+ aTypeArray388[j].method261(packet);
}
}
- public void method261(Buffer buffer) {
+ public void method261(Packet packet) {
do {
- int i = buffer.get1U();
+ int i = packet.get1U();
if (i == 0) {
return;
}
if (i == 1) {
- anInt390 = buffer.get3();
+ anInt390 = packet.get3();
method262(anInt390);
} else if (i == 2) {
- anInt391 = buffer.get1U();
+ anInt391 = packet.get1U();
} else if (i == 3) {
unusedBool = true;
} else if (i == 5) {
aBoolean393 = false;
} else if (i == 6) {
- unusedString = buffer.getString();
+ unusedString = packet.getString();
} else if (i == 7) {
int j = anInt394;
int k = anInt395;
int l = anInt396;
int i1 = anInt397;
- int j1 = buffer.get3();
+ int j1 = packet.get3();
method262(j1);
anInt394 = j;
anInt395 = k;
diff --git a/src/main/java/Game.java b/src/main/java/Game.java
index 91d8234..4a02244 100644
--- a/src/main/java/Game.java
+++ b/src/main/java/Game.java
@@ -63,7 +63,7 @@ public class Game extends GameShell {
public volatile boolean aBoolean831 = false;
public Socket aSocket832;
public int anInt833;
- public Buffer aBuffer_834 = new Buffer(new byte[5000]);
+ public Packet aPacket_834 = new Packet(new byte[5000]);
public NPCEntity[] aNpcArray835 = new NPCEntity[16384];
public int anInt836;
public int[] anIntArray837 = new int[16384];
@@ -74,7 +74,7 @@ public class Game extends GameShell {
public int anInt843;
public String aString844;
public int anInt845;
- public Buffer aBuffer_847 = Buffer.create(1);
+ public Packet aPacket_847 = Packet.create(1);
public boolean aBoolean848 = true;
public int[] anIntArray850;
public int[] anIntArray851;
@@ -115,7 +115,7 @@ public class Game extends GameShell {
public int[] anIntArray892 = new int[anInt888];
public int anInt893;
public int[] anIntArray894 = new int[anInt888];
- public Buffer[] aBufferArray895 = new Buffer[anInt888];
+ public Packet[] aPacketArray895 = new Packet[anInt888];
public int anInt896;
public int anInt899;
public int anInt900;
@@ -270,7 +270,7 @@ public class Game extends GameShell {
public int anInt1079;
public boolean aBoolean1080 = false;
public String[] aStringArray1082 = new String[200];
- public Buffer aBuffer_1083 = Buffer.create(1);
+ public Packet aPacket_1083 = Packet.create(1);
public int anInt1084;
public int anInt1085;
public int anInt1086;
@@ -358,7 +358,7 @@ public class Game extends GameShell {
public int anInt1189 = -1;
public int[] anIntArray1190;
public int[] anIntArray1191;
- public Buffer aBuffer_1192 = Buffer.create(1);
+ public Packet aPacket_1192 = Packet.create(1);
public int anInt1193;
public int anInt1195;
public Image8 aImage_1196;
@@ -821,8 +821,8 @@ public class Game extends GameShell {
if (!aBoolean960) {
method13(90, "Unpacking sounds");
byte[] abyte0 = archive_5.read("sounds.dat", null);
- Buffer buffer = new Buffer(abyte0);
- SoundTrack.method240(buffer);
+ Packet packet = new Packet(abyte0);
+ SoundTrack.method240(packet);
}
method13(95, "Unpacking interfaces");
BitmapFont[] aclass30_sub2_sub1_sub4 = {aFont_1270, aFont_1271, aFont_1272, aFont_1273};
@@ -924,10 +924,10 @@ public class Game extends GameShell {
aMouseRecorder_879 = null;
aOnDemand_1068.method553();
aOnDemand_1068 = null;
- aBuffer_834 = null;
- aBuffer_1192 = null;
- aBuffer_847 = null;
- aBuffer_1083 = null;
+ aPacket_834 = null;
+ aPacket_1192 = null;
+ aPacket_847 = null;
+ aPacket_1083 = null;
anIntArray1234 = null;
aByteArrayArray1183 = null;
aByteArrayArray1247 = null;
@@ -990,7 +990,7 @@ public class Game extends GameShell {
aPlayerArray890 = null;
anIntArray892 = null;
anIntArray894 = null;
- aBufferArray895 = null;
+ aPacketArray895 = null;
anIntArray840 = null;
aNpcArray835 = null;
anIntArray837 = null;
@@ -1236,13 +1236,13 @@ public class Game extends GameShell {
method13(20, "Connecting to web server");
try {
DataInputStream datainputstream = method132("crc" + (int) (Math.random() * 99999999D) + "-" + 317);
- Buffer buffer = new Buffer(new byte[40]);
- datainputstream.readFully(buffer.data, 0, 40);
+ Packet packet = new Packet(new byte[40]);
+ datainputstream.readFully(packet.data, 0, 40);
datainputstream.close();
for (int i1 = 0; i1 < 9; i1++) {
- anIntArray1090[i1] = buffer.get4();
+ anIntArray1090[i1] = packet.get4();
}
- int j1 = buffer.get4();
+ int j1 = packet.get4();
int k1 = 1234;
for (int l1 = 0; l1 < 9; l1++) {
k1 = (k1 << 1) + anIntArray1090[l1];
@@ -1570,7 +1570,7 @@ public class Game extends GameShell {
}
SceneBuilder sceneBuilder = new SceneBuilder(aByteArrayArrayArray1258, 104, 104, anIntArrayArrayArray1214);
int k2 = aByteArrayArray1183.length;
- aBuffer_1192.putOp(0);
+ aPacket_1192.putOp(0);
if (!aBoolean1159) {
for (int i3 = 0; i3 < k2; i3++) {
int i4 = ((anIntArray1234[i3] >> 8) * 64) - anInt1034;
@@ -1588,7 +1588,7 @@ public class Game extends GameShell {
sceneBuilder.method174(k7, 64, 64, l5);
}
}
- aBuffer_1192.putOp(0);
+ aPacket_1192.putOp(0);
for (int i6 = 0; i6 < k2; i6++) {
byte[] abyte1 = aByteArrayArray1247[i6];
if (abyte1 != null) {
@@ -1628,7 +1628,7 @@ public class Game extends GameShell {
}
}
}
- aBuffer_1192.putOp(0);
+ aPacket_1192.putOp(0);
for (int l6 = 0; l6 < 4; l6++) {
for (int j8 = 0; j8 < 13; j8++) {
for (int j9 = 0; j9 < 13; j9++) {
@@ -1651,10 +1651,10 @@ public class Game extends GameShell {
}
}
}
- aBuffer_1192.putOp(0);
+ aPacket_1192.putOp(0);
sceneBuilder.method171(aCollisionMapArray1230, aGraph_946);
aArea_1165.method237();
- aBuffer_1192.putOp(0);
+ aPacket_1192.putOp(0);
int k3 = SceneBuilder.anInt145;
if (k3 > anInt918) {
k3 = anInt918;
@@ -1676,8 +1676,8 @@ public class Game extends GameShell {
}
LocType.aCache_785.method224();
if (super.aGameFrame__15 != null) {
- aBuffer_1192.putOp(210);
- aBuffer_1192.put4(0x3f008edd);
+ aPacket_1192.putOp(210);
+ aPacket_1192.put4(0x3f008edd);
}
if (aBoolean960 && (Signlink.cache_dat != null)) {
int j = aOnDemand_1068.method555(0);
@@ -2100,12 +2100,12 @@ public class Game extends GameShell {
Draw2D.drawLineX(i1 + 1, l + 14 + l1 + k1, 15, anInt927);
}
- public void method31(Buffer buffer, int i) {
+ public void method31(Packet packet, int i) {
anInt839 = 0;
anInt893 = 0;
- method139(buffer);
- method46(i, buffer);
- method86(buffer);
+ method139(packet);
+ method46(i, packet);
+ method86(packet);
for (int k = 0; k < anInt839; k++) {
int l = anIntArray840[k];
if (aNpcArray835[l].anInt1537 != anInt1161) {
@@ -2113,8 +2113,8 @@ public class Game extends GameShell {
aNpcArray835[l] = null;
}
}
- if (buffer.position != i) {
- Signlink.reporterror(aString1173 + " size mismatch in getnpcpos - pos:" + buffer.position + " psize:" + i);
+ if (packet.position != i) {
+ Signlink.reporterror(aString1173 + " size mismatch in getnpcpos - pos:" + packet.position + " psize:" + i);
throw new RuntimeException("eek");
}
for (int i1 = 0; i1 < anInt836; i1++) {
@@ -2131,28 +2131,28 @@ public class Game extends GameShell {
anInt1287 = (anInt1287 + 1) % 4;
aBoolean1233 = true;
aBoolean1223 = true;
- aBuffer_1192.putOp(95);
- aBuffer_1192.put1(anInt1287);
- aBuffer_1192.put1(anInt845);
- aBuffer_1192.put1(anInt1248);
+ aPacket_1192.putOp(95);
+ aPacket_1192.put1(anInt1287);
+ aPacket_1192.put1(anInt845);
+ aPacket_1192.put1(anInt1248);
}
if ((super.anInt27 >= 135) && (super.anInt27 <= 235) && (super.anInt28 >= 467) && (super.anInt28 <= 499)) {
anInt845 = (anInt845 + 1) % 3;
aBoolean1233 = true;
aBoolean1223 = true;
- aBuffer_1192.putOp(95);
- aBuffer_1192.put1(anInt1287);
- aBuffer_1192.put1(anInt845);
- aBuffer_1192.put1(anInt1248);
+ aPacket_1192.putOp(95);
+ aPacket_1192.put1(anInt1287);
+ aPacket_1192.put1(anInt845);
+ aPacket_1192.put1(anInt1248);
}
if ((super.anInt27 >= 273) && (super.anInt27 <= 373) && (super.anInt28 >= 467) && (super.anInt28 <= 499)) {
anInt1248 = (anInt1248 + 1) % 3;
aBoolean1233 = true;
aBoolean1223 = true;
- aBuffer_1192.putOp(95);
- aBuffer_1192.put1(anInt1287);
- aBuffer_1192.put1(anInt845);
- aBuffer_1192.put1(anInt1248);
+ aPacket_1192.putOp(95);
+ aPacket_1192.put1(anInt1287);
+ aPacket_1192.put1(anInt845);
+ aPacket_1192.put1(anInt1248);
}
if ((super.anInt27 >= 412) && (super.anInt27 <= 512) && (super.anInt28 >= 467) && (super.anInt28 <= 499)) {
if (anInt857 == -1) {
@@ -2498,8 +2498,8 @@ public class Game extends GameShell {
anIntArray826[j] = anIntArray826[j + 1];
aLongArray955[j] = aLongArray955[j + 1];
}
- aBuffer_1192.putOp(215);
- aBuffer_1192.put8(l);
+ aPacket_1192.putOp(215);
+ aPacket_1192.put8(l);
break;
}
}
@@ -2752,8 +2752,8 @@ public class Game extends GameShell {
anIntArray826[anInt899] = 0;
anInt899++;
aBoolean1153 = true;
- aBuffer_1192.putOp(188);
- aBuffer_1192.put8(l);
+ aPacket_1192.putOp(188);
+ aPacket_1192.put8(l);
}
}
@@ -2812,9 +2812,9 @@ public class Game extends GameShell {
}
}
- public void method46(int i, Buffer buffer) {
- while ((buffer.bitPosition + 21) < (i * 8)) {
- int k = buffer.getBits(14);
+ public void method46(int i, Packet packet) {
+ while ((packet.bitPosition + 21) < (i * 8)) {
+ int k = packet.getBits(14);
if (k == 16383) {
break;
}
@@ -2824,17 +2824,17 @@ public class Game extends GameShell {
NPCEntity npc = aNpcArray835[k];
anIntArray837[anInt836++] = k;
npc.anInt1537 = anInt1161;
- int l = buffer.getBits(5);
+ int l = packet.getBits(5);
if (l > 15) {
l -= 32;
}
- int i1 = buffer.getBits(5);
+ int i1 = packet.getBits(5);
if (i1 > 15) {
i1 -= 32;
}
- int j1 = buffer.getBits(1);
- npc.aType_1696 = NPCType.method159(buffer.getBits(12));
- int k1 = buffer.getBits(1);
+ int j1 = packet.getBits(1);
+ npc.aType_1696 = NPCType.method159(packet.getBits(12));
+ int k1 = packet.getBits(1);
if (k1 == 1) {
anIntArray894[anInt893++] = k;
}
@@ -2847,7 +2847,7 @@ public class Game extends GameShell {
npc.anInt1511 = npc.aType_1696.anInt77;
npc.method445(aPlayer_1126.anIntArray1500[0] + i1, aPlayer_1126.anIntArray1501[0] + l, j1 == 1);
}
- buffer.accessBytes();
+ packet.accessBytes();
}
public void method47(boolean flag) {
@@ -2973,37 +2973,37 @@ public class Game extends GameShell {
method45();
}
if (j == 326) {
- aBuffer_1192.putOp(101);
- aBuffer_1192.put1(aBoolean1047 ? 0 : 1);
+ aPacket_1192.putOp(101);
+ aPacket_1192.put1(aBoolean1047 ? 0 : 1);
for (int i1 = 0; i1 < 7; i1++) {
- aBuffer_1192.put1(anIntArray1065[i1]);
+ aPacket_1192.put1(anIntArray1065[i1]);
}
for (int l1 = 0; l1 < 5; l1++) {
- aBuffer_1192.put1(anIntArray990[l1]);
+ aPacket_1192.put1(anIntArray990[l1]);
}
return true;
}
if ((j >= 601) && (j <= 612)) {
method147();
if (aString881.length() > 0) {
- aBuffer_1192.putOp(218);
- aBuffer_1192.put8(StringUtil.toBase37(aString881));
- aBuffer_1192.put1(j - 601);
- aBuffer_1192.put1(aBoolean1158 ? 1 : 0);
+ aPacket_1192.putOp(218);
+ aPacket_1192.put8(StringUtil.toBase37(aString881));
+ aPacket_1192.put1(j - 601);
+ aPacket_1192.put1(aBoolean1158 ? 1 : 0);
}
}
return false;
}
- public void method49(Buffer buffer) {
+ public void method49(Packet packet) {
for (int j = 0; j < anInt893; j++) {
int k = anIntArray894[j];
PlayerEntity player = aPlayerArray890[k];
- int l = buffer.get1U();
+ int l = packet.get1U();
if ((l & 0x40) != 0) {
- l += buffer.get1U() << 8;
+ l += packet.get1U() << 8;
}
- method107(l, k, buffer, player);
+ method107(l, k, packet, player);
}
}
@@ -3269,7 +3269,7 @@ public class Game extends GameShell {
anInt1023 = 2;
SceneBuilder.anInt131 = anInt918;
method22();
- aBuffer_1192.putOp(121);
+ aPacket_1192.putOp(121);
return 0;
}
}
@@ -3400,7 +3400,7 @@ public class Game extends GameShell {
}
}
} while ((request.anInt1419 != 93) || !aOnDemand_1068.method564(request.anInt1421));
- SceneBuilder.method173(new Buffer(request.aByteArray1420), aOnDemand_1068);
+ SceneBuilder.method173(new Packet(request.aByteArray1420), aOnDemand_1068);
} while (true);
}
@@ -3512,12 +3512,12 @@ public class Game extends GameShell {
synchronized (aMouseRecorder_879.lock) {
if (aBoolean1205) {
if ((super.anInt26 != 0) || (aMouseRecorder_879.anInt810 >= 40)) {
- aBuffer_1192.putOp(45);
- aBuffer_1192.put1(0);
- int j2 = aBuffer_1192.position;
+ aPacket_1192.putOp(45);
+ aPacket_1192.put1(0);
+ int j2 = aPacket_1192.position;
int j3 = 0;
for (int j4 = 0; j4 < aMouseRecorder_879.anInt810; j4++) {
- if ((j2 - aBuffer_1192.position) >= 240) {
+ if ((j2 - aPacket_1192.position) >= 240) {
break;
}
j3++;
@@ -3551,18 +3551,18 @@ public class Game extends GameShell {
if ((anInt1022 < 8) && (j6 >= -32) && (j6 <= 31) && (k6 >= -32) && (k6 <= 31)) {
j6 += 32;
k6 += 32;
- aBuffer_1192.put2((anInt1022 << 12) + (j6 << 6) + k6);
+ aPacket_1192.put2((anInt1022 << 12) + (j6 << 6) + k6);
anInt1022 = 0;
} else if (anInt1022 < 8) {
- aBuffer_1192.put3(0x800000 + (anInt1022 << 19) + i6);
+ aPacket_1192.put3(0x800000 + (anInt1022 << 19) + i6);
anInt1022 = 0;
} else {
- aBuffer_1192.put4(0xc0000000 + (anInt1022 << 19) + i6);
+ aPacket_1192.put4(0xc0000000 + (anInt1022 << 19) + i6);
anInt1022 = 0;
}
}
}
- aBuffer_1192.putSize1(aBuffer_1192.position - j2);
+ aPacket_1192.putSize1(aPacket_1192.position - j2);
if (j3 >= aMouseRecorder_879.anInt810) {
aMouseRecorder_879.anInt810 = 0;
} else {
@@ -3601,8 +3601,8 @@ public class Game extends GameShell {
j5 = 1;
}
int l5 = (int) l;
- aBuffer_1192.putOp(241);
- aBuffer_1192.put4((l5 << 20) + (j5 << 19) + k4);
+ aPacket_1192.putOp(241);
+ aPacket_1192.put4((l5 << 20) + (j5 << 19) + k4);
}
if (anInt1016 > 0) {
anInt1016--;
@@ -3613,19 +3613,19 @@ public class Game extends GameShell {
if (aBoolean1017 && (anInt1016 <= 0)) {
anInt1016 = 20;
aBoolean1017 = false;
- aBuffer_1192.putOp(86);
- aBuffer_1192.put2(anInt1184);
- aBuffer_1192.put2A(anInt1185);
+ aPacket_1192.putOp(86);
+ aPacket_1192.put2(anInt1184);
+ aPacket_1192.put2A(anInt1185);
}
if (super.aBoolean17 && !aBoolean954) {
aBoolean954 = true;
- aBuffer_1192.putOp(3);
- aBuffer_1192.put1(1);
+ aPacket_1192.putOp(3);
+ aPacket_1192.put1(1);
}
if (!super.aBoolean17 && aBoolean954) {
aBoolean954 = false;
- aBuffer_1192.putOp(3);
- aBuffer_1192.put1(0);
+ aPacket_1192.putOp(3);
+ aPacket_1192.put1(0);
}
method53();
method115();
@@ -3702,11 +3702,11 @@ public class Game extends GameShell {
} else {
component.method204(anInt1085, anInt1066);
}
- aBuffer_1192.putOp(214);
- aBuffer_1192.put2LEA(anInt1084);
- aBuffer_1192.put1C(j1);
- aBuffer_1192.put2LEA(anInt1085);
- aBuffer_1192.put2LE(anInt1066);
+ aPacket_1192.putOp(214);
+ aPacket_1192.put2LEA(anInt1084);
+ aPacket_1192.put1C(j1);
+ aPacket_1192.put2LEA(anInt1085);
+ aPacket_1192.put2LE(anInt1066);
}
} else if (((anInt1253 == 1) || method17(anInt1133 - 1)) && (anInt1133 > 2)) {
method116();
@@ -3755,16 +3755,16 @@ public class Game extends GameShell {
if (super.anInt18 > 4500) {
anInt1011 = 250;
super.anInt18 -= 500;
- aBuffer_1192.putOp(202);
+ aPacket_1192.putOp(202);
}
anInt1010++;
if (anInt1010 > 50) {
- aBuffer_1192.putOp(0);
+ aPacket_1192.putOp(0);
}
try {
- if ((aConnection_1168 != null) && (aBuffer_1192.position > 0)) {
- aConnection_1168.method271(aBuffer_1192.position, aBuffer_1192.data, 0);
- aBuffer_1192.position = 0;
+ if ((aConnection_1168 != null) && (aPacket_1192.position > 0)) {
+ aConnection_1168.method271(aPacket_1192.position, aPacket_1192.data, 0);
+ aPacket_1192.position = 0;
anInt1010 = 0;
}
} catch (IOException _ex) {
@@ -3917,9 +3917,9 @@ public class Game extends GameShell {
DataInputStream datainputstream = method132(s1 + j);
byte[] abyte1 = new byte[6];
datainputstream.readFully(abyte1, 0, 6);
- Buffer buffer = new Buffer(abyte1);
- buffer.position = 3;
- int i2 = buffer.get3() + 6;
+ Packet packet = new Packet(abyte1);
+ packet.position = 3;
+ int i2 = packet.get3() + 6;
int j2 = 6;
abyte0 = new byte[i2];
for (int k2 = 0; k2 < 6; k2++) {
@@ -4056,11 +4056,11 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(57);
- aBuffer_1192.put2A(anInt1285);
- aBuffer_1192.put2A(i1);
- aBuffer_1192.put2LE(anInt1283);
- aBuffer_1192.put2A(anInt1284);
+ aPacket_1192.putOp(57);
+ aPacket_1192.put2A(anInt1285);
+ aPacket_1192.put2A(i1);
+ aPacket_1192.put2LE(anInt1283);
+ aPacket_1192.put2A(anInt1284);
}
}
if (l == 234) {
@@ -4072,19 +4072,19 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(236);
- aBuffer_1192.put2LE(k + anInt1035);
- aBuffer_1192.put2(i1);
- aBuffer_1192.put2LE(j + anInt1034);
+ aPacket_1192.putOp(236);
+ aPacket_1192.put2LE(k + anInt1035);
+ aPacket_1192.put2(i1);
+ aPacket_1192.put2LE(j + anInt1034);
}
if ((l == 62) && method66(i1, k, j)) {
- aBuffer_1192.putOp(192);
- aBuffer_1192.put2(anInt1284);
- aBuffer_1192.put2LE((i1 >> 14) & 0x7fff);
- aBuffer_1192.put2LEA(k + anInt1035);
- aBuffer_1192.put2LE(anInt1283);
- aBuffer_1192.put2LEA(j + anInt1034);
- aBuffer_1192.put2(anInt1285);
+ aPacket_1192.putOp(192);
+ aPacket_1192.put2(anInt1284);
+ aPacket_1192.put2LE((i1 >> 14) & 0x7fff);
+ aPacket_1192.put2LEA(k + anInt1035);
+ aPacket_1192.put2LE(anInt1283);
+ aPacket_1192.put2LEA(j + anInt1034);
+ aPacket_1192.put2(anInt1285);
}
if (l == 511) {
boolean flag2 = method85(2, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, k, aPlayer_1126.anIntArray1500[0], false, j);
@@ -4095,19 +4095,19 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(25);
- aBuffer_1192.put2LE(anInt1284);
- aBuffer_1192.put2A(anInt1285);
- aBuffer_1192.put2(i1);
- aBuffer_1192.put2A(k + anInt1035);
- aBuffer_1192.put2LEA(anInt1283);
- aBuffer_1192.put2(j + anInt1034);
+ aPacket_1192.putOp(25);
+ aPacket_1192.put2LE(anInt1284);
+ aPacket_1192.put2A(anInt1285);
+ aPacket_1192.put2(i1);
+ aPacket_1192.put2A(k + anInt1035);
+ aPacket_1192.put2LEA(anInt1283);
+ aPacket_1192.put2(j + anInt1034);
}
if (l == 74) {
- aBuffer_1192.putOp(122);
- aBuffer_1192.put2LEA(k);
- aBuffer_1192.put2A(j);
- aBuffer_1192.put2LE(i1);
+ aPacket_1192.putOp(122);
+ aPacket_1192.put2LEA(k);
+ aPacket_1192.put2A(j);
+ aPacket_1192.put2LE(i1);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4126,8 +4126,8 @@ public class Game extends GameShell {
flag8 = method48(component);
}
if (flag8) {
- aBuffer_1192.putOp(185);
- aBuffer_1192.put2(k);
+ aPacket_1192.putOp(185);
+ aPacket_1192.put2(k);
}
}
if (l == 561) {
@@ -4138,8 +4138,8 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(128);
- aBuffer_1192.put2(i1);
+ aPacket_1192.putOp(128);
+ aPacket_1192.put2(i1);
}
}
if (l == 20) {
@@ -4150,8 +4150,8 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(155);
- aBuffer_1192.put2LE(i1);
+ aPacket_1192.putOp(155);
+ aPacket_1192.put2LE(i1);
}
}
if (l == 779) {
@@ -4162,8 +4162,8 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(153);
- aBuffer_1192.put2LE(i1);
+ aPacket_1192.putOp(153);
+ aPacket_1192.put2LE(i1);
}
}
if (l == 516) {
@@ -4175,21 +4175,21 @@ public class Game extends GameShell {
}
if (l == 1062) {
method66(i1, k, j);
- aBuffer_1192.putOp(228);
- aBuffer_1192.put2A((i1 >> 14) & 0x7fff);
- aBuffer_1192.put2A(k + anInt1035);
- aBuffer_1192.put2(j + anInt1034);
+ aPacket_1192.putOp(228);
+ aPacket_1192.put2A((i1 >> 14) & 0x7fff);
+ aPacket_1192.put2A(k + anInt1035);
+ aPacket_1192.put2(j + anInt1034);
}
if ((l == 679) && !aBoolean1149) {
- aBuffer_1192.putOp(40);
- aBuffer_1192.put2(k);
+ aPacket_1192.putOp(40);
+ aPacket_1192.put2(k);
aBoolean1149 = true;
}
if (l == 431) {
- aBuffer_1192.putOp(129);
- aBuffer_1192.put2A(j);
- aBuffer_1192.put2(k);
- aBuffer_1192.put2A(i1);
+ aPacket_1192.putOp(129);
+ aPacket_1192.put2A(j);
+ aPacket_1192.put2(k);
+ aPacket_1192.put2A(i1);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4221,10 +4221,10 @@ public class Game extends GameShell {
}
}
if (l == 53) {
- aBuffer_1192.putOp(135);
- aBuffer_1192.put2LE(j);
- aBuffer_1192.put2A(k);
- aBuffer_1192.put2LE(i1);
+ aPacket_1192.putOp(135);
+ aPacket_1192.put2LE(j);
+ aPacket_1192.put2A(k);
+ aPacket_1192.put2LE(i1);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4237,10 +4237,10 @@ public class Game extends GameShell {
}
}
if (l == 539) {
- aBuffer_1192.putOp(16);
- aBuffer_1192.put2A(i1);
- aBuffer_1192.put2LEA(j);
- aBuffer_1192.put2LEA(k);
+ aPacket_1192.putOp(16);
+ aPacket_1192.put2A(i1);
+ aPacket_1192.put2LEA(j);
+ aPacket_1192.put2LEA(k);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4266,12 +4266,12 @@ public class Game extends GameShell {
}
method85(2, 0, 1, 0, aPlayer_1126.anIntArray1501[0], 1, 0, player_7.anIntArray1501[0], aPlayer_1126.anIntArray1500[0], false, player_7.anIntArray1500[0]);
if (l == 484) {
- aBuffer_1192.putOp(139);
- aBuffer_1192.put2LE(anIntArray892[j3]);
+ aPacket_1192.putOp(139);
+ aPacket_1192.put2LE(anIntArray892[j3]);
}
if (l == 6) {
- aBuffer_1192.putOp(128);
- aBuffer_1192.put2(anIntArray892[j3]);
+ aPacket_1192.putOp(128);
+ aPacket_1192.put2(anIntArray892[j3]);
}
flag9 = true;
break;
@@ -4282,13 +4282,13 @@ public class Game extends GameShell {
}
}
if (l == 870) {
- aBuffer_1192.putOp(53);
- aBuffer_1192.put2(j);
- aBuffer_1192.put2A(anInt1283);
- aBuffer_1192.put2LEA(i1);
- aBuffer_1192.put2(anInt1284);
- aBuffer_1192.put2LE(anInt1285);
- aBuffer_1192.put2(k);
+ aPacket_1192.putOp(53);
+ aPacket_1192.put2(j);
+ aPacket_1192.put2A(anInt1283);
+ aPacket_1192.put2LEA(i1);
+ aPacket_1192.put2(anInt1284);
+ aPacket_1192.put2LE(anInt1285);
+ aPacket_1192.put2(k);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4301,10 +4301,10 @@ public class Game extends GameShell {
}
}
if (l == 847) {
- aBuffer_1192.putOp(87);
- aBuffer_1192.put2A(i1);
- aBuffer_1192.put2(k);
- aBuffer_1192.put2A(j);
+ aPacket_1192.putOp(87);
+ aPacket_1192.put2A(i1);
+ aPacket_1192.put2(k);
+ aPacket_1192.put2A(j);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4340,10 +4340,10 @@ public class Game extends GameShell {
return;
}
if (l == 78) {
- aBuffer_1192.putOp(117);
- aBuffer_1192.put2LEA(k);
- aBuffer_1192.put2LEA(i1);
- aBuffer_1192.put2LE(j);
+ aPacket_1192.putOp(117);
+ aPacket_1192.put2LEA(k);
+ aPacket_1192.put2LEA(i1);
+ aPacket_1192.put2LE(j);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4363,8 +4363,8 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(73);
- aBuffer_1192.put2LE(i1);
+ aPacket_1192.putOp(73);
+ aPacket_1192.put2LE(i1);
}
}
if (l == 213) {
@@ -4376,16 +4376,16 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(79);
- aBuffer_1192.put2LE(k + anInt1035);
- aBuffer_1192.put2(i1);
- aBuffer_1192.put2A(j + anInt1034);
+ aPacket_1192.putOp(79);
+ aPacket_1192.put2LE(k + anInt1035);
+ aPacket_1192.put2(i1);
+ aPacket_1192.put2A(j + anInt1034);
}
if (l == 632) {
- aBuffer_1192.putOp(145);
- aBuffer_1192.put2A(k);
- aBuffer_1192.put2A(j);
- aBuffer_1192.put2A(i1);
+ aPacket_1192.putOp(145);
+ aPacket_1192.put2A(k);
+ aPacket_1192.put2A(j);
+ aPacket_1192.put2A(i1);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4398,10 +4398,10 @@ public class Game extends GameShell {
}
}
if (l == 493) {
- aBuffer_1192.putOp(75);
- aBuffer_1192.put2LEA(k);
- aBuffer_1192.put2LE(j);
- aBuffer_1192.put2A(i1);
+ aPacket_1192.putOp(75);
+ aPacket_1192.put2LEA(k);
+ aPacket_1192.put2LE(j);
+ aPacket_1192.put2A(i1);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4422,10 +4422,10 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(156);
- aBuffer_1192.put2A(j + anInt1034);
- aBuffer_1192.put2LE(k + anInt1035);
- aBuffer_1192.put2LEA(i1);
+ aPacket_1192.putOp(156);
+ aPacket_1192.put2A(j + anInt1034);
+ aPacket_1192.put2LE(k + anInt1035);
+ aPacket_1192.put2LEA(i1);
}
if (l == 94) {
boolean flag5 = method85(2, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, k, aPlayer_1126.anIntArray1500[0], false, j);
@@ -4436,15 +4436,15 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(181);
- aBuffer_1192.put2LE(k + anInt1035);
- aBuffer_1192.put2(i1);
- aBuffer_1192.put2LE(j + anInt1034);
- aBuffer_1192.put2A(anInt1137);
+ aPacket_1192.putOp(181);
+ aPacket_1192.put2LE(k + anInt1035);
+ aPacket_1192.put2(i1);
+ aPacket_1192.put2LE(j + anInt1034);
+ aPacket_1192.put2A(anInt1137);
}
if (l == 646) {
- aBuffer_1192.putOp(185);
- aBuffer_1192.put2(k);
+ aPacket_1192.putOp(185);
+ aPacket_1192.put2(k);
Component component_2 = Component.aComponentArray210[k];
if ((component_2.anIntArrayArray226 != null) && (component_2.anIntArrayArray226[0][0] == 5)) {
int i2 = component_2.anIntArrayArray226[0][1];
@@ -4463,8 +4463,8 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(17);
- aBuffer_1192.put2LEA(i1);
+ aPacket_1192.putOp(17);
+ aPacket_1192.put2LEA(i1);
}
}
if (l == 965) {
@@ -4475,8 +4475,8 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(21);
- aBuffer_1192.put2(i1);
+ aPacket_1192.putOp(21);
+ aPacket_1192.put2(i1);
}
}
if (l == 413) {
@@ -4487,9 +4487,9 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(131);
- aBuffer_1192.put2LEA(i1);
- aBuffer_1192.put2A(anInt1137);
+ aPacket_1192.putOp(131);
+ aPacket_1192.put2LEA(i1);
+ aPacket_1192.put2A(anInt1137);
}
}
if (l == 200) {
@@ -4515,10 +4515,10 @@ public class Game extends GameShell {
}
if (l == 900) {
method66(i1, k, j);
- aBuffer_1192.putOp(252);
- aBuffer_1192.put2LEA((i1 >> 14) & 0x7fff);
- aBuffer_1192.put2LE(k + anInt1035);
- aBuffer_1192.put2A(j + anInt1034);
+ aPacket_1192.putOp(252);
+ aPacket_1192.put2LEA((i1 >> 14) & 0x7fff);
+ aPacket_1192.put2LE(k + anInt1035);
+ aPacket_1192.put2A(j + anInt1034);
}
if (l == 412) {
NPCEntity npc_6 = aNpcArray835[i1];
@@ -4528,8 +4528,8 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(72);
- aBuffer_1192.put2A(i1);
+ aPacket_1192.putOp(72);
+ aPacket_1192.put2A(i1);
}
}
if (l == 365) {
@@ -4540,9 +4540,9 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(249);
- aBuffer_1192.put2A(i1);
- aBuffer_1192.put2LE(anInt1137);
+ aPacket_1192.putOp(249);
+ aPacket_1192.put2A(i1);
+ aPacket_1192.put2LE(anInt1137);
}
}
if (l == 729) {
@@ -4553,8 +4553,8 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(39);
- aBuffer_1192.put2LE(i1);
+ aPacket_1192.putOp(39);
+ aPacket_1192.put2LE(i1);
}
}
if (l == 577) {
@@ -4565,16 +4565,16 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(139);
- aBuffer_1192.put2LE(i1);
+ aPacket_1192.putOp(139);
+ aPacket_1192.put2LE(i1);
}
}
if ((l == 956) && method66(i1, k, j)) {
- aBuffer_1192.putOp(35);
- aBuffer_1192.put2LE(j + anInt1034);
- aBuffer_1192.put2A(anInt1137);
- aBuffer_1192.put2A(k + anInt1035);
- aBuffer_1192.put2LE((i1 >> 14) & 0x7fff);
+ aPacket_1192.putOp(35);
+ aPacket_1192.put2LE(j + anInt1034);
+ aPacket_1192.put2A(anInt1137);
+ aPacket_1192.put2A(k + anInt1035);
+ aPacket_1192.put2LE((i1 >> 14) & 0x7fff);
}
if (l == 567) {
boolean flag6 = method85(2, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, k, aPlayer_1126.anIntArray1500[0], false, j);
@@ -4585,16 +4585,16 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(23);
- aBuffer_1192.put2LE(k + anInt1035);
- aBuffer_1192.put2LE(i1);
- aBuffer_1192.put2LE(j + anInt1034);
+ aPacket_1192.putOp(23);
+ aPacket_1192.put2LE(k + anInt1035);
+ aPacket_1192.put2LE(i1);
+ aPacket_1192.put2LE(j + anInt1034);
}
if (l == 867) {
- aBuffer_1192.putOp(43);
- aBuffer_1192.put2LE(k);
- aBuffer_1192.put2A(i1);
- aBuffer_1192.put2A(j);
+ aPacket_1192.putOp(43);
+ aPacket_1192.put2LE(k);
+ aPacket_1192.put2A(i1);
+ aPacket_1192.put2A(j);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4607,11 +4607,11 @@ public class Game extends GameShell {
}
}
if (l == 543) {
- aBuffer_1192.putOp(237);
- aBuffer_1192.put2(j);
- aBuffer_1192.put2A(i1);
- aBuffer_1192.put2(k);
- aBuffer_1192.put2A(anInt1137);
+ aPacket_1192.putOp(237);
+ aPacket_1192.put2(j);
+ aPacket_1192.put2A(i1);
+ aPacket_1192.put2(k);
+ aPacket_1192.put2A(anInt1137);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4651,11 +4651,11 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(14);
- aBuffer_1192.put2A(anInt1284);
- aBuffer_1192.put2(i1);
- aBuffer_1192.put2(anInt1285);
- aBuffer_1192.put2LE(anInt1283);
+ aPacket_1192.putOp(14);
+ aPacket_1192.put2A(anInt1284);
+ aPacket_1192.put2(i1);
+ aPacket_1192.put2(anInt1285);
+ aPacket_1192.put2LE(anInt1283);
}
}
if (l == 639) {
@@ -4683,10 +4683,10 @@ public class Game extends GameShell {
}
}
if (l == 454) {
- aBuffer_1192.putOp(41);
- aBuffer_1192.put2(i1);
- aBuffer_1192.put2A(j);
- aBuffer_1192.put2A(k);
+ aPacket_1192.putOp(41);
+ aPacket_1192.put2(i1);
+ aPacket_1192.put2A(j);
+ aPacket_1192.put2A(k);
anInt1243 = 0;
anInt1244 = k;
anInt1245 = j;
@@ -4706,30 +4706,30 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(18);
- aBuffer_1192.put2LE(i1);
+ aPacket_1192.putOp(18);
+ aPacket_1192.put2LE(i1);
}
}
if (l == 113) {
method66(i1, k, j);
- aBuffer_1192.putOp(70);
- aBuffer_1192.put2LE(j + anInt1034);
- aBuffer_1192.put2(k + anInt1035);
- aBuffer_1192.put2LEA((i1 >> 14) & 0x7fff);
+ aPacket_1192.putOp(70);
+ aPacket_1192.put2LE(j + anInt1034);
+ aPacket_1192.put2(k + anInt1035);
+ aPacket_1192.put2LEA((i1 >> 14) & 0x7fff);
}
if (l == 872) {
method66(i1, k, j);
- aBuffer_1192.putOp(234);
- aBuffer_1192.put2LEA(j + anInt1034);
- aBuffer_1192.put2A((i1 >> 14) & 0x7fff);
- aBuffer_1192.put2LEA(k + anInt1035);
+ aPacket_1192.putOp(234);
+ aPacket_1192.put2LEA(j + anInt1034);
+ aPacket_1192.put2A((i1 >> 14) & 0x7fff);
+ aPacket_1192.put2LEA(k + anInt1035);
}
if (l == 502) {
method66(i1, k, j);
- aBuffer_1192.putOp(132);
- aBuffer_1192.put2LEA(j + anInt1034);
- aBuffer_1192.put2((i1 >> 14) & 0x7fff);
- aBuffer_1192.put2A(k + anInt1035);
+ aPacket_1192.putOp(132);
+ aPacket_1192.put2LEA(j + anInt1034);
+ aPacket_1192.put2((i1 >> 14) & 0x7fff);
+ aPacket_1192.put2A(k + anInt1035);
}
if (l == 1125) {
ObjType type = ObjType.method198(i1);
@@ -4745,8 +4745,8 @@ public class Game extends GameShell {
method77(s5, 0, "");
}
if (l == 169) {
- aBuffer_1192.putOp(185);
- aBuffer_1192.put2(k);
+ aPacket_1192.putOp(185);
+ aPacket_1192.put2(k);
Component component_3 = Component.aComponentArray210[k];
if ((component_3.anIntArrayArray226 != null) && (component_3.anIntArrayArray226[0][0] == 5)) {
int l2 = component_3.anIntArrayArray226[0][1];
@@ -4785,10 +4785,10 @@ public class Game extends GameShell {
anInt915 = super.anInt28;
anInt917 = 2;
anInt916 = 0;
- aBuffer_1192.putOp(253);
- aBuffer_1192.put2LE(j + anInt1034);
- aBuffer_1192.put2LEA(k + anInt1035);
- aBuffer_1192.put2A(i1);
+ aPacket_1192.putOp(253);
+ aPacket_1192.put2LE(j + anInt1034);
+ aPacket_1192.put2LEA(k + anInt1035);
+ aPacket_1192.put2A(i1);
}
if (l == 1448) {
ObjType type_1 = ObjType.method198(i1);
@@ -5051,22 +5051,22 @@ public class Game extends GameShell {
method35(l1);
}
if ((anInt1064 == 3) && (aString1212.length() > 0)) {
- aBuffer_1192.putOp(126);
- aBuffer_1192.put1(0);
- int k = aBuffer_1192.position;
- aBuffer_1192.put8(aLong953);
- Huffman.method526(aString1212, aBuffer_1192);
- aBuffer_1192.putSize1(aBuffer_1192.position - k);
+ aPacket_1192.putOp(126);
+ aPacket_1192.put1(0);
+ int k = aPacket_1192.position;
+ aPacket_1192.put8(aLong953);
+ Huffman.method526(aString1212, aPacket_1192);
+ aPacket_1192.putSize1(aPacket_1192.position - k);
aString1212 = Huffman.method527(aString1212);
aString1212 = Censor.method497(aString1212, 0);
method77(aString1212, 6, StringUtil.formatName(StringUtil.fromBase37(aLong953)));
if (anInt845 == 2) {
anInt845 = 1;
aBoolean1233 = true;
- aBuffer_1192.putOp(95);
- aBuffer_1192.put1(anInt1287);
- aBuffer_1192.put1(anInt845);
- aBuffer_1192.put1(anInt1248);
+ aPacket_1192.putOp(95);
+ aPacket_1192.put1(anInt1287);
+ aPacket_1192.put1(anInt845);
+ aPacket_1192.put1(anInt1248);
}
}
if ((anInt1064 == 4) && (anInt822 < 100)) {
@@ -5094,8 +5094,8 @@ public class Game extends GameShell {
i1 = Integer.parseInt(aString1004);
} catch (Exception ignored) {
}
- aBuffer_1192.putOp(208);
- aBuffer_1192.put4(i1);
+ aPacket_1192.putOp(208);
+ aPacket_1192.put4(i1);
}
anInt1225 = 0;
aBoolean1223 = true;
@@ -5111,8 +5111,8 @@ public class Game extends GameShell {
}
if ((j == 13) || (j == 10)) {
if (aString1004.length() > 0) {
- aBuffer_1192.putOp(60);
- aBuffer_1192.put8(StringUtil.toBase37(aString1004));
+ aPacket_1192.putOp(60);
+ aPacket_1192.put8(StringUtil.toBase37(aString1004));
}
anInt1225 = 0;
aBoolean1223 = true;
@@ -5156,9 +5156,9 @@ public class Game extends GameShell {
}
}
if (aString887.startsWith("::")) {
- aBuffer_1192.putOp(103);
- aBuffer_1192.put1(aString887.length() - 1);
- aBuffer_1192.put(aString887.substring(2));
+ aPacket_1192.putOp(103);
+ aPacket_1192.put1(aString887.length() - 1);
+ aPacket_1192.put(aString887.substring(2));
} else {
String s = aString887.toLowerCase();
int j2 = 0;
@@ -5217,15 +5217,15 @@ public class Game extends GameShell {
i3 = 5;
aString887 = aString887.substring(6);
}
- aBuffer_1192.putOp(4);
- aBuffer_1192.put1(0);
- int j3 = aBuffer_1192.position;
- aBuffer_1192.put1S(i3);
- aBuffer_1192.put1S(j2);
- aBuffer_834.position = 0;
- Huffman.method526(aString887, aBuffer_834);
- aBuffer_1192.putA(aBuffer_834.data, 0, aBuffer_834.position);
- aBuffer_1192.putSize1(aBuffer_1192.position - j3);
+ aPacket_1192.putOp(4);
+ aPacket_1192.put1(0);
+ int j3 = aPacket_1192.position;
+ aPacket_1192.put1S(i3);
+ aPacket_1192.put1S(j2);
+ aPacket_834.position = 0;
+ Huffman.method526(aString887, aPacket_834);
+ aPacket_1192.putA(aPacket_834.data, 0, aPacket_834.position);
+ aPacket_1192.putSize1(aPacket_1192.position - j3);
aString887 = Huffman.method527(aString887);
aString887 = Censor.method497(aString887, 0);
aPlayer_1126.aString1506 = aString887;
@@ -5242,10 +5242,10 @@ public class Game extends GameShell {
if (anInt1287 == 2) {
anInt1287 = 3;
aBoolean1233 = true;
- aBuffer_1192.putOp(95);
- aBuffer_1192.put1(anInt1287);
- aBuffer_1192.put1(anInt845);
- aBuffer_1192.put1(anInt1248);
+ aPacket_1192.putOp(95);
+ aPacket_1192.put1(anInt1287);
+ aPacket_1192.put1(anInt845);
+ aPacket_1192.put1(anInt1248);
}
}
aString887 = "";
@@ -5892,54 +5892,54 @@ public class Game extends GameShell {
aConnection_1168 = new Connection(this, method19(43594 + anInt958));
long l = StringUtil.toBase37(s);
int i = (int) ((l >> 16) & 31L);
- aBuffer_1192.position = 0;
- aBuffer_1192.put1(14);
- aBuffer_1192.put1(i);
- aConnection_1168.method271(2, aBuffer_1192.data, 0);
+ aPacket_1192.position = 0;
+ aPacket_1192.put1(14);
+ aPacket_1192.put1(i);
+ aConnection_1168.method271(2, aPacket_1192.data, 0);
for (int j = 0; j < 8; j++) {
aConnection_1168.method268();
}
int k = aConnection_1168.method268();
int i1 = k;
if (k == 0) {
- aConnection_1168.method270(aBuffer_1083.data, 0, 8);
- aBuffer_1083.position = 0;
- aLong1215 = aBuffer_1083.get8();
+ aConnection_1168.method270(aPacket_1083.data, 0, 8);
+ aPacket_1083.position = 0;
+ aLong1215 = aPacket_1083.get8();
int[] ai = new int[4];
ai[0] = (int) (Math.random() * 99999999D);
ai[1] = (int) (Math.random() * 99999999D);
ai[2] = (int) (aLong1215 >> 32);
ai[3] = (int) aLong1215;
- aBuffer_1192.position = 0;
- aBuffer_1192.put1(10);
- aBuffer_1192.put4(ai[0]);
- aBuffer_1192.put4(ai[1]);
- aBuffer_1192.put4(ai[2]);
- aBuffer_1192.put4(ai[3]);
- aBuffer_1192.put4(Signlink.uid);
- aBuffer_1192.put(s);
- aBuffer_1192.put(s1);
- aBuffer_1192.encrypt(aBigInteger1032, aBigInteger856);
- aBuffer_847.position = 0;
+ aPacket_1192.position = 0;
+ aPacket_1192.put1(10);
+ aPacket_1192.put4(ai[0]);
+ aPacket_1192.put4(ai[1]);
+ aPacket_1192.put4(ai[2]);
+ aPacket_1192.put4(ai[3]);
+ aPacket_1192.put4(Signlink.uid);
+ aPacket_1192.put(s);
+ aPacket_1192.put(s1);
+ aPacket_1192.encrypt(aBigInteger1032, aBigInteger856);
+ aPacket_847.position = 0;
if (flag) {
- aBuffer_847.put1(18);
+ aPacket_847.put1(18);
} else {
- aBuffer_847.put1(16);
+ aPacket_847.put1(16);
}
- aBuffer_847.put1(aBuffer_1192.position + 36 + 1 + 1 + 2);
- aBuffer_847.put1(255);
- aBuffer_847.put2(317);
- aBuffer_847.put1(aBoolean960 ? 1 : 0);
+ aPacket_847.put1(aPacket_1192.position + 36 + 1 + 1 + 2);
+ aPacket_847.put1(255);
+ aPacket_847.put2(317);
+ aPacket_847.put1(aBoolean960 ? 1 : 0);
for (int l1 = 0; l1 < 9; l1++) {
- aBuffer_847.put4(anIntArray1090[l1]);
+ aPacket_847.put4(anIntArray1090[l1]);
}
- aBuffer_847.put(aBuffer_1192.data, aBuffer_1192.position, 0);
- aBuffer_1192.cipher = new ISAACCipher(ai);
+ aPacket_847.put(aPacket_1192.data, aPacket_1192.position, 0);
+ aPacket_1192.cipher = new ISAACCipher(ai);
for (int j2 = 0; j2 < 4; j2++) {
ai[j2] += 50;
}
aISAACCipher_1000 = new ISAACCipher(ai);
- aConnection_1168.method271(aBuffer_847.position, aBuffer_847.data, 0);
+ aConnection_1168.method271(aPacket_847.position, aPacket_847.data, 0);
k = aConnection_1168.method268();
}
if (k == 1) {
@@ -5959,8 +5959,8 @@ public class Game extends GameShell {
super.aBoolean17 = true;
aBoolean954 = true;
aBoolean1157 = true;
- aBuffer_1192.position = 0;
- aBuffer_1083.position = 0;
+ aPacket_1192.position = 0;
+ aPacket_1083.position = 0;
anInt1008 = -1;
anInt841 = -1;
anInt842 = -1;
@@ -5994,7 +5994,7 @@ public class Game extends GameShell {
anInt836 = 0;
for (int i2 = 0; i2 < anInt888; i2++) {
aPlayerArray890[i2] = null;
- aBufferArray895[i2] = null;
+ aPacketArray895[i2] = null;
}
for (int k2 = 0; k2 < 16384; k2++) {
aNpcArray835[k2] = null;
@@ -6099,8 +6099,8 @@ public class Game extends GameShell {
}
if (k == 15) {
aBoolean1157 = true;
- aBuffer_1192.position = 0;
- aBuffer_1083.position = 0;
+ aPacket_1192.position = 0;
+ aPacket_1083.position = 0;
anInt1008 = -1;
anInt841 = -1;
anInt842 = -1;
@@ -6326,43 +6326,43 @@ public class Game extends GameShell {
int k6 = anIntArray1280[i4];
int i7 = anIntArray1281[i4];
if (i == 0) {
- aBuffer_1192.putOp(164);
- aBuffer_1192.put1(k4 + k4 + 3);
+ aPacket_1192.putOp(164);
+ aPacket_1192.put1(k4 + k4 + 3);
}
if (i == 1) {
- aBuffer_1192.putOp(248);
- aBuffer_1192.put1(k4 + k4 + 3 + 14);
+ aPacket_1192.putOp(248);
+ aPacket_1192.put1(k4 + k4 + 3 + 14);
}
if (i == 2) {
- aBuffer_1192.putOp(98);
- aBuffer_1192.put1(k4 + k4 + 3);
+ aPacket_1192.putOp(98);
+ aPacket_1192.put1(k4 + k4 + 3);
}
- aBuffer_1192.put2LEA(k6 + anInt1034);
+ aPacket_1192.put2LEA(k6 + anInt1034);
anInt1261 = anIntArray1280[0];
anInt1262 = anIntArray1281[0];
for (int j7 = 1; j7 < k4; j7++) {
i4--;
- aBuffer_1192.put1(anIntArray1280[i4] - k6);
- aBuffer_1192.put1(anIntArray1281[i4] - i7);
+ aPacket_1192.put1(anIntArray1280[i4] - k6);
+ aPacket_1192.put1(anIntArray1281[i4] - i7);
}
- aBuffer_1192.put2LE(i7 + anInt1035);
- aBuffer_1192.put1C((super.anIntArray30[5] != 1) ? 0 : 1);
+ aPacket_1192.put2LE(i7 + anInt1035);
+ aPacket_1192.put1C((super.anIntArray30[5] != 1) ? 0 : 1);
return true;
}
return i != 1;
}
- public void method86(Buffer buffer) {
+ public void method86(Packet packet) {
for (int j = 0; j < anInt893; j++) {
int k = anIntArray894[j];
NPCEntity npc = aNpcArray835[k];
- int l = buffer.get1U();
+ int l = packet.get1U();
if ((l & 0x10) != 0) {
- int i1 = buffer.get2ULE();
+ int i1 = packet.get2ULE();
if (i1 == 65535) {
i1 = -1;
}
- int i2 = buffer.get1U();
+ int i2 = packet.get1U();
if ((i1 == npc.anInt1526) && (i1 != -1)) {
int l2 = SeqType.aTypeArray351[i1].anInt365;
if (l2 == 1) {
@@ -6384,16 +6384,16 @@ public class Game extends GameShell {
}
}
if ((l & 8) != 0) {
- int j1 = buffer.get1UA();
- int j2 = buffer.getU1C();
+ int j1 = packet.get1UA();
+ int j2 = packet.getU1C();
npc.method447(j2, j1, anInt1161);
npc.anInt1532 = anInt1161 + 300;
- npc.anInt1533 = buffer.get1UA();
- npc.anInt1534 = buffer.get1U();
+ npc.anInt1533 = packet.get1UA();
+ npc.anInt1534 = packet.get1U();
}
if ((l & 0x80) != 0) {
- npc.anInt1520 = buffer.get2U();
- int k1 = buffer.get4();
+ npc.anInt1520 = packet.get2U();
+ int k1 = packet.get4();
npc.anInt1524 = k1 >> 16;
npc.anInt1523 = anInt1161 + (k1 & 0xffff);
npc.anInt1521 = 0;
@@ -6406,25 +6406,25 @@ public class Game extends GameShell {
}
}
if ((l & 0x20) != 0) {
- npc.anInt1502 = buffer.get2U();
+ npc.anInt1502 = packet.get2U();
if (npc.anInt1502 == 65535) {
npc.anInt1502 = -1;
}
}
if ((l & 1) != 0) {
- npc.aString1506 = buffer.getString();
+ npc.aString1506 = packet.getString();
npc.anInt1535 = 100;
}
if ((l & 0x40) != 0) {
- int l1 = buffer.getU1C();
- int k2 = buffer.get1US();
+ int l1 = packet.getU1C();
+ int k2 = packet.get1US();
npc.method447(k2, l1, anInt1161);
npc.anInt1532 = anInt1161 + 300;
- npc.anInt1533 = buffer.get1US();
- npc.anInt1534 = buffer.getU1C();
+ npc.anInt1533 = packet.get1US();
+ npc.anInt1534 = packet.getU1C();
}
if ((l & 2) != 0) {
- npc.aType_1696 = NPCType.method159(buffer.get2ULEA());
+ npc.aType_1696 = NPCType.method159(packet.get2ULEA());
npc.anInt1540 = npc.aType_1696.aByte68;
npc.anInt1504 = npc.aType_1696.anInt79;
npc.anInt1554 = npc.aType_1696.anInt67;
@@ -6434,8 +6434,8 @@ public class Game extends GameShell {
npc.anInt1511 = npc.aType_1696.anInt77;
}
if ((l & 4) != 0) {
- npc.anInt1538 = buffer.get2ULE();
- npc.anInt1539 = buffer.get2ULE();
+ npc.anInt1538 = packet.get2ULE();
+ npc.anInt1539 = packet.get2ULE();
}
}
}
@@ -6657,11 +6657,11 @@ public class Game extends GameShell {
flag1 = true;
}
} else {
- Buffer buffer = SoundTrack.method241(anIntArray1241[i], anIntArray1207[i]);
- if ((System.currentTimeMillis() + (long) (buffer.position / 22)) > (aLong1172 + (long) (anInt1257 / 22))) {
- anInt1257 = buffer.position;
+ Packet packet = SoundTrack.method241(anIntArray1241[i], anIntArray1207[i]);
+ if ((System.currentTimeMillis() + (long) (packet.position / 22)) > (aLong1172 + (long) (anInt1257 / 22))) {
+ anInt1257 = packet.position;
aLong1172 = System.currentTimeMillis();
- if (method59(buffer.data, buffer.position)) {
+ if (method59(packet.data, packet.position)) {
anInt874 = anIntArray1207[i];
anInt1289 = anIntArray1241[i];
} else {
@@ -6699,37 +6699,37 @@ public class Game extends GameShell {
}
}
- public void method91(Buffer buffer, int i) {
- while ((buffer.bitPosition + 10) < (i * 8)) {
- int j = buffer.getBits(11);
+ public void method91(Packet packet, int i) {
+ while ((packet.bitPosition + 10) < (i * 8)) {
+ int j = packet.getBits(11);
if (j == 2047) {
break;
}
if (aPlayerArray890[j] == null) {
aPlayerArray890[j] = new PlayerEntity();
- if (aBufferArray895[j] != null) {
- aPlayerArray890[j].method451(aBufferArray895[j]);
+ if (aPacketArray895[j] != null) {
+ aPlayerArray890[j].method451(aPacketArray895[j]);
}
}
anIntArray892[anInt891++] = j;
PlayerEntity player = aPlayerArray890[j];
player.anInt1537 = anInt1161;
- int k = buffer.getBits(1);
+ int k = packet.getBits(1);
if (k == 1) {
anIntArray894[anInt893++] = j;
}
- int l = buffer.getBits(1);
- int i1 = buffer.getBits(5);
+ int l = packet.getBits(1);
+ int i1 = packet.getBits(5);
if (i1 > 15) {
i1 -= 32;
}
- int j1 = buffer.getBits(5);
+ int j1 = packet.getBits(5);
if (j1 > 15) {
j1 -= 32;
}
player.method445(aPlayer_1126.anIntArray1500[0] + j1, aPlayer_1126.anIntArray1501[0] + i1, l == 1);
}
- buffer.accessBytes();
+ packet.accessBytes();
}
public void method92() {
@@ -6753,17 +6753,17 @@ public class Game extends GameShell {
int j2 = (aPlayer_1126.anInt1551 - l1) >> 7;
boolean flag1 = method85(1, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, j2, aPlayer_1126.anIntArray1500[0], true, i2);
if (flag1) {
- aBuffer_1192.put1(i);
- aBuffer_1192.put1(j);
- aBuffer_1192.put2(anInt1185);
- aBuffer_1192.put1(57);
- aBuffer_1192.put1(anInt1209);
- aBuffer_1192.put1(anInt1170);
- aBuffer_1192.put1(89);
- aBuffer_1192.put2(aPlayer_1126.anInt1550);
- aBuffer_1192.put2(aPlayer_1126.anInt1551);
- aBuffer_1192.put1(anInt1264);
- aBuffer_1192.put1(63);
+ aPacket_1192.put1(i);
+ aPacket_1192.put1(j);
+ aPacket_1192.put2(anInt1185);
+ aPacket_1192.put1(57);
+ aPacket_1192.put1(anInt1209);
+ aPacket_1192.put1(anInt1170);
+ aPacket_1192.put1(89);
+ aPacket_1192.put2(aPlayer_1126.anInt1550);
+ aPacket_1192.put2(aPlayer_1126.anInt1551);
+ aPacket_1192.put1(anInt1264);
+ aPacket_1192.put1(63);
}
}
}
@@ -7234,8 +7234,8 @@ public class Game extends GameShell {
if (aBoolean1103) {
if ((anInt1054 != -1) && (anInt1054 == anInt1221)) {
anInt1054 = -1;
- aBuffer_1192.putOp(120);
- aBuffer_1192.put1(anInt1221);
+ aPacket_1192.putOp(120);
+ aPacket_1192.put1(anInt1221);
}
aBoolean1103 = false;
aArea_1125.method237();
@@ -7749,20 +7749,20 @@ public class Game extends GameShell {
}
}
- public void method107(int i, int j, Buffer buffer, PlayerEntity player) {
+ public void method107(int i, int j, Packet packet, PlayerEntity player) {
if ((i & 0x400) != 0) {
- player.anInt1543 = buffer.get1US();
- player.anInt1545 = buffer.get1US();
- player.anInt1544 = buffer.get1US();
- player.anInt1546 = buffer.get1US();
- player.anInt1547 = buffer.get2ULEA() + anInt1161;
- player.anInt1548 = buffer.get2UA() + anInt1161;
- player.anInt1549 = buffer.get1US();
+ player.anInt1543 = packet.get1US();
+ player.anInt1545 = packet.get1US();
+ player.anInt1544 = packet.get1US();
+ player.anInt1546 = packet.get1US();
+ player.anInt1547 = packet.get2ULEA() + anInt1161;
+ player.anInt1548 = packet.get2UA() + anInt1161;
+ player.anInt1549 = packet.get1US();
player.method446();
}
if ((i & 0x100) != 0) {
- player.anInt1520 = buffer.get2ULE();
- int k = buffer.get4();
+ player.anInt1520 = packet.get2ULE();
+ int k = packet.get4();
player.anInt1524 = k >> 16;
player.anInt1523 = anInt1161 + (k & 0xffff);
player.anInt1521 = 0;
@@ -7775,11 +7775,11 @@ public class Game extends GameShell {
}
}
if ((i & 8) != 0) {
- int l = buffer.get2ULE();
+ int l = packet.get2ULE();
if (l == 65535) {
l = -1;
}
- int i2 = buffer.getU1C();
+ int i2 = packet.getU1C();
if ((l == player.anInt1526) && (l != -1)) {
int i3 = SeqType.aTypeArray351[l].anInt365;
if (i3 == 1) {
@@ -7801,7 +7801,7 @@ public class Game extends GameShell {
}
}
if ((i & 4) != 0) {
- player.aString1506 = buffer.getString();
+ player.aString1506 = packet.getString();
if (player.aString1506.charAt(0) == '~') {
player.aString1506 = player.aString1506.substring(1);
method77(player.aString1506, 2, player.aString1703);
@@ -7813,10 +7813,10 @@ public class Game extends GameShell {
player.anInt1535 = 150;
}
if ((i & 0x80) != 0) {
- int i1 = buffer.get2ULE();
- int j2 = buffer.get1U();
- int j3 = buffer.getU1C();
- int k3 = buffer.position;
+ int i1 = packet.get2ULE();
+ int j2 = packet.get1U();
+ int j3 = packet.getU1C();
+ int k3 = packet.position;
if ((player.aString1703 != null) && player.aBoolean1710) {
long l3 = StringUtil.toBase37(player.aString1703);
boolean flag = false;
@@ -7831,10 +7831,10 @@ public class Game extends GameShell {
}
if (!flag && (anInt1251 == 0)) {
try {
- aBuffer_834.position = 0;
- buffer.getReversed(aBuffer_834.data, 0, j3);
- aBuffer_834.position = 0;
- String s = Huffman.method525(j3, aBuffer_834);
+ aPacket_834.position = 0;
+ packet.getReversed(aPacket_834.data, 0, j3);
+ aPacket_834.position = 0;
+ String s = Huffman.method525(j3, aPacket_834);
s = Censor.method497(s, 0);
player.aString1506 = s;
player.anInt1513 = i1 >> 8;
@@ -7852,41 +7852,41 @@ public class Game extends GameShell {
}
}
}
- buffer.position = k3 + j3;
+ packet.position = k3 + j3;
}
if ((i & 1) != 0) {
- player.anInt1502 = buffer.get2ULE();
+ player.anInt1502 = packet.get2ULE();
if (player.anInt1502 == 65535) {
player.anInt1502 = -1;
}
}
if ((i & 0x10) != 0) {
- int j1 = buffer.getU1C();
+ int j1 = packet.getU1C();
byte[] abyte0 = new byte[j1];
- Buffer buffer_1 = new Buffer(abyte0);
- buffer.get(abyte0, 0, j1);
- aBufferArray895[j] = buffer_1;
- player.method451(buffer_1);
+ Packet packet_1 = new Packet(abyte0);
+ packet.get(abyte0, 0, j1);
+ aPacketArray895[j] = packet_1;
+ player.method451(packet_1);
}
if ((i & 2) != 0) {
- player.anInt1538 = buffer.get2ULEA();
- player.anInt1539 = buffer.get2ULE();
+ player.anInt1538 = packet.get2ULEA();
+ player.anInt1539 = packet.get2ULE();
}
if ((i & 0x20) != 0) {
- int k1 = buffer.get1U();
- int k2 = buffer.get1UA();
+ int k1 = packet.get1U();
+ int k2 = packet.get1UA();
player.method447(k2, k1, anInt1161);
player.anInt1532 = anInt1161 + 300;
- player.anInt1533 = buffer.getU1C();
- player.anInt1534 = buffer.get1U();
+ player.anInt1533 = packet.getU1C();
+ player.anInt1534 = packet.get1U();
}
if ((i & 0x200) != 0) {
- int l1 = buffer.get1U();
- int l2 = buffer.get1US();
+ int l1 = packet.get1U();
+ int l2 = packet.get1US();
player.method447(l2, l1, anInt1161);
player.anInt1532 = anInt1161 + 300;
- player.anInt1533 = buffer.get1U();
- player.anInt1534 = buffer.getU1C();
+ player.anInt1533 = packet.get1U();
+ player.anInt1534 = packet.getU1C();
}
}
@@ -8051,8 +8051,8 @@ public class Game extends GameShell {
}
aLongArray925[anInt822++] = l;
aBoolean1153 = true;
- aBuffer_1192.putOp(133);
- aBuffer_1192.put8(l);
+ aPacket_1192.putOp(133);
+ aPacket_1192.put8(l);
}
public void method114() {
@@ -8173,46 +8173,46 @@ public class Game extends GameShell {
}
}
- public void method117(Buffer buffer) {
- buffer.accessBits();
- int j = buffer.getBits(1);
+ public void method117(Packet packet) {
+ packet.accessBits();
+ int j = packet.getBits(1);
if (j == 0) {
return;
}
- int k = buffer.getBits(2);
+ int k = packet.getBits(2);
if (k == 0) {
anIntArray894[anInt893++] = anInt889;
return;
}
if (k == 1) {
- int l = buffer.getBits(3);
+ int l = packet.getBits(3);
aPlayer_1126.method448(false, l);
- int k1 = buffer.getBits(1);
+ int k1 = packet.getBits(1);
if (k1 == 1) {
anIntArray894[anInt893++] = anInt889;
}
return;
}
if (k == 2) {
- int i1 = buffer.getBits(3);
+ int i1 = packet.getBits(3);
aPlayer_1126.method448(true, i1);
- int l1 = buffer.getBits(3);
+ int l1 = packet.getBits(3);
aPlayer_1126.method448(true, l1);
- int j2 = buffer.getBits(1);
+ int j2 = packet.getBits(1);
if (j2 == 1) {
anIntArray894[anInt893++] = anInt889;
}
return;
}
if (k == 3) {
- anInt918 = buffer.getBits(2);
- int j1 = buffer.getBits(1);
- int i2 = buffer.getBits(1);
+ anInt918 = packet.getBits(2);
+ int j1 = packet.getBits(1);
+ int i2 = packet.getBits(1);
if (i2 == 1) {
anIntArray894[anInt893++] = anInt889;
}
- int k2 = buffer.getBits(7);
- int l2 = buffer.getBits(7);
+ int k2 = packet.getBits(7);
+ int l2 = packet.getBits(7);
aPlayer_1126.method445(l2, k2, j1 == 1);
}
}
@@ -8379,8 +8379,8 @@ public class Game extends GameShell {
for (int k = j; k < anInt822; k++) {
aLongArray925[k] = aLongArray925[k + 1];
}
- aBuffer_1192.putOp(74);
- aBuffer_1192.put8(l);
+ aPacket_1192.putOp(74);
+ aPacket_1192.put8(l);
return;
}
}
@@ -8886,8 +8886,8 @@ public class Game extends GameShell {
aArea_1111.method238(0, super.aGraphics12, 637);
}
- public void method134(Buffer buffer) {
- int j = buffer.getBits(8);
+ public void method134(Packet packet) {
+ int j = packet.getBits(8);
if (j < anInt891) {
for (int k = j; k < anInt891; k++) {
anIntArray840[anInt839++] = anIntArray892[k];
@@ -8901,12 +8901,12 @@ public class Game extends GameShell {
for (int l = 0; l < j; l++) {
int i1 = anIntArray892[l];
PlayerEntity player = aPlayerArray890[i1];
- int j1 = buffer.getBits(1);
+ int j1 = packet.getBits(1);
if (j1 == 0) {
anIntArray892[anInt891++] = i1;
player.anInt1537 = anInt1161;
} else {
- int k1 = buffer.getBits(2);
+ int k1 = packet.getBits(2);
if (k1 == 0) {
anIntArray892[anInt891++] = i1;
player.anInt1537 = anInt1161;
@@ -8914,20 +8914,20 @@ public class Game extends GameShell {
} else if (k1 == 1) {
anIntArray892[anInt891++] = i1;
player.anInt1537 = anInt1161;
- int l1 = buffer.getBits(3);
+ int l1 = packet.getBits(3);
player.method448(false, l1);
- int j2 = buffer.getBits(1);
+ int j2 = packet.getBits(1);
if (j2 == 1) {
anIntArray894[anInt893++] = i1;
}
} else if (k1 == 2) {
anIntArray892[anInt891++] = i1;
player.anInt1537 = anInt1161;
- int i2 = buffer.getBits(3);
+ int i2 = packet.getBits(3);
player.method448(true, i2);
- int k2 = buffer.getBits(3);
+ int k2 = packet.getBits(3);
player.method448(true, k2);
- int l2 = buffer.getBits(1);
+ int l2 = packet.getBits(1);
if (l2 == 1) {
anIntArray894[anInt893++] = i1;
}
@@ -9037,14 +9037,14 @@ public class Game extends GameShell {
aBoolean962 = false;
}
- public void method137(Buffer buffer, int j) {
+ public void method137(Packet packet, int j) {
if (j == 84) {
- int k = buffer.get1U();
+ int k = packet.get1U();
int j3 = anInt1268 + ((k >> 4) & 7);
int i6 = anInt1269 + (k & 7);
- int l8 = buffer.get2U();
- int k11 = buffer.get2U();
- int l13 = buffer.get2U();
+ int l8 = packet.get2U();
+ int k11 = packet.get2U();
+ int l13 = packet.get2U();
if ((j3 >= 0) && (i6 >= 0) && (j3 < 104) && (i6 < 104)) {
LinkedList list_1 = aListArrayArrayArray827[anInt918][j3][i6];
if (list_1 != null) {
@@ -9061,11 +9061,11 @@ public class Game extends GameShell {
return;
}
if (j == 105) {
- int l = buffer.get1U();
+ int l = packet.get1U();
int k3 = anInt1268 + ((l >> 4) & 7);
int j6 = anInt1269 + (l & 7);
- int i9 = buffer.get2U();
- int l11 = buffer.get1U();
+ int i9 = packet.get2U();
+ int l11 = packet.get1U();
int i14 = (l11 >> 4) & 0xf;
int i16 = l11 & 7;
if ((aPlayer_1126.anIntArray1500[0] >= (k3 - i14)) && (aPlayer_1126.anIntArray1500[0] <= (k3 + i14)) && (aPlayer_1126.anIntArray1501[0] >= (j6 - i14)) && (aPlayer_1126.anIntArray1501[0] <= (j6 + i14)) && aBoolean848 && !aBoolean960 && (anInt1062 < 50)) {
@@ -9076,12 +9076,12 @@ public class Game extends GameShell {
}
}
if (j == 215) {
- int i1 = buffer.get2UA();
- int l3 = buffer.get1US();
+ int i1 = packet.get2UA();
+ int l3 = packet.get1US();
int k6 = anInt1268 + ((l3 >> 4) & 7);
int j9 = anInt1269 + (l3 & 7);
- int i12 = buffer.get2UA();
- int j14 = buffer.get2U();
+ int i12 = packet.get2UA();
+ int j14 = packet.get2U();
if ((k6 >= 0) && (j9 >= 0) && (k6 < 104) && (j9 < 104) && (i12 != anInt884)) {
ObjStackEntity class30_sub2_sub4_sub2_2 = new ObjStackEntity();
class30_sub2_sub4_sub2_2.anInt1558 = i1;
@@ -9095,10 +9095,10 @@ public class Game extends GameShell {
return;
}
if (j == 156) {
- int j1 = buffer.get1UA();
+ int j1 = packet.get1UA();
int i4 = anInt1268 + ((j1 >> 4) & 7);
int l6 = anInt1269 + (j1 & 7);
- int k9 = buffer.get2U();
+ int k9 = packet.get2U();
if ((i4 >= 0) && (l6 >= 0) && (i4 < 104) && (l6 < 104)) {
LinkedList list = aListArrayArrayArray827[anInt918][i4][l6];
if (list != null) {
@@ -9118,14 +9118,14 @@ public class Game extends GameShell {
return;
}
if (j == 160) {
- int k1 = buffer.get1US();
+ int k1 = packet.get1US();
int j4 = anInt1268 + ((k1 >> 4) & 7);
int i7 = anInt1269 + (k1 & 7);
- int l9 = buffer.get1US();
+ int l9 = packet.get1US();
int j12 = l9 >> 2;
int k14 = l9 & 3;
int j16 = anIntArray1177[j12];
- int j17 = buffer.get2UA();
+ int j17 = packet.get2UA();
if ((j4 >= 0) && (i7 >= 0) && (j4 < 103) && (i7 < 103)) {
int j18 = anIntArrayArrayArray1214[anInt918][j4][i7];
int i19 = anIntArrayArrayArray1214[anInt918][j4 + 1][i7];
@@ -9168,21 +9168,21 @@ public class Game extends GameShell {
return;
}
if (j == 147) {
- int l1 = buffer.get1US();
+ int l1 = packet.get1US();
int k4 = anInt1268 + ((l1 >> 4) & 7);
int j7 = anInt1269 + (l1 & 7);
- int i10 = buffer.get2U();
- byte byte0 = buffer.get1S();
- int l14 = buffer.get2ULE();
- byte byte1 = buffer.get1C();
- int k17 = buffer.get2U();
- int k18 = buffer.get1US();
+ int i10 = packet.get2U();
+ byte byte0 = packet.get1S();
+ int l14 = packet.get2ULE();
+ byte byte1 = packet.get1C();
+ int k17 = packet.get2U();
+ int k18 = packet.get1US();
int j19 = k18 >> 2;
int i20 = k18 & 3;
int l20 = anIntArray1177[j19];
- byte byte2 = buffer.get1();
- int l21 = buffer.get2U();
- byte byte3 = buffer.get1C();
+ byte byte2 = packet.get1();
+ int l21 = packet.get2U();
+ byte byte3 = packet.get1C();
PlayerEntity player;
if (i10 == anInt884) {
player = aPlayer_1126;
@@ -9228,11 +9228,11 @@ public class Game extends GameShell {
}
}
if (j == 151) {
- int i2 = buffer.get1UA();
+ int i2 = packet.get1UA();
int l4 = anInt1268 + ((i2 >> 4) & 7);
int k7 = anInt1269 + (i2 & 7);
- int j10 = buffer.get2ULE();
- int k12 = buffer.get1US();
+ int j10 = packet.get2ULE();
+ int k12 = packet.get1US();
int i15 = k12 >> 2;
int k16 = k12 & 3;
int l17 = anIntArray1177[i15];
@@ -9242,12 +9242,12 @@ public class Game extends GameShell {
return;
}
if (j == 4) {
- int j2 = buffer.get1U();
+ int j2 = packet.get1U();
int i5 = anInt1268 + ((j2 >> 4) & 7);
int l7 = anInt1269 + (j2 & 7);
- int k10 = buffer.get2U();
- int l12 = buffer.get1U();
- int j15 = buffer.get2U();
+ int k10 = packet.get2U();
+ int l12 = packet.get1U();
+ int j15 = packet.get2U();
if ((i5 >= 0) && (l7 >= 0) && (i5 < 104) && (l7 < 104)) {
i5 = (i5 * 128) + 64;
l7 = (l7 * 128) + 64;
@@ -9257,9 +9257,9 @@ public class Game extends GameShell {
return;
}
if (j == 44) {
- int k2 = buffer.get2ULEA();
- int j5 = buffer.get2U();
- int i8 = buffer.get1U();
+ int k2 = packet.get2ULEA();
+ int j5 = packet.get2U();
+ int i8 = packet.get1U();
int l10 = anInt1268 + ((i8 >> 4) & 7);
int i13 = anInt1269 + (i8 & 7);
if ((l10 >= 0) && (i13 >= 0) && (l10 < 104) && (i13 < 104)) {
@@ -9275,11 +9275,11 @@ public class Game extends GameShell {
return;
}
if (j == 101) {
- int l2 = buffer.getU1C();
+ int l2 = packet.getU1C();
int k5 = l2 >> 2;
int j8 = l2 & 3;
int i11 = anIntArray1177[k5];
- int j13 = buffer.get1U();
+ int j13 = packet.get1U();
int k15 = anInt1268 + ((j13 >> 4) & 7);
int l16 = anInt1269 + (j13 & 7);
if ((k15 >= 0) && (l16 >= 0) && (k15 < 104) && (l16 < 104)) {
@@ -9288,19 +9288,19 @@ public class Game extends GameShell {
return;
}
if (j == 117) {
- int i3 = buffer.get1U();
+ int i3 = packet.get1U();
int l5 = anInt1268 + ((i3 >> 4) & 7);
int k8 = anInt1269 + (i3 & 7);
- int j11 = l5 + buffer.get1();
- int k13 = k8 + buffer.get1();
- int l15 = buffer.get2();
- int i17 = buffer.get2U();
- int i18 = buffer.get1U() * 4;
- int l18 = buffer.get1U() * 4;
- int k19 = buffer.get2U();
- int j20 = buffer.get2U();
- int i21 = buffer.get1U();
- int j21 = buffer.get1U();
+ int j11 = l5 + packet.get1();
+ int k13 = k8 + packet.get1();
+ int l15 = packet.get2();
+ int i17 = packet.get2U();
+ int i18 = packet.get1U() * 4;
+ int l18 = packet.get1U() * 4;
+ int k19 = packet.get2U();
+ int j20 = packet.get2U();
+ int i21 = packet.get1U();
+ int j21 = packet.get1U();
if ((l5 >= 0) && (k8 >= 0) && (l5 < 104) && (k8 < 104) && (j11 >= 0) && (k13 >= 0) && (j11 < 104) && (k13 < 104) && (i17 != 65535)) {
l5 = (l5 * 128) + 64;
k8 = (k8 * 128) + 64;
@@ -9313,9 +9313,9 @@ public class Game extends GameShell {
}
}
- public void method139(Buffer buffer) {
- buffer.accessBits();
- int k = buffer.getBits(8);
+ public void method139(Packet packet) {
+ packet.accessBits();
+ int k = packet.getBits(8);
if (k < anInt836) {
for (int l = k; l < anInt836; l++) {
anIntArray840[anInt839++] = anIntArray837[l];
@@ -9329,12 +9329,12 @@ public class Game extends GameShell {
for (int i1 = 0; i1 < k; i1++) {
int j1 = anIntArray837[i1];
NPCEntity npc = aNpcArray835[j1];
- int k1 = buffer.getBits(1);
+ int k1 = packet.getBits(1);
if (k1 == 0) {
anIntArray837[anInt836++] = j1;
npc.anInt1537 = anInt1161;
} else {
- int l1 = buffer.getBits(2);
+ int l1 = packet.getBits(2);
if (l1 == 0) {
anIntArray837[anInt836++] = j1;
npc.anInt1537 = anInt1161;
@@ -9342,20 +9342,20 @@ public class Game extends GameShell {
} else if (l1 == 1) {
anIntArray837[anInt836++] = j1;
npc.anInt1537 = anInt1161;
- int i2 = buffer.getBits(3);
+ int i2 = packet.getBits(3);
npc.method448(false, i2);
- int k2 = buffer.getBits(1);
+ int k2 = packet.getBits(1);
if (k2 == 1) {
anIntArray894[anInt893++] = j1;
}
} else if (l1 == 2) {
anIntArray837[anInt836++] = j1;
npc.anInt1537 = anInt1161;
- int j2 = buffer.getBits(3);
+ int j2 = packet.getBits(3);
npc.method448(true, j2);
- int l2 = buffer.getBits(3);
+ int l2 = packet.getBits(3);
npc.method448(true, l2);
- int i3 = buffer.getBits(1);
+ int i3 = packet.getBits(1);
if (i3 == 1) {
anIntArray894[anInt893++] = j1;
}
@@ -9546,21 +9546,21 @@ public class Game extends GameShell {
}
}
- public void method143(int i, Buffer buffer) {
+ public void method143(int i, Packet packet) {
anInt839 = 0;
anInt893 = 0;
- method117(buffer);
- method134(buffer);
- method91(buffer, i);
- method49(buffer);
+ method117(packet);
+ method134(packet);
+ method91(packet, i);
+ method49(packet);
for (int k = 0; k < anInt839; k++) {
int l = anIntArray840[k];
if (aPlayerArray890[l].anInt1537 != anInt1161) {
aPlayerArray890[l] = null;
}
}
- if (buffer.position != i) {
- Signlink.reporterror("Error packet size mismatch in getplayer pos:" + buffer.position + " psize:" + i);
+ if (packet.position != i) {
+ Signlink.reporterror("Error packet size mismatch in getplayer pos:" + packet.position + " psize:" + i);
throw new RuntimeException("eek");
}
for (int i1 = 0; i1 < anInt891; i1++) {
@@ -9608,8 +9608,8 @@ public class Game extends GameShell {
return false;
}
if (anInt1008 == -1) {
- aConnection_1168.method270(aBuffer_1083.data, 0, 1);
- anInt1008 = aBuffer_1083.data[0] & 0xff;
+ aConnection_1168.method270(aPacket_1083.data, 0, 1);
+ anInt1008 = aPacket_1083.data[0] & 0xff;
if (aISAACCipher_1000 != null) {
anInt1008 = (anInt1008 - aISAACCipher_1000.method246()) & 0xff;
}
@@ -9618,8 +9618,8 @@ public class Game extends GameShell {
}
if (anInt1007 == -1) {
if (i > 0) {
- aConnection_1168.method270(aBuffer_1083.data, 0, 1);
- anInt1007 = aBuffer_1083.data[0] & 0xff;
+ aConnection_1168.method270(aPacket_1083.data, 0, 1);
+ anInt1007 = aPacket_1083.data[0] & 0xff;
i--;
} else {
return false;
@@ -9627,9 +9627,9 @@ public class Game extends GameShell {
}
if (anInt1007 == -2) {
if (i > 1) {
- aConnection_1168.method270(aBuffer_1083.data, 0, 2);
- aBuffer_1083.position = 0;
- anInt1007 = aBuffer_1083.get2U();
+ aConnection_1168.method270(aPacket_1083.data, 0, 2);
+ aPacket_1083.position = 0;
+ anInt1007 = aPacket_1083.get2U();
i -= 2;
} else {
return false;
@@ -9638,24 +9638,24 @@ public class Game extends GameShell {
if (i < anInt1007) {
return false;
}
- aBuffer_1083.position = 0;
- aConnection_1168.method270(aBuffer_1083.data, 0, anInt1007);
+ aPacket_1083.position = 0;
+ aConnection_1168.method270(aPacket_1083.data, 0, anInt1007);
anInt1009 = 0;
anInt843 = anInt842;
anInt842 = anInt841;
anInt841 = anInt1008;
if (anInt1008 == 81) {
- method143(anInt1007, aBuffer_1083);
+ method143(anInt1007, aPacket_1083);
aBoolean1080 = false;
anInt1008 = -1;
return true;
}
if (anInt1008 == 176) {
- anInt1167 = aBuffer_1083.getU1C();
- anInt1154 = aBuffer_1083.get2UA();
- anInt1120 = aBuffer_1083.get1U();
- anInt1193 = aBuffer_1083.get4ME();
- anInt1006 = aBuffer_1083.get2U();
+ anInt1167 = aPacket_1083.getU1C();
+ anInt1154 = aPacket_1083.get2UA();
+ anInt1120 = aPacket_1083.get1U();
+ anInt1193 = aPacket_1083.get4ME();
+ anInt1006 = aPacket_1083.get2U();
if ((anInt1193 != 0) && (anInt857 == -1)) {
Signlink.dnslookup(StringUtil.formatIPv4(anInt1193));
method147();
@@ -9677,8 +9677,8 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 64) {
- anInt1268 = aBuffer_1083.getU1C();
- anInt1269 = aBuffer_1083.get1US();
+ anInt1268 = aPacket_1083.getU1C();
+ anInt1269 = aPacket_1083.get1US();
for (int j = anInt1268; j < (anInt1268 + 8); j++) {
for (int l9 = anInt1269; l9 < (anInt1269 + 8); l9++) {
if (aListArrayArrayArray827[anInt918][j][l9] != null) {
@@ -9696,7 +9696,7 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 185) {
- int k = aBuffer_1083.get2ULEA();
+ int k = aPacket_1083.get2ULEA();
Component.aComponentArray210[k].anInt233 = 3;
if (aPlayer_1126.aType_1698 == null) {
Component.aComponentArray210[k].anInt234 = (aPlayer_1126.anIntArray1700[0] << 25) + (aPlayer_1126.anIntArray1700[4] << 20) + (aPlayer_1126.anIntArray1717[0] << 15) + (aPlayer_1126.anIntArray1717[8] << 10) + (aPlayer_1126.anIntArray1717[11] << 5) + aPlayer_1126.anIntArray1717[1];
@@ -9715,7 +9715,7 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 72) {
- int i1 = aBuffer_1083.get2ULE();
+ int i1 = aPacket_1083.get2ULE();
Component component = Component.aComponentArray210[i1];
for (int k15 = 0; k15 < component.anIntArray253.length; k15++) {
component.anIntArray253[k15] = -1;
@@ -9727,18 +9727,18 @@ public class Game extends GameShell {
if (anInt1008 == 214) {
anInt822 = anInt1007 / 8;
for (int j1 = 0; j1 < anInt822; j1++) {
- aLongArray925[j1] = aBuffer_1083.get8();
+ aLongArray925[j1] = aPacket_1083.get8();
}
anInt1008 = -1;
return true;
}
if (anInt1008 == 166) {
aBoolean1160 = true;
- anInt1098 = aBuffer_1083.get1U();
- anInt1099 = aBuffer_1083.get1U();
- anInt1100 = aBuffer_1083.get2U();
- anInt1101 = aBuffer_1083.get1U();
- anInt1102 = aBuffer_1083.get1U();
+ anInt1098 = aPacket_1083.get1U();
+ anInt1099 = aPacket_1083.get1U();
+ anInt1100 = aPacket_1083.get2U();
+ anInt1101 = aPacket_1083.get1U();
+ anInt1102 = aPacket_1083.get1U();
if (anInt1102 >= 100) {
anInt858 = (anInt1098 * 128) + 64;
anInt860 = (anInt1099 * 128) + 64;
@@ -9749,9 +9749,9 @@ public class Game extends GameShell {
}
if (anInt1008 == 134) {
aBoolean1153 = true;
- int k1 = aBuffer_1083.get1U();
- int i10 = aBuffer_1083.get4RME();
- int l15 = aBuffer_1083.get1U();
+ int k1 = aPacket_1083.get1U();
+ int i10 = aPacket_1083.get4RME();
+ int l15 = aPacket_1083.get1U();
anIntArray864[k1] = i10;
anIntArray922[k1] = l15;
anIntArray1044[k1] = 1;
@@ -9764,8 +9764,8 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 71) {
- int l1 = aBuffer_1083.get2U();
- int j10 = aBuffer_1083.get1UA();
+ int l1 = aPacket_1083.get2U();
+ int j10 = aPacket_1083.get1UA();
if (l1 == 65535) {
l1 = -1;
}
@@ -9776,7 +9776,7 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 74) {
- int i2 = aBuffer_1083.get2ULE();
+ int i2 = aPacket_1083.get2ULE();
if (i2 == 65535) {
i2 = -1;
}
@@ -9790,8 +9790,8 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 121) {
- int j2 = aBuffer_1083.get2ULEA();
- int k10 = aBuffer_1083.get2UA();
+ int j2 = aPacket_1083.get2ULEA();
+ int k10 = aPacket_1083.get2UA();
if (aBoolean1151 && !aBoolean960) {
anInt1227 = j2;
aBoolean1228 = false;
@@ -9807,9 +9807,9 @@ public class Game extends GameShell {
return false;
}
if (anInt1008 == 70) {
- int k2 = aBuffer_1083.get2();
- int l10 = aBuffer_1083.get2LE();
- int i16 = aBuffer_1083.get2ULE();
+ int k2 = aPacket_1083.get2();
+ int l10 = aPacket_1083.get2LE();
+ int i16 = aPacket_1083.get2ULE();
Component component_5 = Component.aComponentArray210[i16];
component_5.anInt263 = k2;
component_5.anInt265 = l10;
@@ -9820,27 +9820,27 @@ public class Game extends GameShell {
int l2 = anInt1069;
int i11 = anInt1070;
if (anInt1008 == 73) {
- l2 = aBuffer_1083.get2UA();
- i11 = aBuffer_1083.get2U();
+ l2 = aPacket_1083.get2UA();
+ i11 = aPacket_1083.get2U();
aBoolean1159 = false;
}
if (anInt1008 == 241) {
- i11 = aBuffer_1083.get2UA();
- aBuffer_1083.accessBits();
+ i11 = aPacket_1083.get2UA();
+ aPacket_1083.accessBits();
for (int j16 = 0; j16 < 4; j16++) {
for (int l20 = 0; l20 < 13; l20++) {
for (int j23 = 0; j23 < 13; j23++) {
- int i26 = aBuffer_1083.getBits(1);
+ int i26 = aPacket_1083.getBits(1);
if (i26 == 1) {
- anIntArrayArrayArray1129[j16][l20][j23] = aBuffer_1083.getBits(26);
+ anIntArrayArrayArray1129[j16][l20][j23] = aPacket_1083.getBits(26);
} else {
anIntArrayArrayArray1129[j16][l20][j23] = -1;
}
}
}
}
- aBuffer_1083.accessBytes();
- l2 = aBuffer_1083.get2U();
+ aPacket_1083.accessBytes();
+ l2 = aPacket_1083.get2U();
aBoolean1159 = true;
}
if ((anInt1069 == l2) && (anInt1070 == i11) && (anInt1023 == 2)) {
@@ -10010,7 +10010,7 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 208) {
- int i3 = aBuffer_1083.get2LE();
+ int i3 = aPacket_1083.get2LE();
if (i3 >= 0) {
method60(i3);
}
@@ -10019,38 +10019,38 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 99) {
- anInt1021 = aBuffer_1083.get1U();
+ anInt1021 = aPacket_1083.get1U();
anInt1008 = -1;
return true;
}
if (anInt1008 == 75) {
- int j3 = aBuffer_1083.get2ULEA();
- int j11 = aBuffer_1083.get2ULEA();
+ int j3 = aPacket_1083.get2ULEA();
+ int j11 = aPacket_1083.get2ULEA();
Component.aComponentArray210[j11].anInt233 = 2;
Component.aComponentArray210[j11].anInt234 = j3;
anInt1008 = -1;
return true;
}
if (anInt1008 == 114) {
- anInt1104 = aBuffer_1083.get2ULE() * 30;
+ anInt1104 = aPacket_1083.get2ULE() * 30;
anInt1008 = -1;
return true;
}
if (anInt1008 == 60) {
- anInt1269 = aBuffer_1083.get1U();
- anInt1268 = aBuffer_1083.getU1C();
- while (aBuffer_1083.position < anInt1007) {
- int k3 = aBuffer_1083.get1U();
- method137(aBuffer_1083, k3);
+ anInt1269 = aPacket_1083.get1U();
+ anInt1268 = aPacket_1083.getU1C();
+ while (aPacket_1083.position < anInt1007) {
+ int k3 = aPacket_1083.get1U();
+ method137(aPacket_1083, k3);
}
anInt1008 = -1;
return true;
}
if (anInt1008 == 35) {
- int l3 = aBuffer_1083.get1U();
- int k11 = aBuffer_1083.get1U();
- int j17 = aBuffer_1083.get1U();
- int k21 = aBuffer_1083.get1U();
+ int l3 = aPacket_1083.get1U();
+ int k11 = aPacket_1083.get1U();
+ int j17 = aPacket_1083.get1U();
+ int k21 = aPacket_1083.get1U();
aBooleanArray876[l3] = true;
anIntArray873[l3] = k11;
anIntArray1203[l3] = j17;
@@ -10060,9 +10060,9 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 174) {
- int i4 = aBuffer_1083.get2U();
- int l11 = aBuffer_1083.get1U();
- int k17 = aBuffer_1083.get2U();
+ int i4 = aPacket_1083.get2U();
+ int l11 = aPacket_1083.get1U();
+ int k17 = aPacket_1083.get2U();
if (aBoolean848 && !aBoolean960 && (anInt1062 < 50)) {
anIntArray1207[anInt1062] = i4;
anIntArray1241[anInt1062] = l11;
@@ -10073,9 +10073,9 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 104) {
- int j4 = aBuffer_1083.getU1C();
- int i12 = aBuffer_1083.get1UA();
- String s6 = aBuffer_1083.getString();
+ int j4 = aPacket_1083.getU1C();
+ int i12 = aPacket_1083.get1UA();
+ String s6 = aPacket_1083.getString();
if ((j4 >= 1) && (j4 <= 5)) {
if (s6.equalsIgnoreCase("null")) {
s6 = null;
@@ -10092,7 +10092,7 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 253) {
- String s = aBuffer_1083.getString();
+ String s = aPacket_1083.getString();
if (s.endsWith(":tradereq:")) {
String s3 = s.substring(0, s.indexOf(":"));
long l17 = StringUtil.toBase37(s3);
@@ -10157,8 +10157,8 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 50) {
- long l4 = aBuffer_1083.get8();
- int i18 = aBuffer_1083.get1U();
+ long l4 = aPacket_1083.get8();
+ int i18 = aPacket_1083.get1U();
String s7 = StringUtil.formatName(StringUtil.fromBase37(l4));
for (int k24 = 0; k24 < anInt899; k24++) {
if (l4 != aLongArray955[k24]) {
@@ -10209,14 +10209,14 @@ public class Game extends GameShell {
if (anInt1221 == 12) {
aBoolean1153 = true;
}
- anInt1148 = aBuffer_1083.get1U();
+ anInt1148 = aPacket_1083.get1U();
anInt1008 = -1;
return true;
}
if (anInt1008 == 254) {
- anInt855 = aBuffer_1083.get1U();
+ anInt855 = aPacket_1083.get1U();
if (anInt855 == 1) {
- anInt1222 = aBuffer_1083.get2U();
+ anInt1222 = aPacket_1083.get2U();
}
if ((anInt855 >= 2) && (anInt855 <= 6)) {
if (anInt855 == 2) {
@@ -10240,19 +10240,19 @@ public class Game extends GameShell {
anInt938 = 128;
}
anInt855 = 2;
- anInt934 = aBuffer_1083.get2U();
- anInt935 = aBuffer_1083.get2U();
- anInt936 = aBuffer_1083.get1U();
+ anInt934 = aPacket_1083.get2U();
+ anInt935 = aPacket_1083.get2U();
+ anInt936 = aPacket_1083.get1U();
}
if (anInt855 == 10) {
- anInt933 = aBuffer_1083.get2U();
+ anInt933 = aPacket_1083.get2U();
}
anInt1008 = -1;
return true;
}
if (anInt1008 == 248) {
- int i5 = aBuffer_1083.get2UA();
- int k12 = aBuffer_1083.get2U();
+ int i5 = aPacket_1083.get2UA();
+ int k12 = aPacket_1083.get2U();
if (anInt1276 != -1) {
anInt1276 = -1;
aBoolean1223 = true;
@@ -10270,8 +10270,8 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 79) {
- int j5 = aBuffer_1083.get2ULE();
- int l12 = aBuffer_1083.get2UA();
+ int j5 = aPacket_1083.get2ULE();
+ int l12 = aPacket_1083.get2UA();
Component component_3 = Component.aComponentArray210[j5];
if ((component_3 != null) && (component_3.anInt262 == 0)) {
if (l12 < 0) {
@@ -10297,9 +10297,9 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 196) {
- long l5 = aBuffer_1083.get8();
- int j18 = aBuffer_1083.get4();
- int l21 = aBuffer_1083.get1U();
+ long l5 = aPacket_1083.get8();
+ int j18 = aPacket_1083.get4();
+ int l21 = aPacket_1083.get1U();
boolean flag5 = false;
for (int i28 = 0; i28 < 100; i28++) {
if (anIntArray1240[i28] != j18) {
@@ -10321,7 +10321,7 @@ public class Game extends GameShell {
try {
anIntArray1240[anInt1169] = j18;
anInt1169 = (anInt1169 + 1) % 100;
- String s9 = Huffman.method525(anInt1007 - 13, aBuffer_1083);
+ String s9 = Huffman.method525(anInt1007 - 13, aPacket_1083);
if (l21 != 3) {
s9 = Censor.method497(s9, 0);
}
@@ -10340,13 +10340,13 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 85) {
- anInt1269 = aBuffer_1083.getU1C();
- anInt1268 = aBuffer_1083.getU1C();
+ anInt1269 = aPacket_1083.getU1C();
+ anInt1268 = aPacket_1083.getU1C();
anInt1008 = -1;
return true;
}
if (anInt1008 == 24) {
- anInt1054 = aBuffer_1083.get1US();
+ anInt1054 = aPacket_1083.get1US();
if (anInt1054 == anInt1221) {
if (anInt1054 == 3) {
anInt1221 = 1;
@@ -10359,9 +10359,9 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 246) {
- int i6 = aBuffer_1083.get2ULE();
- int i13 = aBuffer_1083.get2U();
- int k18 = aBuffer_1083.get2U();
+ int i6 = aPacket_1083.get2ULE();
+ int i13 = aPacket_1083.get2U();
+ int k18 = aPacket_1083.get2U();
if (k18 == 65535) {
Component.aComponentArray210[i6].anInt233 = 0;
} else {
@@ -10376,14 +10376,14 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 171) {
- boolean flag1 = aBuffer_1083.get1U() == 1;
- int j13 = aBuffer_1083.get2U();
+ boolean flag1 = aPacket_1083.get1U() == 1;
+ int j13 = aPacket_1083.get2U();
Component.aComponentArray210[j13].aBoolean266 = flag1;
anInt1008 = -1;
return true;
}
if (anInt1008 == 142) {
- int j6 = aBuffer_1083.get2ULE();
+ int j6 = aPacket_1083.get2ULE();
method60(j6);
if (anInt1276 != -1) {
anInt1276 = -1;
@@ -10402,8 +10402,8 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 126) {
- String s1 = aBuffer_1083.getString();
- int k13 = aBuffer_1083.get2UA();
+ String s1 = aPacket_1083.getString();
+ int k13 = aPacket_1083.get2UA();
if ((k13 >= 0) && (k13 < Component.aComponentArray210.length)) {
Component component = Component.aComponentArray210[k13];
if (component != null) {
@@ -10417,9 +10417,9 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 206) {
- anInt1287 = aBuffer_1083.get1U();
- anInt845 = aBuffer_1083.get1U();
- anInt1248 = aBuffer_1083.get1U();
+ anInt1287 = aPacket_1083.get1U();
+ anInt845 = aPacket_1083.get1U();
+ anInt1248 = aPacket_1083.get1U();
aBoolean1233 = true;
aBoolean1223 = true;
anInt1008 = -1;
@@ -10429,21 +10429,21 @@ public class Game extends GameShell {
if (anInt1221 == 12) {
aBoolean1153 = true;
}
- anInt878 = aBuffer_1083.get2();
+ anInt878 = aPacket_1083.get2();
anInt1008 = -1;
return true;
}
if (anInt1008 == 8) {
- int k6 = aBuffer_1083.get2ULEA();
- int l13 = aBuffer_1083.get2U();
+ int k6 = aPacket_1083.get2ULEA();
+ int l13 = aPacket_1083.get2U();
Component.aComponentArray210[k6].anInt233 = 1;
Component.aComponentArray210[k6].anInt234 = l13;
anInt1008 = -1;
return true;
}
if (anInt1008 == 122) {
- int l6 = aBuffer_1083.get2ULEA();
- int i14 = aBuffer_1083.get2ULEA();
+ int l6 = aPacket_1083.get2ULEA();
+ int i14 = aPacket_1083.get2ULEA();
int i19 = (i14 >> 10) & 0x1f;
int i22 = (i14 >> 5) & 0x1f;
int l24 = i14 & 0x1f;
@@ -10453,15 +10453,15 @@ public class Game extends GameShell {
}
if (anInt1008 == 53) {
aBoolean1153 = true;
- int i7 = aBuffer_1083.get2U();
+ int i7 = aPacket_1083.get2U();
Component component_1 = Component.aComponentArray210[i7];
- int j19 = aBuffer_1083.get2U();
+ int j19 = aPacket_1083.get2U();
for (int j22 = 0; j22 < j19; j22++) {
- int i25 = aBuffer_1083.get1U();
+ int i25 = aPacket_1083.get1U();
if (i25 == 255) {
- i25 = aBuffer_1083.get4ME();
+ i25 = aPacket_1083.get4ME();
}
- component_1.anIntArray253[j22] = aBuffer_1083.get2ULEA();
+ component_1.anIntArray253[j22] = aPacket_1083.get2ULEA();
component_1.anIntArray252[j22] = i25;
}
for (int j25 = j19; j25 < component_1.anIntArray253.length; j25++) {
@@ -10472,10 +10472,10 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 230) {
- int j7 = aBuffer_1083.get2UA();
- int j14 = aBuffer_1083.get2U();
- int k19 = aBuffer_1083.get2U();
- int k22 = aBuffer_1083.get2ULEA();
+ int j7 = aPacket_1083.get2UA();
+ int j14 = aPacket_1083.get2U();
+ int k19 = aPacket_1083.get2U();
+ int k22 = aPacket_1083.get2ULEA();
Component.aComponentArray210[j14].anInt270 = k19;
Component.aComponentArray210[j14].anInt271 = k22;
Component.aComponentArray210[j14].anInt269 = j7;
@@ -10483,18 +10483,18 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 221) {
- anInt900 = aBuffer_1083.get1U();
+ anInt900 = aPacket_1083.get1U();
aBoolean1153 = true;
anInt1008 = -1;
return true;
}
if (anInt1008 == 177) {
aBoolean1160 = true;
- anInt995 = aBuffer_1083.get1U();
- anInt996 = aBuffer_1083.get1U();
- anInt997 = aBuffer_1083.get2U();
- anInt998 = aBuffer_1083.get1U();
- anInt999 = aBuffer_1083.get1U();
+ anInt995 = aPacket_1083.get1U();
+ anInt996 = aPacket_1083.get1U();
+ anInt997 = aPacket_1083.get2U();
+ anInt998 = aPacket_1083.get1U();
+ anInt999 = aPacket_1083.get1U();
if (anInt999 >= 100) {
int k7 = (anInt995 * 128) + 64;
int k14 = (anInt996 * 128) + 64;
@@ -10516,13 +10516,13 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 249) {
- anInt1046 = aBuffer_1083.get1UA();
- anInt884 = aBuffer_1083.get2ULEA();
+ anInt1046 = aPacket_1083.get1UA();
+ anInt884 = aPacket_1083.get2ULEA();
anInt1008 = -1;
return true;
}
if (anInt1008 == 65) {
- method31(aBuffer_1083, anInt1007);
+ method31(aPacket_1083, anInt1007);
anInt1008 = -1;
return true;
}
@@ -10543,7 +10543,7 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 97) {
- int l7 = aBuffer_1083.get2U();
+ int l7 = aPacket_1083.get2U();
method60(l7);
if (anInt1189 != -1) {
anInt1189 = -1;
@@ -10564,14 +10564,14 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 218) {
- anInt1042 = aBuffer_1083.get2LEA();
+ anInt1042 = aPacket_1083.get2LEA();
aBoolean1223 = true;
anInt1008 = -1;
return true;
}
if (anInt1008 == 87) {
- int j8 = aBuffer_1083.get2ULE();
- int l14 = aBuffer_1083.get4RME();
+ int j8 = aPacket_1083.get2ULE();
+ int l14 = aPacket_1083.get4RME();
anIntArray1045[j8] = l14;
if (anIntArray971[j8] != l14) {
anIntArray971[j8] = l14;
@@ -10585,8 +10585,8 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 36) {
- int k8 = aBuffer_1083.get2ULE();
- byte byte0 = aBuffer_1083.get1();
+ int k8 = aPacket_1083.get2ULE();
+ byte byte0 = aPacket_1083.get1();
anIntArray1045[k8] = byte0;
if (anIntArray971[k8] != byte0) {
anIntArray971[k8] = byte0;
@@ -10600,13 +10600,13 @@ public class Game extends GameShell {
return true;
}
if (anInt1008 == 61) {
- anInt1055 = aBuffer_1083.get1U();
+ anInt1055 = aPacket_1083.get1U();
anInt1008 = -1;
return true;
}
if (anInt1008 == 200) {
- int l8 = aBuffer_1083.get2U();
- int i15 = aBuffer_1083.get2();
+ int l8 = aPacket_1083.get2U();
+ int i15 = aPacket_1083.get2();
Component component_4 = Component.aComponentArray210[l8];
component_4.anInt257 = i15;
if (i15 == -1) {
@@ -10637,14 +10637,14 @@ public class Game extends GameShell {
}
if (anInt1008 == 34) {
aBoolean1153 = true;
- int i9 = aBuffer_1083.get2U();
+ int i9 = aPacket_1083.get2U();
Component component_2 = Component.aComponentArray210[i9];
- while (aBuffer_1083.position < anInt1007) {
- int j20 = aBuffer_1083.getUSmart();
- int i23 = aBuffer_1083.get2U();
- int l25 = aBuffer_1083.get1U();
+ while (aPacket_1083.position < anInt1007) {
+ int j20 = aPacket_1083.getUSmart();
+ int i23 = aPacket_1083.get2U();
+ int l25 = aPacket_1083.get1U();
if (l25 == 255) {
- l25 = aBuffer_1083.get4();
+ l25 = aPacket_1083.get4();
}
if ((j20 >= 0) && (j20 < component_2.anIntArray253.length)) {
component_2.anIntArray253[j20] = i23;
@@ -10655,19 +10655,19 @@ public class Game extends GameShell {
return true;
}
if ((anInt1008 == 105) || (anInt1008 == 84) || (anInt1008 == 147) || (anInt1008 == 215) || (anInt1008 == 4) || (anInt1008 == 117) || (anInt1008 == 156) || (anInt1008 == 44) || (anInt1008 == 160) || (anInt1008 == 101) || (anInt1008 == 151)) {
- method137(aBuffer_1083, anInt1008);
+ method137(aPacket_1083, anInt1008);
anInt1008 = -1;
return true;
}
if (anInt1008 == 106) {
- anInt1221 = aBuffer_1083.getU1C();
+ anInt1221 = aPacket_1083.getU1C();
aBoolean1153 = true;
aBoolean1103 = true;
anInt1008 = -1;
return true;
}
if (anInt1008 == 164) {
- int j9 = aBuffer_1083.get2ULE();
+ int j9 = aPacket_1083.get2ULE();
method60(j9);
if (anInt1189 != -1) {
anInt1189 = -1;
@@ -10688,7 +10688,7 @@ public class Game extends GameShell {
} catch (Exception exception) {
StringBuilder s2 = new StringBuilder("T2 - " + anInt1008 + "," + anInt842 + "," + anInt843 + " - " + anInt1007 + "," + (anInt1034 + aPlayer_1126.anIntArray1500[0]) + "," + (anInt1035 + aPlayer_1126.anIntArray1501[0]) + " - ");
for (int j15 = 0; (j15 < anInt1007) && (j15 < 50); j15++) {
- s2.append(aBuffer_1083.data[j15]).append(",");
+ s2.append(aPacket_1083.data[j15]).append(",");
}
Signlink.reporterror(s2.toString());
method44();
@@ -10774,7 +10774,7 @@ public class Game extends GameShell {
}
public void method147() {
- aBuffer_1192.putOp(130);
+ aPacket_1192.putOp(130);
if (anInt1189 != -1) {
anInt1189 = -1;
aBoolean1153 = true;
diff --git a/src/main/java/Huffman.java b/src/main/java/Huffman.java
index ce2c740..d727b01 100644
--- a/src/main/java/Huffman.java
+++ b/src/main/java/Huffman.java
@@ -5,14 +5,14 @@
public class Huffman {
public static final char[] aCharArray631 = new char[100];
- public static final Buffer A_BUFFER___632 = new Buffer(new byte[100]);
+ public static final Packet A_PACKET___632 = new Packet(new byte[100]);
public static final char[] aCharArray633 = {' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', '[', ']'};
- public static String method525(int i, Buffer buffer) {
+ public static String method525(int i, Packet packet) {
int j = 0;
int k = -1;
for (int l = 0; l < i; l++) {
- int i1 = buffer.get1U();
+ int i1 = packet.get1U();
int j1 = (i1 >> 4) & 0xf;
if (k == -1) {
if (j1 < 13) {
@@ -50,7 +50,7 @@ public class Huffman {
return new String(aCharArray631, 0, j);
}
- public static void method526(String s, Buffer buffer) {
+ public static void method526(String s, Packet packet) {
if (s.length() > 80) {
s = s.substring(0, 80);
}
@@ -73,27 +73,27 @@ public class Huffman {
if (k < 13) {
i = k;
} else {
- buffer.put1(k);
+ packet.put1(k);
}
} else if (k < 13) {
- buffer.put1((i << 4) + k);
+ packet.put1((i << 4) + k);
i = -1;
} else {
- buffer.put1((i << 4) + (k >> 4));
+ packet.put1((i << 4) + (k >> 4));
i = k & 0xf;
}
}
if (i != -1) {
- buffer.put1(i << 4);
+ packet.put1(i << 4);
}
}
public static String method527(String s) {
- A_BUFFER___632.position = 0;
- method526(s, A_BUFFER___632);
- int j = A_BUFFER___632.position;
- A_BUFFER___632.position = 0;
- return method525(j, A_BUFFER___632);
+ A_PACKET___632.position = 0;
+ method526(s, A_PACKET___632);
+ int j = A_PACKET___632.position;
+ A_PACKET___632.position = 0;
+ return method525(j, A_PACKET___632);
}
}
diff --git a/src/main/java/IDKType.java b/src/main/java/IDKType.java
index 4134f29..3842b3b 100644
--- a/src/main/java/IDKType.java
+++ b/src/main/java/IDKType.java
@@ -17,8 +17,8 @@ public class IDKType {
}
public static void method535(FileArchive archive) {
- Buffer buffer = new Buffer(archive.read("idk.dat", null));
- anInt655 = buffer.get2U();
+ Packet packet = new Packet(archive.read("idk.dat", null));
+ anInt655 = packet.get2U();
if (aIDKTypeArray656 == null) {
aIDKTypeArray656 = new IDKType[anInt655];
}
@@ -26,32 +26,32 @@ public class IDKType {
if (aIDKTypeArray656[j] == null) {
aIDKTypeArray656[j] = new IDKType();
}
- aIDKTypeArray656[j].method536(buffer);
+ aIDKTypeArray656[j].method536(packet);
}
}
- public void method536(Buffer buffer) {
+ public void method536(Packet packet) {
do {
- int i = buffer.get1U();
+ int i = packet.get1U();
if (i == 0) {
return;
}
if (i == 1) {
- anInt657 = buffer.get1U();
+ anInt657 = packet.get1U();
} else if (i == 2) {
- int j = buffer.get1U();
+ int j = packet.get1U();
anIntArray658 = new int[j];
for (int k = 0; k < j; k++) {
- anIntArray658[k] = buffer.get2U();
+ anIntArray658[k] = packet.get2U();
}
} else if (i == 3) {
aBoolean662 = true;
} else if ((i >= 40) && (i < 50)) {
- anIntArray659[i - 40] = buffer.get2U();
+ anIntArray659[i - 40] = packet.get2U();
} else if ((i >= 50) && (i < 60)) {
- anIntArray660[i - 50] = buffer.get2U();
+ anIntArray660[i - 50] = packet.get2U();
} else if ((i >= 60) && (i < 70)) {
- anIntArray661[i - 60] = buffer.get2U();
+ anIntArray661[i - 60] = packet.get2U();
} else {
System.out.println("Error unrecognised config code: " + i);
}
diff --git a/src/main/java/Image24.java b/src/main/java/Image24.java
index 765e151..f38cb2b 100644
--- a/src/main/java/Image24.java
+++ b/src/main/java/Image24.java
@@ -43,41 +43,41 @@ public class Image24 extends Draw2D {
}
public Image24(FileArchive archive, String s, int i) {
- Buffer buffer = new Buffer(archive.read(s + ".dat", null));
- Buffer buffer_1 = new Buffer(archive.read("index.dat", null));
- buffer_1.position = buffer.get2U();
- anInt1444 = buffer_1.get2U();
- anInt1445 = buffer_1.get2U();
- int j = buffer_1.get1U();
+ Packet packet = new Packet(archive.read(s + ".dat", null));
+ Packet packet_1 = new Packet(archive.read("index.dat", null));
+ packet_1.position = packet.get2U();
+ anInt1444 = packet_1.get2U();
+ anInt1445 = packet_1.get2U();
+ int j = packet_1.get1U();
int[] ai = new int[j];
for (int k = 0; k < (j - 1); k++) {
- ai[k + 1] = buffer_1.get3();
+ ai[k + 1] = packet_1.get3();
if (ai[k + 1] == 0) {
ai[k + 1] = 1;
}
}
for (int l = 0; l < i; l++) {
- buffer_1.position += 2;
- buffer.position += buffer_1.get2U() * buffer_1.get2U();
- buffer_1.position++;
+ packet_1.position += 2;
+ packet.position += packet_1.get2U() * packet_1.get2U();
+ packet_1.position++;
}
- anInt1442 = buffer_1.get1U();
- anInt1443 = buffer_1.get1U();
- anInt1440 = buffer_1.get2U();
- anInt1441 = buffer_1.get2U();
- int i1 = buffer_1.get1U();
+ anInt1442 = packet_1.get1U();
+ anInt1443 = packet_1.get1U();
+ anInt1440 = packet_1.get2U();
+ anInt1441 = packet_1.get2U();
+ int i1 = packet_1.get1U();
int j1 = anInt1440 * anInt1441;
anIntArray1439 = new int[j1];
if (i1 == 0) {
for (int k1 = 0; k1 < j1; k1++) {
- anIntArray1439[k1] = ai[buffer.get1U()];
+ anIntArray1439[k1] = ai[packet.get1U()];
}
return;
}
if (i1 == 1) {
for (int l1 = 0; l1 < anInt1440; l1++) {
for (int i2 = 0; i2 < anInt1441; i2++) {
- anIntArray1439[l1 + (i2 * anInt1440)] = ai[buffer.get1U()];
+ anIntArray1439[l1 + (i2 * anInt1440)] = ai[packet.get1U()];
}
}
}
diff --git a/src/main/java/Image8.java b/src/main/java/Image8.java
index a2366b0..9865923 100644
--- a/src/main/java/Image8.java
+++ b/src/main/java/Image8.java
@@ -14,38 +14,38 @@ public class Image8 extends Draw2D {
public int anInt1457;
public Image8(FileArchive archive, String s, int i) {
- Buffer buffer = new Buffer(archive.read(s + ".dat", null));
- Buffer buffer_1 = new Buffer(archive.read("index.dat", null));
- buffer_1.position = buffer.get2U();
- anInt1456 = buffer_1.get2U();
- anInt1457 = buffer_1.get2U();
- int j = buffer_1.get1U();
+ Packet packet = new Packet(archive.read(s + ".dat", null));
+ Packet packet_1 = new Packet(archive.read("index.dat", null));
+ packet_1.position = packet.get2U();
+ anInt1456 = packet_1.get2U();
+ anInt1457 = packet_1.get2U();
+ int j = packet_1.get1U();
anIntArray1451 = new int[j];
for (int k = 0; k < (j - 1); k++) {
- anIntArray1451[k + 1] = buffer_1.get3();
+ anIntArray1451[k + 1] = packet_1.get3();
}
for (int l = 0; l < i; l++) {
- buffer_1.position += 2;
- buffer.position += buffer_1.get2U() * buffer_1.get2U();
- buffer_1.position++;
+ packet_1.position += 2;
+ packet.position += packet_1.get2U() * packet_1.get2U();
+ packet_1.position++;
}
- anInt1454 = buffer_1.get1U();
- anInt1455 = buffer_1.get1U();
- anInt1452 = buffer_1.get2U();
- anInt1453 = buffer_1.get2U();
- int i1 = buffer_1.get1U();
+ anInt1454 = packet_1.get1U();
+ anInt1455 = packet_1.get1U();
+ anInt1452 = packet_1.get2U();
+ anInt1453 = packet_1.get2U();
+ int i1 = packet_1.get1U();
int j1 = anInt1452 * anInt1453;
aByteArray1450 = new byte[j1];
if (i1 == 0) {
for (int k1 = 0; k1 < j1; k1++) {
- aByteArray1450[k1] = buffer.get1();
+ aByteArray1450[k1] = packet.get1();
}
return;
}
if (i1 == 1) {
for (int l1 = 0; l1 < anInt1452; l1++) {
for (int i2 = 0; i2 < anInt1453; i2++) {
- aByteArray1450[l1 + (i2 * anInt1452)] = buffer.get1();
+ aByteArray1450[l1 + (i2 * anInt1452)] = packet.get1();
}
}
}
diff --git a/src/main/java/LocType.java b/src/main/java/LocType.java
index 3e885c7..4f98b2d 100644
--- a/src/main/java/LocType.java
+++ b/src/main/java/LocType.java
@@ -6,7 +6,7 @@ public class LocType {
public static final Model[] A_MODEL_ARRAY_741 = new Model[4];
public static boolean aBoolean752;
- public static Buffer aBuffer_753;
+ public static Packet aPacket_753;
public static int[] anIntArray755;
public static int anInt756;
public static Game aGame765;
@@ -64,10 +64,10 @@ public class LocType {
}
anInt771 = (anInt771 + 1) % 20;
LocType type = aTypeArray782[anInt771];
- aBuffer_753.position = anIntArray755[i];
+ aPacket_753.position = anIntArray755[i];
type.anInt754 = i;
type.method573();
- type.method582(aBuffer_753);
+ type.method582(aPacket_753);
return type;
}
@@ -76,18 +76,18 @@ public class LocType {
aCache_780 = null;
anIntArray755 = null;
aTypeArray782 = null;
- aBuffer_753 = null;
+ aPacket_753 = null;
}
public static void method576(FileArchive archive) {
- aBuffer_753 = new Buffer(archive.read("loc.dat", null));
- Buffer buffer = new Buffer(archive.read("loc.idx", null));
- anInt756 = buffer.get2U();
+ aPacket_753 = new Packet(archive.read("loc.dat", null));
+ Packet packet = new Packet(archive.read("loc.idx", null));
+ anInt756 = packet.get2U();
anIntArray755 = new int[anInt756];
int i = 2;
for (int j = 0; j < anInt756; j++) {
anIntArray755[j] = i;
- i += buffer.get2U();
+ i += packet.get2U();
}
aTypeArray782 = new LocType[20];
for (int k = 0; k < 20; k++) {
@@ -325,57 +325,57 @@ public class LocType {
return model_3;
}
- public void method582(Buffer buffer) {
+ public void method582(Packet packet) {
int i = -1;
label0:
do {
int j;
do {
- j = buffer.get1U();
+ j = packet.get1U();
if (j == 0) {
break label0;
}
if (j == 1) {
- int k = buffer.get1U();
+ int k = packet.get1U();
if (k > 0) {
if ((anIntArray773 == null) || aBoolean752) {
anIntArray776 = new int[k];
anIntArray773 = new int[k];
for (int k1 = 0; k1 < k; k1++) {
- anIntArray773[k1] = buffer.get2U();
- anIntArray776[k1] = buffer.get1U();
+ anIntArray773[k1] = packet.get2U();
+ anIntArray776[k1] = packet.get1U();
}
} else {
- buffer.position += k * 3;
+ packet.position += k * 3;
}
}
} else if (j == 2) {
- aString739 = buffer.getString();
+ aString739 = packet.getString();
} else if (j == 3) {
- aByteArray777 = buffer.getStringRaw();
+ aByteArray777 = packet.getStringRaw();
} else if (j == 5) {
- int l = buffer.get1U();
+ int l = packet.get1U();
if (l > 0) {
if ((anIntArray773 == null) || aBoolean752) {
anIntArray776 = null;
anIntArray773 = new int[l];
for (int l1 = 0; l1 < l; l1++) {
- anIntArray773[l1] = buffer.get2U();
+ anIntArray773[l1] = packet.get2U();
}
} else {
- buffer.position += l * 2;
+ packet.position += l * 2;
}
}
} else if (j == 14) {
- anInt744 = buffer.get1U();
+ anInt744 = packet.get1U();
} else if (j == 15) {
- anInt761 = buffer.get1U();
+ anInt761 = packet.get1U();
} else if (j == 17) {
aBoolean767 = false;
} else if (j == 18) {
aBoolean757 = false;
} else if (j == 19) {
- i = buffer.get1U();
+ i = packet.get1U();
if (i == 1) {
aBoolean778 = true;
}
@@ -386,54 +386,54 @@ public class LocType {
} else if (j == 23) {
aBoolean764 = true;
} else if (j == 24) {
- anInt781 = buffer.get2U();
+ anInt781 = packet.get2U();
if (anInt781 == 65535) {
anInt781 = -1;
}
} else if (j == 28) {
- anInt775 = buffer.get1U();
+ anInt775 = packet.get1U();
} else if (j == 29) {
- aByte737 = buffer.get1();
+ aByte737 = packet.get1();
} else if (j == 39) {
- aByte742 = buffer.get1();
+ aByte742 = packet.get1();
} else if ((j >= 30) && (j < 39)) {
if (aStringArray786 == null) {
aStringArray786 = new String[5];
}
- aStringArray786[j - 30] = buffer.getString();
+ aStringArray786[j - 30] = packet.getString();
if (aStringArray786[j - 30].equalsIgnoreCase("hidden")) {
aStringArray786[j - 30] = null;
}
} else if (j == 40) {
- int i1 = buffer.get1U();
+ int i1 = packet.get1U();
anIntArray784 = new int[i1];
anIntArray747 = new int[i1];
for (int i2 = 0; i2 < i1; i2++) {
- anIntArray784[i2] = buffer.get2U();
- anIntArray747[i2] = buffer.get2U();
+ anIntArray784[i2] = packet.get2U();
+ anIntArray747[i2] = packet.get2U();
}
} else if (j == 60) {
- anInt746 = buffer.get2U();
+ anInt746 = packet.get2U();
} else if (j == 62) {
aBoolean751 = true;
} else if (j == 64) {
aBoolean779 = false;
} else if (j == 65) {
- anInt748 = buffer.get2U();
+ anInt748 = packet.get2U();
} else if (j == 66) {
- anInt772 = buffer.get2U();
+ anInt772 = packet.get2U();
} else if (j == 67) {
- anInt740 = buffer.get2U();
+ anInt740 = packet.get2U();
} else if (j == 68) {
- anInt758 = buffer.get2U();
+ anInt758 = packet.get2U();
} else if (j == 69) {
- anInt768 = buffer.get1U();
+ anInt768 = packet.get1U();
} else if (j == 70) {
- anInt738 = buffer.get2();
+ anInt738 = packet.get2();
} else if (j == 71) {
- anInt745 = buffer.get2();
+ anInt745 = packet.get2();
} else if (j == 72) {
- anInt783 = buffer.get2();
+ anInt783 = packet.get2();
} else if (j == 73) {
aBoolean736 = true;
} else if (j == 74) {
@@ -442,22 +442,22 @@ public class LocType {
if (j != 75) {
continue;
}
- anInt760 = buffer.get1U();
+ anInt760 = packet.get1U();
}
continue label0;
} while (j != 77);
- anInt774 = buffer.get2U();
+ anInt774 = packet.get2U();
if (anInt774 == 65535) {
anInt774 = -1;
}
- anInt749 = buffer.get2U();
+ anInt749 = packet.get2U();
if (anInt749 == 65535) {
anInt749 = -1;
}
- int j1 = buffer.get1U();
+ int j1 = packet.get1U();
anIntArray759 = new int[j1 + 1];
for (int j2 = 0; j2 <= j1; j2++) {
- anIntArray759[j2] = buffer.get2U();
+ anIntArray759[j2] = packet.get2U();
if (anIntArray759[j2] == 65535) {
anIntArray759[j2] = -1;
}
diff --git a/src/main/java/Model.java b/src/main/java/Model.java
index 881a66c..456a4dd 100644
--- a/src/main/java/Model.java
+++ b/src/main/java/Model.java
@@ -174,19 +174,19 @@ public class Model extends Entity {
faceColor = new int[faceCount];
- Buffer buf0 = new Buffer(header.data);
+ Packet buf0 = new Packet(header.data);
buf0.position = header.obPoint1Position;
- Buffer buf1 = new Buffer(header.data);
+ Packet buf1 = new Packet(header.data);
buf1.position = header.obPoint2Position;
- Buffer buf2 = new Buffer(header.data);
+ Packet buf2 = new Packet(header.data);
buf2.position = header.obPoint3Position;
- Buffer buf3 = new Buffer(header.data);
+ Packet buf3 = new Packet(header.data);
buf3.position = header.obPoint4Position;
- Buffer buf4 = new Buffer(header.data);
+ Packet buf4 = new Packet(header.data);
buf4.position = header.obPoint5Position;
int x = 0;
@@ -812,23 +812,23 @@ public class Model extends Entity {
header.texturedFaceCount = 0;
return;
}
- Buffer buffer = new Buffer(src);
- buffer.position = src.length - 18;
+ Packet packet = new Packet(src);
+ packet.position = src.length - 18;
ModelHeader header = headers[id] = new ModelHeader();
header.data = src;
- header.vertexCount = buffer.get2U();
- header.faceCount = buffer.get2U();
- header.texturedFaceCount = buffer.get1U();
- int k = buffer.get1U();
- int l = buffer.get1U();
- int i1 = buffer.get1U();
- int j1 = buffer.get1U();
- int k1 = buffer.get1U();
- int l1 = buffer.get2U();
- int i2 = buffer.get2U();
+ header.vertexCount = packet.get2U();
+ header.faceCount = packet.get2U();
+ header.texturedFaceCount = packet.get1U();
+ int k = packet.get1U();
+ int l = packet.get1U();
+ int i1 = packet.get1U();
+ int j1 = packet.get1U();
+ int k1 = packet.get1U();
+ int l1 = packet.get2U();
+ int i2 = packet.get2U();
//noinspection unused
- int j2 = buffer.get2U();
- int k2 = buffer.get2U();
+ int j2 = packet.get2U();
+ int k2 = packet.get2U();
int offset = 0;
header.obPoint1Position = offset;
offset += header.vertexCount;
diff --git a/src/main/java/NPCType.java b/src/main/java/NPCType.java
index 24db3c2..83c44c1 100644
--- a/src/main/java/NPCType.java
+++ b/src/main/java/NPCType.java
@@ -5,7 +5,7 @@
public class NPCType {
public static int anInt56;
- public static Buffer aBuffer_60;
+ public static Packet aPacket_60;
public static int anInt62;
public static int[] anIntArray72;
public static NPCType[] aTypeArray80;
@@ -53,21 +53,21 @@ public class NPCType {
}
anInt56 = (anInt56 + 1) % 20;
NPCType type = aTypeArray80[anInt56] = new NPCType();
- aBuffer_60.position = anIntArray72[i];
+ aPacket_60.position = anIntArray72[i];
type.aLong78 = i;
- type.method165(aBuffer_60);
+ type.method165(aPacket_60);
return type;
}
public static void method162(FileArchive archive) {
- aBuffer_60 = new Buffer(archive.read("npc.dat", null));
- Buffer buffer = new Buffer(archive.read("npc.idx", null));
- anInt62 = buffer.get2U();
+ aPacket_60 = new Packet(archive.read("npc.dat", null));
+ Packet packet = new Packet(archive.read("npc.idx", null));
+ anInt62 = packet.get2U();
anIntArray72 = new int[anInt62];
int i = 2;
for (int j = 0; j < anInt62; j++) {
anIntArray72[j] = i;
- i += buffer.get2U();
+ i += packet.get2U();
}
aTypeArray80 = new NPCType[20];
for (int k = 0; k < 20; k++) {
@@ -79,7 +79,7 @@ public class NPCType {
aCache_95 = null;
anIntArray72 = null;
aTypeArray80 = null;
- aBuffer_60 = null;
+ aPacket_60 = null;
}
public Model method160() {
@@ -197,92 +197,92 @@ public class NPCType {
return model_1;
}
- public void method165(Buffer buffer) {
+ public void method165(Packet packet) {
do {
- int i = buffer.get1U();
+ int i = packet.get1U();
if (i == 0) {
return;
}
if (i == 1) {
- int j = buffer.get1U();
+ int j = packet.get1U();
anIntArray94 = new int[j];
for (int j1 = 0; j1 < j; j1++) {
- anIntArray94[j1] = buffer.get2U();
+ anIntArray94[j1] = packet.get2U();
}
} else if (i == 2) {
- aString65 = buffer.getString();
+ aString65 = packet.getString();
} else if (i == 3) {
- aByteArray89 = buffer.getStringRaw();
+ aByteArray89 = packet.getStringRaw();
} else if (i == 12) {
- aByte68 = buffer.get1();
+ aByte68 = packet.get1();
} else if (i == 13) {
- anInt77 = buffer.get2U();
+ anInt77 = packet.get2U();
} else if (i == 14) {
- anInt67 = buffer.get2U();
+ anInt67 = packet.get2U();
} else if (i == 17) {
- anInt67 = buffer.get2U();
- anInt58 = buffer.get2U();
- anInt83 = buffer.get2U();
- anInt55 = buffer.get2U();
+ anInt67 = packet.get2U();
+ anInt58 = packet.get2U();
+ anInt83 = packet.get2U();
+ anInt55 = packet.get2U();
} else if ((i >= 30) && (i < 40)) {
if (aStringArray66 == null) {
aStringArray66 = new String[5];
}
- aStringArray66[i - 30] = buffer.getString();
+ aStringArray66[i - 30] = packet.getString();
if (aStringArray66[i - 30].equalsIgnoreCase("hidden")) {
aStringArray66[i - 30] = null;
}
} else if (i == 40) {
- int k = buffer.get1U();
+ int k = packet.get1U();
anIntArray76 = new int[k];
anIntArray70 = new int[k];
for (int k1 = 0; k1 < k; k1++) {
- anIntArray76[k1] = buffer.get2U();
- anIntArray70[k1] = buffer.get2U();
+ anIntArray76[k1] = packet.get2U();
+ anIntArray70[k1] = packet.get2U();
}
} else if (i == 60) {
- int l = buffer.get1U();
+ int l = packet.get1U();
anIntArray73 = new int[l];
for (int l1 = 0; l1 < l; l1++) {
- anIntArray73[l1] = buffer.get2U();
+ anIntArray73[l1] = packet.get2U();
}
} else if (i == 90) {
- unusedInt2 = buffer.get2U();
+ unusedInt2 = packet.get2U();
} else if (i == 91) {
- unusedInt0 = buffer.get2U();
+ unusedInt0 = packet.get2U();
} else if (i == 92) {
- unusedInt1 = buffer.get2U();
+ unusedInt1 = packet.get2U();
} else if (i == 93) {
aBoolean87 = false;
} else if (i == 95) {
- anInt61 = buffer.get2U();
+ anInt61 = packet.get2U();
} else if (i == 97) {
- anInt91 = buffer.get2U();
+ anInt91 = packet.get2U();
} else if (i == 98) {
- anInt86 = buffer.get2U();
+ anInt86 = packet.get2U();
} else if (i == 99) {
aBoolean93 = true;
} else if (i == 100) {
- anInt85 = buffer.get1();
+ anInt85 = packet.get1();
} else if (i == 101) {
- anInt92 = buffer.get1() * 5;
+ anInt92 = packet.get1() * 5;
} else if (i == 102) {
- anInt75 = buffer.get2U();
+ anInt75 = packet.get2U();
} else if (i == 103) {
- anInt79 = buffer.get2U();
+ anInt79 = packet.get2U();
} else if (i == 106) {
- anInt57 = buffer.get2U();
+ anInt57 = packet.get2U();
if (anInt57 == 65535) {
anInt57 = -1;
}
- anInt59 = buffer.get2U();
+ anInt59 = packet.get2U();
if (anInt59 == 65535) {
anInt59 = -1;
}
- int i1 = buffer.get1U();
+ int i1 = packet.get1U();
anIntArray88 = new int[i1 + 1];
for (int i2 = 0; i2 <= i1; i2++) {
- anIntArray88[i2] = buffer.get2U();
+ anIntArray88[i2] = packet.get2U();
if (anIntArray88[i2] == 65535) {
anIntArray88[i2] = -1;
}
diff --git a/src/main/java/ObjType.java b/src/main/java/ObjType.java
index 37b16e0..50cc125 100644
--- a/src/main/java/ObjType.java
+++ b/src/main/java/ObjType.java
@@ -9,7 +9,7 @@ public class ObjType {
public static ObjType[] aTypeArray172;
public static int anInt180;
public static boolean aBoolean182 = true;
- public static Buffer aBuffer_183;
+ public static Packet aPacket_183;
public static int[] anIntArray195;
public static int anInt203;
public byte aByte154;
@@ -61,18 +61,18 @@ public class ObjType {
aCache_158 = null;
anIntArray195 = null;
aTypeArray172 = null;
- aBuffer_183 = null;
+ aPacket_183 = null;
}
public static void method193(FileArchive archive) {
- aBuffer_183 = new Buffer(archive.read("obj.dat", null));
- Buffer buffer = new Buffer(archive.read("obj.idx", null));
- anInt203 = buffer.get2U();
+ aPacket_183 = new Packet(archive.read("obj.dat", null));
+ Packet packet = new Packet(archive.read("obj.idx", null));
+ anInt203 = packet.get2U();
anIntArray195 = new int[anInt203];
int i = 2;
for (int j = 0; j < anInt203; j++) {
anIntArray195[j] = i;
- i += buffer.get2U();
+ i += packet.get2U();
}
aTypeArray172 = new ObjType[10];
for (int k = 0; k < 10; k++) {
@@ -88,10 +88,10 @@ public class ObjType {
}
anInt180 = (anInt180 + 1) % 10;
ObjType type = aTypeArray172[anInt180];
- aBuffer_183.position = anIntArray195[i];
+ aPacket_183.position = anIntArray195[i];
type.anInt157 = i;
type.method197();
- type.method203(aBuffer_183);
+ type.method203(aPacket_183);
if (type.anInt163 != -1) {
type.method199();
}
@@ -466,57 +466,57 @@ public class ObjType {
return model;
}
- public void method203(Buffer buffer) {
+ public void method203(Packet packet) {
do {
- int i = buffer.get1U();
+ int i = packet.get1U();
if (i == 0) {
return;
}
if (i == 1) {
- anInt174 = buffer.get2U();
+ anInt174 = packet.get2U();
} else if (i == 2) {
- aString170 = buffer.getString();
+ aString170 = packet.getString();
} else if (i == 3) {
- aByteArray178 = buffer.getStringRaw();
+ aByteArray178 = packet.getStringRaw();
} else if (i == 4) {
- anInt181 = buffer.get2U();
+ anInt181 = packet.get2U();
} else if (i == 5) {
- anInt190 = buffer.get2U();
+ anInt190 = packet.get2U();
} else if (i == 6) {
- anInt198 = buffer.get2U();
+ anInt198 = packet.get2U();
} else if (i == 7) {
- anInt169 = buffer.get2U();
+ anInt169 = packet.get2U();
if (anInt169 > 32767) {
anInt169 -= 0x10000;
}
} else if (i == 8) {
- anInt194 = buffer.get2U();
+ anInt194 = packet.get2U();
if (anInt194 > 32767) {
anInt194 -= 0x10000;
}
} else if (i == 10) {
- unusedInt = buffer.get2U();
+ unusedInt = packet.get2U();
} else if (i == 11) {
aBoolean176 = true;
} else if (i == 12) {
- anInt155 = buffer.get4();
+ anInt155 = packet.get4();
} else if (i == 16) {
aBoolean161 = true;
} else if (i == 23) {
- anInt165 = buffer.get2U();
- aByte205 = buffer.get1();
+ anInt165 = packet.get2U();
+ aByte205 = packet.get1();
} else if (i == 24) {
- anInt188 = buffer.get2U();
+ anInt188 = packet.get2U();
} else if (i == 25) {
- anInt200 = buffer.get2U();
- aByte154 = buffer.get1();
+ anInt200 = packet.get2U();
+ aByte154 = packet.get1();
} else if (i == 26) {
- anInt164 = buffer.get2U();
+ anInt164 = packet.get2U();
} else if ((i >= 30) && (i < 35)) {
if (aStringArray168 == null) {
aStringArray168 = new String[5];
}
- aStringArray168[i - 30] = buffer.getString();
+ aStringArray168[i - 30] = packet.getString();
if (aStringArray168[i - 30].equalsIgnoreCase("hidden")) {
aStringArray168[i - 30] = null;
}
@@ -524,52 +524,52 @@ public class ObjType {
if (aStringArray189 == null) {
aStringArray189 = new String[5];
}
- aStringArray189[i - 35] = buffer.getString();
+ aStringArray189[i - 35] = packet.getString();
} else if (i == 40) {
- int j = buffer.get1U();
+ int j = packet.get1U();
anIntArray156 = new int[j];
anIntArray160 = new int[j];
for (int k = 0; k < j; k++) {
- anIntArray156[k] = buffer.get2U();
- anIntArray160[k] = buffer.get2U();
+ anIntArray156[k] = packet.get2U();
+ anIntArray160[k] = packet.get2U();
}
} else if (i == 78) {
- anInt185 = buffer.get2U();
+ anInt185 = packet.get2U();
} else if (i == 79) {
- anInt162 = buffer.get2U();
+ anInt162 = packet.get2U();
} else if (i == 90) {
- anInt175 = buffer.get2U();
+ anInt175 = packet.get2U();
} else if (i == 91) {
- anInt197 = buffer.get2U();
+ anInt197 = packet.get2U();
} else if (i == 92) {
- anInt166 = buffer.get2U();
+ anInt166 = packet.get2U();
} else if (i == 93) {
- anInt173 = buffer.get2U();
+ anInt173 = packet.get2U();
} else if (i == 95) {
- anInt204 = buffer.get2U();
+ anInt204 = packet.get2U();
} else if (i == 97) {
- anInt179 = buffer.get2U();
+ anInt179 = packet.get2U();
} else if (i == 98) {
- anInt163 = buffer.get2U();
+ anInt163 = packet.get2U();
} else if ((i >= 100) && (i < 110)) {
if (anIntArray193 == null) {
anIntArray193 = new int[10];
anIntArray201 = new int[10];
}
- anIntArray193[i - 100] = buffer.get2U();
- anIntArray201[i - 100] = buffer.get2U();
+ anIntArray193[i - 100] = packet.get2U();
+ anIntArray201[i - 100] = packet.get2U();
} else if (i == 110) {
- anInt167 = buffer.get2U();
+ anInt167 = packet.get2U();
} else if (i == 111) {
- anInt192 = buffer.get2U();
+ anInt192 = packet.get2U();
} else if (i == 112) {
- anInt191 = buffer.get2U();
+ anInt191 = packet.get2U();
} else if (i == 113) {
- anInt196 = buffer.get1();
+ anInt196 = packet.get1();
} else if (i == 114) {
- anInt184 = buffer.get1() * 5;
+ anInt184 = packet.get1() * 5;
} else if (i == 115) {
- anInt202 = buffer.get1U();
+ anInt202 = packet.get1U();
}
} while (true);
}
diff --git a/src/main/java/OnDemand.java b/src/main/java/OnDemand.java
index d94aeb8..b782eb1 100644
--- a/src/main/java/OnDemand.java
+++ b/src/main/java/OnDemand.java
@@ -163,21 +163,21 @@ public class OnDemand implements Runnable {
for (int i = 0; i < 4; i++) {
byte[] abyte0 = archive.read(as[i], null);
int j = abyte0.length / 2;
- Buffer buffer = new Buffer(abyte0);
+ Packet packet = new Packet(abyte0);
anIntArrayArray1364[i] = new int[j];
aByteArrayArray1342[i] = new byte[j];
for (int l = 0; l < j; l++) {
- anIntArrayArray1364[i][l] = buffer.get2U();
+ anIntArrayArray1364[i][l] = packet.get2U();
}
}
String[] as1 = {"model_crc", "anim_crc", "midi_crc", "map_crc"};
for (int k = 0; k < 4; k++) {
byte[] abyte1 = archive.read(as1[k], null);
int i1 = abyte1.length / 4;
- Buffer buffer_1 = new Buffer(abyte1);
+ Packet packet_1 = new Packet(abyte1);
anIntArrayArray1365[k] = new int[i1];
for (int l1 = 0; l1 < i1; l1++) {
- anIntArrayArray1365[k][l1] = buffer_1.get4();
+ anIntArrayArray1365[k][l1] = packet_1.get4();
}
}
byte[] abyte2 = archive.read("model_index", null);
@@ -191,7 +191,7 @@ public class OnDemand implements Runnable {
}
}
abyte2 = archive.read("map_index", null);
- Buffer class30_sub2_sub2_2 = new Buffer(abyte2);
+ Packet class30_sub2_sub2_2 = new Packet(abyte2);
j1 = abyte2.length / 7;
anIntArray1371 = new int[j1];
anIntArray1350 = new int[j1];
@@ -204,14 +204,14 @@ public class OnDemand implements Runnable {
anIntArray1356[i2] = class30_sub2_sub2_2.get1U();
}
abyte2 = archive.read("anim_index", null);
- class30_sub2_sub2_2 = new Buffer(abyte2);
+ class30_sub2_sub2_2 = new Packet(abyte2);
j1 = abyte2.length / 2;
anIntArray1360 = new int[j1];
for (int j2 = 0; j2 < j1; j2++) {
anIntArray1360[j2] = class30_sub2_sub2_2.get2U();
}
abyte2 = archive.read("midi_index", null);
- class30_sub2_sub2_2 = new Buffer(abyte2);
+ class30_sub2_sub2_2 = new Packet(abyte2);
j1 = abyte2.length;
anIntArray1348 = new int[j1];
for (int k2 = 0; k2 < j1; k2++) {
diff --git a/src/main/java/Buffer.java b/src/main/java/Packet.java
similarity index 78%
rename from src/main/java/Buffer.java
rename to src/main/java/Packet.java
index e52edfe..0772492 100644
--- a/src/main/java/Buffer.java
+++ b/src/main/java/Packet.java
@@ -1,6 +1,30 @@
import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
-public class Buffer extends DoublyLinkedListNode {
+/**
+ * A {@link Packet} encapsulates a finite amount of data and provides methods for reading and writing to that data.
+ * The put() and get() methods describe the type of data they use by attributes in their
+ * suffix. The naming convention is put[type][U:unsigned][endianness][modifier].
+ *
+ * Types:
+ * # — the number of bytes
+ * Op — 1 byte which is modified by the {@link #cipher}
+ * Smart — 1 or 2 byte value [-16384...16383]
+ * USmart — 1 or 2 byte value [0...32768]
+ * String — {@link StandardCharsets#ISO_8859_1} encoding delimited by a newline character (\n)
+ *
+ * Endianness:
+ * LE — little endian (DCBA)
+ * ME — middle endian (CDAB)
+ * RME — reversed middle endian (BADC)
+ * Note: ME and RME are not standard, and are a form of obfuscation similar to the modifier attribute.
+ *
+ * Modifiers:
+ * A — put(v + 128) — get: v - 128
+ * C — put(-v) — get: -v
+ * S — put(128 - v) — get: 128 - v
+ */
+public class Packet extends DoublyLinkedListNode {
public static final LinkedList pool0 = new LinkedList();
public static final LinkedList pool1 = new LinkedList();
@@ -10,39 +34,39 @@ public class Buffer extends DoublyLinkedListNode {
public static int poolSize1;
public static int poolSize2;
- public static Buffer create(int sizeType) {
+ public static Packet create(int sizeType) {
synchronized (pool1) {
- Buffer buffer = null;
+ Packet packet = null;
if ((sizeType == 0) && (poolSize0 > 0)) {
poolSize0--;
- buffer = (Buffer) pool0.method251();
+ packet = (Packet) pool0.method251();
} else if ((sizeType == 1) && (poolSize1 > 0)) {
poolSize1--;
- buffer = (Buffer) pool1.method251();
+ packet = (Packet) pool1.method251();
} else if ((sizeType == 2) && (poolSize2 > 0)) {
poolSize2--;
- buffer = (Buffer) pool2.method251();
+ packet = (Packet) pool2.method251();
}
- if (buffer != null) {
- buffer.position = 0;
- return buffer;
+ if (packet != null) {
+ packet.position = 0;
+ return packet;
}
}
- Buffer buffer = new Buffer();
- buffer.position = 0;
+ Packet packet = new Packet();
+ packet.position = 0;
if (sizeType == 0) {
- buffer.data = new byte[100];
+ packet.data = new byte[100];
} else if (sizeType == 1) {
- buffer.data = new byte[5000];
+ packet.data = new byte[5000];
} else {
- buffer.data = new byte[30000];
+ packet.data = new byte[30000];
}
- return buffer;
+ return packet;
}
public byte[] data;
@@ -50,10 +74,10 @@ public class Buffer extends DoublyLinkedListNode {
public int bitPosition;
public ISAACCipher cipher;
- public Buffer() {
+ public Packet() {
}
- public Buffer(byte[] src) {
+ public Packet(byte[] src) {
data = src;
position = 0;
}
@@ -130,7 +154,7 @@ public class Buffer extends DoublyLinkedListNode {
}
public void put(String s) {
- put(s.getBytes());
+ put(s.getBytes(StandardCharsets.ISO_8859_1));
put1('\n');
}
@@ -177,15 +201,25 @@ public class Buffer extends DoublyLinkedListNode {
return (128 - data[position++]) & 0xff;
}
+ /**
+ * Gets a 1 or 2 byte varint which has the range [-16384...16383].
+ *
+ * @return the value.
+ */
public int getSmart() {
int i = data[position] & 0xff;
if (i < 0x80) {
return get1U() - 0x40;
} else {
- return get2U() - 0xc000;
+ return get2U() - 0xC000;
}
}
+ /**
+ * Gets a 1 or 2 byte varint which has the range [0...32768].
+ *
+ * @return the value.
+ */
public int getUSmart() {
int i = data[position] & 0xff;
if (i < 0x80) {
diff --git a/src/main/java/PlayerEntity.java b/src/main/java/PlayerEntity.java
index 8962471..a755214 100644
--- a/src/main/java/PlayerEntity.java
+++ b/src/main/java/PlayerEntity.java
@@ -101,22 +101,22 @@ public class PlayerEntity extends PathingEntity {
return model;
}
- public void method451(Buffer buffer) {
- buffer.position = 0;
- anInt1702 = buffer.get1U();
- anInt1706 = buffer.get1U();
+ public void method451(Packet packet) {
+ packet.position = 0;
+ anInt1702 = packet.get1U();
+ anInt1706 = packet.get1U();
aType_1698 = null;
anInt1701 = 0;
for (int j = 0; j < 12; j++) {
- int k = buffer.get1U();
+ int k = packet.get1U();
if (k == 0) {
anIntArray1717[j] = 0;
continue;
}
- int i1 = buffer.get1U();
+ int i1 = packet.get1U();
anIntArray1717[j] = (k << 8) + i1;
if ((j == 0) && (anIntArray1717[0] == 65535)) {
- aType_1698 = NPCType.method159(buffer.get2U());
+ aType_1698 = NPCType.method159(packet.get2U());
break;
}
if ((anIntArray1717[j] >= 512) && ((anIntArray1717[j] - 512) < ObjType.anInt203)) {
@@ -127,43 +127,43 @@ public class PlayerEntity extends PathingEntity {
}
}
for (int l = 0; l < 5; l++) {
- int j1 = buffer.get1U();
+ int j1 = packet.get1U();
if ((j1 < 0) || (j1 >= Game.anIntArrayArray1003[l].length)) {
j1 = 0;
}
anIntArray1700[l] = j1;
}
- super.anInt1511 = buffer.get2U();
+ super.anInt1511 = packet.get2U();
if (super.anInt1511 == 65535) {
super.anInt1511 = -1;
}
- super.anInt1512 = buffer.get2U();
+ super.anInt1512 = packet.get2U();
if (super.anInt1512 == 65535) {
super.anInt1512 = -1;
}
- super.anInt1554 = buffer.get2U();
+ super.anInt1554 = packet.get2U();
if (super.anInt1554 == 65535) {
super.anInt1554 = -1;
}
- super.anInt1555 = buffer.get2U();
+ super.anInt1555 = packet.get2U();
if (super.anInt1555 == 65535) {
super.anInt1555 = -1;
}
- super.anInt1556 = buffer.get2U();
+ super.anInt1556 = packet.get2U();
if (super.anInt1556 == 65535) {
super.anInt1556 = -1;
}
- super.anInt1557 = buffer.get2U();
+ super.anInt1557 = packet.get2U();
if (super.anInt1557 == 65535) {
super.anInt1557 = -1;
}
- super.anInt1505 = buffer.get2U();
+ super.anInt1505 = packet.get2U();
if (super.anInt1505 == 65535) {
super.anInt1505 = -1;
}
- aString1703 = StringUtil.formatName(StringUtil.fromBase37(buffer.get8()));
- anInt1705 = buffer.get1U();
- anInt1723 = buffer.get2U();
+ aString1703 = StringUtil.formatName(StringUtil.fromBase37(packet.get8()));
+ anInt1705 = packet.get1U();
+ anInt1723 = packet.get2U();
aBoolean1710 = true;
aLong1718 = 0L;
for (int k1 = 0; k1 < 12; k1++) {
diff --git a/src/main/java/SceneBuilder.java b/src/main/java/SceneBuilder.java
index 47eac3c..45a5576 100644
--- a/src/main/java/SceneBuilder.java
+++ b/src/main/java/SceneBuilder.java
@@ -68,10 +68,10 @@ public class SceneBuilder {
return i_109_;
}
- public static void method173(Buffer buffer, OnDemand onDemand) {
+ public static void method173(Packet packet, OnDemand onDemand) {
int i_110_ = -1;
for (; ; ) {
- int i_111_ = buffer.getUSmart();
+ int i_111_ = packet.getUSmart();
if (i_111_ == 0) {
break;
}
@@ -79,11 +79,11 @@ public class SceneBuilder {
LocType type = LocType.method572(i_110_);
type.method574(onDemand);
for (; ; ) {
- int i_112_ = buffer.getUSmart();
+ int i_112_ = packet.getUSmart();
if (i_112_ == 0) {
break;
}
- buffer.get1U();
+ packet.get1U();
}
}
}
@@ -331,10 +331,10 @@ public class SceneBuilder {
public static boolean method189(int i, byte[] is, int i_250_) {
boolean bool = true;
- Buffer buffer = new Buffer(is);
+ Packet packet = new Packet(is);
int i_252_ = -1;
for (; ; ) {
- int i_253_ = buffer.getUSmart();
+ int i_253_ = packet.getUSmart();
if (i_253_ == 0) {
break;
}
@@ -343,20 +343,20 @@ public class SceneBuilder {
boolean bool_255_ = false;
for (; ; ) {
if (bool_255_) {
- int i_256_ = buffer.getUSmart();
+ int i_256_ = packet.getUSmart();
if (i_256_ == 0) {
break;
}
- buffer.get1U();
+ packet.get1U();
} else {
- int i_257_ = buffer.getUSmart();
+ int i_257_ = packet.getUSmart();
if (i_257_ == 0) {
break;
}
i_254_ += i_257_ - 1;
int i_258_ = i_254_ & 0x3f;
int i_259_ = (i_254_ >> 6) & 0x3f;
- int i_260_ = buffer.get1U() >> 2;
+ int i_260_ = packet.get1U() >> 2;
int i_261_ = i_259_ + i;
int i_262_ = i_258_ + i_250_;
if ((i_261_ > 0) && (i_262_ > 0) && (i_261_ < 103) && (i_262_ < 103)) {
@@ -1062,14 +1062,14 @@ public class SceneBuilder {
}
}
}
- Buffer buffer = new Buffer(is);
+ Packet packet = new Packet(is);
for (int i_172_ = 0; i_172_ < 4; i_172_++) {
for (int i_173_ = 0; i_173_ < 64; i_173_++) {
for (int i_174_ = 0; i_174_ < 64; i_174_++) {
if ((i_172_ == i) && (i_173_ >= i_165_) && (i_173_ < (i_165_ + 8)) && (i_174_ >= i_166_) && (i_174_ < (i_166_ + 8))) {
- method181(i_168_ + ChunkUtil.method156(i_174_ & 0x7, i_162_, i_173_ & 0x7), 0, buffer, i_164_ + ChunkUtil.method155(i_162_, i_174_ & 0x7, i_173_ & 0x7), i_167_, i_162_, 0);
+ method181(i_168_ + ChunkUtil.method156(i_174_ & 0x7, i_162_, i_173_ & 0x7), 0, packet, i_164_ + ChunkUtil.method155(i_162_, i_174_ & 0x7, i_173_ & 0x7), i_167_, i_162_, 0);
} else {
- method181(-1, 0, buffer, -1, 0, 0, 0);
+ method181(-1, 0, packet, -1, 0, 0, 0);
}
}
}
@@ -1086,21 +1086,21 @@ public class SceneBuilder {
}
}
}
- Buffer buffer = new Buffer(is);
+ Packet packet = new Packet(is);
for (int i_182_ = 0; i_182_ < 4; i_182_++) {
for (int i_183_ = 0; i_183_ < 64; i_183_++) {
for (int i_184_ = 0; i_184_ < 64; i_184_++) {
- method181(i_184_ + i, i_177_, buffer, i_183_ + i_175_, i_182_, 0, i_176_);
+ method181(i_184_ + i, i_177_, packet, i_183_ + i_175_, i_182_, 0, i_176_);
}
}
}
}
- public void method181(int i, int i_185_, Buffer buffer, int i_186_, int i_187_, int i_188_, int i_190_) {
+ public void method181(int i, int i_185_, Packet packet, int i_186_, int i_187_, int i_188_, int i_190_) {
if ((i_186_ >= 0) && (i_186_ < 104) && (i >= 0) && (i < 104)) {
aByteArrayArrayArray149[i_187_][i_186_][i] = (byte) 0;
for (; ; ) {
- int i_191_ = buffer.get1U();
+ int i_191_ = packet.get1U();
if (i_191_ == 0) {
if (i_187_ == 0) {
anIntArrayArrayArray129[0][i_186_][i] = -method172(932731 + i_186_ + i_190_, 556238 + i + i_185_) * 8;
@@ -1111,7 +1111,7 @@ public class SceneBuilder {
break;
}
if (i_191_ == 1) {
- int i_192_ = buffer.get1U();
+ int i_192_ = packet.get1U();
if (i_192_ == 1) {
i_192_ = 0;
}
@@ -1124,7 +1124,7 @@ public class SceneBuilder {
break;
}
if (i_191_ <= 49) {
- aByteArrayArrayArray130[i_187_][i_186_][i] = buffer.get1();
+ aByteArrayArrayArray130[i_187_][i_186_][i] = packet.get1();
aByteArrayArrayArray136[i_187_][i_186_][i] = (byte) ((i_191_ - 2) / 4);
aByteArrayArrayArray148[i_187_][i_186_][i] = (byte) (((i_191_ - 2) + i_188_) & 0x3);
} else if (i_191_ <= 81) {
@@ -1135,16 +1135,16 @@ public class SceneBuilder {
}
} else {
for (; ; ) {
- int i_193_ = buffer.get1U();
+ int i_193_ = packet.get1U();
if (i_193_ == 0) {
break;
}
if (i_193_ == 1) {
- buffer.get1U();
+ packet.get1U();
break;
}
if (i_193_ <= 49) {
- buffer.get1U();
+ packet.get1U();
}
}
}
@@ -1164,17 +1164,17 @@ public class SceneBuilder {
}
public void method183(SceneCollisionMap[] collisionMaps, SceneGraph graph, int i, int i_197_, int i_198_, int i_199_, byte[] is, int i_200_, int i_201_, int i_202_) {
- Buffer buffer = new Buffer(is);
+ Packet packet = new Packet(is);
int i_203_ = -1;
for (; ; ) {
- int i_204_ = buffer.getUSmart();
+ int i_204_ = packet.getUSmart();
if (i_204_ == 0) {
break;
}
i_203_ += i_204_;
int i_205_ = 0;
for (; ; ) {
- int i_206_ = buffer.getUSmart();
+ int i_206_ = packet.getUSmart();
if (i_206_ == 0) {
break;
}
@@ -1182,7 +1182,7 @@ public class SceneBuilder {
int i_207_ = i_205_ & 0x3f;
int i_208_ = (i_205_ >> 6) & 0x3f;
int i_209_ = i_205_ >> 12;
- int i_210_ = buffer.get1U();
+ int i_210_ = packet.get1U();
int i_211_ = i_210_ >> 2;
int i_212_ = i_210_ & 0x3;
if ((i_209_ == i) && (i_208_ >= i_200_) && (i_208_ < (i_200_ + 8)) && (i_207_ >= i_198_) && (i_207_ < (i_198_ + 8))) {
@@ -1228,17 +1228,17 @@ public class SceneBuilder {
}
public void method190(int i, SceneCollisionMap[] collisionMaps, int i_263_, SceneGraph graph, byte[] is) {
- Buffer buffer = new Buffer(is);
+ Packet packet = new Packet(is);
int i_265_ = -1;
for (; ; ) {
- int i_266_ = buffer.getUSmart();
+ int i_266_ = packet.getUSmart();
if (i_266_ == 0) {
break;
}
i_265_ += i_266_;
int i_267_ = 0;
for (; ; ) {
- int i_268_ = buffer.getUSmart();
+ int i_268_ = packet.getUSmart();
if (i_268_ == 0) {
break;
}
@@ -1246,7 +1246,7 @@ public class SceneBuilder {
int i_269_ = i_267_ & 0x3f;
int i_270_ = (i_267_ >> 6) & 0x3f;
int i_271_ = i_267_ >> 12;
- int i_272_ = buffer.get1U();
+ int i_272_ = packet.get1U();
int i_273_ = i_272_ >> 2;
int i_274_ = i_272_ & 0x3;
int i_275_ = i_270_ + i;
diff --git a/src/main/java/SeqFrame.java b/src/main/java/SeqFrame.java
index b881c42..6e3c460 100644
--- a/src/main/java/SeqFrame.java
+++ b/src/main/java/SeqFrame.java
@@ -83,27 +83,27 @@ public class SeqFrame {
* @see #get(int)
*/
public static void readAnimation(byte[] src) {
- Buffer offsets = new Buffer(src);
+ Packet offsets = new Packet(src);
offsets.position = src.length - 8;
int offset = 0;
- Buffer header = new Buffer(src);
+ Packet header = new Packet(src);
header.position = offset;
offset += offsets.get2U() + 2;
- Buffer tran1 = new Buffer(src);
+ Packet tran1 = new Packet(src);
tran1.position = offset;
offset += offsets.get2U();
- Buffer tran2 = new Buffer(src);
+ Packet tran2 = new Packet(src);
tran2.position = offset;
offset += offsets.get2U();
- Buffer del = new Buffer(src);
+ Packet del = new Packet(src);
del.position = offset;
offset += offsets.get2U();
- Buffer skel = new Buffer(src);
+ Packet skel = new Packet(src);
skel.position = offset;
SeqSkeleton skeleton = new SeqSkeleton(skel);
diff --git a/src/main/java/SeqSkeleton.java b/src/main/java/SeqSkeleton.java
index d78bca8..3288561 100644
--- a/src/main/java/SeqSkeleton.java
+++ b/src/main/java/SeqSkeleton.java
@@ -31,7 +31,7 @@ public class SeqSkeleton {
*
* @param in the input
*/
- public SeqSkeleton(Buffer in) {
+ public SeqSkeleton(Packet in) {
final int length = in.get1U();
baseTypes = new int[length];
baseLabels = new int[length][];
diff --git a/src/main/java/SeqType.java b/src/main/java/SeqType.java
index 65d0ad4..d107e4a 100644
--- a/src/main/java/SeqType.java
+++ b/src/main/java/SeqType.java
@@ -26,8 +26,8 @@ public class SeqType {
}
public static void method257(FileArchive archive) {
- Buffer buffer = new Buffer(archive.read("seq.dat", null));
- anInt350 = buffer.get2U();
+ Packet packet = new Packet(archive.read("seq.dat", null));
+ anInt350 = packet.get2U();
if (aTypeArray351 == null) {
aTypeArray351 = new SeqType[anInt350];
}
@@ -35,7 +35,7 @@ public class SeqType {
if (aTypeArray351[j] == null) {
aTypeArray351[j] = new SeqType();
}
- aTypeArray351[j].method259(buffer);
+ aTypeArray351[j].method259(packet);
}
}
@@ -53,52 +53,52 @@ public class SeqType {
return j;
}
- public void method259(Buffer buffer) {
+ public void method259(Packet packet) {
do {
- int i = buffer.get1U();
+ int i = packet.get1U();
if (i == 0) {
break;
}
if (i == 1) {
- anInt352 = buffer.get1U();
+ anInt352 = packet.get1U();
anIntArray353 = new int[anInt352];
anIntArray354 = new int[anInt352];
anIntArray355 = new int[anInt352];
for (int j = 0; j < anInt352; j++) {
- anIntArray353[j] = buffer.get2U();
- anIntArray354[j] = buffer.get2U();
+ anIntArray353[j] = packet.get2U();
+ anIntArray354[j] = packet.get2U();
if (anIntArray354[j] == 65535) {
anIntArray354[j] = -1;
}
- anIntArray355[j] = buffer.get2U();
+ anIntArray355[j] = packet.get2U();
}
} else if (i == 2) {
- anInt356 = buffer.get2U();
+ anInt356 = packet.get2U();
} else if (i == 3) {
- int k = buffer.get1U();
+ int k = packet.get1U();
anIntArray357 = new int[k + 1];
for (int l = 0; l < k; l++) {
- anIntArray357[l] = buffer.get1U();
+ anIntArray357[l] = packet.get1U();
}
anIntArray357[k] = 9999999;
} else if (i == 4) {
aBoolean358 = true;
} else if (i == 5) {
- anInt359 = buffer.get1U();
+ anInt359 = packet.get1U();
} else if (i == 6) {
- anInt360 = buffer.get2U();
+ anInt360 = packet.get2U();
} else if (i == 7) {
- anInt361 = buffer.get2U();
+ anInt361 = packet.get2U();
} else if (i == 8) {
- anInt362 = buffer.get1U();
+ anInt362 = packet.get1U();
} else if (i == 9) {
- anInt363 = buffer.get1U();
+ anInt363 = packet.get1U();
} else if (i == 10) {
- anInt364 = buffer.get1U();
+ anInt364 = packet.get1U();
} else if (i == 11) {
- anInt365 = buffer.get1U();
+ anInt365 = packet.get1U();
} else if (i == 12) {
- unusedInt = buffer.get4();
+ unusedInt = packet.get4();
} else {
System.out.println("Error unrecognised seq config code: " + i);
}
diff --git a/src/main/java/SoundEnvelope.java b/src/main/java/SoundEnvelope.java
index 06ff20d..68c85f5 100644
--- a/src/main/java/SoundEnvelope.java
+++ b/src/main/java/SoundEnvelope.java
@@ -19,20 +19,20 @@ public class SoundEnvelope {
public SoundEnvelope() {
}
- public void method325(Buffer buffer) {
- anInt540 = buffer.get1U();
- anInt538 = buffer.get4();
- anInt539 = buffer.get4();
- method326(buffer);
+ public void method325(Packet packet) {
+ anInt540 = packet.get1U();
+ anInt538 = packet.get4();
+ anInt539 = packet.get4();
+ method326(packet);
}
- public void method326(Buffer buffer) {
- anInt535 = buffer.get1U();
+ public void method326(Packet packet) {
+ anInt535 = packet.get1U();
anIntArray536 = new int[anInt535];
anIntArray537 = new int[anInt535];
for (int i = 0; i < anInt535; i++) {
- anIntArray536[i] = buffer.get2U();
- anIntArray537[i] = buffer.get2U();
+ anIntArray536[i] = packet.get2U();
+ anIntArray537[i] = packet.get2U();
}
}
diff --git a/src/main/java/SoundFilter.java b/src/main/java/SoundFilter.java
index 5eac416..1a81ce8 100644
--- a/src/main/java/SoundFilter.java
+++ b/src/main/java/SoundFilter.java
@@ -69,25 +69,25 @@ public class SoundFilter {
return anIntArray665[i] * 2;
}
- public void method545(Buffer buffer, SoundEnvelope envelope) {
- int i = buffer.get1U();
+ public void method545(Packet packet, SoundEnvelope envelope) {
+ int i = packet.get1U();
anIntArray665[0] = i >> 4;
anIntArray665[1] = i & 0xf;
if (i != 0) {
- anIntArray668[0] = buffer.get2U();
- anIntArray668[1] = buffer.get2U();
- int j = buffer.get1U();
+ anIntArray668[0] = packet.get2U();
+ anIntArray668[1] = packet.get2U();
+ int j = packet.get1U();
for (int k = 0; k < 2; k++) {
for (int l = 0; l < anIntArray665[k]; l++) {
- anIntArrayArrayArray666[k][0][l] = buffer.get2U();
- anIntArrayArrayArray667[k][0][l] = buffer.get2U();
+ anIntArrayArrayArray666[k][0][l] = packet.get2U();
+ anIntArrayArrayArray667[k][0][l] = packet.get2U();
}
}
for (int i1 = 0; i1 < 2; i1++) {
for (int j1 = 0; j1 < anIntArray665[i1]; j1++) {
if ((j & (1 << (i1 * 4) << j1)) != 0) {
- anIntArrayArrayArray666[i1][1][j1] = buffer.get2U();
- anIntArrayArrayArray667[i1][1][j1] = buffer.get2U();
+ anIntArrayArrayArray666[i1][1][j1] = packet.get2U();
+ anIntArrayArrayArray667[i1][1][j1] = packet.get2U();
} else {
anIntArrayArrayArray666[i1][1][j1] = anIntArrayArrayArray666[i1][0][j1];
anIntArrayArrayArray667[i1][1][j1] = anIntArrayArrayArray667[i1][0][j1];
@@ -95,7 +95,7 @@ public class SoundFilter {
}
}
if ((j != 0) || (anIntArray668[1] != anIntArray668[0])) {
- envelope.method326(buffer);
+ envelope.method326(packet);
}
} else {
anIntArray668[0] = anIntArray668[1] = 0;
diff --git a/src/main/java/SoundTone.java b/src/main/java/SoundTone.java
index 9364ef7..1763237 100644
--- a/src/main/java/SoundTone.java
+++ b/src/main/java/SoundTone.java
@@ -231,51 +231,51 @@ public class SoundTone {
}
}
- public void method169(Buffer buffer) {
+ public void method169(Packet packet) {
aEnvelope_98 = new SoundEnvelope();
- aEnvelope_98.method325(buffer);
+ aEnvelope_98.method325(packet);
aEnvelope_99 = new SoundEnvelope();
- aEnvelope_99.method325(buffer);
- int i = buffer.get1U();
+ aEnvelope_99.method325(packet);
+ int i = packet.get1U();
if (i != 0) {
- buffer.position--;
+ packet.position--;
aEnvelope_100 = new SoundEnvelope();
- aEnvelope_100.method325(buffer);
+ aEnvelope_100.method325(packet);
aEnvelope_101 = new SoundEnvelope();
- aEnvelope_101.method325(buffer);
+ aEnvelope_101.method325(packet);
}
- i = buffer.get1U();
+ i = packet.get1U();
if (i != 0) {
- buffer.position--;
+ packet.position--;
aEnvelope_102 = new SoundEnvelope();
- aEnvelope_102.method325(buffer);
+ aEnvelope_102.method325(packet);
aEnvelope_103 = new SoundEnvelope();
- aEnvelope_103.method325(buffer);
+ aEnvelope_103.method325(packet);
}
- i = buffer.get1U();
+ i = packet.get1U();
if (i != 0) {
- buffer.position--;
+ packet.position--;
aEnvelope_104 = new SoundEnvelope();
- aEnvelope_104.method325(buffer);
+ aEnvelope_104.method325(packet);
aEnvelope_105 = new SoundEnvelope();
- aEnvelope_105.method325(buffer);
+ aEnvelope_105.method325(packet);
}
for (int j = 0; j < 10; j++) {
- int k = buffer.getUSmart();
+ int k = packet.getUSmart();
if (k == 0) {
break;
}
anIntArray106[j] = k;
- anIntArray107[j] = buffer.getSmart();
- anIntArray108[j] = buffer.getUSmart();
+ anIntArray107[j] = packet.getSmart();
+ anIntArray108[j] = packet.getUSmart();
}
- anInt109 = buffer.getUSmart();
- anInt110 = buffer.getUSmart();
- anInt113 = buffer.get2U();
- anInt114 = buffer.get2U();
+ anInt109 = packet.getUSmart();
+ anInt110 = packet.getUSmart();
+ anInt113 = packet.get2U();
+ anInt114 = packet.get2U();
aSoundFilter_111 = new SoundFilter();
aEnvelope_112 = new SoundEnvelope();
- aSoundFilter_111.method545(buffer, aEnvelope_112);
+ aSoundFilter_111.method545(packet, aEnvelope_112);
}
}
diff --git a/src/main/java/SoundTrack.java b/src/main/java/SoundTrack.java
index a458373..538402c 100644
--- a/src/main/java/SoundTrack.java
+++ b/src/main/java/SoundTrack.java
@@ -7,7 +7,7 @@ public class SoundTrack {
public static final SoundTrack[] A_TRACK_ARRAY_325 = new SoundTrack[5000];
public static final int[] anIntArray326 = new int[5000];
public static byte[] aByteArray327;
- public static Buffer aBuffer_328;
+ public static Packet aPacket_328;
public final SoundTone[] aToneArray329 = new SoundTone[10];
public int anInt330;
public int anInt331;
@@ -15,22 +15,22 @@ public class SoundTrack {
public SoundTrack() {
}
- public static void method240(Buffer buffer) {
+ public static void method240(Packet packet) {
aByteArray327 = new byte[0x6baa8];
- aBuffer_328 = new Buffer(aByteArray327);
+ aPacket_328 = new Packet(aByteArray327);
SoundTone.method166();
do {
- int j = buffer.get2U();
+ int j = packet.get2U();
if (j == 65535) {
return;
}
A_TRACK_ARRAY_325[j] = new SoundTrack();
- A_TRACK_ARRAY_325[j].method242(buffer);
+ A_TRACK_ARRAY_325[j].method242(packet);
anIntArray326[j] = A_TRACK_ARRAY_325[j].method243();
} while (true);
}
- public static Buffer method241(int i, int j) {
+ public static Packet method241(int i, int j) {
if (A_TRACK_ARRAY_325[j] != null) {
SoundTrack track = A_TRACK_ARRAY_325[j];
return track.method244(i);
@@ -39,17 +39,17 @@ public class SoundTrack {
}
}
- public void method242(Buffer buffer) {
+ public void method242(Packet packet) {
for (int i = 0; i < 10; i++) {
- int j = buffer.get1U();
+ int j = packet.get1U();
if (j != 0) {
- buffer.position--;
+ packet.position--;
aToneArray329[i] = new SoundTone();
- aToneArray329[i].method169(buffer);
+ aToneArray329[i].method169(packet);
}
}
- anInt330 = buffer.get2U();
- anInt331 = buffer.get2U();
+ anInt330 = packet.get2U();
+ anInt331 = packet.get2U();
}
public int method243() {
@@ -77,24 +77,24 @@ public class SoundTrack {
return j;
}
- public Buffer method244(int i) {
+ public Packet method244(int i) {
int k = method245(i);
- aBuffer_328.position = 0;
- aBuffer_328.put4(0x52494646);
- aBuffer_328.put4LE(36 + k);
- aBuffer_328.put4(0x57415645);
- aBuffer_328.put4(0x666d7420);
- aBuffer_328.put4LE(16);
- aBuffer_328.put2LE(1);
- aBuffer_328.put2LE(1);
- aBuffer_328.put4LE(22050);
- aBuffer_328.put4LE(22050);
- aBuffer_328.put2LE(1);
- aBuffer_328.put2LE(8);
- aBuffer_328.put4(0x64617461);
- aBuffer_328.put4LE(k);
- aBuffer_328.position += k;
- return aBuffer_328;
+ aPacket_328.position = 0;
+ aPacket_328.put4(0x52494646);
+ aPacket_328.put4LE(36 + k);
+ aPacket_328.put4(0x57415645);
+ aPacket_328.put4(0x666d7420);
+ aPacket_328.put4LE(16);
+ aPacket_328.put2LE(1);
+ aPacket_328.put2LE(1);
+ aPacket_328.put4LE(22050);
+ aPacket_328.put4LE(22050);
+ aPacket_328.put2LE(1);
+ aPacket_328.put2LE(8);
+ aPacket_328.put4(0x64617461);
+ aPacket_328.put4LE(k);
+ aPacket_328.position += k;
+ return aPacket_328;
}
public int method245(int i) {
diff --git a/src/main/java/SpotAnimType.java b/src/main/java/SpotAnimType.java
index c02533e..5851b5f 100644
--- a/src/main/java/SpotAnimType.java
+++ b/src/main/java/SpotAnimType.java
@@ -23,8 +23,8 @@ public class SpotAnimType {
}
public static void method264(FileArchive archive) {
- Buffer buffer = new Buffer(archive.read("spotanim.dat", null));
- anInt402 = buffer.get2U();
+ Packet packet = new Packet(archive.read("spotanim.dat", null));
+ anInt402 = packet.get2U();
if (aTypeArray403 == null) {
aTypeArray403 = new SpotAnimType[anInt402];
}
@@ -33,37 +33,37 @@ public class SpotAnimType {
aTypeArray403[j] = new SpotAnimType();
}
aTypeArray403[j].anInt404 = j;
- aTypeArray403[j].method265(buffer);
+ aTypeArray403[j].method265(packet);
}
}
- public void method265(Buffer buffer) {
+ public void method265(Packet packet) {
do {
- int i = buffer.get1U();
+ int i = packet.get1U();
if (i == 0) {
return;
}
if (i == 1) {
- anInt405 = buffer.get2U();
+ anInt405 = packet.get2U();
} else if (i == 2) {
- anInt406 = buffer.get2U();
+ anInt406 = packet.get2U();
if (SeqType.aTypeArray351 != null) {
aType_407 = SeqType.aTypeArray351[anInt406];
}
} else if (i == 4) {
- anInt410 = buffer.get2U();
+ anInt410 = packet.get2U();
} else if (i == 5) {
- anInt411 = buffer.get2U();
+ anInt411 = packet.get2U();
} else if (i == 6) {
- anInt412 = buffer.get2U();
+ anInt412 = packet.get2U();
} else if (i == 7) {
- anInt413 = buffer.get1U();
+ anInt413 = packet.get1U();
} else if (i == 8) {
- anInt414 = buffer.get1U();
+ anInt414 = packet.get1U();
} else if ((i >= 40) && (i < 50)) {
- anIntArray408[i - 40] = buffer.get2U();
+ anIntArray408[i - 40] = packet.get2U();
} else if ((i >= 50) && (i < 60)) {
- anIntArray409[i - 50] = buffer.get2U();
+ anIntArray409[i - 50] = packet.get2U();
} else {
System.out.println("Error unrecognised spotanim config code: " + i);
}
diff --git a/src/main/java/VarbitType.java b/src/main/java/VarbitType.java
index e57b1c7..0f304c5 100644
--- a/src/main/java/VarbitType.java
+++ b/src/main/java/VarbitType.java
@@ -18,8 +18,8 @@ public class VarbitType {
}
public static void method533(FileArchive archive) {
- Buffer buffer = new Buffer(archive.read("varbit.dat", null));
- anInt645 = buffer.get2U();
+ Packet packet = new Packet(archive.read("varbit.dat", null));
+ anInt645 = packet.get2U();
if (aVarbitArray646 == null) {
aVarbitArray646 = new VarbitType[anInt645];
}
@@ -27,34 +27,34 @@ public class VarbitType {
if (aVarbitArray646[j] == null) {
aVarbitArray646[j] = new VarbitType();
}
- aVarbitArray646[j].method534(buffer);
+ aVarbitArray646[j].method534(packet);
if (aVarbitArray646[j].aBoolean651) {
VarpType.aVarpArray701[aVarbitArray646[j].anInt648].unusedBool3 = true;
}
}
- if (buffer.position != buffer.data.length) {
+ if (packet.position != packet.data.length) {
System.out.println("varbit load mismatch");
}
}
- public void method534(Buffer buffer) {
+ public void method534(Packet packet) {
do {
- int j = buffer.get1U();
+ int j = packet.get1U();
if (j == 0) {
return;
}
if (j == 1) {
- anInt648 = buffer.get2U();
- anInt649 = buffer.get1U();
- anInt650 = buffer.get1U();
+ anInt648 = packet.get2U();
+ anInt649 = packet.get1U();
+ anInt650 = packet.get1U();
} else if (j == 10) {
- unusedString = buffer.getString();
+ unusedString = packet.getString();
} else if (j == 2) {
aBoolean651 = true;
} else if (j == 3) {
- unusedInt0 = buffer.get4();
+ unusedInt0 = packet.get4();
} else if (j == 4) {
- unusedInt1 = buffer.get4();
+ unusedInt1 = packet.get4();
} else {
System.out.println("Error unrecognised config code: " + j);
}
diff --git a/src/main/java/VarpType.java b/src/main/java/VarpType.java
index 53ecb26..11b771d 100644
--- a/src/main/java/VarpType.java
+++ b/src/main/java/VarpType.java
@@ -25,9 +25,9 @@ public class VarpType {
}
public static void method546(FileArchive archive) {
- Buffer buffer = new Buffer(archive.read("varp.dat", null));
+ Packet packet = new Packet(archive.read("varp.dat", null));
anInt702 = 0;
- anInt700 = buffer.get2U();
+ anInt700 = packet.get2U();
if (aVarpArray701 == null) {
aVarpArray701 = new VarpType[anInt700];
}
@@ -38,43 +38,43 @@ public class VarpType {
if (aVarpArray701[j] == null) {
aVarpArray701[j] = new VarpType();
}
- aVarpArray701[j].method547(buffer, j);
+ aVarpArray701[j].method547(packet, j);
}
- if (buffer.position != buffer.data.length) {
+ if (packet.position != packet.data.length) {
System.out.println("varptype load mismatch");
}
}
- public void method547(Buffer buffer, int i) {
+ public void method547(Packet packet, int i) {
do {
- int j = buffer.get1U();
+ int j = packet.get1U();
if (j == 0) {
return;
}
if (j == 1) {
- unusedInt0 = buffer.get1U();
+ unusedInt0 = packet.get1U();
} else if (j == 2) {
- unusedInt1 = buffer.get1U();
+ unusedInt1 = packet.get1U();
} else if (j == 3) {
unusedBool0 = true;
anIntArray703[anInt702++] = i;
} else if (j == 4) {
unusedBool1 = false;
} else if (j == 5) {
- anInt709 = buffer.get2U();
+ anInt709 = packet.get2U();
} else if (j == 6) {
unusedBool2 = true;
} else if (j == 7) {
- unusedInt2 = buffer.get4();
+ unusedInt2 = packet.get4();
} else if (j == 8) {
unusedInt3 = 1;
unusedBool3 = true;
} else if (j == 10) {
- unusedString = buffer.getString();
+ unusedString = packet.getString();
} else if (j == 11) {
unusedBool3 = true;
} else if (j == 12) {
- unusedInt4 = buffer.get4();
+ unusedInt4 = packet.get4();
} else if (j == 13) {
unusedInt3 = 2;
} else {