Skip to content

Commit e9d09a7

Browse files
committed
Refactoring
1 parent 16015fa commit e9d09a7

9 files changed

+1205
-1233
lines changed
+87-87
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
1-
2-
// $FF: renamed from: c
3-
public class class_7 {
4-
5-
// $FF: renamed from: a long
6-
public long usernameHash;
7-
// $FF: renamed from: b java.lang.String
8-
public String username;
9-
// $FF: renamed from: c int
10-
public int pid;
11-
// $FF: renamed from: d int
12-
public int appearanceId;
13-
// $FF: renamed from: e int
14-
public int currentX;
15-
// $FF: renamed from: f int
16-
public int currentY;
17-
// $FF: renamed from: g int
18-
public int field_612;
19-
// $FF: renamed from: h int
20-
public int field_613;
21-
// $FF: renamed from: i int
22-
public int animationCurrent;
23-
// $FF: renamed from: j int
24-
public int animationNext;
25-
// $FF: renamed from: k int
26-
public int movingStep;
27-
// $FF: renamed from: l int
28-
public int waypointCurrent;
29-
// $FF: renamed from: m int[]
30-
public int[] waypointsX;
31-
// $FF: renamed from: n int[]
32-
public int[] waypointsY;
33-
// $FF: renamed from: o int[]
34-
public int[] wornItems;
35-
// $FF: renamed from: p java.lang.String
36-
public String messageSent;
37-
// $FF: renamed from: q int
38-
public int messageTimer;
39-
// $FF: renamed from: r int
40-
public int bubbleItemId;
41-
// $FF: renamed from: s int
42-
public int bubbleTimer;
43-
// $FF: renamed from: t int
44-
public int damageTaken;
45-
// $FF: renamed from: u int
46-
public int healthCurrent;
47-
// $FF: renamed from: v int
48-
public int healthMax;
49-
// $FF: renamed from: w int
50-
public int combatTimeout;
51-
// $FF: renamed from: x int
52-
public int combatLevel;
53-
// $FF: renamed from: y int
54-
public int hairColour;
55-
// $FF: renamed from: z int
56-
public int topColour;
57-
// $FF: renamed from: A int
58-
public int trouserColour;
59-
// $FF: renamed from: B int
60-
public int skinColour;
61-
// $FF: renamed from: C int
62-
public int field_634;
63-
// $FF: renamed from: D int
64-
public int field_635;
65-
// $FF: renamed from: E int
66-
public int field_636;
67-
// $FF: renamed from: F int
68-
public int field_637;
69-
// $FF: renamed from: G boolean
70-
public boolean field_638;
71-
// $FF: renamed from: H int
72-
public int field_639;
73-
// $FF: renamed from: I int
74-
public int skullType;
75-
76-
77-
// $FF: renamed from: <init> () void
78-
public class_7() {
79-
super();
80-
this.waypointsX = new int[10];
81-
this.waypointsY = new int[10];
82-
this.wornItems = new int[12];
83-
this.combatLevel = -1;
84-
this.field_638 = false;
85-
this.field_639 = -1;
86-
}
87-
}
1+
2+
// $FF: renamed from: c
3+
public class GameCharacter {
4+
5+
// $FF: renamed from: a long
6+
public long usernameHash;
7+
// $FF: renamed from: b java.lang.String
8+
public String username;
9+
// $FF: renamed from: c int
10+
public int pid;
11+
// $FF: renamed from: d int
12+
public int appearanceId;
13+
// $FF: renamed from: e int
14+
public int currentX;
15+
// $FF: renamed from: f int
16+
public int currentY;
17+
// $FF: renamed from: g int
18+
public int field_612;
19+
// $FF: renamed from: h int
20+
public int field_613;
21+
// $FF: renamed from: i int
22+
public int animationCurrent;
23+
// $FF: renamed from: j int
24+
public int animationNext;
25+
// $FF: renamed from: k int
26+
public int movingStep;
27+
// $FF: renamed from: l int
28+
public int waypointCurrent;
29+
// $FF: renamed from: m int[]
30+
public int[] waypointsX;
31+
// $FF: renamed from: n int[]
32+
public int[] waypointsY;
33+
// $FF: renamed from: o int[]
34+
public int[] wornItems;
35+
// $FF: renamed from: p java.lang.String
36+
public String messageSent;
37+
// $FF: renamed from: q int
38+
public int messageTimer;
39+
// $FF: renamed from: r int
40+
public int bubbleItemId;
41+
// $FF: renamed from: s int
42+
public int bubbleTimer;
43+
// $FF: renamed from: t int
44+
public int damageTaken;
45+
// $FF: renamed from: u int
46+
public int healthCurrent;
47+
// $FF: renamed from: v int
48+
public int healthMax;
49+
// $FF: renamed from: w int
50+
public int combatTimeout;
51+
// $FF: renamed from: x int
52+
public int combatLevel;
53+
// $FF: renamed from: y int
54+
public int hairColour;
55+
// $FF: renamed from: z int
56+
public int topColour;
57+
// $FF: renamed from: A int
58+
public int trouserColour;
59+
// $FF: renamed from: B int
60+
public int skinColour;
61+
// $FF: renamed from: C int
62+
public int field_634;
63+
// $FF: renamed from: D int
64+
public int field_635;
65+
// $FF: renamed from: E int
66+
public int field_636;
67+
// $FF: renamed from: F int
68+
public int field_637;
69+
// $FF: renamed from: G boolean
70+
public boolean field_638;
71+
// $FF: renamed from: H int
72+
public int field_639;
73+
// $FF: renamed from: I int
74+
public int skullType;
75+
76+
77+
// $FF: renamed from: <init> () void
78+
public GameCharacter() {
79+
super();
80+
this.waypointsX = new int[10];
81+
this.waypointsY = new int[10];
82+
this.wornItems = new int[12];
83+
this.combatLevel = -1;
84+
this.field_638 = false;
85+
this.field_639 = -1;
86+
}
87+
}

src/Version.java

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// $FF: renamed from: e
2+
public class Version {
3+
// $FF: renamed from: b int
4+
public static int clientVer = 177;
5+
// $FF: renamed from: c int
6+
public static int configVer = 85;
7+
// $FF: renamed from: d int
8+
public static int mapsVer = 63;
9+
// $FF: renamed from: e int
10+
public static int mediaVer = 58;
11+
// $FF: renamed from: f int
12+
public static int modelsVer = 36;
13+
// $FF: renamed from: g int
14+
public static int texturesVer = 17;
15+
// $FF: renamed from: h int
16+
public static int entityVer = 24;
17+
// $FF: renamed from: i int
18+
public static int soundsVer = 1;
19+
// $FF: renamed from: j int
20+
public static int filterVer = 2;
21+
}

src/a/a/ClientStream.java

+33-34
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package a.a;
22

33
import a.class_5;
4-
import a.a.class_0;
5-
import a.a.class_9;
4+
65
import java.io.IOException;
76
import java.io.InputStream;
87
import java.io.OutputStream;
@@ -14,29 +13,29 @@ public class ClientStream extends class_5 implements Runnable {
1413
// $FF: renamed from: I java.io.InputStream
1514
private InputStream field_598;
1615
// $FF: renamed from: J java.io.OutputStream
17-
private OutputStream field_599;
16+
private OutputStream outstream;
1817
// $FF: renamed from: K java.net.Socket
1918
private Socket field_600;
2019
// $FF: renamed from: L boolean
2120
private boolean field_601;
2221
// $FF: renamed from: M byte[]
23-
private byte[] field_602;
22+
private byte[] buffer;
2423
// $FF: renamed from: N int
25-
private int field_603;
24+
private int endOffset;
2625
// $FF: renamed from: O int
27-
private int field_604;
26+
private int offset;
2827
// $FF: renamed from: P boolean
2928
private boolean field_605;
3029

3130

3231
// $FF: renamed from: <init> (java.net.Socket, a.a.a) void
33-
public ClientStream(Socket var1, class_0 var2) throws IOException {
32+
public ClientStream(Socket var1, GameShell var2) throws IOException {
3433
super();
3534
this.field_601 = false;
3635
this.field_605 = true;
3736
this.field_600 = var1;
3837
this.field_598 = var1.getInputStream();
39-
this.field_599 = var1.getOutputStream();
38+
this.outstream = var1.getOutputStream();
4039
this.field_605 = false;
4140
var2.method_21(this);
4241
}
@@ -51,8 +50,8 @@ public void closeStream() {
5150
this.field_598.close();
5251
}
5352

54-
if(this.field_599 != null) {
55-
this.field_599.close();
53+
if(this.outstream != null) {
54+
this.outstream.close();
5655
}
5756

5857
if(this.field_600 != null) {
@@ -72,7 +71,7 @@ public void closeStream() {
7271
}
7372
}
7473

75-
this.field_602 = null;
74+
this.buffer = null;
7675
}
7776

7877
// $FF: renamed from: b () int
@@ -86,7 +85,7 @@ public int available() throws IOException {
8685
}
8786

8887
// $FF: renamed from: a (int, int, byte[]) void
89-
public void method_146(int var1, int var2, byte[] var3) throws IOException {
88+
public void readStreamBytes(int var1, int var2, byte[] var3) throws IOException {
9089
if(!this.field_601) {
9190
int var4 = 0;
9291
boolean var5 = false;
@@ -105,10 +104,10 @@ public void method_146(int var1, int var2, byte[] var3) throws IOException {
105104
}
106105

107106
// $FF: renamed from: a (byte[], int, int) void
108-
public void method_147(byte[] var1, int var2, int var3) throws IOException {
107+
public void writeStreamBytes(byte[] var1, int var2, int var3) throws IOException {
109108
if(!this.field_601) {
110-
if(this.field_602 == null) {
111-
this.field_602 = new byte[5000];
109+
if(this.buffer == null) {
110+
this.buffer = new byte[5000];
112111
}
113112

114113
synchronized(this) {
@@ -117,9 +116,9 @@ public void method_147(byte[] var1, int var2, int var3) throws IOException {
117116
int var6 = 0;
118117
if (class_9.field_759 || var6 < var3) {
119118
do {
120-
this.field_602[this.field_604] = var1[var6 + var2];
121-
this.field_604 = (this.field_604 + 1) % 5000;
122-
if (this.field_604 == (this.field_603 + 4900) % 5000) {
119+
this.buffer[this.offset] = var1[var6 + var2];
120+
this.offset = (this.offset + 1) % 5000;
121+
if (this.offset == (this.endOffset + 4900) % 5000) {
123122
throw new IOException("buffer overflow");
124123
}
125124

@@ -143,13 +142,13 @@ public void run() {
143142
do {
144143

145144

146-
int var1;
147-
int var2;
145+
int len;
146+
int off;
148147
synchronized(this) {
149148
try {
150149
label126:
151150
{
152-
if (this.field_604 == this.field_603) {
151+
if (this.offset == this.endOffset) {
153152
try {
154153
this.wait();
155154
} catch (InterruptedException var10) {
@@ -161,37 +160,37 @@ public void run() {
161160
return;
162161
}
163162

164-
var2 = this.field_603;
165-
if (this.field_604 >= this.field_603) {
166-
var1 = this.field_604 - this.field_603;
163+
off = this.endOffset;
164+
if (this.offset >= this.endOffset) {
165+
len = this.offset - this.endOffset;
167166
if (!var5) {
168167
break label126;
169168
}
170169
}
171170

172-
var1 = 5000 - this.field_603;
171+
len = 5000 - this.endOffset;
173172
}
174173
} catch (Throwable var13) {
175174
throw var13;
176175
}
177176
}
178-
if (var1 > 0) {
177+
if (len > 0) {
179178
try {
180-
this.field_599.write(this.field_602, var2, var1);
179+
this.outstream.write(this.buffer, off, len);
181180
} catch (IOException var12) {
182-
super.field_573 = true;
183-
super.field_574 = "Twriter:" + var12;
181+
super.socketException = true;
182+
super.socketExceptionMessage = "Twriter:" + var12;
184183
}
185184

186-
this.field_603 = (this.field_603 + var1) % 5000;
185+
this.endOffset = (this.endOffset + len) % 5000;
187186

188187
try {
189-
if (this.field_604 == this.field_603) {
190-
this.field_599.flush();
188+
if (this.offset == this.endOffset) {
189+
this.outstream.flush();
191190
}
192191
} catch (IOException var11) {
193-
super.field_573 = true;
194-
super.field_574 = "Twriter:" + var11;
192+
super.socketException = true;
193+
super.socketExceptionMessage = "Twriter:" + var11;
195194
}
196195
}
197196

src/a/a/GameApplet.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import a.class_20;
44
import a.Utility;
55
import a.class_22;
6-
import a.a.class_0;
7-
import a.a.ClientStream;
8-
import a.a.class_9;
96

107
import java.awt.Color;
118
import java.awt.Font;
@@ -14,7 +11,7 @@
1411
import java.math.BigInteger;
1512

1613
// $FF: renamed from: a.a.b
17-
public class GameApplet extends class_0 {
14+
public class GameApplet extends GameShell {
1815

1916
// $FF: renamed from: R java.lang.String[]
2017
public static String[] loginResponses;

0 commit comments

Comments
 (0)