diff --git a/assets/res/AGolf2/picture/background.jpg b/assets/res/AGolf2/picture/background.jpg deleted file mode 100644 index e006ad36..00000000 Binary files a/assets/res/AGolf2/picture/background.jpg and /dev/null differ diff --git a/assets/res/AGolf2/picture/background_prevtrack.png b/assets/res/AGolf2/picture/background_prevtrack.png deleted file mode 100644 index 8dd9c9dd..00000000 Binary files a/assets/res/AGolf2/picture/background_prevtrack.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/background_select.png b/assets/res/AGolf2/picture/background_select.png deleted file mode 100644 index 22decdd8..00000000 Binary files a/assets/res/AGolf2/picture/background_select.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/background_settings.png b/assets/res/AGolf2/picture/background_settings.png deleted file mode 100644 index fc5877c9..00000000 Binary files a/assets/res/AGolf2/picture/background_settings.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_mirror_hor.png b/assets/res/AGolf2/picture/editor_mirror_hor.png deleted file mode 100644 index 2b780c2e..00000000 Binary files a/assets/res/AGolf2/picture/editor_mirror_hor.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_mirror_ver.png b/assets/res/AGolf2/picture/editor_mirror_ver.png deleted file mode 100644 index 50c8ca69..00000000 Binary files a/assets/res/AGolf2/picture/editor_mirror_ver.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_mouse.png b/assets/res/AGolf2/picture/editor_mouse.png deleted file mode 100644 index fd63ab15..00000000 Binary files a/assets/res/AGolf2/picture/editor_mouse.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_move_down.png b/assets/res/AGolf2/picture/editor_move_down.png deleted file mode 100644 index db4def5e..00000000 Binary files a/assets/res/AGolf2/picture/editor_move_down.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_move_left.png b/assets/res/AGolf2/picture/editor_move_left.png deleted file mode 100644 index 05f8f72a..00000000 Binary files a/assets/res/AGolf2/picture/editor_move_left.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_move_right.png b/assets/res/AGolf2/picture/editor_move_right.png deleted file mode 100644 index 3703c1cf..00000000 Binary files a/assets/res/AGolf2/picture/editor_move_right.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_move_up.png b/assets/res/AGolf2/picture/editor_move_up.png deleted file mode 100644 index 93b37218..00000000 Binary files a/assets/res/AGolf2/picture/editor_move_up.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_paint_fill.png b/assets/res/AGolf2/picture/editor_paint_fill.png deleted file mode 100644 index 4df249d9..00000000 Binary files a/assets/res/AGolf2/picture/editor_paint_fill.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_paint_fill_active.png b/assets/res/AGolf2/picture/editor_paint_fill_active.png deleted file mode 100644 index cdd09d35..00000000 Binary files a/assets/res/AGolf2/picture/editor_paint_fill_active.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_paint_pencil.png b/assets/res/AGolf2/picture/editor_paint_pencil.png deleted file mode 100644 index 98d16367..00000000 Binary files a/assets/res/AGolf2/picture/editor_paint_pencil.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_paint_pencil_active.png b/assets/res/AGolf2/picture/editor_paint_pencil_active.png deleted file mode 100644 index 255d9766..00000000 Binary files a/assets/res/AGolf2/picture/editor_paint_pencil_active.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_paint_stamp.png b/assets/res/AGolf2/picture/editor_paint_stamp.png deleted file mode 100644 index 90926cad..00000000 Binary files a/assets/res/AGolf2/picture/editor_paint_stamp.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_paint_stamp_active.png b/assets/res/AGolf2/picture/editor_paint_stamp_active.png deleted file mode 100644 index 88574219..00000000 Binary files a/assets/res/AGolf2/picture/editor_paint_stamp_active.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/editor_swap.png b/assets/res/AGolf2/picture/editor_swap.png deleted file mode 100644 index 738adc41..00000000 Binary files a/assets/res/AGolf2/picture/editor_swap.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/game_balls_big.png b/assets/res/AGolf2/picture/game_balls_big.png deleted file mode 100644 index 482ac61e..00000000 Binary files a/assets/res/AGolf2/picture/game_balls_big.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/game_balls_normal.png b/assets/res/AGolf2/picture/game_balls_normal.png deleted file mode 100644 index c1b6a707..00000000 Binary files a/assets/res/AGolf2/picture/game_balls_normal.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/game_balls_small.png b/assets/res/AGolf2/picture/game_balls_small.png deleted file mode 100644 index 270f0f9c..00000000 Binary files a/assets/res/AGolf2/picture/game_balls_small.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/game_playericons.png b/assets/res/AGolf2/picture/game_playericons.png deleted file mode 100644 index f640215a..00000000 Binary files a/assets/res/AGolf2/picture/game_playericons.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/game_thumbs.png b/assets/res/AGolf2/picture/game_thumbs.png deleted file mode 100644 index 9e851b58..00000000 Binary files a/assets/res/AGolf2/picture/game_thumbs.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/track_elements.png b/assets/res/AGolf2/picture/track_elements.png deleted file mode 100644 index 9be3c6ad..00000000 Binary files a/assets/res/AGolf2/picture/track_elements.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/track_objects.png b/assets/res/AGolf2/picture/track_objects.png deleted file mode 100644 index 3ed10ad8..00000000 Binary files a/assets/res/AGolf2/picture/track_objects.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/track_shapes.png b/assets/res/AGolf2/picture/track_shapes.png deleted file mode 100644 index db245406..00000000 Binary files a/assets/res/AGolf2/picture/track_shapes.png and /dev/null differ diff --git a/assets/res/AGolf2/picture/track_slopes.png b/assets/res/AGolf2/picture/track_slopes.png deleted file mode 100644 index cace506a..00000000 Binary files a/assets/res/AGolf2/picture/track_slopes.png and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_acid.au b/assets/res/AGolf2/sound/ball_acid.au deleted file mode 100644 index b1ac0e2f..00000000 Binary files a/assets/res/AGolf2/sound/ball_acid.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_bouncer.au b/assets/res/AGolf2/sound/ball_bouncer.au deleted file mode 100644 index 3be7fe8c..00000000 Binary files a/assets/res/AGolf2/sound/ball_bouncer.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_hole.au b/assets/res/AGolf2/sound/ball_hole.au deleted file mode 100644 index cbe219d1..00000000 Binary files a/assets/res/AGolf2/sound/ball_hole.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_mine.au b/assets/res/AGolf2/sound/ball_mine.au deleted file mode 100644 index f1470a45..00000000 Binary files a/assets/res/AGolf2/sound/ball_mine.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_sacid.au b/assets/res/AGolf2/sound/ball_sacid.au deleted file mode 100644 index 720c568e..00000000 Binary files a/assets/res/AGolf2/sound/ball_sacid.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_sizechange.au b/assets/res/AGolf2/sound/ball_sizechange.au deleted file mode 100644 index d189a92c..00000000 Binary files a/assets/res/AGolf2/sound/ball_sizechange.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_swamp.au b/assets/res/AGolf2/sound/ball_swamp.au deleted file mode 100644 index 4795687b..00000000 Binary files a/assets/res/AGolf2/sound/ball_swamp.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_teleport.au b/assets/res/AGolf2/sound/ball_teleport.au deleted file mode 100644 index 20922a15..00000000 Binary files a/assets/res/AGolf2/sound/ball_teleport.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/ball_water.au b/assets/res/AGolf2/sound/ball_water.au deleted file mode 100644 index 2fb2f14c..00000000 Binary files a/assets/res/AGolf2/sound/ball_water.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/game_draw.au b/assets/res/AGolf2/sound/game_draw.au deleted file mode 100644 index f0f13a94..00000000 Binary files a/assets/res/AGolf2/sound/game_draw.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/game_lose.au b/assets/res/AGolf2/sound/game_lose.au deleted file mode 100644 index 607a9811..00000000 Binary files a/assets/res/AGolf2/sound/game_lose.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/game_win.au b/assets/res/AGolf2/sound/game_win.au deleted file mode 100644 index 2e34f195..00000000 Binary files a/assets/res/AGolf2/sound/game_win.au and /dev/null differ diff --git a/assets/res/AGolf2/sound/player_strike.au b/assets/res/AGolf2/sound/player_strike.au deleted file mode 100644 index bce236c3..00000000 Binary files a/assets/res/AGolf2/sound/player_strike.au and /dev/null differ diff --git a/client/src/main/java/agolf/Conn.java b/client/src/main/java/agolf/Conn.java index 18f2fdb9..7a7b112e 100644 --- a/client/src/main/java/agolf/Conn.java +++ b/client/src/main/java/agolf/Conn.java @@ -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; @@ -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"; - } } diff --git a/client/src/main/java/agolf/GameApplet.java b/client/src/main/java/agolf/GameApplet.java index f5d7158e..73230b93 100644 --- a/client/src/main/java/agolf/GameApplet.java +++ b/client/src/main/java/agolf/GameApplet.java @@ -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(); @@ -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(); } } diff --git a/client/src/main/java/agolf/LobbySelectRNOPspammer.java b/client/src/main/java/agolf/LobbySelectNumberOfPlayersFetcher.java similarity index 82% rename from client/src/main/java/agolf/LobbySelectRNOPspammer.java rename to client/src/main/java/agolf/LobbySelectNumberOfPlayersFetcher.java index 547b3fef..d53c4d65 100644 --- a/client/src/main/java/agolf/LobbySelectRNOPspammer.java +++ b/client/src/main/java/agolf/LobbySelectNumberOfPlayersFetcher.java @@ -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); diff --git a/client/src/main/java/agolf/LobbySelectPanel.java b/client/src/main/java/agolf/LobbySelectPanel.java index 0c7e28a0..d5dbead7 100644 --- a/client/src/main/java/agolf/LobbySelectPanel.java +++ b/client/src/main/java/agolf/LobbySelectPanel.java @@ -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) { @@ -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; } } diff --git a/client/src/main/java/agolf/game/GameBackgroundCanvas.java b/client/src/main/java/agolf/game/GameBackgroundCanvas.java index a107ee44..6981d0dc 100644 --- a/client/src/main/java/agolf/game/GameBackgroundCanvas.java +++ b/client/src/main/java/agolf/game/GameBackgroundCanvas.java @@ -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; @@ -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; @@ -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; - } } diff --git a/client/src/main/java/agolf/game/GameCanvas.java b/client/src/main/java/agolf/game/GameCanvas.java index 3afb6412..cbb5b787 100644 --- a/client/src/main/java/agolf/game/GameCanvas.java +++ b/client/src/main/java/agolf/game/GameCanvas.java @@ -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; @@ -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; diff --git a/client/src/main/java/com/aapeli/applet/AdCanvasText.java b/client/src/main/java/com/aapeli/applet/AdCanvasText.java index 3b14bd4a..d17a5c20 100644 --- a/client/src/main/java/com/aapeli/applet/AdCanvasText.java +++ b/client/src/main/java/com/aapeli/applet/AdCanvasText.java @@ -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; diff --git a/client/src/main/java/com/aapeli/bigtext/BigText.java b/client/src/main/java/com/aapeli/bigtext/BigText.java index 85414141..66fe135a 100644 --- a/client/src/main/java/com/aapeli/bigtext/BigText.java +++ b/client/src/main/java/com/aapeli/bigtext/BigText.java @@ -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; @@ -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) { @@ -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; - } } diff --git a/client/src/main/java/com/aapeli/client/BadWordFilter.java b/client/src/main/java/com/aapeli/client/BadWordFilter.java index 2ce1e796..7d33919e 100644 Binary files a/client/src/main/java/com/aapeli/client/BadWordFilter.java and b/client/src/main/java/com/aapeli/client/BadWordFilter.java differ diff --git a/client/src/main/java/com/aapeli/client/Class88.java b/client/src/main/java/com/aapeli/client/Class88.java index 868422dd..988b5660 100644 --- a/client/src/main/java/com/aapeli/client/Class88.java +++ b/client/src/main/java/com/aapeli/client/Class88.java @@ -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; @@ -204,8 +204,4 @@ private static String method1708(String var0) { return var2.toString(); } - - static { - aColor1499 = new Color(64, 160, 255); - } } diff --git a/client/src/main/java/com/aapeli/client/IPanel_Sub40.java b/client/src/main/java/com/aapeli/client/IPanel_Sub40.java index 60744b0d..ef3180aa 100644 --- a/client/src/main/java/com/aapeli/client/IPanel_Sub40.java +++ b/client/src/main/java/com/aapeli/client/IPanel_Sub40.java @@ -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; @@ -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); - } } diff --git a/client/src/main/java/com/aapeli/client/Panel_Sub24.java b/client/src/main/java/com/aapeli/client/Panel_Sub24.java index 4f3d9d34..accd3655 100644 --- a/client/src/main/java/com/aapeli/client/Panel_Sub24.java +++ b/client/src/main/java/com/aapeli/client/Panel_Sub24.java @@ -16,18 +16,18 @@ class Panel_Sub24 extends Panel implements ActionListener, FocusListener { - protected static final Color aColor616; - private static final Color aColor617; - private static final Color aColor618; - private static final Color aColor619; - private static final Color aColor620; - private static final Color aColor621; - private static final Color aColor622; - private static final Font aFont623; - private static final Font aFont624; - private static final Font aFont625; - private static final Font aFont626; - private static final Font aFont627; + protected static final Color aColor616 = new Color(240, 240, 240); + private static final Color aColor617 = Color.black; + private static final Color aColor618 = new Color(255, 224, 224); + private static final Color aColor619 = new Color(144, 144, 240); + private static final Color aColor620 = new Color(128, 255, 128); + private static final Color aColor621 = new Color(255, 128, 128); + private static final Color aColor622 = new Color(224, 224, 128); + private static final Font aFont623 = new Font("Dialog", Font.PLAIN, 12); + private static final Font aFont624 = new Font("Dialog", Font.PLAIN, 14); + private static final Font aFont625 = new Font("Dialog", Font.PLAIN, 11); + private static final Font aFont626 = new Font("Serif", Font.PLAIN, 18); + private static final Font aFont627 = new Font("Dialog", Font.PLAIN, 16); private TextManager aTextManager628; private ImageManager anImageManager629; private Class88 aClass88_630; @@ -350,19 +350,4 @@ private boolean method484(String var1) { } } } - - static { - aColor616 = new Color(240, 240, 240); - aColor617 = Color.black; - aColor618 = new Color(255, 224, 224); - aColor619 = new Color(144, 144, 240); - aColor620 = new Color(128, 255, 128); - aColor621 = new Color(255, 128, 128); - aColor622 = new Color(224, 224, 128); - aFont623 = new Font("Dialog", Font.PLAIN, 12); - aFont624 = new Font("Dialog", Font.PLAIN, 14); - aFont625 = new Font("Dialog", Font.PLAIN, 11); - aFont626 = new Font("Serif", Font.PLAIN, 18); - aFont627 = new Font("Dialog", Font.PLAIN, 16); - } } diff --git a/client/src/main/java/com/aapeli/client/TextManager.java b/client/src/main/java/com/aapeli/client/TextManager.java index 605c3288..d886e961 100644 --- a/client/src/main/java/com/aapeli/client/TextManager.java +++ b/client/src/main/java/com/aapeli/client/TextManager.java @@ -508,7 +508,7 @@ private String method1728(long var1, int var3) { var5 = false; } - int var6 = var4.get(var5 ? 11 : 10); + int var6 = var4.get(var5 ? Calendar.HOUR_OF_DAY : Calendar.HOUR); int var7 = var4.get(Calendar.MINUTE); String var8 = ""; if (!var5) { diff --git a/client/src/main/java/com/aapeli/client/UrlLabel.java b/client/src/main/java/com/aapeli/client/UrlLabel.java index 2b9219b9..04f9a009 100644 --- a/client/src/main/java/com/aapeli/client/UrlLabel.java +++ b/client/src/main/java/com/aapeli/client/UrlLabel.java @@ -20,10 +20,10 @@ public class UrlLabel extends IPanel implements MouseListener { public static final int ALIGN_RIGHT = 1; public static final int TARGET_SAME = 0; public static final int TARGET_NEW = 1; - private static final String[] urlTargets = new String[2]; - private static final Cursor defaultCursor; - private static final Cursor handCursor; - private static final Font fontDialog11; + private static final String[] urlTargets = new String[]{"_top", "_blank"}; + private static final Cursor defaultCursor = new Cursor(Cursor.DEFAULT_CURSOR); + private static final Cursor handCursor = new Cursor(Cursor.HAND_CURSOR); + private static final Font fontDialog11 = new Font("Dialog", Font.PLAIN, 11); private Applet applet; private Font currentFont; private URL url; @@ -207,14 +207,6 @@ public void setTarget(String target) { this.urlTarget = target; } - static { - urlTargets[0] = "_top"; - urlTargets[1] = "_blank"; - defaultCursor = new Cursor(Cursor.DEFAULT_CURSOR); - handCursor = new Cursor(Cursor.HAND_CURSOR); - fontDialog11 = new Font("Dialog", Font.PLAIN, 11); - } - private static char[] method822(String var0) { char[] var10000 = var0.toCharArray(); char[] var10001 = var10000; diff --git a/client/src/main/java/com/aapeli/colorgui/ColorButton.java b/client/src/main/java/com/aapeli/colorgui/ColorButton.java index c34aacc5..7b470bfa 100644 --- a/client/src/main/java/com/aapeli/colorgui/ColorButton.java +++ b/client/src/main/java/com/aapeli/colorgui/ColorButton.java @@ -20,7 +20,7 @@ public class ColorButton extends IPanel implements MouseMotionListener, MouseLis public static final int BORDER_NONE = 0; public static final int BORDER_NORMAL = 1; public static final int BORDER_THICK = 2; - private static final Color aColor3253; + private static final Color aColor3253 = new Color(192, 192, 192); private Color aColor3254; private Color aColor3255; private Color aColor3256; @@ -571,8 +571,4 @@ public void innerSetFlashState(boolean var1) { this.aBoolean3286 = var1; this.repaint(); } - - static { - aColor3253 = new Color(192, 192, 192); - } } diff --git a/client/src/main/java/com/aapeli/colorgui/ColorTextArea.java b/client/src/main/java/com/aapeli/colorgui/ColorTextArea.java index 9f9bf104..eb653ecb 100644 --- a/client/src/main/java/com/aapeli/colorgui/ColorTextArea.java +++ b/client/src/main/java/com/aapeli/colorgui/ColorTextArea.java @@ -31,10 +31,10 @@ public class ColorTextArea extends IPanel implements ComponentListener, Adjustme public static final int BORDER_NONE = 0; public static final int BORDER_BEVELED = 1; public static final int BORDER_NONE_ROUNDCORNER = 2; - private static final Color[] aColorArray3327; - private static final Color aColor3328; - private static final Color aColor3329; - private static final Color aColor3330; + private static final Color[] aColorArray3327 = new Color[]{new Color(0, 0, 0), new Color(224, 0, 0), new Color(0, 160, 0), new Color(0, 0, 240), new Color(160, 128, 0), new Color(160, 0, 160), new Color(0, 144, 160), new Color(112, 112, 112), new Color(255, 255, 255)}; + private static final Color aColor3328 = new Color(255, 255, 255); + private static final Color aColor3329 = new Color(192, 192, 192); + private static final Color aColor3330 = new Color(64, 64, 64); private Scrollbar aScrollbar3331; private boolean aBoolean3332; private Image anImage3333; @@ -368,11 +368,4 @@ private void method854(int var1, boolean var2) { } } } - - static { - aColorArray3327 = new Color[]{new Color(0, 0, 0), new Color(224, 0, 0), new Color(0, 160, 0), new Color(0, 0, 240), new Color(160, 128, 0), new Color(160, 0, 160), new Color(0, 144, 160), new Color(112, 112, 112), new Color(255, 255, 255)}; - aColor3328 = new Color(255, 255, 255); - aColor3329 = new Color(192, 192, 192); - aColor3330 = new Color(64, 64, 64); - } } diff --git a/client/src/main/java/com/aapeli/colorgui/MultiColorListListener.java b/client/src/main/java/com/aapeli/colorgui/MultiColorListListener.java index 59822d48..c534d78c 100644 --- a/client/src/main/java/com/aapeli/colorgui/MultiColorListListener.java +++ b/client/src/main/java/com/aapeli/colorgui/MultiColorListListener.java @@ -1,10 +1,6 @@ package com.aapeli.colorgui; -/** - * Playforia - * 7.7.2013 - */ public interface MultiColorListListener { - public void mouseDoubleClicked(MultiColorListItem clickedItem); + void mouseDoubleClicked(MultiColorListItem clickedItem); } diff --git a/client/src/main/java/com/aapeli/colorgui/RoundButton.java b/client/src/main/java/com/aapeli/colorgui/RoundButton.java index 18f4375a..dbf945cc 100644 --- a/client/src/main/java/com/aapeli/colorgui/RoundButton.java +++ b/client/src/main/java/com/aapeli/colorgui/RoundButton.java @@ -12,7 +12,6 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; -import java.awt.image.ImageObserver; import java.util.Enumeration; import java.util.Vector; diff --git a/client/src/main/java/com/aapeli/connection/Connection.java b/client/src/main/java/com/aapeli/connection/Connection.java index 96c782ce..eb1c2e8e 100644 --- a/client/src/main/java/com/aapeli/connection/Connection.java +++ b/client/src/main/java/com/aapeli/connection/Connection.java @@ -34,7 +34,6 @@ public final class Connection implements Runnable { public static final int STATE_DISCONNECTED = 4; /* Other Constants */ - private static final String encoding = "UTF-8"; public static final int CIPHER_MAGIC_DEFAULT = 4; private AApplet gameApplet; @@ -199,13 +198,8 @@ private boolean connect() { InputStreamReader reader; OutputStreamWriter writer; - try { - reader = new InputStreamReader(in, encoding); - writer = new OutputStreamWriter(out, encoding); - } catch (UnsupportedEncodingException ex) { - reader = new InputStreamReader(in); - writer = new OutputStreamWriter(out); - } + reader = new InputStreamReader(in); + writer = new OutputStreamWriter(out); this.sockIn = new BufferedReader(reader); this.sockOut = new BufferedWriter(writer); diff --git a/client/src/main/java/com/aapeli/multiuser/ChatBase.java b/client/src/main/java/com/aapeli/multiuser/ChatBase.java index c554b1a8..97db7432 100644 --- a/client/src/main/java/com/aapeli/multiuser/ChatBase.java +++ b/client/src/main/java/com/aapeli/multiuser/ChatBase.java @@ -29,8 +29,8 @@ public abstract class ChatBase extends IPanel implements ComponentListener, User public static final int CIDR_NONE = 0; public static final int CIDR_UNREG = 1; public static final int CIDR_UNCONF = 2; - private static final Color sayButtonColor; - private static boolean shouldDisplayChatInputHelp; + private static final Color sayButtonColor = new Color(144, 144, 224); + private static boolean shouldDisplayChatInputHelp = true; public Parameters param; public TextManager textManager; public ImageManager imageManager; @@ -620,9 +620,4 @@ private ChatListener[] getChatListenersCopy() { private void paintSignupMessage() { this.signupMessage = getSignupMessage(this.chatDisabledStatus, this, this.inputTextField, this.sayButton, this.signupMessage, this.getRegisterationNeededText(), this.getConfirmationNeededText(), this.param); } - - static { - sayButtonColor = new Color(144, 144, 224); - shouldDisplayChatInputHelp = true; - } } diff --git a/client/src/main/java/com/aapeli/multiuser/ChatTextArea.java b/client/src/main/java/com/aapeli/multiuser/ChatTextArea.java index e1359ffb..1fa1036f 100644 --- a/client/src/main/java/com/aapeli/multiuser/ChatTextArea.java +++ b/client/src/main/java/com/aapeli/multiuser/ChatTextArea.java @@ -9,8 +9,8 @@ public class ChatTextArea extends ColorTextArea { - public static final Font DEFAULT_FONT; - public static final Font SMALL_FONT; + public static final Font DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12); + public static final Font SMALL_FONT = new Font("Dialog", Font.PLAIN, 11); private TextManager aTextManager4728; private BadWordFilter aBadWordFilter4729; private Hashtable aHashtable4730; @@ -193,9 +193,4 @@ private String method862(String var1, boolean var2) { return var1; } - - static { - DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12); - SMALL_FONT = new Font("Dialog", Font.PLAIN, 11); - } } diff --git a/client/src/main/java/com/aapeli/multiuser/UserList.java b/client/src/main/java/com/aapeli/multiuser/UserList.java index b69ae081..89e887df 100644 --- a/client/src/main/java/com/aapeli/multiuser/UserList.java +++ b/client/src/main/java/com/aapeli/multiuser/UserList.java @@ -37,11 +37,11 @@ public class UserList extends IPanel implements ComponentListener, ItemListener, public static final int SORT_NICKNAME_CBA = 2; public static final int SORT_RANKING_123 = 3; public static final int SORT_RANKING_321 = 4; - private static final Color aColor3453; - private static final Color aColor3454; - private static final Font aFont3455; - private static final Color aColor3456; - private static final Color aColor3457; + private static final Color aColor3453 = Color.white; + private static final Color aColor3454 = Color.black; + private static final Font aFont3455 = new Font("Dialog", Font.PLAIN, 9); + private static final Color aColor3456 = new Color(224, 224, 224); + private static final Color aColor3457 = new Color(208, 208, 255); private UserListHandler anUserListHandler3458; private TextManager textManager; private ImageManager imageManager; @@ -930,12 +930,4 @@ private UserListItem method937(String var1, boolean var2, int var3) { return var14; } - - static { - aColor3453 = Color.white; - aColor3454 = Color.black; - aFont3455 = new Font("Dialog", Font.PLAIN, 9); - aColor3456 = new Color(224, 224, 224); - aColor3457 = new Color(208, 208, 255); - } } diff --git a/client/src/main/java/com/aapeli/tools/Tools.java b/client/src/main/java/com/aapeli/tools/Tools.java index 72d0ab36..8fcda336 100644 --- a/client/src/main/java/com/aapeli/tools/Tools.java +++ b/client/src/main/java/com/aapeli/tools/Tools.java @@ -302,8 +302,8 @@ public static String arrayToString(Object[] var0, char var1) { } private static void method1875(StringBuffer var0, int var1) { - int var2 = var1 / '\uea60'; - var1 -= var2 * '\uea60'; + int var2 = var1 / 60000; + var1 -= var2 * 60000; int var3 = var1 / 1000; int var4 = var1 - var3 * 1000; if (var2 < 10) { diff --git a/client/src/main/java/org/moparforia/client/TrackDumper.java b/client/src/main/java/org/moparforia/client/TrackDumper.java index 5cc9e583..f2cedcab 100644 --- a/client/src/main/java/org/moparforia/client/TrackDumper.java +++ b/client/src/main/java/org/moparforia/client/TrackDumper.java @@ -191,75 +191,74 @@ public void notifyConnectionUp() { System.out.println("connected"); } - static String[] aStringArray2369 = new String[68]; - static { - aStringArray2369[0] = "status\t"; - aStringArray2369[1] = "basicinfo\t"; - aStringArray2369[2] = "numberofusers\t"; - aStringArray2369[3] = "users\t"; - aStringArray2369[4] = "ownjoin\t"; - aStringArray2369[5] = "joinfromgame\t"; - aStringArray2369[6] = "say\t"; - aStringArray2369[7] = "logintype\t"; - aStringArray2369[8] = "login"; - aStringArray2369[9] = "lobbyselect\t"; - aStringArray2369[10] = "select\t"; - aStringArray2369[11] = "back"; - aStringArray2369[12] = "challenge\t"; - aStringArray2369[13] = "cancel\t"; - aStringArray2369[14] = "accept\t"; - aStringArray2369[15] = "cfail\t"; - aStringArray2369[16] = "nouser"; - aStringArray2369[17] = "nochall"; - aStringArray2369[18] = "cother"; - aStringArray2369[19] = "cbyother"; - aStringArray2369[20] = "refuse"; - aStringArray2369[21] = "afail"; - aStringArray2369[22] = "gsn\t"; - aStringArray2369[23] = "lobby\tnc\t"; - aStringArray2369[24] = "lobby\t"; - aStringArray2369[25] = "lobby"; - aStringArray2369[26] = "tracksetlist\t"; - aStringArray2369[27] = "tracksetlist"; - aStringArray2369[28] = "gamelist\t"; - aStringArray2369[29] = "full\t"; - aStringArray2369[30] = "add\t"; - aStringArray2369[31] = "change\t"; - aStringArray2369[32] = "remove\t"; - aStringArray2369[33] = "gameinfo\t"; - aStringArray2369[34] = "players"; - aStringArray2369[35] = "owninfo\t"; - aStringArray2369[36] = "game\tstarttrack\t"; - aStringArray2369[37] = "game\tstartturn\t"; - aStringArray2369[38] = "game\tstart"; - aStringArray2369[39] = "game\tbeginstroke\t"; - aStringArray2369[40] = "game\tendstroke\t"; - aStringArray2369[41] = "game\tresetvoteskip"; - aStringArray2369[42] = "game\t"; - aStringArray2369[43] = "game"; - aStringArray2369[44] = "quit"; - aStringArray2369[45] = "join\t"; - aStringArray2369[46] = "part\t"; - aStringArray2369[47] = "cspt\t"; - aStringArray2369[48] = "qmpt"; - aStringArray2369[49] = "cspc\t"; - aStringArray2369[50] = "jmpt\t"; - aStringArray2369[51] = "tracklist\t"; - aStringArray2369[52] = "Tiikoni"; - aStringArray2369[53] = "Leonardo"; - aStringArray2369[54] = "Ennaji"; - aStringArray2369[55] = "Hoeg"; - aStringArray2369[56] = "Darwin"; - aStringArray2369[57] = "Dante"; - aStringArray2369[58] = "ConTrick"; - aStringArray2369[59] = "Dewlor"; - aStringArray2369[60] = "Scope"; - aStringArray2369[61] = "SuperGenuis"; - aStringArray2369[62] = "Zwan"; - aStringArray2369[63] = "\tT !\t"; - aStringArray2369[64] = "\tcr\t"; - aStringArray2369[65] = "rnop"; - aStringArray2369[66] = "nop\t"; - aStringArray2369[67] = "error"; - } + static String[] aStringArray2369 = 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" + }; } diff --git a/client/src/main/java/org/moparforia/client/trackdump/Connection.java b/client/src/main/java/org/moparforia/client/trackdump/Connection.java index 0090bb0d..cb7b6a21 100644 --- a/client/src/main/java/org/moparforia/client/trackdump/Connection.java +++ b/client/src/main/java/org/moparforia/client/trackdump/Connection.java @@ -8,7 +8,6 @@ import java.io.InterruptedIOException; import java.io.OutputStream; import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; import java.net.Socket; import java.util.Vector; @@ -20,7 +19,6 @@ public final class Connection implements Runnable { public static final int DCR_RETRYFAIL = 3; public static final int DCR_VERSION = 4; public static final int DCR_HANDLEFAILED = 5; - private static final String aString1608 = "UTF-8"; private ConnListener aConnListener1611; private GameCrypto aGameCrypto_1612; private int anInt1613; @@ -161,13 +159,8 @@ private boolean method1776() { InputStreamReader var5; OutputStreamWriter var6; - try { - var5 = new InputStreamReader(var3, "UTF-8"); - var6 = new OutputStreamWriter(var4, "UTF-8"); - } catch (UnsupportedEncodingException var8) { - var5 = new InputStreamReader(var3); - var6 = new OutputStreamWriter(var4); - } + var5 = new InputStreamReader(var3); + var6 = new OutputStreamWriter(var4); this.in = new BufferedReader(var5); this.out = new BufferedWriter(var6); diff --git a/client/src/main/resources/l10n/en_US/AGolf2.xml b/client/src/main/resources/l10n/en_US/AGolf2.xml deleted file mode 100644 index c5238804..00000000 --- a/client/src/main/resources/l10n/en_US/AGolf2.xml +++ /dev/null @@ -1,1051 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Search]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/src/main/resources/l10n/fi_FI/AGolf2.xml b/client/src/main/resources/l10n/fi_FI/AGolf2.xml deleted file mode 100644 index 63652781..00000000 --- a/client/src/main/resources/l10n/fi_FI/AGolf2.xml +++ /dev/null @@ -1,1051 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Hae]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/src/main/resources/l10n/sv_SE/AGolf2.xml b/client/src/main/resources/l10n/sv_SE/AGolf2.xml deleted file mode 100644 index 2b6f8573..00000000 --- a/client/src/main/resources/l10n/sv_SE/AGolf2.xml +++ /dev/null @@ -1,1051 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sök]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/acannons.html b/doc/acannons.html deleted file mode 100644 index 6947ecac..00000000 --- a/doc/acannons.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/acannons1.png b/doc/acannons1.png deleted file mode 100644 index 7b28f1c8..00000000 Binary files a/doc/acannons1.png and /dev/null differ diff --git a/doc/acannons2.png b/doc/acannons2.png deleted file mode 100644 index 1a94c0ba..00000000 Binary files a/doc/acannons2.png and /dev/null differ diff --git a/doc/acannons3.png b/doc/acannons3.png deleted file mode 100644 index 87084fbe..00000000 Binary files a/doc/acannons3.png and /dev/null differ diff --git a/doc/adraw.html b/doc/adraw.html deleted file mode 100644 index de211384..00000000 --- a/doc/adraw.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/adraw1.png b/doc/adraw1.png deleted file mode 100644 index dc099f60..00000000 Binary files a/doc/adraw1.png and /dev/null differ diff --git a/doc/adraw2.png b/doc/adraw2.png deleted file mode 100644 index 7cf9b1bc..00000000 Binary files a/doc/adraw2.png and /dev/null differ diff --git a/doc/agolf2.html b/doc/agolf2.html deleted file mode 100644 index c573e2dc..00000000 --- a/doc/agolf2.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/ajaja.html b/doc/ajaja.html deleted file mode 100644 index c21409ea..00000000 --- a/doc/ajaja.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/apool.html b/doc/apool.html deleted file mode 100644 index 0d17d5c5..00000000 --- a/doc/apool.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/cgc.html b/doc/cgc.html deleted file mode 100644 index c221d715..00000000 --- a/doc/cgc.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/championship.txt b/doc/championship.txt deleted file mode 100644 index f50f3994..00000000 --- a/doc/championship.txt +++ /dev/null @@ -1,2 +0,0 @@ -birchwood -========= diff --git a/doc/defence.html b/doc/defence.html deleted file mode 100644 index efb01f2c..00000000 --- a/doc/defence.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/libs.txt b/doc/libs.txt deleted file mode 100644 index fcc7d212..00000000 --- a/doc/libs.txt +++ /dev/null @@ -1,8 +0,0 @@ -shared -> com.aapeli.... -shared2 -> com.playray.... - -acannons -> shared2 -adraw -> shared -agolf -> shared -agolf2 -> shared -apool -> shared2 diff --git a/doc/old_challenge.java b/doc/old_challenge.java deleted file mode 100644 index c18e112a..00000000 --- a/doc/old_challenge.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.server; - -/** - * Playforia - * 7.6.2013 - */ -public class Challenge { - - public Player challenger; - public Player challenged; - public int numTracks; - public int trackType; - public int maxStrokes; - public int timeLimit; - public int waterEvent; - public int collision; - public int scoring; - public int scoringEnd; - - // ("challenge\t" + this.opponentName + "\t" + this.tracksNum + "\t" + this.trackType + "\t" + this.maxStrokes + "\t" + this.timeLimit + - // "\t" + this.waterEvent + "\t" + this.collision + "\t" + this.scoring + "\t" + this.scoringEnd - - public Challenge(Player challenger) { - this.challenger = challenger; - } - - public boolean equals(Object o) { - if(!(o instanceof Challenge)) - return false; - Challenge c = (Challenge) o; - return numTracks == c.numTracks && trackType == c.trackType && maxStrokes == c.maxStrokes - && timeLimit == c.timeLimit && waterEvent == c.waterEvent && collision == c.collision - && scoringEnd == c.scoringEnd && scoring == c.scoring - && challenger.equals(c.challenger) && challenged.equals(c.challenged); - } -} diff --git a/doc/old_championgame.java b/doc/old_championgame.java deleted file mode 100644 index a47e3cf0..00000000 --- a/doc/old_championgame.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.server.game; - -import org.server.*; -import org.server.game.gametypes.Game; - -/** - * pre set tracks game, the tracklist is static. - */ - -public class ChampionshipGame extends Game { - - private int tracksetID; - Player player; - Session session; - - public ChampionshipGame(Player p, int tracksetID) { - super(Lobby.LOBBY_SINGLE); - this.tracksetID = tracksetID; - addPlayer(p); - player = players.get(0); - session = Server.getSession(player); - initTracks(); - startGame(); - } - - @Override - protected void initTracks() { - // tracks = TrackStore.getRandomTrackSet(10,0); // todo: championship isnt random, must have sets. - tracks = TrackStore.championshipSet(0); - } - - protected void startGame() { - broadcastD("status", "game"); - // name, password, playertype?, playerCount, numberOfTracks, - // trackType, maxstrokes, strokeTimeout, water, collision, trackscore, - // trackscoreend, tracksetlist!?! - - broadcastD("game", "gameinfo", "Single Moms In Your Area", "f", 0, 1, tracks.length, -1, 0, 0, 0, 0, 0, 0, "t"); - broadcastD("game", "players"); - broadcastD("game", "owninfo", 0, player.nick, "-"); - broadcastD("game", "cr", "0,0,0,0,0,0,0,0,0", - "2,2,3,3,3,3,1,4,5", "2,3,3,3,3,4,1,6,7", - "2,2,2,2,3,3,1,3,4", "2,2,2,2,3,3,1,3,4"); - broadcastD("game", "start"); - broadcastD("game", "starttrack","t", gameId, tracks[0]); - broadcastD("game", "startturn", 0); - } -} diff --git a/doc/old_dualgame.java b/doc/old_dualgame.java deleted file mode 100644 index 087248cd..00000000 --- a/doc/old_dualgame.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.server.game; - -import org.server.Lobby; -import org.server.Player; -import org.server.game.gametypes.Game; - -/** - * 1 v 1 challenge game?!? - */ -public class DualGame extends Game { - - public DualGame() { - super(Lobby.LOBBY_DUAL); - // "challenge\t" + this.opponentName + "\t" + this.tracksNum + "\t" + this.trackType + "\t" + this.maxStrokes + "\t" + this.timeLimit + "\t" + this.waterEvent + "\t" + this.collision + "\t" + this.scoring + "\t" + this.scoringEnd /*+ (isUsingCustomServer ? ("\t" + this.trackCategory) : "")*/); - - } - - @Override - protected void initTracks() { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - protected void startGame() { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - protected void nextTrack() { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void beginStroke(Player p, String mouseCoords) { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void endStroke(Player p, String playStatus) { - //To change body of implemented methods use File | Settings | File Templates. - } -} diff --git a/doc/old_game.java b/doc/old_game.java deleted file mode 100644 index 38bce425..00000000 --- a/doc/old_game.java +++ /dev/null @@ -1,194 +0,0 @@ -package org.server.game; - -import org.server.*; - -import java.util.ArrayList; -import java.util.List; - -/** - * Playforia - * 30.5.2013 - */ -public abstract class Game { - - public static final int PERM_EVERYONE = 0; - public static final int PERM_REGISTERED = 1; - public static final int PERM_VIP = 2; - public static final int STROKES_UNLIMITED = 0; - public static final int STROKETIMEOUT_INFINITE = 0; - public static final int WATER_START = 0; - public static final int WATER_SHORE = 1; - public static final int COLLISION_NO = 0; - public static final int COLLISION_YES = 1; - public static final int SCORING_STROKE = 0; - public static final int SCORING_TRACK = 1; - public static final int SCORING_WEIGHT_END_NONE = 0; - public static final int SCORING_WEIGHT_END_LITTLE = 1; - public static final int SCORING_WEIGHT_END_PLENTY = 2; - public int gameId; - public List players; - public List playersNumber; - public int numberIndex = 0; - protected Track[] tracks; - protected int currentTrack = 0; - protected int confirmCount = 0; - protected int strokesThisTrack = 0; - protected int lobbySource; - protected int wantsGameCount = 0; - protected String playStatus; - - - public Game(int lobbySource) { - this.gameId = Server.generateGameID(); - this.lobbySource = lobbySource; - players = new ArrayList(); - playersNumber = new ArrayList(); - } - - - protected abstract void initTracks(); - - protected abstract void startGame(); - - - public int getLobbySource() { - return lobbySource; - } - - public boolean addPlayer(Player p) { - //todo some check that you can actually add this player to this game. - players.add(p); - playersNumber.add(numberIndex++); - return true; - } - - public void removeGame() { - // todo: clearup of game - } - - public void beginStroke(Player p, String mouseCoords) { - //todo: anti cheat mechanisms! - int id = getIndex(p); - broadcastDExcept(p, "game", "beginstroke", playersNumber.get(id), mouseCoords); - - } - - public void broadcastDExcept(Player p, Object... args) { - for (int i = 0; i < players.size(); i++) { - if (!players.get(i).equals(p)) { - Session s = Server.getSession(players.get(i)); - Conn.writeD(s, args); - } - } - } - - public void endStroke(Player p, String playStatus) { - boolean finished = true; - this.playStatus = playStatus; - for (int i = 0; i < playStatus.length(); i++) { - if (playStatus.charAt(i) == 'f') { - finished = false; - break; - } - } - - - confirmCount++; // only sends the command after everyone confirms end stroke. - if (confirmCount == players.size()) { - confirmCount = 0; - if (finished) { - nextTrack(); - } else { - broadcastD("game", "startturn", getNextPlayer(playStatus)); - } - } - - } - - public int getNextPlayer(String s) { - strokesThisTrack++; - int player = strokesThisTrack % players.size(); - - if (s.charAt(player) == 't') { // if this player has already finihed - strokesThisTrack++; - } - return playersNumber.get(strokesThisTrack % players.size()); - } - - public int getFirstPlayer() { - return playersNumber.get(0); - } - - - public void removePlayer(Player p) { - int id = getIndex(p); - players.remove(p); - playersNumber.remove((Integer) id); // im not sure about this one :/ - } - - public int getIndex(Player p) { - int id = 0; - for (int i = 0; i < players.size(); i++) { - if (players.get(i).equals(p)) { - id = i; - break; - } - } - return id; - } - - protected void nextTrack() { - strokesThisTrack = 0; - currentTrack++; - if (currentTrack < tracks.length) { // there is a next track - Track t = tracks[currentTrack]; - StringBuffer buff = new StringBuffer(); - for (int i = 0; i < players.size(); i++) { - buff.append("t"); - } - - broadcastD("game", "starttrack", buff.toString(),gameId, t); - broadcastD("game", "startturn", getFirstPlayer()); - } else { - endGame(); - } - } - - protected void endGame() { - broadcastD("game", "end"); - } - - public void broadcastD(Object... data) { - for (Player p : players) { - Conn.writeD(Server.getSession(p), data); - } - } - - public void wantsNewGame(Player p) { - wantsGameCount++; - broadcastDExcept(p, "game", "rfng", playersNumber.get(getIndex(p))); - if (wantsGameCount >= players.size()) { - wantsGameCount = 0; - currentTrack = 0; - strokesThisTrack = 0; - initTracks(); - startGame(); - } - } - - public void voteSkip(Player p) { - nextTrack(); // cba to implement this properly - } - - public boolean hasPlayer(Player p) { - return players.contains(p); - } - - public boolean isEmpty() { - return players.size() == 0; - } - - public Player[] getPlayers() { - return players.toArray(new Player[0]); - } -} diff --git a/doc/old_handler.java b/doc/old_handler.java deleted file mode 100644 index 30ad25a1..00000000 --- a/doc/old_handler.java +++ /dev/null @@ -1,250 +0,0 @@ -package org.server; - -import com.sun.xml.internal.ws.api.server.AbstractServerAsyncTransport; -import org.server.game.*; - -/** - * Playforia - * 31.5.2013 - */ -public class Handler { - - public void handleS(Session session, String string) { - String[] args = string.split("\t"); - if (args[0].equals("tlog")) { - // tlog 1 clientconnect loadtime:i:539^loadertime:i:1239 - int i = Integer.parseInt(args[1]); - String dont = args[2]; - String know = args[3]; - } - } - - public void handleCommand(Session session, String cmd) { - Player player = session.getPlayer(); - if (cmd.equals("new")) { - Conn.writeC(session, "id " + Server.nextId()); - } else if (cmd.startsWith("old ")) { - int oldId = Integer.parseInt(cmd.substring(4));//todo checks, maybe - Conn.writeC(session, "id " + Server.nextId()); - } else if (cmd.equals("pong")) { - session.lastPong = System.currentTimeMillis(); - } - } - - public void handleData(Session session, String data) { - Player player = session.getPlayer(); - - int firstSpace = data.indexOf(' '); - long numClientSentPackets = Long.parseLong(data.substring(0, firstSpace));//todo checks, maybe - data = data.substring(firstSpace + 1); - String[] args = data.split("\t"); - - if (args[0].equals("version")) { - String version = args[1];//todo checks, maybe - Conn.writeD(session, "versok"); - } else if (args[0].equals("language")) { - String locale = args[1]; - player.locale = locale; - } else if (args[0].equals("logintype")) { - String logintype = args[1];//nr=not registered, reg=registered - Conn.writeD(session, "status", "login"); - } else if (args[0].equals("login")) { - Conn.writeD(session, "basicinfo", - player.isEmailVerified ? "t" : "f", player.elevation, - Config.USE_BADWORD_FILTER ? "t" : "f", Config.DISABLE_GUEST_CHAT ? "t" : "f"); - Conn.writeD(session, "status", "lobbyselect");// thid param would be an integer (with the official server it's 300) - } else if (args[0].equals("lobbyselect")) { - if (args[1].equals("rnop")) { - // request number of players - Conn.writeD(session, "nop", Server.getLobby(0).numPlayersInLobby(), - Server.getLobby(1).numPlayersInLobby(), Server.getLobby(2).numPlayersInLobby()); - - } else if (args[1].equals("select")) { - String lobbyId = args[2]; - int lobbyIdInt = Integer.parseInt(lobbyId.equals("x") ? "3" : lobbyId); - if (Server.getLobby(lobbyIdInt - 1).hasPlayer(player)) - return;//todo or disconnect - for (int i = 0; i < 3; i++) - Server.getLobby(i).removePlayer(player); - - Lobby lobby = Server.getLobby(lobbyIdInt - 1); - lobby.addPlayer(player); - - } - } else if (args[0].equals("lobby")) { - - if (args[1].equals("tracksetlist")) { - Conn.writeD(session, "lobby", "tracksetlist", "moparisthebest", "2", "18", "bigT II", "52", "muminjsh", - "91", "jimbojones123", "77", "Vargav", "98", "Brolapse", "1", "9", "bigT II", "22", - "lutikas", "32", "lutikas", "31", "lutikas", "32", "Niall", "1", "18", "bigT II", - "41", "anu42", "54", "taifferi", "50", "anu42", "54", "tL", "2", "9", "bigT II", - "35", "jimbojones123", "50", "lutikas", "46", "Modellbauer", "50", "dongs", "3", "9", - "Tgib", "36", "DysT", "105", "Modellbauer", "60", "-", "0", "bnl", "3", "18", - "Shaun The Best", "88", "muminjsh", "185", "kylamees", "143", "-", "0", "Fat_Cookies", - "2", "18", "bigT II", "18", "Nicko1", "39", "Nicko1", "38", "tkrrotk", "43");// temp workaround - - } else if (args[1].equals("cspc")) { // start championship game!11! - int setId = Integer.parseInt(args[2]); - ChampionshipGame championshipGame = new ChampionshipGame(player, setId); - Server.getLobby(0).addGame(championshipGame); // championshipgame is in singleplayer lobby - - } else if (args[1].equals("cspt")) { // create training game - int numberOfTracks =Integer.parseInt(args[2]); - int trackType = Integer.parseInt(args[3]); - int water = Integer.parseInt(args[4]); - TrainingGame game = new TrainingGame(player,numberOfTracks,trackType,water); - Server.getLobby(0).addGame(game); - } else if (args[1].equals("challenge")) { // challenge another player - // ("challenge\t" + this.opponentName + "\t" + this.tracksNum + "\t" + this.trackType + "\t" + this.maxStrokes + "\t" + this.timeLimit + - // "\t" + this.waterEvent + "\t" + this.collision + "\t" + this.scoring + "\t" + this.scoringEnd - Challenge c = new Challenge(player); - Player other = Server.getPlayer(Lobby.LOBBY_DUAL, args[2]); - if(other == null || other.equals(player)) { - Conn.writeD(session, Tools.tabularize("lobby", "cfail", "nouser")); - return; - } else if(other.isNotAcceptingChallenges) { - Conn.writeD(session, Tools.tabularize("lobby", "cfail", "nochall")); - return; - } - Challenge c1 = Server.getChallenge(other); - if(c1 != null) { - if(c1.challenged != null && c1.challenged.equals(other)) { - Conn.write(session, Tools.tabularize("lobby", "cfail", "cbyother")); - return; - } else if(c1.challenger != null && c1.challenger.equals(other)) { - Conn.write(session, Tools.tabularize("lobby", "cfail", "cother")); - return; - } else { - c1 = null; - } - } - - c.challenged = other; - int i = 3; - c.numTracks = Integer.parseInt(args[i++]); - c.trackType = Integer.parseInt(args[i++]); - c.maxStrokes = Integer.parseInt(args[i++]); - c.timeLimit = Integer.parseInt(args[i++]); - c.waterEvent = Integer.parseInt(args[i++]); - c.collision = Integer.parseInt(args[i++]); - c.scoring = Integer.parseInt(args[i++]); - c.scoringEnd = Integer.parseInt(args[i++]); - Conn.writeD(session, Tools.tabularize("lobby", "challenge", c.challenger.nick, c.numTracks, - c.trackType, c.maxStrokes, c.timeLimit, c.waterEvent, c.collision, c.scoring, c.scoringEnd)); - Server.addChallenge(c); - } else if(args[1].equals("cancel")) { - Player other = Server.getPlayer(Lobby.LOBBY_DUAL, args[2]); - Challenge c = Server.getChallenge(player); - if(c == null) { - //todo kick etc - return; - } - Conn.writeD(Server.getSession(other), Tools.tabularize("lobby", "cancel")); - Server.removeChallenge(c); - } else if(args[1].equals("cfail")) { - Player other = Server.getPlayer(Lobby.LOBBY_DUAL, args[2]); - if(args[3].equals("refuse")) { - Challenge c = Server.getChallenge(other); - if(c == null) { - //todo kick - return; - } - Conn.writeD(session, Tools.tabularize("lobby", "cfail", "refuse")); - Server.removeChallenge(c); - } else if(args[3].equals("cother")) { - - } else if(args[3].equals("nochall")) { - - } else if(args[3].equals("cbyother")) { - - } - } else if (args[1].equals("cmpt")) { // create multiplayer game - MultiplayerGame game = new MultiplayerGame(player, args); - Lobby l = Server.getLobby(Lobby.LOBBY_MULTI); - l.addGame(game); - l.broadcastD("lobby", "gamelist", "add", game.getLobbyString()); - // lobby gamelist change - - } else if (args[1].equals("jmpt")) { // join existing multiplayer game - //CLIENT> WRITE "d 6 lobby jmpt 1647588 lomad" - Game[] gams = Server.getLobby(Lobby.LOBBY_MULTI).getGames(); - for (int i = 0; i < gams.length; i++) { - MultiplayerGame game = (MultiplayerGame) gams[i]; - if (game.gameId == Integer.parseInt(args[2])) { - String password = null; - if (args.length > 3) { - password = args[3]; - } - - game.addPlayer(player, password); - Server.getLobby(Lobby.LOBBY_MULTI).removePlayer(player); - - - } - } - } else if (args[1].equals("back")) { - for (int i = 0; i < 3; i++) { - Lobby lob = Server.getLobby(i); - if (lob.hasPlayer(player)) { - lob.removePlayer(player); - Conn.writeD(Server.getSession(player), "status", "lobbyselect"); - } - - } - } - - } else if (args[0].equals("game")) { - if (args[1].equals("beginstroke")) { - //beginstroke\t7sw8 - - Game g = getGame(player); - String mouseCoords = args[2]; - g.beginStroke(player, mouseCoords); - - } else if (args[1].equals("endstroke")) { - Game g = getGame(player); - g.endStroke(player, args[3]); - - } else if (args[1].equals("voteskip") || args[1].equals("skip")) { - Game g = getGame(player); - g.voteSkip(player); - - } else if (args[1].equals("newgame")) { - Game g = getGame(player); - g.wantsNewGame(player); - } else if (args[1].equals("back")) { - Game g = getGame(player); - - // im sorry, i hate instanceof too. - if (g instanceof MultiplayerGame) { - MultiplayerGame g2 = (MultiplayerGame) g; - g2.removePlayer(player); - } else { - g.removePlayer(player); - } - - Lobby l = Server.getLobby(g.getLobbySource()); - if (g.isEmpty()) { - System.out.println("is it really empty?"); - l.removeGame(g); - // once again bit messy at the moment, cba to make nice - if (g instanceof MultiplayerGame) { - MultiplayerGame g2 = (MultiplayerGame) g; - g2.removeGameFromLobby(); - } - } - l.addPlayer(player); - } - - - } - } - - public Game getGame(Player p) { - for (int i = 0; i < 3; i++) { - Game yup = Server.getLobby(i).getGame(p); - if (yup != null) { - return yup; - } - } - return null; diff --git a/doc/old_lobby.java b/doc/old_lobby.java deleted file mode 100644 index bf38906d..00000000 --- a/doc/old_lobby.java +++ /dev/null @@ -1,129 +0,0 @@ -package org.server; - -import org.server.game.gametypes.Game; -import org.server.game.MultiplayerGame; - -import java.util.ArrayList; -import java.util.List; - -/** - * Playforia - * 30.5.2013 - */ -public class Lobby { - - public static final int LOBBY_SINGLE = 0; - public static final int LOBBY_DUAL = 1; - public static final int LOBBY_MULTI = 2; - private List players; - private List games; - private int id; - - public Lobby(int id) { - this.id = id + 1; // not sure why this must be +1, but it must! - players = new ArrayList(); - games = new ArrayList(); - } - - public int numPlayersInLobby() { - return players.size(); - } - - public int numPlayersInGame() { - int count = 0; - for (Game g : games) { - count += g.players.size(); - } - return count; - } - - public Player[] getPlayers() { - return players.toArray(new Player[0]); - } - - public void addPlayer(Player player) { - Session session = Server.getSession(player); - if (!players.contains(player)) - players.add(player); - Conn.writeD(session, "status", "lobby", id); - //Conn.writeD(session, "numberofusers", 1, 2, 3, 4, 5, 6); - // lobbySingle, ingameSingle, lobbyDual, ingameDual, lobbyMulti, ingameMulti - - - Player[] lobbyPlayers = getPlayers(); - String[] lobbyPlayersData = new String[lobbyPlayers.length]; - int pointer = 0; - for (int i = 0; i < lobbyPlayers.length; i++) { - if (lobbyPlayers[i] != null && !lobbyPlayers[i].equals(player)) { - lobbyPlayersData[pointer++] = lobbyPlayers[i].toString(); - Session ps = Server.getSession(lobbyPlayers[i]); - Conn.writeD(ps, "lobby", "join", player.toString()); - } - } - if (lobbyPlayersData != null && lobbyPlayersData.length > 0 && lobbyPlayersData[0] != null) - Conn.writeD(session, "lobby", "users", lobbyPlayersData); - Conn.writeD(session, "lobby", "ownjoin", player.toString()); - Conn.writeD(session, "lobby", "serversay", "serversay"); - Conn.writeD(session, "lobby", "sheriffsay", "sheriffsay"); - - if (id == 3) { - Game[] games = getGames(); - String[] gameString = new String[games.length]; - StringBuffer buff = new StringBuffer(); - int length = 0; - for (int i = 0; i < gameString.length; i++) { - MultiplayerGame g = (MultiplayerGame) games[i]; - if (g.isPublic()) { - buff.append(g.getLobbyString() + "\t"); - length++; - } - } - - Conn.writeD(session, "lobby", "gamelist", "full", length, buff.toString()); - } - - } - - public void removePlayer(Player p) { - broadcastD("lobby", "part", p.nick, 3); - players.remove(p); - } - - public int numGames() { - return games.size(); - } - - public Game[] getGames() { - return games.toArray(new Game[0]); - } - - public void addGame(Game g) { - if (!games.contains(g)) - games.add(g); - } - - public void removeGame(Game g) { - g.removeGame(); - games.remove(g); - } - - public Game getGame(Player p) { - for (Game g : games) - if (g.hasPlayer(p)) - return g; - return null; - } - - public boolean hasPlayer(Player player) { - for (Player p : players) - if (p.equals(player)) - return true; - return false; - } - - public void broadcastD(Object... data) { - for (Player p : players) { - Conn.writeD(Server.getSession(p), data); - } - } -} diff --git a/doc/old_multigame.java b/doc/old_multigame.java deleted file mode 100644 index 0c38e687..00000000 --- a/doc/old_multigame.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.server.game; - -import org.server.*; - -import java.util.Arrays; - -/** - * MULTIPLAYER init!11 - */ -public class MultiplayerGame extends Game { - - - public String name; - public String password; - public int playerCount; - public int numberOfTracks; - public int trackType; - public int maxStrokes; - public int strokeTimeout; - public int water; - public int collision; - public int scoreSystem; - public int weightEnd; - private boolean isPublic = true; - private boolean passworded; - private Player creator; - - - public MultiplayerGame(Player p, String[] values) { - super(Lobby.LOBBY_MULTI); - creator = p; - this.name = values[2]; - this.password = values[3]; - passworded = (!(this.password.equals("-") || this.password.equals(""))); - this.playerCount = Integer.parseInt(values[5]); - this.numberOfTracks = Integer.parseInt(values[6]); - this.trackType = Integer.parseInt(values[7]); - this.maxStrokes = Integer.parseInt(values[8]); - this.strokeTimeout = Integer.parseInt(values[9]); - this.water = Integer.parseInt(values[10]); - this.collision = Integer.parseInt(values[11]); - this.scoreSystem = Integer.parseInt(values[12]); - this.weightEnd = Integer.parseInt(values[13]); - initTracks(); - this.addPlayer(p, password); // must put pass or wrong method is called. - } - - public String getLobbyString() { - // CLIENT> READ "d 82 lobby gamelist full 2 1624968 #1624968 t 0 3 -1 10 1 20 60 0 1 0 0 1 1624960 #1624960 t 0 3 -1 10 1 20 60 0 1 0 0 1" - - return Tools.tabularize(gameId, name, passworded ? "t" : "f", 0, - playerCount, -1, numberOfTracks, trackType, maxStrokes, strokeTimeout, - water, collision, scoreSystem, weightEnd, players.size()); - } - - public boolean isPublic() { - return isPublic; - } - - - @Override - protected void initTracks() { - if((creator.elevation == 2 && trackType == 10) || (creator.elevation < 2 && trackType == 7)) { - tracks = TrackStore.getRandomTrackSet(numberOfTracks, 10); - } - else { - tracks = TrackStore.getRandomTrackSet(numberOfTracks, trackType); - } - } - - public boolean addPlayer(Player p, String pass) { - Lobby lobby = Server.getLobby(this.lobbySource); - - if (passworded && (!pass.equals(this.password))) { - lobby.addPlayer(p); // LOL YOU GOT THE PASSWORD WRONG BACK TO THE LOBBY U GO - return false; - - } else { // correct password or no password - broadcastD("game", "join", players.size(), p.nick, "-"); // important this happens before players added. - super.addPlayer(p); - welcomeMessage(p); - - if (players.size() > 1) { // if this is not the first player, update list. - lobby.broadcastD("lobby", "gamelist", "change", getLobbyString()); - } - - if (playerCount == players.size()) { // if game filled up, start!! - startGame(); - } - return true; - } - } - - - protected void startGame() { - removeGameFromLobby(); - broadcastD("game", "start"); - StringBuffer buff = new StringBuffer(); - for (int i = 0; i < players.size(); i++) { - buff.append("t"); - } - - broadcastD("game", "starttrack", buff.toString(),gameId, tracks[0]); - broadcastD("game", "startturn", 0); - } - - private void welcomeMessage(Player p) { - Session session = Server.getSession(p); - Conn.writeD(session, "status", "game"); - Conn.writeD(session, "game", "gameinfo", name, "t", gameId, playerCount, - numberOfTracks, trackType, maxStrokes, strokeTimeout, water, collision, scoreSystem, weightEnd, "f"); - String[] multiplier = new String[numberOfTracks]; - Arrays.fill(multiplier, "1"); - Conn.writeD(session, "game", "scoringmulti", Tools.tabularize(multiplier, "")); - Conn.writeD(session, "game", "players"); - for (int i = 0; i < players.size(); i++) { - Conn.writeD(session, "game", "owninfo", i, players.get(i).nick, "-"); - } - } - - public void removePlayer(Player p) { - int id = -1; - for (int i = 0; i < players.size(); i++) { - if (players.get(i).equals(p)) { - id = i; - } - } - super.removePlayer(p); - if (id != -1) { - broadcastD("game", "part", id, 4); - - if (!isPublic) { // if the game is being played, just pick the first player to shoot. - broadcastD("game", "startturn", playersNumber.get(0)); - } - } - } - - public void removeGameFromLobby() { - isPublic = false; - Server.getLobby(this.lobbySource).broadcastD("lobby", "gamelist", "remove", gameId); - } - -} diff --git a/doc/old_parseMapInstruction.java b/doc/old_parseMapInstruction.java deleted file mode 100644 index 65075150..00000000 --- a/doc/old_parseMapInstruction.java +++ /dev/null @@ -1,195 +0,0 @@ -String line = tknzr.nextToken(); -if (!line.startsWith("V ")) {// "V 1" - return false; -} else if (Integer.parseInt(line.substring(2)) != 1) {// if not "V 1" - return false; -} else { - line = tknzr.nextToken(); - if (!line.startsWith("A ")) {// "A author name" - return false; - } else { - this.author = line.substring(2).trim(); - if (this.author.length() == 0) { - return false; - } else { - line = tknzr.nextToken(); - if (!line.startsWith("N ")) {// "N trakc name" - return false; - } else { - this.trackName = line.substring(2).trim(); - if (this.trackName.length() == 0) { - return false; - } else { - line = tknzr.nextToken(); - if (line.startsWith("C ")) {// "C ???" todo - this.aString88 = line.substring(2).trim(); - line = tknzr.nextToken(); - } else { - this.aString88 = null; - } - - if (!line.startsWith("T ")) {// "T track data,Ads:xxx" - return false; - - } else { - - /** - * - * The below is the map parsing shit - * firstly the input map is "expanded", any letter preceeding by a number is duplicated that number times. - * If input letter is A,B,C, the letter + the next three are concatenated into one int (4 * bytes) - * If input letters are D,E,F,G,H,I, the current tile is exactly the same as an adjacent one so - * one is selected, depending on the input letter. - * - * - */ - String mapData = line.substring(2); - - StringTokenizer tokenizer = new StringTokenizer(mapData, ","); - mapData = this.expandMap(tokenizer.nextToken()); - int cursorIndex = 0; - - int tileX; - for (int tileY = 0; tileY < 25; ++tileY) { - for (tileX = 0; tileX < 49; ++tileX) { - - int currentMapIndex = mapChars.indexOf(mapData.charAt(cursorIndex)); - - if (currentMapIndex <= 2) { // if input= A,B or C - int mapcursor_one_ahead; - int mapcursor_two_ahead; - int mapcursor_three_ahead; - - if (currentMapIndex == 1) { // if input = B. - mapcursor_one_ahead = mapChars.indexOf(mapData.charAt(cursorIndex + 1)); - mapcursor_two_ahead = mapChars.indexOf(mapData.charAt(cursorIndex + 2)); - mapcursor_three_ahead = mapChars.indexOf(mapData.charAt(cursorIndex + 3)); - cursorIndex += 4; - } else { // if input = A or C - mapcursor_one_ahead = mapChars.indexOf(mapData.charAt(cursorIndex + 1)); - mapcursor_two_ahead = mapChars.indexOf(mapData.charAt(cursorIndex + 2)); - mapcursor_three_ahead = 0; - cursorIndex += 3; - } - - // (currentMapIndex << 24) + (mapcursor_one_ahead << 16) + (mapcursor_two_ahead << 8) + mapcursor_three_ahead; - this.mapTiles[tileX][tileY] = currentMapIndex * 256 * 256 * 256 + mapcursor_one_ahead * 256 * 256 + mapcursor_two_ahead * 256 + mapcursor_three_ahead; - } else { - if (currentMapIndex == 3) { // if input = D - this.mapTiles[tileX][tileY] = this.mapTiles[tileX - 1][tileY]; // tile to west is same as current - } - - if (currentMapIndex == 4) { // if input = E; - this.mapTiles[tileX][tileY] = this.mapTiles[tileX][tileY - 1]; // tile to the north is same as current - } - - if (currentMapIndex == 5) { // if input = F; - this.mapTiles[tileX][tileY] = this.mapTiles[tileX - 1][tileY - 1]; // tile to the northwest is same as current - } - - if (currentMapIndex == 6) { // if input = G; - this.mapTiles[tileX][tileY] = this.mapTiles[tileX - 2][tileY]; // 2 tiles west is same as current (skip a tile to the left) - } - - if (currentMapIndex == 7) { // if input = H - this.mapTiles[tileX][tileY] = this.mapTiles[tileX][tileY - 2]; // 2 tiles north is same as current (skip the tile above) - } - - if (currentMapIndex == 8) { // if input= I - this.mapTiles[tileX][tileY] = this.mapTiles[tileX - 2][tileY - 2]; // 2 tiles northwest is same as current (skip the diagonal) - } - - ++cursorIndex; - } - } - } - - for (tileX = 0; tileX < advertSize; ++tileX) { - this.anIntArrayArray97[tileX][0] = this.anIntArrayArray97[tileX][1] = -1; - } - - int var12; - int var14; - if (tokenizer.hasMoreTokens()) { - mapData = tokenizer.nextToken(); - if (!mapData.startsWith("Ads:")) { - return false; - } - - mapData = mapData.substring(4); - var12 = mapData.length() / 5; - - for (int var13 = 0; var13 < var12; ++var13) { - var14 = mapChars.indexOf(mapData.charAt(var13 * 5)); - this.anIntArrayArray97[var14][0] = Integer.parseInt(mapData.substring(var13 * 5 + 1, var13 * 5 + 3)); - this.anIntArrayArray97[var14][1] = Integer.parseInt(mapData.substring(var13 * 5 + 3, var13 * 5 + 5)); - } - } - - this.aString89 = aString77; - this.firstBestPar = this.lastBestPar = null; - this.trackStokesRecord = null; - this.briefRatings = null; - - while (tknzr.hasMoreTokens()) { - mapData = tknzr.nextToken(); - if (mapData.startsWith("S ")) { - this.aString89 = mapData.substring(2).trim(); - if (this.aString89.length() != 6) { - return false; - } - } - - StringTokenizer var15; - if (mapData.startsWith("I ")) { - var15 = new StringTokenizer(mapData.substring(2), ","); - if (var15.countTokens() != 4) { - return false; - } - - this.trackStokesRecord = new int[4]; - - for (var14 = 0; var14 < 4; ++var14) { - this.trackStokesRecord[var14] = Integer.parseInt(var15.nextToken()); - } - } - - if (mapData.startsWith("B ")) { - this.firstBestPar = mapData.substring(2); - } - - if (mapData.startsWith("L ")) { - this.lastBestPar = mapData.substring(2); - } - - if (mapData.startsWith("R ")) { - var15 = new StringTokenizer(mapData.substring(2), ","); - if (var15.countTokens() != 11) { - return false; - } - - this.briefRatings = new int[11]; - - for (var14 = 0; var14 <= 10; ++var14) { - this.briefRatings[var14] = Integer.parseInt(var15.nextToken()); - } - } - } - - this.aBooleanArray96 = new boolean[4]; - - for (var12 = 0; var12 < 4; ++var12) { - this.aBooleanArray96[var12] = this.aString89.charAt(var12) == 116; - } - - this.checkSolids(); - this.drawForegroundMap(); - return true; - } - - - } - } - } - } -} diff --git a/doc/old_player.java b/doc/old_player.java deleted file mode 100644 index 3a04326c..00000000 --- a/doc/old_player.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.server; - -import java.util.Random; - -/** - * Playforia - * 30.5.2013 - */ -public class Player { - - private static final Random random = new Random(); - public static final int ELEV_NORMAL = 0; - public static final int ELEV_SHERIFF = 1; - public static final int ELEV_ADMIN = 2; - public String nick; - public String locale; - public String profilePage; - public String avatarUrl; - public int elevation; - public int points; - public boolean isEmailVerified; - public boolean isRegistered; - public boolean isVip; - public boolean isSheriff; - public boolean isNotAcceptingChallenges; - - public Player(String locale) { - this("mopar" + random.nextInt(10000), locale); - } - - public Player(String nick, String locale) { - this.nick = nick; - this.locale = locale; - profilePage = "-"; - avatarUrl = "-"; - isRegistered = true; - isVip = false; - isSheriff = false; - isEmailVerified = true; - elevation = ELEV_NORMAL; - points = 0; - } - - @Override - public boolean equals(Object o) { - if(!(o instanceof Player)) - return false; - Player p = (Player) o; - return nick.equals(p.nick) && points == p.points && locale.equals(p.locale); - } - - @Override - public String toString() { - String tmp = ""; - if(isRegistered) - tmp += "r"; - if(isVip) - tmp += "v"; - if(isSheriff) - tmp += "s"; - if(isNotAcceptingChallenges) - tmp += "n"; - Object[] arr = new Object[] {"3:" + nick, tmp, points, locale, profilePage, avatarUrl}; - return Tools.triangelize(arr); - } -} diff --git a/doc/old_traininggame.java b/doc/old_traininggame.java deleted file mode 100644 index 2c9dcb85..00000000 --- a/doc/old_traininggame.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.server.game; - -import org.server.Lobby; -import org.server.Player; -import org.server.TrackStore; - -/** - * single player training game - */ -public class TrainingGame extends Game { - - private int tracksType; - private int noOfTracks; - private int water; - private int permission; - private int maxStrokes; - private int strokeTimeout; - private int collision; - private int scoring; - private int scoringEnd; - - public TrainingGame(Player p, int noOfTracks, int trackTypes, int water) { - super(Lobby.LOBBY_SINGLE); - addPlayer(p); - this.noOfTracks = noOfTracks; - this.tracksType = trackTypes; - this.water = water; - permission = PERM_EVERYONE; - maxStrokes = STROKES_UNLIMITED; - strokeTimeout = STROKETIMEOUT_INFINITE; - collision = COLLISION_YES; - scoring = SCORING_STROKE; - scoringEnd = SCORING_WEIGHT_END_NONE; - initTracks(); - startGame(); - } - - @Override - protected void initTracks() { - if((players.get(0).elevation == 2 && tracksType == 10) || (players.get(0).elevation < 2 && tracksType == 7)) { - tracks = TrackStore.getRandomTrackSet(noOfTracks, 10); - } - else { - tracks = TrackStore.getRandomTrackSet(noOfTracks, tracksType); - } - } - - @Override - protected void startGame() { - broadcastD("status", "game"); - broadcastD("game", "gameinfo", "Single Moms In Your Area", "f", permission, 1, tracks.length, tracksType, - maxStrokes, strokeTimeout, water, collision, scoring, scoringEnd, "f"); - broadcastD("game", "players"); - for (int i = 0; i < players.size(); i++) { - broadcastD("game", "owninfo", i, players.get(i).nick, "-"); - } - broadcastD("game", "start"); - broadcastD("game", "starttrack", "t", gameId, tracks[0]); - broadcastD("game", "startturn", 0); - } - - -} diff --git a/doc/storygolf.html b/doc/storygolf.html deleted file mode 100644 index 3e3875b3..00000000 --- a/doc/storygolf.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/tracksets.txt b/doc/tracksets.txt deleted file mode 100644 index f6d82297..00000000 --- a/doc/tracksets.txt +++ /dev/null @@ -1,211 +0,0 @@ -Birchwood - Easy -Leonardo-Leobas_1 -Tiikoni-Removable_Wall -Leonardo-Simple_Triple -Ennaji-Watertank_run -Leonardo-Garapalou -Leonardo-Two_Bridges -Tiikoni-Wormhole -Leonardo-Trip_to_Basement -Leonardo-Virtuoso_Bridges - 1 Leonardo - Leobas 1 - 2 Tiikoni - Removable Wall - 3 Leonardo - Simple Triple - 4 Ennaji - Watertank run - 5 Leonardo - Garapalou - 6 Leonardo - Two Bridges - 7 Tiikoni - Wormhole - 8 Leonardo - Trip to Basement - 9 Leonardo - Virtuoso Bridges - -Oak Park - Easy -Tiikoni-Barrier_III -Leonardo-Basic_Z_2 -Tiikoni-Oval_I -Leonardo-Amdazou -Tiikoni-Lower_V -Hoeg-Miniaturica -Leonardo-Monday_Hogback -Aither-Four_Rooms -Tiikoni-Speedy -Leonardo-Rood -Leonardo-Basic_Z_1 -Leonardo-Zab_2 -Tiikoni-Sandwall -Leonardo-Mud_Cisterns -Tiikoni-Flume -Leonardo-The_lake_and_the_river -Leonardo-Mi_Bo -Darwin-Darwin_s_road_II - 1 Tiikoni - Barrier III - 2 Leonardo - Basic Z-2 - 3 Tiikoni - Oval I - 4 Leonardo - Amdazou - 5 Tiikoni - Lower V - 6 Hoeg - Miniaturica - 7 Leonardo - Monday Hogback - 8 Tiikoni - Four Rooms - 9 Tiikoni - Speedy - 10 Leonardo - Rood - 11 Leonardo - Basic Z-1 - 12 Leonardo - Zab 2 - 13 Tiikoni - Sandwall - 14 Leonardo - Mud Cisterns - 15 Tiikoni - Flume - 16 Leonardo - The lake and the river - 17 Leonardo - Mi-Bo - 18 Darwin - Darwin's road II - -The First - Medium -Tiikoni-Curve_I -Leonardo-Barb_II -Tiikoni-Oval_III -Tiikoni-Bridgebuilder -Leonardo-Sand_Stripe -Tiikoni-Hopper -Leonardo-Real_Pro_s_7_Strokes -Ennaji-8_rooms -Leonardo-Resemble_of_T_B_ -Tiikoni-Barrier_I -Tiikoni-Magnetic_Aid -Ennaji-Icy_cavern -Tiikoni-Over_and_Up -Tiikoni-Returns -Leonardo-Triple_Crossing -Tiikoni-Two_Ways -Leonardo-Try_it -Tiikoni-Uphill_I - 1 Tiikoni - Curve I - 2 Leonardo - Barb II - 3 Tiikoni - Oval III - 4 Tiikoni - Bridgebuilder - 5 Leonardo - Sand Stripe - 6 Tiikoni - Hopper - 7 Leonardo - Real Pro's 7 Strokes - 8 Ennaji - 8 rooms - 9 Leonardo - Resemble of T.B. - 10 Tiikoni - Barrier I - 11 Tiikoni - Magnetic Aid - 12 Ennaji - Icy cavern - 13 Tiikoni - Over and Up - 14 Tiikoni - Returns - 15 Leonardo - Triple Crossing - 16 Tiikoni - Two Ways - 17 Leonardo - Try it - 18 Tiikoni - Uphill I - -Spruce Corpse - Medium -Darwin-Three_hills -Leonardo-Updo -Leonardo-Kim_Dim -Leonardo-Well_stairs -Tiikoni-Continents -Leonardo-Drobri -Dante-Waterway -Leonardo-Six_bends -Leonardo-Gurus_do_it_better - 1 Darwin - Three hills - 2 Leonardo - Updo - 3 Leonardo - Kim-Dim - 4 Leonardo - Well stairs - 5 Tiikoni - Continents - 6 Leonardo - Drobri - 7 Dante - Waterway - 8 Leonardo - Six bends - 9 Leonardo - Gurus do it better - -One by One - Medium -Leonardo-1_stroke__4_bounces -Dante-Room_Worm -SuperGenuis-Too_easy_too -Tiikoni-Downhill -ConTrick-Tea_for_irish -Zwan-Wohwonk -Dante-Drop_it -Leonardo-Stopper -Dante-Ice_Bounce -Darwin-Narrow_bridges -Dante-ArmChair -Leonardo-Go_go_go -SuperGenuis-Worm -Dante-Keep_on_track -Tiikoni-Leaps -Zwan-Rebound_goal -Enygma-There_and_back -Dante-Traditional_bounce - 1 Leonardo - 1 stroke, 4 bounces - 2 Dante - Room Worm - 3 SuperGenius - Too easy too - 4 Tiikoni - Downhill - 5 ConTrick - Tea for irish - 6 Zwan - Wohwonk - 7 Dante - Drop it - 8 Leonardo - Stopper - 9 Dante - Ice Bounce - 10 Darwin - Narrow bridges - 11 Dante - ArmChair - 12 Leonardo - Go go go - 13 SuperGenuis - Worm - 14 Dante - Keep on track - 15 Tiikoni - Leaps - 16 Zwan - Rebound goal - 17 Leonardo - There and back - 18 Dante - Traditional bounce - -Scary Set - Hard -Leonardo-Dream_of_Six_Strokes -Tiikoni-Acid_Way -Leonardo-KGB_s_wish -Tiikoni-Minimum_Possibility -Leonardo-Risky_Business -Darwin-Ruins_of_the_tempel -Leonardo-Abstemiously_Dangerous -Tiikoni-Leaking_Spiral -Leonardo-Tube_of_Death - 1 Leonardo - Dream of Six Strokes - 2 Tiikoni - Acid Way - 3 Leonardo - KGB's wish - 4 Tiikoni - Minimum Possibility - 5 Leonardo - Risky Business - 6 Darwin - Ruins of the tempel - 7 Leonardo - Abstemiously Dangerous - 8 Tiikoni - Leaking Spiral - 9 Leonardo - Tube of Death - -Torment Fields - Hard -Leonardo-Revocations -Dante-Bridges -Leonardo-Jump_to_the_elevator -Leonardo-Dream_of_Four_Strokes -Leonardo-Walls___Waters -Zwan-Hillocky -Tiikoni-Mean -Leonardo-Jacke_s_Dream -Hoeg-Raffle_Imposition -Zwan-No_man_s_land -Leonardo-Dui_Hui -Dante-Swiftly_repeating_myself -Leonardo-Advance_d_ -Tiikoni-Pipe -Zwan-Tribulation -Leonardo-Skills_and_Snares -Zwan-Acid_Floor -Zwan-Wararumbel - 1 Leonardo - Revocations - 2 Dante - Bridges - 3 Leonardo - Jump to the elevator - 4 Leonardo - Dream of Four Strokes - 5 Leonardo - Walls & Waters - 6 Zwan - Hillocky - 7 Tiikoni - Mean - 8 Leonardo - Jacke's Dream - 9 Hoeg - Raffle Imposition - 10 Zwan - No man's land - 11 Leonardo - Dui-Hui - 12 Dante - Swiftly repeating myself - 13 Leonardo - Advance(d) - 14 Tiikoni - Pipe - 15 Zwan - Tribulation - 16 Leonardo - Skills and Snares - 17 Zwan - Acid Floor - 18 Zwan - Wararumbel diff --git a/server/src/main/java/org/moparforia/server/game/Game.java b/server/src/main/java/org/moparforia/server/game/Game.java index 2715a9ae..9840e381 100644 --- a/server/src/main/java/org/moparforia/server/game/Game.java +++ b/server/src/main/java/org/moparforia/server/game/Game.java @@ -10,10 +10,6 @@ import java.util.ArrayList; import java.util.regex.Matcher; -/** - * Playforia - * 11.6.2013 - */ public abstract class Game extends PlayerCollection { protected final int gameId; diff --git a/server/src/main/java/org/moparforia/server/game/GameType.java b/server/src/main/java/org/moparforia/server/game/GameType.java index dbd3160a..2d0c10fb 100644 --- a/server/src/main/java/org/moparforia/server/game/GameType.java +++ b/server/src/main/java/org/moparforia/server/game/GameType.java @@ -1,9 +1,5 @@ package org.moparforia.server.game; -/** - * Playforia - * 24.6.2013 - */ public enum GameType { GOLF(35), GOLF2(14), CANNONS(24), POOL(41);//, DRAW(16) diff --git a/server/src/main/java/org/moparforia/server/game/Lobby.java b/server/src/main/java/org/moparforia/server/game/Lobby.java index de3719e3..d3cf9601 100644 --- a/server/src/main/java/org/moparforia/server/game/Lobby.java +++ b/server/src/main/java/org/moparforia/server/game/Lobby.java @@ -8,10 +8,6 @@ import java.util.ArrayList; import java.util.HashMap; -/** - * Playforia - * 11.6.2013 - */ public class Lobby extends PlayerCollection { public static final int PART_REASON_STARTED_SP = 1; // todo: enum this ? diff --git a/server/src/main/java/org/moparforia/server/game/LobbyRef.java b/server/src/main/java/org/moparforia/server/game/LobbyRef.java deleted file mode 100644 index ea5afdcd..00000000 --- a/server/src/main/java/org/moparforia/server/game/LobbyRef.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.moparforia.server.game; - -/** - * Playforia - * 24.6.2013 - */ -public class LobbyRef { - - private GameType gameType; - private LobbyType lobbyType; - private Lobby lobby; - - public LobbyRef(GameType gameType, LobbyType lobbyType, Lobby lobby) { - this.gameType = gameType; - this.lobbyType = lobbyType; - this.lobby = lobby; - } - - public GameType getGameType() { - return gameType; - } - - public LobbyType getLobbyType() { - return lobbyType; - } - - public Lobby getLobby() { - return lobby; - } -} diff --git a/server/src/main/java/org/moparforia/server/net/PacketType.java b/server/src/main/java/org/moparforia/server/net/PacketType.java index da0b62d7..6e4f4fda 100644 --- a/server/src/main/java/org/moparforia/server/net/PacketType.java +++ b/server/src/main/java/org/moparforia/server/net/PacketType.java @@ -1,9 +1,5 @@ package org.moparforia.server.net; -/** - * Playforia - * 11.6.2013 - */ public enum PacketType { DATA, STRING, COMMAND, NONE } diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/ChatHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/ChatHandler.java index f79ab5de..37265879 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/ChatHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/ChatHandler.java @@ -12,10 +12,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 13.6.2013 - */ public class ChatHandler implements PacketHandler { @Override public PacketType getType() { diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/GameHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/GameHandler.java index dbbc4d13..ff7f92be 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/GameHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/GameHandler.java @@ -10,10 +10,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 12.6.2013 - */ public class GameHandler implements PacketHandler { @Override public PacketType getType() { diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyCreateSinglePlayerHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyCreateSinglePlayerHandler.java index 23afc780..1e13fa66 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyCreateSinglePlayerHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyCreateSinglePlayerHandler.java @@ -11,10 +11,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 13.6.2013 - */ public class LobbyCreateSinglePlayerHandler implements PacketHandler { @Override public PacketType getType() { diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyDualplayerHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyDualplayerHandler.java index e2501305..323258e9 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyDualplayerHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyDualplayerHandler.java @@ -12,10 +12,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 24.6.2013 - */ public class LobbyDualplayerHandler implements PacketHandler { @Override public PacketType getType() { diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyHandler.java index 65db4f6d..8dda2529 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbyHandler.java @@ -16,10 +16,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 12.6.2013 - */ public class LobbyHandler implements PacketHandler { private static final TrackManager manager = FileSystemTrackManager.getInstance(); diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbySelectHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbySelectHandler.java index 5de96283..cb53da20 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbySelectHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LobbySelectHandler.java @@ -12,10 +12,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 11.6.2013 - */ public class LobbySelectHandler implements PacketHandler { public PacketType getType() { @@ -29,7 +25,7 @@ public Pattern getPattern() { @Override public boolean handle(Server server, Packet packet, Matcher message) { - if (message.group(1).equals("rnop")) { + if (message.group(1).equals("rnop")) { // request number of players packet.getChannel().writeAndFlush("d lobbyselect\tnop\t" + Tools.tabularize(server.getLobby(LobbyType.SINGLE).totalPlayerCount(), server.getLobby(LobbyType.DUAL).totalPlayerCount(), server.getLobby(LobbyType.MULTI).totalPlayerCount())); } else if (message.group(1).equals("select")) { // 1 for single, 1h for single hidden chat, 2 for dual, x for multi diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LoginHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LoginHandler.java index 020a1f0f..1ae1ec89 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LoginHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LoginHandler.java @@ -10,10 +10,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 11.6.2013 - */ public class LoginHandler implements PacketHandler { @Override public PacketType getType() { diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LoginTypeHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LoginTypeHandler.java index 5164e9b1..bd1a9e30 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LoginTypeHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/LoginTypeHandler.java @@ -9,10 +9,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 11.6.2013 - */ public class LoginTypeHandler implements PacketHandler { @Override public PacketType getType() { diff --git a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/TrackTestLoginHandler.java b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/TrackTestLoginHandler.java index e076c743..c492d41d 100644 --- a/server/src/main/java/org/moparforia/server/net/packethandlers/golf/TrackTestLoginHandler.java +++ b/server/src/main/java/org/moparforia/server/net/packethandlers/golf/TrackTestLoginHandler.java @@ -11,10 +11,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * Playforia - * 13.6.2013 - */ public class TrackTestLoginHandler implements PacketHandler { Pattern namePattern; diff --git a/shared/src/main/java/org/moparforia/shared/tracks/TrackCategory.java b/shared/src/main/java/org/moparforia/shared/tracks/TrackCategory.java index 134e5703..360ce797 100644 --- a/shared/src/main/java/org/moparforia/shared/tracks/TrackCategory.java +++ b/shared/src/main/java/org/moparforia/shared/tracks/TrackCategory.java @@ -1,9 +1,5 @@ package org.moparforia.shared.tracks; -/** - * Playforia - * 18.6.2013 - */ public enum TrackCategory { UNKNOWN("?", -1), diff --git a/shared/src/main/java/org/moparforia/shared/tracks/TrackSet.java b/shared/src/main/java/org/moparforia/shared/tracks/TrackSet.java index 1adad433..e2f4e298 100644 --- a/shared/src/main/java/org/moparforia/shared/tracks/TrackSet.java +++ b/shared/src/main/java/org/moparforia/shared/tracks/TrackSet.java @@ -2,10 +2,6 @@ import java.util.List; -/** - * Playforia - * 18.6.2013 - */ public class TrackSet { private String name; diff --git a/shared/src/main/java/org/moparforia/shared/tracks/TrackSetDifficulty.java b/shared/src/main/java/org/moparforia/shared/tracks/TrackSetDifficulty.java index 7239c732..87e9352e 100644 --- a/shared/src/main/java/org/moparforia/shared/tracks/TrackSetDifficulty.java +++ b/shared/src/main/java/org/moparforia/shared/tracks/TrackSetDifficulty.java @@ -1,9 +1,5 @@ package org.moparforia.shared.tracks; -/** - * Playforia - * 18.6.2013 - */ public enum TrackSetDifficulty { EASY(1), MEDIUM(2), HARD(3);