Skip to content

Commit

Permalink
Merge pull request #127 from StenAL/features
Browse files Browse the repository at this point in the history
More deobfuscation for chat and input-related classes
  • Loading branch information
PhilippvK authored Nov 19, 2024
2 parents 93d3977 + bff0b3f commit 641a3cb
Show file tree
Hide file tree
Showing 28 changed files with 1,391 additions and 1,854 deletions.
10 changes: 5 additions & 5 deletions client/src/main/java/agolf/GameApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public void defineImages(ImageManager imageManager, String var2) {
imageManager.defineSharedImage("ranking-icons.gif"); // TODO
imageManager.defineSharedImage("language-flags.png"); // TODO
imageManager.defineSharedImage("credit-background.jpg"); // TODO
imageManager.defineSharedImage("bigtext.gif"); // TODO
imageManager.defineSharedImage("tf-background.gif"); // TODO

for (int i = 0; i < GameBackgroundCanvas.trackAdvertSize; ++i) {
Expand Down Expand Up @@ -211,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 @@ -231,11 +230,12 @@ 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 disableGuestChat) {
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;
this.disableGuestChat = disableGuestChat;
}

protected void trackTestLogin(String username, String password) {
Expand Down
8 changes: 4 additions & 4 deletions client/src/main/java/agolf/lobby/LobbyChatPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import agolf.GameApplet;
import agolf.GameContainer;
import com.aapeli.multiuser.ChatLobby;
import com.aapeli.multiuser.GlobalChatListener;
import com.aapeli.multiuser.Languages;
import com.aapeli.multiuser.MultiLanguageChatListener;
import com.aapeli.multiuser.User;

class LobbyChatPanel extends ChatLobby implements GlobalChatListener {
class LobbyChatPanel extends ChatLobby implements MultiLanguageChatListener {

private static boolean aBoolean3712 = true;
private static boolean aBoolean3713 = true;
Expand Down Expand Up @@ -36,7 +36,7 @@ protected LobbyChatPanel(GameContainer gameContainer, int width, int height, int
this.disableChatInput(2);
}

this.setOutputToGlobal(Languages.getLanguageId(gameContainer.params.getChatLocale()));
this.addChatWithLanguage(Languages.getLanguageId(gameContainer.params.getChatLocale()));
this.addChatListener(this);
}

Expand Down Expand Up @@ -232,7 +232,7 @@ protected boolean handlePacket(String[] args) {

System.arraycopy(args, 2, users, 0, i);

this.setFullUserList(users);
this.setUserList(users);
return true;
} else if (args[1].equals("ownjoin")) {
this.localUserJoin(args[2]);
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
Loading

0 comments on commit 641a3cb

Please sign in to comment.