Skip to content

Commit

Permalink
Client: More miscellaneous deobfuscation
Browse files Browse the repository at this point in the history
  • Loading branch information
StenAL committed Nov 9, 2024
1 parent 23dd110 commit 0e51c72
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 82 deletions.
7 changes: 4 additions & 3 deletions client/src/main/java/agolf/GameApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ protected void setGameState(int activePanel, int lobbyId, int lobbyExtra) {
}
}

this.gameContainer.lobbyPanel.method395();
this.gameContainer.lobbyPanel.init();
this.addToContent(this.gameContainer.lobbyPanel);
}

Expand All @@ -230,9 +230,10 @@ protected void setGameState(int activePanel, int lobbyId, int lobbyExtra) {
}
}

protected void setGameSettings(boolean emailUnconfirmed, int var2, boolean useBadWordFilter, boolean var4) {
protected void setGameSettings(
boolean emailUnconfirmed, int playerElevationLevel, boolean useBadWordFilter, boolean var4) {
this.syncUnknownBool = new SynchronizedBool(emailUnconfirmed);
this.syncPlayerAccessLevel = new SynchronizedInteger(var2);
this.syncPlayerAccessLevel = new SynchronizedInteger(playerElevationLevel);
this.gameContainer.badWordFilter = useBadWordFilter ? new BadWordFilter(super.textManager) : null;
this.disableGuestChat = var4;
}
Expand Down
18 changes: 9 additions & 9 deletions client/src/main/java/agolf/lobby/LobbyDualPlayerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public void actionPerformed(ActionEvent evt) {
/*if(isUsingCustomServer) {
this.trackCategory = this.choicerTrackCategory.getSelectedIndex();
}*/
this.update(1);
this.setState(1);
this.gameContainer.lobbyPanel.writeData("challenge\t"
+ this.opponentName
+ "\t"
Expand All @@ -399,7 +399,7 @@ public void actionPerformed(ActionEvent evt) {
} else if (evtSource == this.buttonCancel) {
synchronized (synchronizedObject) {
if (this.currentState == 1) {
this.update(0);
this.setState(0);
this.gameContainer.lobbyPanel.writeData("cancel\t" + this.opponentName);
return;
}
Expand Down Expand Up @@ -442,7 +442,7 @@ protected boolean handlePacket(String[] args) {
/*if(isUsingCustomServer) {
this.trackCategory = Integer.parseInt(args[11]);
}*/
this.update(2);
this.setState(2);
}

if (this.checkboxBeep.getState()) {
Expand All @@ -453,7 +453,7 @@ protected boolean handlePacket(String[] args) {
} else if (args[1].equals("cancel")) {
synchronized (synchronizedObject) {
if (this.currentState == 2) {
this.update(0);
this.setState(0);
return true;
}

Expand All @@ -465,7 +465,7 @@ protected boolean handlePacket(String[] args) {
return true;
}

this.update(0);
this.setState(0);
}

if (args[2].equals("nouser")) {
Expand Down Expand Up @@ -496,7 +496,7 @@ protected boolean handlePacket(String[] args) {
return true;
}

this.update(0);
this.setState(0);
}

this.extraText = this.gameContainer.textManager.getGame("LobbyReal_ChallengedLeft");
Expand All @@ -507,7 +507,7 @@ protected boolean handlePacket(String[] args) {
}
}

protected void update(int state) {
protected void setState(int state) {
this.extraText = null;
if (state == this.currentState) {
this.repaint();
Expand Down Expand Up @@ -600,7 +600,7 @@ private void create() {
private void accept() {
synchronized (synchronizedObject) {
if (this.currentState == 2) {
this.update(-1);
this.setState(-1);
this.gameContainer.lobbyPanel.writeData("accept\t" + this.opponentName);
return;
}
Expand All @@ -610,7 +610,7 @@ private void accept() {
private void refuse() {
synchronized (synchronizedObject) {
if (this.currentState == 2) {
this.update(0);
this.setState(0);
this.gameContainer.lobbyPanel.writeData("cfail\t" + this.opponentName + "\trefuse");
return;
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/agolf/lobby/LobbyPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ public void selectLobby(int lobbyId, int lobbyExtra) {
this.setVisible(true);
}

public void method395() {
public void init() {
if (this.activeLobby == 1) {
this.lobbySinglePlayerPanel.requestTrackSetList();
}

if (this.activeLobby == 2) {
this.lobbyDualPlayerPanel.update(0);
this.lobbyDualPlayerPanel.setState(0);
this.lobbyDualPlayerPanel.allowChallenges();
}

Expand Down
24 changes: 12 additions & 12 deletions client/src/main/java/com/aapeli/client/IPanel_Sub40.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,31 @@ protected IPanel_Sub40(AApplet var1, Frame_Sub3_Sub1 var2, int var3, int var4) {
this.setSharedBackground(var1.imageManager, "tf-background.gif", 0, 0);
}

public void update(Graphics var1) {
this.drawBackground(var1);
var1.setFont(aFont3209);
public void update(Graphics g) {
this.drawBackground(g);
g.setFont(aFont3209);
if (this.aHtmlText3214 == null) {
String var2 = null;
String text = null;
if (this.anInt3212 == 0) {
if (this.anInt3213 == 1) {
var2 = "WS_ScoreNotSaved";
text = "WS_ScoreNotSaved";
} else if (this.anInt3213 == 2) {
var2 = "WM_StatsNotSaved";
text = "WM_StatsNotSaved";
}
} else if (this.anInt3212 == 1) {
if (this.anInt3213 == 1) {
var2 = "RS_PersonalRecord";
text = "RS_PersonalRecord";
} else if (this.anInt3213 == 2) {
var2 = "RM_FirstRanking";
text = "RM_FirstRanking";
}
}

var2 = this.anAApplet3210.textManager.getShared("GameFin_" + var2);
this.aHtmlText3214 = new HtmlText(var1, 410, var2);
text = this.anAApplet3210.textManager.getShared("GameFin_" + text);
this.aHtmlText3214 = new HtmlText(g, 410, text);
}

var1.setColor(aColor3206);
this.aHtmlText3214.print(var1, 20, 45);
g.setColor(aColor3206);
this.aHtmlText3214.print(g, 20, 45);
}

public void actionPerformed(ActionEvent var1) {
Expand Down
57 changes: 29 additions & 28 deletions client/src/main/java/com/aapeli/client/ImageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void unDefineImage(String var1) {
}

public void startLoadingImages() {
this.imageTracker.method1626();
this.imageTracker.loadImages();
}

public boolean isLoadingFinished() {
Expand Down Expand Up @@ -127,16 +127,16 @@ public Image getImage(String var1) {
return this.imageTracker.getNImage(this.getAlias(var1));
}

public boolean isDefined(String var1) {
return this.imageTracker.containsNImage(this.getAlias(var1));
public boolean isDefined(String imageAlias) {
return this.imageTracker.containsNImage(this.getAlias(imageAlias));
}

public Image getIfAvailable(String var1) {
return this.imageTracker.getNImageFromTable(this.getAlias(var1));
}

public Image getEvenNotLoaded(String var1) {
return this.imageTracker.method1629(this.getAlias(var1));
public Image getEvenNotLoaded(String imageAlias) {
return this.imageTracker.getImage(this.getAlias(imageAlias));
}

public Image getShared(String var1) {
Expand Down Expand Up @@ -223,50 +223,51 @@ public Image createImage(int[] var1, int var2, int var3, Component var4) {
return var5;
}

public Image[] separateImages(Image var1, int var2) {
return this.separateImages(var1, var2, 1)[0];
public Image[] separateImages(Image image, int length) {
return this.separateImages(image, length, 1)[0];
}

public Image[][] separateImages(Image var1, int var2, int var3) {
public Image[][] separateImages(Image image, int length, int rows) {
if (this.isDebug) {
System.out.println("ImageManager.separateImages(...," + var2 + "," + var3 + ")");
System.out.println("ImageManager.separateImages(...," + length + "," + rows + ")");
}

int var4 = this.getWidth(var1);
int var5 = this.getHeight(var1);
int var6 = var4 / var2;
int var7 = var5 / var3;
if (this.isDebug && (var4 % var2 > 0 || var5 % var3 > 0)) {
int width = this.getWidth(image);
int height = this.getHeight(image);
int aspectRatio = width / length;
int rowHeight = height / rows;
if (this.isDebug && (width % length > 0 || height % rows > 0)) {
System.out.println("ImageManager.separateImages(...,"
+ var2
+ length
+ ","
+ var3
+ rows
+ "): Warning! Source image can not be divided to "
+ var2
+ length
+ "*"
+ var3
+ rows
+ " blocks");
Thread.dumpStack();
}

int[] var8 = this.getPixels(var1, var4, var5);
Image[][] var10 = new Image[var3][var2];
int[] pixels = this.getPixels(image, width, height);
Image[][] images = new Image[rows][length];

for (int var11 = 0; var11 < var3; ++var11) {
for (int var12 = 0; var12 < var2; ++var12) {
int[] var9 = new int[var6 * var7];
for (int row = 0; row < rows; ++row) {
for (int col = 0; col < length; ++col) {
int[] var9 = new int[aspectRatio * rowHeight];

for (int var13 = 0; var13 < var7; ++var13) {
for (int var14 = 0; var14 < var6; ++var14) {
var9[var13 * var6 + var14] = var8[var11 * var4 * var7 + var13 * var4 + var12 * var6 + var14];
for (int var13 = 0; var13 < rowHeight; ++var13) {
for (int var14 = 0; var14 < aspectRatio; ++var14) {
var9[var13 * aspectRatio + var14] =
pixels[row * width * rowHeight + var13 * width + col * aspectRatio + var14];
}
}

var10[var11][var12] = this.createImage(var9, var6, var7);
images[row][col] = this.createImage(var9, aspectRatio, rowHeight);
}
}

return var10;
return images;
}

public Image getAlphaMultipliedImage(Image var1, double var2) {
Expand Down
14 changes: 7 additions & 7 deletions client/src/main/java/com/aapeli/client/ImageResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
class ImageResource {

private String aString1404;
private Image anImage1405;
private Image image;
private int anInt1406;
private final ImageTracker aImageTracker_1407;

protected ImageResource(ImageTracker var1, String var2, Image var3) {
protected ImageResource(ImageTracker var1, String var2, Image image) {
this.aImageTracker_1407 = var1;
this.aString1404 = var2;
this.anImage1405 = var3;
this.image = image;
this.anInt1406 = 0;
}

protected String method1648() {
return this.aString1404;
}

protected Image method1649() {
return this.anImage1405;
protected Image getImage() {
return this.image;
}

protected void method1650() {
Expand All @@ -33,8 +33,8 @@ protected boolean method1651() {
}

protected void method1652() {
this.anImage1405.flush();
this.anImage1405 = null;
this.image.flush();
this.image = null;
this.aString1404 = null;
}
}
Loading

0 comments on commit 0e51c72

Please sign in to comment.