From my work yesterday today I have found region loading and dumping from 1 area. Yet I am unsure if all objects are there as most of them look blank =\ IDK about this
http://**********/v/t2xgb62s
And the code:
Code:
if(!aBoolean1159)
{
for(int i3 = 0; i3 < k2; i3++)
{
int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
byte abyte0[] = aByteArrayArray1183[i3];
if(abyte0 != null) {
objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
for (int i = 0; i < 9999; i += 64) {
i4 = (anIntArray1234[i3] >> 8) * 64 - i;
k5 = (anIntArray1234[i3] & 0xff) * 64 - i;
int x = (i4 + i) /64;
int y = (k5 + i) /64;
objectManager.method180(abyte0, k5, i4,
(x - 6) * 8,
(y - 6) * 8, aClass11Array1230);
}
}
}
for(int j4 = 0; j4 < k2; j4++)
{
int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
byte abyte2[] = aByteArrayArray1183[j4];
if(abyte2 == null && anInt1070 < 800) {
objectManager.method174(k7, 64, 64, l5);
for (int i = 0; i < 9999; i += 64) {
l5 = (anIntArray1234[j4] >> 8) * 64 - i;
k7 = (anIntArray1234[j4] & 0xff) * 64 - i;
objectManager.method174(k7, 64, 64, l5);
}
}
}
anInt1097++;
if(anInt1097 > 160)
{
anInt1097 = 0;
stream.createFrame(238);
stream.writeWordBigEndian(96);
}
stream.createFrame(0);
for(int i6 = 0; i6 < k2; i6++)
{
byte abyte1[] = aByteArrayArray1247[i6];
if(abyte1 != null)
{
int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
for (int i = 0; i < 9999; i += 64) {
l8 = (anIntArray1234[i6] >> 8) * 64 - i;
k9 = (anIntArray1234[i6] & 0xff) * 64 - i;
objectManager.method190(l8, aClass11Array1230,
k9, worldController, abyte1);
}
}
}
}
Code:
public final void method190(int i, Class11 aclass11[], int j, WorldController worldController, byte abyte0[])
{
{
Stream stream = new Stream(abyte0);
int objectId = -1;
do
{
int i1 = stream.method422();
if(i1 == 0)
break;
objectId += i1;
int j1 = 0;
do
{
int k1 = stream.method422();
if(k1 == 0)
break;
j1 += k1 - 1;
int l1 = j1 & 0x3f;
int i2 = j1 >> 6 & 0x3f;
int plane = j1 >> 12;
int objectInfo = stream.readUnsignedByte();
int objectType = objectInfo >> 2;
int objectFace = objectInfo & 3;
int j3 = i2 + i;
int k3 = l1 + j;
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new
FileWriter("./areas/area" +
""+(j3 + client.baseX) /64+"_"
+(k3 + client.baseY)/64+".txt", true));
System.out.println("Dumping Area: "+(j3 + client.baseX) /64+"_"
+(k3 + client.baseY)/64);
} catch (IOException e1) {
e1.printStackTrace();
}
if(j3 > 0 && k3 > 0 && j3 < 103 && k3 < 103)
{
int l3 = plane;
if((aByteArrayArrayArray149[1][j3][k3] & 2) == 2)
l3--;
Class11 class11 = null;
if(l3 >= 0)
class11 = aclass11[l3];
if (bw != null) {
try {
bw.append("X: "+(j3 + client.baseX));
bw.append("\t");
bw.append("Y: "+(k3 + client.baseY));
bw.append("\t");
bw.append("ObjectType: "+objectType);
bw.append("\t");
bw.append("Plane: "+plane);
bw.append("\t");
bw.append("ObjectId: "+objectId).append("\t");
bw.append("Face: "+objectFace);
bw.newLine();
bw.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
System.out.println(objectId);
method175(k3, worldController, class11, objectType, plane, j3, objectId, objectFace);
}
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
} while(true);
} while(true);
}
}