Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More client code quality improvements, removing more unused assets #116

Merged
merged 4 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed assets/res/AGolf2/picture/background.jpg
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/background_prevtrack.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/background_select.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/background_settings.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_mirror_hor.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_mirror_ver.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_mouse.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_move_down.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_move_left.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_move_right.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_move_up.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_paint_fill.png
Binary file not shown.
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_paint_pencil.png
Binary file not shown.
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_paint_stamp.png
Binary file not shown.
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/editor_swap.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/game_balls_big.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/game_balls_normal.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/game_balls_small.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/game_playericons.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/game_thumbs.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/track_elements.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/track_objects.png
Binary file not shown.
Binary file removed assets/res/AGolf2/picture/track_shapes.png
Diff not rendered.
Binary file removed assets/res/AGolf2/picture/track_slopes.png
Diff not rendered.
Binary file removed assets/res/AGolf2/sound/ball_acid.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/ball_bouncer.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/ball_hole.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/ball_mine.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/ball_sacid.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/ball_sizechange.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/ball_swamp.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/ball_teleport.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/ball_water.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/game_draw.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/game_lose.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/game_win.au
Binary file not shown.
Binary file removed assets/res/AGolf2/sound/player_strike.au
Binary file not shown.
142 changes: 70 additions & 72 deletions client/src/main/java/agolf/Conn.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,76 @@

public class Conn implements ConnListener {

private static final String[] cipherCmds = new String[68];
private static final String[] cipherCmds = new String[] {
"status\t",
"basicinfo\t",
"numberofusers\t",
"users\t",
"ownjoin\t",
"joinfromgame\t",
"say\t",
"logintype\t",
"login",
"lobbyselect\t",
"select\t",
"back",
"challenge\t",
"cancel\t",
"accept\t",
"cfail\t",
"nouser",
"nochall",
"cother",
"cbyother",
"refuse",
"afail",
"gsn\t",
"lobby\tnc\t",
"lobby\t",
"lobby",
"tracksetlist\t",
"tracksetlist",
"gamelist\t",
"full\t",
"add\t",
"change\t",
"remove\t",
"gameinfo\t",
"players",
"owninfo\t",
"game\tstarttrack\t",
"game\tstartturn\t",
"game\tstart",
"game\tbeginstroke\t",
"game\tendstroke\t",
"game\tresetvoteskip",
"game\t",
"game",
"quit",
"join\t",
"part\t",
"cspt\t",
"qmpt",
"cspc\t",
"jmpt\t",
"tracklist\t",
"Tiikoni",
"Leonardo",
"Ennaji",
"Hoeg",
"Darwin",
"Dante",
"ConTrick",
"Dewlor",
"Scope",
"SuperGenuis",
"Zwan",
"\tT !\t",
"\tcr\t",
"rnop",
"nop\t",
"error"
};
private GameContainer gameContainer;
private Connection connection;
private String aString2372;
Expand Down Expand Up @@ -183,75 +252,4 @@ else if (args[0].equals("game")) {
this.gameContainer.gamePanel.handlePacket(args);
}
}

static {
cipherCmds[0] = "status\t";
cipherCmds[1] = "basicinfo\t";
cipherCmds[2] = "numberofusers\t";
cipherCmds[3] = "users\t";
cipherCmds[4] = "ownjoin\t";
cipherCmds[5] = "joinfromgame\t";
cipherCmds[6] = "say\t";
cipherCmds[7] = "logintype\t";
cipherCmds[8] = "login";
cipherCmds[9] = "lobbyselect\t";
cipherCmds[10] = "select\t";
cipherCmds[11] = "back";
cipherCmds[12] = "challenge\t";
cipherCmds[13] = "cancel\t";
cipherCmds[14] = "accept\t";
cipherCmds[15] = "cfail\t";
cipherCmds[16] = "nouser";
cipherCmds[17] = "nochall";
cipherCmds[18] = "cother";
cipherCmds[19] = "cbyother";
cipherCmds[20] = "refuse";
cipherCmds[21] = "afail";
cipherCmds[22] = "gsn\t";
cipherCmds[23] = "lobby\tnc\t";
cipherCmds[24] = "lobby\t";
cipherCmds[25] = "lobby";
cipherCmds[26] = "tracksetlist\t";
cipherCmds[27] = "tracksetlist";
cipherCmds[28] = "gamelist\t";
cipherCmds[29] = "full\t";
cipherCmds[30] = "add\t";
cipherCmds[31] = "change\t";
cipherCmds[32] = "remove\t";
cipherCmds[33] = "gameinfo\t";
cipherCmds[34] = "players";
cipherCmds[35] = "owninfo\t";
cipherCmds[36] = "game\tstarttrack\t";
cipherCmds[37] = "game\tstartturn\t";
cipherCmds[38] = "game\tstart";
cipherCmds[39] = "game\tbeginstroke\t";
cipherCmds[40] = "game\tendstroke\t";
cipherCmds[41] = "game\tresetvoteskip";
cipherCmds[42] = "game\t";
cipherCmds[43] = "game";
cipherCmds[44] = "quit";
cipherCmds[45] = "join\t";
cipherCmds[46] = "part\t";
cipherCmds[47] = "cspt\t";
cipherCmds[48] = "qmpt";
cipherCmds[49] = "cspc\t";
cipherCmds[50] = "jmpt\t";
cipherCmds[51] = "tracklist\t";
cipherCmds[52] = "Tiikoni";
cipherCmds[53] = "Leonardo";
cipherCmds[54] = "Ennaji";
cipherCmds[55] = "Hoeg";
cipherCmds[56] = "Darwin";
cipherCmds[57] = "Dante";
cipherCmds[58] = "ConTrick";
cipherCmds[59] = "Dewlor";
cipherCmds[60] = "Scope";
cipherCmds[61] = "SuperGenuis";
cipherCmds[62] = "Zwan";
cipherCmds[63] = "\tT !\t";
cipherCmds[64] = "\tcr\t";
cipherCmds[65] = "rnop";
cipherCmds[66] = "nop\t";
cipherCmds[67] = "error";
}
}
4 changes: 2 additions & 2 deletions client/src/main/java/agolf/GameApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected void setGameState(int activePanel, int lobbyId, int lobbyExtra) {
if (activePanel != this.activePanel && this.syncIsValidSite.get()) {
this.activePanel = activePanel;
if (this.gameContainer.lobbySelectionPanel != null) {
this.gameContainer.lobbySelectionPanel.destroyRNOP();
this.gameContainer.lobbySelectionPanel.destroyNumberOfPlayersFetcher();
}

this.clearContent();
Expand Down Expand Up @@ -191,7 +191,7 @@ protected void setGameState(int activePanel, int lobbyId, int lobbyExtra) {

if (!var5) {
this.addToContent(this.gameContainer.lobbySelectionPanel);
this.gameContainer.lobbySelectionPanel.resetRNOP();
this.gameContainer.lobbySelectionPanel.resetNumberOfPlayersFetcher();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import com.aapeli.tools.Tools;

class LobbySelectRNOPspammer implements Runnable {
class LobbySelectNumberOfPlayersFetcher implements Runnable {

private final LobbySelectPanel lobbySelectPanel;
private boolean running;


protected LobbySelectRNOPspammer(LobbySelectPanel lobbySelectPanel) {
protected LobbySelectNumberOfPlayersFetcher(LobbySelectPanel lobbySelectPanel) {
this.lobbySelectPanel = lobbySelectPanel;
this.running = true;
Thread thread = new Thread(this);
Expand Down
17 changes: 8 additions & 9 deletions client/src/main/java/agolf/LobbySelectPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public class LobbySelectPanel extends Panel implements ActionListener, MouseList
private Choicer choicerGraphics;
private Choicer audioChoicer;
private int[] lobbyNumPlayers;
private LobbySelectRNOPspammer lobbySelectRNOP;
private static final String[] aStringArray544 = new String[22];
private LobbySelectNumberOfPlayersFetcher lobbySelectNumberOfPlayersFetcher;


protected LobbySelectPanel(GameContainer gameContainer, int width, int height) {
Expand Down Expand Up @@ -185,15 +184,15 @@ protected boolean selectLobby(int lobbyId, boolean playHidden) {
}
}

protected void resetRNOP() {
this.destroyRNOP();
this.lobbySelectRNOP = new LobbySelectRNOPspammer(this);
protected void resetNumberOfPlayersFetcher() {
this.destroyNumberOfPlayersFetcher();
this.lobbySelectNumberOfPlayersFetcher = new LobbySelectNumberOfPlayersFetcher(this);
}

protected void destroyRNOP() {
if (this.lobbySelectRNOP != null) {
this.lobbySelectRNOP.stop();
this.lobbySelectRNOP = null;
protected void destroyNumberOfPlayersFetcher() {
if (this.lobbySelectNumberOfPlayersFetcher != null) {
this.lobbySelectNumberOfPlayersFetcher.stop();
this.lobbySelectNumberOfPlayersFetcher = null;
}

}
Expand Down
26 changes: 7 additions & 19 deletions client/src/main/java/agolf/game/GameBackgroundCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

public class GameBackgroundCanvas extends Canvas {

protected static final Color aColor75;
protected static final Color aColor75 = new Color(240, 240, 255);
private static final String mapChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
private static final String defaultTrackSettings = "fttt14";
public static final int[] anIntArray78;
public static final int[] anIntArray79;
public static final String[] aStringArray80;
public static final int trackAdvertSize;
public static final int[] anIntArray78 = new int[]{3, 5, 8, 49};
public static final int[] anIntArray79 = new int[]{2, 3, 5, 25};
public static final String[] aStringArray80 = new String[]{"small", "medium", "large", "full"};
public static final int trackAdvertSize = aStringArray80.length;
protected GameContainer gameContainer;
private Image backgroundImg;
protected Image image;
Expand Down Expand Up @@ -718,10 +718,10 @@ private int method129(int var1, int var2, double var3) {
return var1;
} else {
int var7 = (var1 & 16711680) >> 16;
int var8 = (var1 & '\uff00') >> 8;
int var8 = (var1 & 65280) >> 8;
int var9 = var1 & 255;
int var10 = (var2 & 16711680) >> 16;
int var11 = (var2 & '\uff00') >> 8;
int var11 = (var2 & 65280) >> 8;
int var12 = var2 & 255;
int var13 = var10 - var7;
int var14 = var11 - var8;
Expand All @@ -732,16 +732,4 @@ private int method129(int var1, int var2, double var3) {
return (int) (4278190080L + (long) (var16 << 16) + (long) (var17 << 8) + (long) var18);
}
}

static {
aColor75 = new Color(240, 240, 255);
anIntArray78 = new int[]{3, 5, 8, 49};
anIntArray79 = new int[]{2, 3, 5, 25};
aStringArray80 = new String[4];
aStringArray80[0] = "small";
aStringArray80[1] = "medium";
aStringArray80[2] = "large";
aStringArray80[3] = "full";
trackAdvertSize = aStringArray80.length;
}
}
8 changes: 4 additions & 4 deletions client/src/main/java/agolf/game/GameCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,8 @@ private void doStroke(int playerId, boolean isLocalPlayer, int mouseX, int mouse
double speed = temp / 6.5D;
speed *= speed;
if (!this.norandom) {
this.speedX[playerId] += speed * ((double) (this.rngSeed.next() % '\uc351') / 100000.0D - 0.25D);
this.speedY[playerId] += speed * ((double) (this.rngSeed.next() % '\uc351') / 100000.0D - 0.25D);
this.speedX[playerId] += speed * ((double) (this.rngSeed.next() % 50001) / 100000.0D - 0.25D);
this.speedY[playerId] += speed * ((double) (this.rngSeed.next() % 50001) / 100000.0D - 0.25D);
}
this.isLocalPlayer = isLocalPlayer;
this.gameState = 2;
Expand Down Expand Up @@ -1011,8 +1011,8 @@ private void doHackedStroke(int playerId, boolean isLocalPlayer, int mouseX, int
var7 = Math.sqrt(temp_aDoubleArray2828[playerId] * temp_aDoubleArray2828[playerId] + temp_aDoubleArray2829[playerId] * temp_aDoubleArray2829[playerId]);
double var9 = var7 / 6.5D;
var9 *= var9;
temp_aDoubleArray2828[playerId] += var9 * ((double) (temp_aSeed_2836.next() % '\uc351') / 100000.0D - 0.25D);
temp_aDoubleArray2829[playerId] += var9 * ((double) (temp_aSeed_2836.next() % '\uc351') / 100000.0D - 0.25D);
temp_aDoubleArray2828[playerId] += var9 * ((double) (temp_aSeed_2836.next() % 50001) / 100000.0D - 0.25D);
temp_aDoubleArray2829[playerId] += var9 * ((double) (temp_aSeed_2836.next() % 50001) / 100000.0D - 0.25D);
temp_aBoolean2832 = isLocalPlayer;
//this.gameState = 2;
temp_aBoolean2843 = false;
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/com/aapeli/applet/AdCanvasText.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private AdCanvasText(int var1, int var2, int var3, int var4, Color var5, Color v
this.aColor1306 = var5;
this.aColor1307 = var6;
this.aString1308 = var9;
this.fontDialog = new Font("Dialog", bold ? 1 : 0, size);
this.fontDialog = new Font("Dialog", bold ? Font.BOLD : Font.PLAIN, size);
this.anInt1310 = -1;
if (var3 > 0) {
this.anInt1310 = 1;
Expand Down
14 changes: 4 additions & 10 deletions client/src/main/java/com/aapeli/bigtext/BigText.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class BigText {
public static final int VALIGN_TOP = -1;
public static final int VALIGN_MIDDLE = 0;
public static final int VALIGN_BOTTOM = 1;
protected static final Color aColor1312;
protected static final Color aColor1312 = Color.white;
private static final String aString1313 = "ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ 1234567890:!?/&Ü+-*%<>()ÁÉÑ'\"¿¡ÍÓÚØ";
protected static final int[] anIntArray1314;
protected static final int anInt1315;
protected static final int[] anIntArray1314 = new int[]{0, 23, 47, 71, 95, 116, 136, 160, 183, 195, 219, 243, 264, 299, 323, 347, 370, 394, 418, 442, 465, 489, 513, 542, 566, 590, 614, 637, 661, 685, 700, 714, 736, 756, 777, 798, 819, 839, 859, 881, 901, 913, 924, 949, 972, 1002, 1027, 1051, 1071, 1097, 1126, 1149, 1172, 1186, 1200, 1225, 1246, 1270, 1281, 1303, 1328, 1339, 1354, 1378, 1402};
protected static final int anInt1315 = anIntArray1314.length;
private static ImageManager anImageManager1316;
private static int[] anIntArray1317;
private static int[] anIntArray1318;
Expand Down Expand Up @@ -175,7 +175,7 @@ private void method1552(int var1, int var2, int var3, double var4, double var6,
}

private int method1553(int var1, int var2, double var3, double var5, double var7) {
return (var2 << 24) + ((int) ((double) ((var1 & 16711680) >> 16) * var3) << 16) + ((int) ((double) ((var1 & '\uff00') >> 8) * var5) << 8) + (int) ((double) (var1 & 255) * var7);
return (var2 << 24) + ((int) ((double) ((var1 & 16711680) >> 16) * var3) << 16) + ((int) ((double) ((var1 & 65280) >> 8) * var5) << 8) + (int) ((double) (var1 & 255) * var7);
}

private void method1554(String var1, Color var2, int var3, Component var4) {
Expand Down Expand Up @@ -274,10 +274,4 @@ private void method1558(int var1, Component var2) {
}
}
}

static {
aColor1312 = Color.white;
anIntArray1314 = new int[]{0, 23, 47, 71, 95, 116, 136, 160, 183, 195, 219, 243, 264, 299, 323, 347, 370, 394, 418, 442, 465, 489, 513, 542, 566, 590, 614, 637, 661, 685, 700, 714, 736, 756, 777, 798, 819, 839, 859, 881, 901, 913, 924, 949, 972, 1002, 1027, 1051, 1071, 1097, 1126, 1149, 1172, 1186, 1200, 1225, 1246, 1270, 1281, 1303, 1328, 1339, 1354, 1378, 1402};
anInt1315 = anIntArray1314.length;
}
}
Binary file modified client/src/main/java/com/aapeli/client/BadWordFilter.java
Binary file not shown.
6 changes: 1 addition & 5 deletions client/src/main/java/com/aapeli/client/Class88.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class Class88 implements ActionListener {

private static final Color aColor1499;
private static final Color aColor1499 = new Color(64, 160, 255);
private Parameters aParameters1500;
private TextManager aTextManager1501;
private ImageManager anImageManager1502;
Expand Down Expand Up @@ -204,8 +204,4 @@ private static String method1708(String var0) {

return var2.toString();
}

static {
aColor1499 = new Color(64, 160, 255);
}
}
18 changes: 5 additions & 13 deletions client/src/main/java/com/aapeli/client/IPanel_Sub40.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

class IPanel_Sub40 extends IPanel implements ActionListener {

private static final Color aColor3205;
private static final Color aColor3206;
private static final Color aColor3207;
private static final Color aColor3208;
private static final Font aFont3209;
private static final Color aColor3205 = new Color(240, 240, 240);
private static final Color aColor3206 = Color.black;
private static final Color aColor3207 = new Color(128, 255, 128);
private static final Color aColor3208 = new Color(240, 240, 96);
private static final Font aFont3209 = new Font("Dialog", Font.PLAIN, 16);
private AApplet anAApplet3210;
private Frame_Sub3_Sub1 aFrame_Sub3_Sub1_3211;
private int anInt3212;
Expand Down Expand Up @@ -100,12 +100,4 @@ private void method821() {
}

}

static {
aColor3205 = new Color(240, 240, 240);
aColor3206 = Color.black;
aColor3207 = new Color(128, 255, 128);
aColor3208 = new Color(240, 240, 96);
aFont3209 = new Font("Dialog", Font.PLAIN, 16);
}
}
Loading
Loading