From 1d967633147acf51a424e76f40573c7eaf0e2309 Mon Sep 17 00:00:00 2001 From: Sten Laane <21343173+StenAL@users.noreply.github.com> Date: Tue, 2 Jan 2024 22:22:04 +0200 Subject: [PATCH] Delete unused code from com.aapeli package This deletes ~7400 lines of unused code, making the project easier to reason about and develop. Almost all of these classes are never referenced in code accessible by the minigolf client, with two exceptions: - Product is referenced in AApplet.java in some methods that are never called; these methods were also removed - AutoPopups.java references Class85, however the field storing an instance is never initialized so it's always null. This field was removed. --- .../main/java/com/aapeli/applet/AApplet.java | 48 - .../java/com/aapeli/client/ApajaGames.java | 115 -- .../java/com/aapeli/client/AutoPopups.java | 7 - .../main/java/com/aapeli/client/Badge.java | 80 -- .../java/com/aapeli/client/BadgeHandler.java | 123 -- .../com/aapeli/client/CharacterImage.java | 340 ----- .../main/java/com/aapeli/client/Class85.java | 67 - .../com/aapeli/client/ClipPlaybackTask.java | 21 - .../com/aapeli/client/Frame_Sub3_Sub2.java | 36 - .../java/com/aapeli/client/IPanel_Sub41.java | 78 -- .../java/com/aapeli/client/KeyButton.java | 236 ---- .../main/java/com/aapeli/client/Match.java | 207 --- .../com/aapeli/client/NeedAccountFrame.java | 34 - .../java/com/aapeli/client/NickTextField.java | 106 -- .../java/com/aapeli/client/Panel_Sub23.java | 134 -- .../java/com/aapeli/client/PersonalScore.java | 67 - .../com/aapeli/client/PersonalScoreUnit.java | 37 - .../java/com/aapeli/client/SoundPlayer.java | 117 -- .../java/com/aapeli/client/Tournament.java | 115 -- .../com/aapeli/client/UrlLabelRegister.java | 12 - .../com/aapeli/colorgui/KeyboardButton.java | 182 --- .../java/com/aapeli/colorgui/ProgressBar.java | 218 --- .../com/aapeli/credit/BuyCreditsHandler.java | 7 - .../java/com/aapeli/credit/Canvas_Sub9.java | 278 ---- .../main/java/com/aapeli/credit/Class101.java | 34 - .../main/java/com/aapeli/credit/Class102.java | 44 - .../main/java/com/aapeli/credit/Class103.java | 34 - .../java/com/aapeli/credit/IPanel_Sub42.java | 334 ----- .../main/java/com/aapeli/credit/Product.java | 87 -- .../com/aapeli/credit/ProductHandler.java | 121 -- .../java/com/aapeli/credit/PurchaseFrame.java | 236 ---- .../com/aapeli/credit/PurchaseHandler.java | 12 - .../java/com/aapeli/multiuser/ChatGame.java | 351 ----- .../aapeli/multiuser/ChatGameListener.java | 9 - .../java/com/aapeli/multiuser/ChatSimple.java | 143 -- .../com/aapeli/multiuser/QuitConfirm.java | 194 --- .../com/aapeli/multiuser/QuitHandler.java | 9 - .../java/com/aapeli/order/OrderCanvas.java | 131 -- .../java/com/aapeli/order/OrderFrame.java | 187 --- .../java/com/aapeli/order/OrderHandler.java | 9 - .../com/aapeli/settingsgui/GuiListener.java | 9 - .../aapeli/settingsgui/GuiListenerExt.java | 10 - .../settingsgui/LobbyRoomSettingsPanel.java | 343 ----- .../java/com/aapeli/settingsgui/Rule.java | 38 - .../java/com/aapeli/settingsgui/Unit.java | 138 -- .../com/aapeli/settingsgui/UnitButton.java | 51 - .../com/aapeli/settingsgui/UnitCheckbox.java | 64 - .../aapeli/settingsgui/UnitCheckboxGroup.java | 93 -- .../com/aapeli/settingsgui/UnitChoice.java | 90 -- .../java/com/aapeli/settingsgui/UnitData.java | 35 - .../com/aapeli/settingsgui/UnitLabel.java | 66 - .../com/aapeli/settingsgui/UnitSpace.java | 22 - .../com/aapeli/settingsgui/UnitTextField.java | 70 - .../com/aapeli/singleclient/Class105.java | 87 -- .../com/aapeli/singleclient/Class106.java | 113 -- .../singleclient/HashTableContainer.java | 27 - .../com/aapeli/singleclient/SingleClient.java | 1200 ----------------- .../com/aapeli/singleclient/SingleGame.java | 9 - .../com/aapeli/singleclient/TopListUnit.java | 52 - .../java/com/aapeli/tilt/MoneyTextField.java | 124 -- .../java/com/aapeli/tools/DelayTimer.java | 91 -- .../src/main/java/com/aapeli/tools/Sort.java | 72 - .../main/java/com/aapeli/tools/Sortable.java | 7 - 63 files changed, 7411 deletions(-) delete mode 100644 client/src/main/java/com/aapeli/client/ApajaGames.java delete mode 100644 client/src/main/java/com/aapeli/client/Badge.java delete mode 100644 client/src/main/java/com/aapeli/client/BadgeHandler.java delete mode 100644 client/src/main/java/com/aapeli/client/CharacterImage.java delete mode 100644 client/src/main/java/com/aapeli/client/Class85.java delete mode 100755 client/src/main/java/com/aapeli/client/ClipPlaybackTask.java delete mode 100644 client/src/main/java/com/aapeli/client/Frame_Sub3_Sub2.java delete mode 100644 client/src/main/java/com/aapeli/client/IPanel_Sub41.java delete mode 100644 client/src/main/java/com/aapeli/client/KeyButton.java delete mode 100644 client/src/main/java/com/aapeli/client/Match.java delete mode 100644 client/src/main/java/com/aapeli/client/NeedAccountFrame.java delete mode 100644 client/src/main/java/com/aapeli/client/NickTextField.java delete mode 100644 client/src/main/java/com/aapeli/client/Panel_Sub23.java delete mode 100644 client/src/main/java/com/aapeli/client/PersonalScore.java delete mode 100644 client/src/main/java/com/aapeli/client/PersonalScoreUnit.java delete mode 100644 client/src/main/java/com/aapeli/client/SoundPlayer.java delete mode 100644 client/src/main/java/com/aapeli/client/Tournament.java delete mode 100644 client/src/main/java/com/aapeli/client/UrlLabelRegister.java delete mode 100644 client/src/main/java/com/aapeli/colorgui/KeyboardButton.java delete mode 100644 client/src/main/java/com/aapeli/colorgui/ProgressBar.java delete mode 100644 client/src/main/java/com/aapeli/credit/BuyCreditsHandler.java delete mode 100644 client/src/main/java/com/aapeli/credit/Canvas_Sub9.java delete mode 100644 client/src/main/java/com/aapeli/credit/Class101.java delete mode 100644 client/src/main/java/com/aapeli/credit/Class102.java delete mode 100644 client/src/main/java/com/aapeli/credit/Class103.java delete mode 100644 client/src/main/java/com/aapeli/credit/IPanel_Sub42.java delete mode 100644 client/src/main/java/com/aapeli/credit/Product.java delete mode 100644 client/src/main/java/com/aapeli/credit/ProductHandler.java delete mode 100644 client/src/main/java/com/aapeli/credit/PurchaseFrame.java delete mode 100644 client/src/main/java/com/aapeli/credit/PurchaseHandler.java delete mode 100644 client/src/main/java/com/aapeli/multiuser/ChatGame.java delete mode 100644 client/src/main/java/com/aapeli/multiuser/ChatGameListener.java delete mode 100644 client/src/main/java/com/aapeli/multiuser/ChatSimple.java delete mode 100644 client/src/main/java/com/aapeli/multiuser/QuitConfirm.java delete mode 100644 client/src/main/java/com/aapeli/multiuser/QuitHandler.java delete mode 100644 client/src/main/java/com/aapeli/order/OrderCanvas.java delete mode 100644 client/src/main/java/com/aapeli/order/OrderFrame.java delete mode 100644 client/src/main/java/com/aapeli/order/OrderHandler.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/GuiListener.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/GuiListenerExt.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/LobbyRoomSettingsPanel.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/Rule.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/Unit.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/UnitButton.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/UnitCheckbox.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/UnitCheckboxGroup.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/UnitChoice.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/UnitData.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/UnitLabel.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/UnitSpace.java delete mode 100644 client/src/main/java/com/aapeli/settingsgui/UnitTextField.java delete mode 100644 client/src/main/java/com/aapeli/singleclient/Class105.java delete mode 100644 client/src/main/java/com/aapeli/singleclient/Class106.java delete mode 100644 client/src/main/java/com/aapeli/singleclient/HashTableContainer.java delete mode 100644 client/src/main/java/com/aapeli/singleclient/SingleClient.java delete mode 100644 client/src/main/java/com/aapeli/singleclient/SingleGame.java delete mode 100644 client/src/main/java/com/aapeli/singleclient/TopListUnit.java delete mode 100644 client/src/main/java/com/aapeli/tilt/MoneyTextField.java delete mode 100644 client/src/main/java/com/aapeli/tools/DelayTimer.java delete mode 100644 client/src/main/java/com/aapeli/tools/Sort.java delete mode 100644 client/src/main/java/com/aapeli/tools/Sortable.java diff --git a/client/src/main/java/com/aapeli/applet/AApplet.java b/client/src/main/java/com/aapeli/applet/AApplet.java index 48118676..e7072edc 100644 --- a/client/src/main/java/com/aapeli/applet/AApplet.java +++ b/client/src/main/java/com/aapeli/applet/AApplet.java @@ -6,7 +6,6 @@ import com.aapeli.client.StringDraw; import com.aapeli.client.TextManager; import com.aapeli.connection.Connection; -import com.aapeli.credit.Product; import com.aapeli.tools.QuickTimer; import com.aapeli.tools.QuickTimerListener; import com.aapeli.tools.Tools; @@ -694,53 +693,6 @@ public void allowExternalPopups() { this.callJavaScriptJSON("{\"block\":\"false\"}"); } - public void callJavaScriptJsonBuyConfirmNeeded(Product var1) { - String var2 = "{\"buy\":{\"status\":\"cneeded\",\"product\":\""; - var2 = var2 + var1.getProductName(); - var2 = var2 + "}}"; - this.callJavaScriptJSON(var2); - } - - public void callJavaScriptJsonBuyConfirmAnswer(Product var1, boolean var2) { - String var3 = "{\"buy\":{\"status\":\"canswer\",\"product\":\""; - var3 = var3 + var1.getProductName(); - var3 = var3 + "\",\"answer\":\""; - var3 = var3 + (var2 ? "yes" : "no"); - var3 = var3 + "\"}}"; - this.callJavaScriptJSON(var3); - } - - public void callJavaScriptJsonBuyStarted(Product var1) { - this.callJavaScriptJsonBuyStarted(var1.getProductName()); - } - - public void callJavaScriptJsonBuyStarted(String var1) { - String var2 = "{\"buy\":{\"status\":\"started\",\"product\":\""; - var2 = var2 + var1; - var2 = var2 + "\"}}"; - this.callJavaScriptJSON(var2); - } - - public void callJavaScriptJsonBuyFinished(Product var1, int var2) { - this.callJavaScriptJsonBuyFinished(var1.getProductName(), var2); - } - - public void callJavaScriptJsonBuyFinished(String var1, int var2) { - String var3 = "{\"buy\":{\"status\":\"finished\",\"product\":\""; - var3 = var3 + var1; - var3 = var3 + "\",\"result\":\""; - if (var2 == 1) { - var3 = var3 + "ok"; - } else if (var2 == 0) { - var3 = var3 + "nobalance"; - } else if (var2 == -1) { - var3 = var3 + "error"; - } - - var3 = var3 + "\"}}"; - this.callJavaScriptJSON(var3); - } - public void setConnectionReference(Connection var1) { this.connection = var1; } diff --git a/client/src/main/java/com/aapeli/client/ApajaGames.java b/client/src/main/java/com/aapeli/client/ApajaGames.java deleted file mode 100644 index 988c223d..00000000 --- a/client/src/main/java/com/aapeli/client/ApajaGames.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.aapeli.client; - -import java.applet.Applet; -import java.awt.Canvas; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.net.MalformedURLException; -import java.net.URL; - -public class ApajaGames extends Canvas implements MouseListener { - - public static final int anInt144 = 33; - public static final int anInt145 = 13; - private static final int[] anIntArray146; - private static final int[] anIntArray147; - private Applet anApplet148; - private URL anURL149; - private Image anImage150; - private static final String[] aStringArray151 = new String[2]; - - - public ApajaGames(Applet var1) { - this.anApplet148 = var1; - this.setSize(33, 13); - - try { - this.anURL149 = new URL("http://www.apaja.com/"); - } catch (MalformedURLException var3) { - ; - } - - this.setCursor(new Cursor(12)); - this.addMouseListener(this); - } - - public void addNotify() { - super.addNotify(); - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - if (this.anImage150 == null) { - this.anImage150 = this.method222(); - } - - var1.drawImage(this.anImage150, 0, 0, this); - } - - public void mouseEntered(MouseEvent var1) { - this.repaint(); - } - - public void mouseExited(MouseEvent var1) { - this.repaint(); - } - - public void mousePressed(MouseEvent var1) { - this.anApplet148.getAppletContext().showDocument(this.anURL149, "_blank"); - } - - public void mouseReleased(MouseEvent var1) { - } - - public void mouseClicked(MouseEvent var1) { - } - - private Image method222() { - Color[] var1 = new Color[16]; - - for (int var2 = 0; var2 < 16; ++var2) { - var1[var2] = new Color(anIntArray146[var2]); - } - - Image var10 = this.createImage(33, 13); - Graphics var3 = var10.getGraphics(); - int var4 = 0; - int var5 = 7; - - for (int var7 = 0; var7 < 13; ++var7) { - for (int var8 = 0; var8 < 33; ++var8) { - int var6 = anIntArray147[var4]; - - for (int var9 = 0; var9 < var5; ++var9) { - var6 >>= 4; - } - - var6 &= 15; - var3.setColor(var1[var6]); - var3.fillRect(var8, var7, 1, 1); - --var5; - if (var5 == -1) { - ++var4; - var5 = 7; - } - } - } - - return var10; - } - - static { - aStringArray151[0] = "http://www.apaja.com/"; - aStringArray151[1] = "_blank"; - anIntArray146 = new int[]{0, 16762624, 16752640, 16777215, 16448250, 16250871, 15987700, 15724527, 15461355, 15066597, 14803425, 14671582, 14342874, 13948116, 16742144, 13619151}; - anIntArray147 = new int[]{0, 0, 0, 0, 1118481, 590558003, 860116327, 2022288332, -805240832, 33554435, 1382, 2013855744, 218107921, 551564080, 808730710, 2004914364, -1060110080, 917504, 50331654, 1736968448, 851984, 304144435, 858801216, 1610612896, -859779071, 305065523, 858993733, 1719175578, -1127358720, 805306432, 12356, 1348468736, -1342177040, 50541363, 53674752, 1342638233, -1425220097, 3158016, 805306416, 1080061952, 179306496, -268238848, 50541315, 84281088, 786432, 251671347, 858993459, 1146513288, -1715745571, -1048576, 0, 0, 0, 0}; - } -} diff --git a/client/src/main/java/com/aapeli/client/AutoPopups.java b/client/src/main/java/com/aapeli/client/AutoPopups.java index 4777c0cf..28ae8974 100644 --- a/client/src/main/java/com/aapeli/client/AutoPopups.java +++ b/client/src/main/java/com/aapeli/client/AutoPopups.java @@ -7,7 +7,6 @@ public class AutoPopups { private Class78 aClass78_1327; private Class88 aClass88_1328; - private Class85 aClass85_1329; private long aLong1330; private static final String aString1331 = "facebook"; @@ -39,8 +38,6 @@ public void gameFinished(boolean var1) { this.method1562(); } else if (this.aClass88_1328 != null && this.aClass88_1328.method1700()) { this.method1562(); - } else if (this.aClass85_1329 != null && !var1 && this.aClass85_1329.method1678()) { - this.method1562(); } } } @@ -78,10 +75,6 @@ public void close() { this.aClass88_1328.method1701(); } - if (this.aClass85_1329 != null) { - this.aClass85_1329.method1679(); - } - } } diff --git a/client/src/main/java/com/aapeli/client/Badge.java b/client/src/main/java/com/aapeli/client/Badge.java deleted file mode 100644 index c30ded8a..00000000 --- a/client/src/main/java/com/aapeli/client/Badge.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.tools.Sortable; - -import java.util.StringTokenizer; - -public final class Badge implements Sortable { - - private int anInt2594; - private int anInt2595; - private int anInt2596; - private String aString2597; - private boolean aBoolean2598; - private boolean aBoolean2599; - private static final String[] aStringArray2600 = new String[6]; - - - protected Badge(String var1) { - StringTokenizer var2 = new StringTokenizer(var1, ";"); - this.anInt2594 = Integer.parseInt(var2.nextToken()); - this.aString2597 = var2.nextToken(); - this.anInt2595 = Integer.parseInt(var2.nextToken()); - this.anInt2596 = Integer.parseInt(var2.nextToken()); - this.aBoolean2598 = var2.nextToken().equals("t"); - this.aBoolean2599 = var2.nextToken().equals("t"); - } - - public String toString() { - return "[Badge: id=" + this.anInt2594 + ", label=\"" + this.aString2597 + "\", threshold=" + this.anInt2595 + ", order=" + this.anInt2596 + ", active=" + this.aBoolean2598 + ", owned=" + this.aBoolean2599 + "]"; - } - - public int compareTo(Sortable var1) { - if (var1 == null) { - return -1; - } else if (!(var1 instanceof Badge)) { - return -1; - } else { - int var2 = this.getOrder(); - int var3 = ((Badge) ((Badge) var1)).getOrder(); - return var2 < var3 ? -1 : (var2 > var3 ? 1 : 0); - } - } - - public int getBadgeId() { - return this.anInt2594; - } - - public String getLabel() { - return this.aString2597; - } - - public int getThreshold() { - return this.anInt2595; - } - - public int getOrder() { - return this.anInt2596; - } - - public boolean isActive() { - return this.aBoolean2598; - } - - public boolean isOwned() { - return this.aBoolean2599; - } - - protected void method1563() { - this.aBoolean2599 = true; - } - - static { - aStringArray2600[0] = ", owned="; - aStringArray2600[1] = ", order="; - aStringArray2600[2] = ", active="; - aStringArray2600[3] = ", label=\""; - aStringArray2600[4] = "[Badge: id="; - aStringArray2600[5] = "\", threshold="; - } -} diff --git a/client/src/main/java/com/aapeli/client/BadgeHandler.java b/client/src/main/java/com/aapeli/client/BadgeHandler.java deleted file mode 100644 index bd7a92c6..00000000 --- a/client/src/main/java/com/aapeli/client/BadgeHandler.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.applet.AApplet; -import com.aapeli.client.Badge; -import com.aapeli.tools.Sort; - -import java.util.StringTokenizer; -import java.util.Vector; - -public class BadgeHandler { - - public static final int VALUE_LOWEREQUAL = 1; - public static final int VALUE_HIGHEREQUAL = 2; - private AApplet anAApplet1332; - private Badge[] aBadgeArray1333; - private static final String[] aStringArray1334 = new String[2]; - - - public BadgeHandler(AApplet var1, String var2) { - this.anAApplet1332 = var1; - if (var2.equals("-")) { - this.aBadgeArray1333 = new Badge[0]; - } else { - StringTokenizer var3 = new StringTokenizer(var2, "^"); - int var4 = var3.countTokens(); - this.aBadgeArray1333 = new Badge[var4]; - - for (int var5 = 0; var5 < var4; ++var5) { - this.aBadgeArray1333[var5] = new Badge(var3.nextToken()); - } - - } - } - - public BadgeHandler(String var1) { - this((AApplet) null, var1); - } - - public Badge awardBadge(String var1) { - Badge var2 = this.getBadge(var1); - if (var2 == null) { - return null; - } else if (var2.isActive() && !var2.isOwned()) { - this.method1565(var2); - return var2; - } else { - return null; - } - } - - public Badge[] awardBadges(String var1, int var2, int var3) { - Vector var4 = this.method1564(var1); - int var5 = var4.size(); - if (var5 == 0) { - return null; - } else { - for (int var9 = 0; var9 < var5; ++var9) { - Badge var8 = (Badge) ((Badge) var4.elementAt(var9)); - boolean var6 = false; - if (var8.isActive() && !var8.isOwned()) { - int var7 = var8.getThreshold(); - if (var3 == 1 && var2 <= var7 || var3 == 2 && var2 >= var7) { - this.method1565(var8); - var6 = true; - } - } - - if (!var6) { - var4.removeElementAt(var9); - --var9; - --var5; - } - } - - if (var5 == 0) { - return null; - } else { - Badge[] var11 = new Badge[var5]; - - for (int var10 = 0; var10 < var5; ++var10) { - var11[var10] = (Badge) ((Badge) var4.elementAt(var10)); - } - - return var11; - } - } - } - - public Badge getBadge(String var1) { - for (int var2 = 0; var2 < this.aBadgeArray1333.length; ++var2) { - if (this.aBadgeArray1333[var2].getLabel().equalsIgnoreCase(var1)) { - return this.aBadgeArray1333[var2]; - } - } - - return null; - } - - private Vector method1564(String var1) { - Vector var2 = new Vector(); - - for (int var3 = 0; var3 < this.aBadgeArray1333.length; ++var3) { - if (this.aBadgeArray1333[var3].getLabel().equalsIgnoreCase(var1)) { - var2.addElement(this.aBadgeArray1333[var3]); - } - } - - return Sort.quickSort(var2); - } - - private void method1565(Badge var1) { - if (this.anAApplet1332 != null) { - this.anAApplet1332.callJavaScriptJSON("{\"badgenotify\":{\"id\":\"" + var1.getBadgeId() + "\"}}"); - } - - var1.method1563(); - } - - static { - aStringArray1334[0] = "\"}}"; - aStringArray1334[1] = "{\"badgenotify\":{\"id\":\""; - } -} diff --git a/client/src/main/java/com/aapeli/client/CharacterImage.java b/client/src/main/java/com/aapeli/client/CharacterImage.java deleted file mode 100644 index 200344b3..00000000 --- a/client/src/main/java/com/aapeli/client/CharacterImage.java +++ /dev/null @@ -1,340 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.ImageManager; -import com.aapeli.tools.QuickTimer; -import com.aapeli.tools.QuickTimerListener; -import com.aapeli.tools.Tools; - -import java.applet.Applet; -import java.awt.Color; -import java.awt.Component; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.image.ImageObserver; -import java.net.MalformedURLException; -import java.net.URL; - -public class CharacterImage implements QuickTimerListener { - - public static final int SIZE_MEDIUM = 1; - public static final int SIZE_SMALL = 0; - public static final int SIZE_NORMAL = 1; - public static final int[] IMAGE_WIDTH; - public static final int[] IMAGE_HEIGHT; - private static final String[] aStringArray2567; - private static Image[][] anImageArrayArray2568; - private Applet anApplet2569; - private ImageManager anImageManager2570; - private URL anURL2571; - private int anInt2572; - private int anInt2573; - private long aLong2574; - private Image anImage2575; - private Component aComponent2576; - private QuickTimer aQuickTimer2577; - private static final String[] aStringArray2578 = new String[5]; - - - public CharacterImage(ImageManager var1, String var2, int var3) { - this.anImageManager2570 = var1; - this.anApplet2569 = var1.getApplet(); - this.anInt2573 = var3; - this.anInt2572 = 0; - if (var2 != null) { - if (!var2.equals("-")) { - if (var2.equals("?")) { - this.anInt2572 = 3; - } else { - this.anURL2571 = method1586(this.anApplet2569.getCodeBase(), var2); - if (this.anURL2571 != null) { - this.method1578(this.anURL2571); - } else { - this.anInt2572 = 3; - } - - } - } - } - } - - public CharacterImage(ImageManager var1, int var2) { - this(var1, (String) null, var2); - } - - public synchronized void qtFinished() { - this.aQuickTimer2577 = null; - if (this.aComponent2576 != null) { - this.aComponent2576.repaint(); - } - - } - - public synchronized void draw(Graphics var1, int var2, int var3, Component var4) { - if (this.aQuickTimer2577 != null) { - this.aQuickTimer2577.removeListener(this); - this.aQuickTimer2577 = null; - } - - this.aComponent2576 = var4; - this.method1579(var1, var2, var3); - } - - public Image getImage() { - this.method1580(); - return this.anImage2575; - } - - public int getSize() { - return this.anInt2573; - } - - private void method1578(URL var1) { - this.anImageManager2570.method1594(var1); - this.anInt2572 = 1; - this.aLong2574 = System.currentTimeMillis(); - } - - private void method1579(Graphics var1, int var2, int var3) { - this.method1580(); - boolean var4 = false; - - try { - if (this.anInt2572 == 2) { - var1.drawImage(this.anImage2575, var2, var3, (ImageObserver) null); - return; - } - - if (this.anInt2572 == 0) { - var4 = this.method1581(var1, var2, var3); - } else { - if (this.anInt2572 == 1) { - if (System.currentTimeMillis() <= this.aLong2574 + 17000L) { - this.method1582(var1, var2, var3); - var4 = true; - } else { - this.anInt2572 = 3; - } - } - - if (this.anInt2572 == 3) { - var4 = this.method1583(var1, var2, var3); - } - } - } catch (Exception var6) { - this.aComponent2576 = null; - return; - } - - if (var4 && this.aComponent2576 != null) { - this.aQuickTimer2577 = new QuickTimer(1000, this); - } - - } - - private void method1580() { - if (this.anInt2572 == 1) { - this.anImage2575 = this.anImageManager2570.method1595(this.anURL2571.toString()); - if (this.anImage2575 != null) { - this.anInt2572 = 2; - this.anURL2571 = null; - } - } - - } - - private boolean method1581(Graphics var1, int var2, int var3) { - if (this.method1584(var1, var2, var3, 0)) { - return false; - } else { - Color var4 = var1.getColor(); - var1.setColor(Color.lightGray); - var1.fillRect(var2, var3, IMAGE_WIDTH[this.anInt2573], IMAGE_HEIGHT[this.anInt2573]); - var1.setColor(Color.black); - var1.drawRect(var2, var3, IMAGE_WIDTH[this.anInt2573] - 1, IMAGE_HEIGHT[this.anInt2573] - 1); - var1.setColor(var4); - return true; - } - } - - private void method1582(Graphics var1, int var2, int var3) { - if (!this.method1584(var1, var2, var3, 1)) { - Color var4 = var1.getColor(); - var1.setColor(Color.white); - var1.fillRect(var2, var3, IMAGE_WIDTH[this.anInt2573], IMAGE_HEIGHT[this.anInt2573]); - var1.setColor(Color.lightGray); - var1.drawRect(var2, var3, IMAGE_WIDTH[this.anInt2573] - 1, IMAGE_HEIGHT[this.anInt2573] - 1); - var1.setColor(var4); - } - } - - private boolean method1583(Graphics var1, int var2, int var3) { - if (this.method1584(var1, var2, var3, 2)) { - return false; - } else { - Color var4 = var1.getColor(); - var1.setColor(Color.white); - var1.fillRect(var2, var3, IMAGE_WIDTH[this.anInt2573], IMAGE_HEIGHT[this.anInt2573]); - var1.setColor(Color.red); - var1.drawRect(var2, var3, IMAGE_WIDTH[this.anInt2573] - 1, IMAGE_HEIGHT[this.anInt2573] - 1); - var1.drawLine(var2, var3, var2 + IMAGE_WIDTH[this.anInt2573] - 1, var3 + IMAGE_HEIGHT[this.anInt2573] - 1); - var1.drawLine(var2 + IMAGE_WIDTH[this.anInt2573] - 1, var3, var2, var3 + IMAGE_HEIGHT[this.anInt2573] - 1); - var1.setColor(var4); - return true; - } - } - - private boolean method1584(Graphics var1, int var2, int var3, int var4) { - Image var5 = this.method1585(var4); - if (var5 == null) { - return false; - } else { - var1.drawImage(var5, var2, var3, (ImageObserver) null); - return true; - } - } - - private Image method1585(int var1) { - if (anImageArrayArray2568[var1][this.anInt2573] != null) { - return anImageArrayArray2568[var1][this.anInt2573]; - } else { - Image var2 = anImageArrayArray2568[var1][1]; - if (var2 == null) { - var2 = this.anImageManager2570.getShared("char_" + aStringArray2567[var1] + ".png", true); - } - - if (var2 == null) { - return null; - } else { - if (this.anInt2573 != 1) { - var2 = var2.getScaledInstance(IMAGE_WIDTH[this.anInt2573], IMAGE_HEIGHT[this.anInt2573], 4); - - for (int var3 = 0; !this.anApplet2569.prepareImage(var2, this.anApplet2569) && var3 < 50; ++var3) { - Tools.sleep(10L); - } - } - - anImageArrayArray2568[var1][this.anInt2573] = var2; - return var2; - } - } - } - - private static URL method1586(URL var0, String var1) { - try { - URL var2 = new URL(var0, var1); - if (var0.getProtocol().equalsIgnoreCase("file")) { - return var2; - } else { - if (var2.getProtocol().equalsIgnoreCase("http")) { - String var3 = var0.getHost(); - String var4 = var2.getHost(); - if (!var4.equals(var3)) { - String var5 = var2.getFile(); - if (var5.charAt(0) != 47) { - var5 = "/" + var5; - } - - var2 = new URL("http://" + var3 + var5); - } - } - - return var2; - } - } catch (MalformedURLException var6) { - return null; - } - } - - static { - aStringArray2578[0] = ".png"; - aStringArray2578[1] = "char_"; - aStringArray2578[2] = "http://"; - aStringArray2578[3] = "file"; - aStringArray2578[4] = "http"; - IMAGE_WIDTH = new int[]{30, 60}; - IMAGE_HEIGHT = new int[]{30, 60}; - aStringArray2567 = new String[3]; - aStringArray2567[0] = "unreg"; - aStringArray2567[1] = "loading"; - aStringArray2567[2] = "invalid"; - anImageArrayArray2568 = new Image[3][2]; - } - - private static char[] method1587(String var0) { - char[] var10000 = var0.toCharArray(); - char[] var10001 = var10000; - - while (true) { - int var10002 = var10001.length; - var10001 = var10000; - int var4 = var10002; - if (var10002 >= 2) { - break; - } - - char[] var1 = var10001; - int var2 = var4; - var10000 = var1; - char[] var10003 = var1; - var10002 = var2; - var10001 = var10003; - if (var10002 != 0) { - var10001 = var10000; - boolean var3 = false; - var10003[0] = (char) (var10003[0] ^ 36); - break; - } - } - - return var10001; - } - - private static String method1588(char[] var0) { - int var10000 = var0.length; - int var1 = 0; - char[] var10001 = var0; - if (var10000 > 1) { - var10001 = var0; - if (var10000 <= var1) { - return (new String(var0)).intern(); - } - } - - do { - char[] var10002 = var10001; - int var10003 = var1; - - while (true) { - char var10004 = var10002[var10003]; - byte var10005; - switch (var1 % 5) { - case 0: - var10005 = 126; - break; - case 1: - var10005 = 2; - break; - case 2: - var10005 = 101; - break; - case 3: - var10005 = 126; - break; - default: - var10005 = 36; - } - - var10002[var10003] = (char) (var10004 ^ var10005); - ++var1; - if (var10000 != 0) { - break; - } - - var10003 = var10000; - var10002 = var10001; - } - } while (var10000 > var1); - - return (new String(var10001)).intern(); - } -} diff --git a/client/src/main/java/com/aapeli/client/Class85.java b/client/src/main/java/com/aapeli/client/Class85.java deleted file mode 100644 index 5587b02c..00000000 --- a/client/src/main/java/com/aapeli/client/Class85.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.Frame_Sub3_Sub2; -import com.aapeli.client.ImageManager; -import com.aapeli.client.Parameters; -import com.aapeli.client.TextManager; - -class Class85 { - - private Parameters aParameters1465; - private TextManager aTextManager1466; - private ImageManager anImageManager1467; - private int[] anIntArray1468; - private boolean aBoolean1469; - private int anInt1470; - private int anInt1471; - private Frame_Sub3_Sub2 aFrame_Sub3_Sub2_1472; - - - protected boolean method1678() { - if (!this.aBoolean1469) { - return false; - } else { - try { - if (this.aParameters1465.getSession() != null) { - this.aBoolean1469 = false; - return false; - } - - ++this.anInt1470; - if (this.anInt1470 == this.anIntArray1468[this.anInt1471]) { - ++this.anInt1471; - if (this.anInt1471 == this.anIntArray1468.length) { - this.aBoolean1469 = false; - } - - this.method1681(); - return true; - } - } catch (Exception var2) { - this.aBoolean1469 = false; - } - - return false; - } - } - - protected void method1679() { - try { - if (this.aFrame_Sub3_Sub2_1472 != null) { - this.aFrame_Sub3_Sub2_1472.close(); - } - } catch (Exception var2) { - ; - } - - } - - protected void method1680() { - this.aFrame_Sub3_Sub2_1472 = null; - } - - private void method1681() { - this.aFrame_Sub3_Sub2_1472 = new Frame_Sub3_Sub2(this.aParameters1465, this.aTextManager1466, this.anImageManager1467, this); - this.aFrame_Sub3_Sub2_1472.method240(this.aParameters1465.getApplet()); - } -} diff --git a/client/src/main/java/com/aapeli/client/ClipPlaybackTask.java b/client/src/main/java/com/aapeli/client/ClipPlaybackTask.java deleted file mode 100755 index 8eb8b25c..00000000 --- a/client/src/main/java/com/aapeli/client/ClipPlaybackTask.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.aapeli.client; - -class ClipPlaybackTask { - - private String clipName; - private long timeoutTimestamp; - - - public ClipPlaybackTask(String clipName, int timeoutMs) { - this.clipName = clipName; - this.timeoutTimestamp = System.currentTimeMillis() + (long) timeoutMs; - } - - protected String getClipName() { - return this.clipName; - } - - protected long getTimeoutTimestamp() { - return this.timeoutTimestamp; - } -} diff --git a/client/src/main/java/com/aapeli/client/Frame_Sub3_Sub2.java b/client/src/main/java/com/aapeli/client/Frame_Sub3_Sub2.java deleted file mode 100644 index a77f0210..00000000 --- a/client/src/main/java/com/aapeli/client/Frame_Sub3_Sub2.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.Class85; -import com.aapeli.client.Frame_Sub3; -import com.aapeli.client.IPanel_Sub41; -import com.aapeli.client.ImageManager; -import com.aapeli.client.Parameters; -import com.aapeli.client.TextManager; - -import java.awt.Component; - -class Frame_Sub3_Sub2 extends Frame_Sub3 { - - private Class85 aClass85_2887; - private IPanel_Sub41 anIPanel_Sub41_2888; - private static final String aString2889 = "RegRemind_Title"; - - - protected Frame_Sub3_Sub2(Parameters var1, TextManager var2, ImageManager var3, Class85 var4) { - super(var2); - this.aClass85_2887 = var4; - this.anIPanel_Sub41_2888 = new IPanel_Sub41(var1, var2, var3, this); - } - - protected void method240(Component var1) { - this.method238(var1, super.aTextManager187.getShared("RegRemind_Title"), this.anIPanel_Sub41_2888); - } - - protected void close() { - super.close(); - this.aClass85_2887.method1680(); - this.anIPanel_Sub41_2888 = null; - this.aClass85_2887 = null; - } - -} diff --git a/client/src/main/java/com/aapeli/client/IPanel_Sub41.java b/client/src/main/java/com/aapeli/client/IPanel_Sub41.java deleted file mode 100644 index a39bb534..00000000 --- a/client/src/main/java/com/aapeli/client/IPanel_Sub41.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.Frame_Sub3_Sub2; -import com.aapeli.client.IPanel; -import com.aapeli.client.ImageManager; -import com.aapeli.client.Parameters; -import com.aapeli.client.StringDraw; -import com.aapeli.client.TextManager; -import com.aapeli.client.UrlLabel; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.LayoutManager; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; - -class IPanel_Sub41 extends IPanel implements MouseListener { - - private static final Color aColor3219; - private static final Color aColor3220; - private static final Font aFont3221; - private static final Font aFont3222; - private TextManager aTextManager3223; - private Frame_Sub3_Sub2 aFrame_Sub3_Sub2_3224; - private static final String[] aStringArray3225 = new String[4]; - - - protected IPanel_Sub41(Parameters var1, TextManager var2, ImageManager var3, Frame_Sub3_Sub2 var4) { - this.aTextManager3223 = var2; - this.aFrame_Sub3_Sub2_3224 = var4; - this.setSize(310, 160); - this.setBackground(aColor3219); - this.setLayout((LayoutManager) null); - UrlLabel var5 = new UrlLabel(var1.getApplet(), aFont3222, var2.getShared("RegRemind_ClickHere"), var1.getRegisterPage()); - var5.setTarget(0); - var5.setBounds(20, 110, 270, 30); - var5.setBackground(aColor3219); - var5.setForeground(aColor3220); - var5.addMouseListener(this); - this.add(var5); - this.setSharedBackground(var3, "tf-background.gif", 0, 0); - } - - public void update(Graphics var1) { - this.drawBackground(var1); - var1.setFont(aFont3221); - var1.setColor(aColor3220); - StringDraw.drawStringWithMaxWidth(var1, this.aTextManager3223.getShared("RegRemind_GameOver"), 20, 35, -1, 270); - } - - public void mouseEntered(MouseEvent var1) { - } - - public void mouseExited(MouseEvent var1) { - } - - public void mousePressed(MouseEvent var1) { - } - - public void mouseReleased(MouseEvent var1) { - this.aFrame_Sub3_Sub2_3224.close(); - } - - public void mouseClicked(MouseEvent var1) { - } - - static { - aStringArray3225[0] = "tf-background.gif"; - aStringArray3225[1] = "RegRemind_ClickHere"; - aStringArray3225[2] = "RegRemind_GameOver"; - aStringArray3225[3] = "Dialog"; - aColor3219 = new Color(240, 240, 240); - aColor3220 = Color.black; - aFont3221 = new Font("Dialog", 0, 14); - aFont3222 = new Font("Dialog", 0, 16); - } -} diff --git a/client/src/main/java/com/aapeli/client/KeyButton.java b/client/src/main/java/com/aapeli/client/KeyButton.java deleted file mode 100644 index a05ff338..00000000 --- a/client/src/main/java/com/aapeli/client/KeyButton.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.TextManager; -import com.aapeli.colorgui.RadioButton; - -import java.awt.Color; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; - -public class KeyButton extends RadioButton implements KeyListener { - - private static final int[] anIntArray4976; - private static final String[] aStringArray4977; - private static final int anInt4978; - private static final Color aColor4979; - private static final Color aColor4980; - private static final Color aColor4981; - private TextManager aTextManager4982; - private int anInt4983; - private static final String[] aStringArray4984 = new String[3]; - - - public KeyButton(TextManager var1) { - this(var1, -1); - } - - public KeyButton(TextManager var1, int var2) { - this.aTextManager4982 = var1; - this.method831(var2); - } - - public void mousePressed(MouseEvent var1) { - super.mousePressed(var1); - this.removeKeyListener(this); - if (this.getState()) { - this.setLabel(this.aTextManager4982.getShared("Key_EnterNew")); - this.setBackground(aColor4979); - this.addKeyListener(this); - } else { - this.method831(this.anInt4983); - } - - } - - public void keyPressed(KeyEvent var1) { - if (this.getState()) { - this.method831(var1.getKeyCode()); - this.setState(false); - } - - this.removeKeyListener(this); - } - - public void keyReleased(KeyEvent var1) { - } - - public void keyTyped(KeyEvent var1) { - } - - public boolean isKeySet() { - return this.anInt4983 >= 0; - } - - public int getKey() { - return this.anInt4983; - } - - public void cancelSettingKey() { - if (this.getState()) { - this.setState(false); - this.removeKeyListener(this); - this.method831(this.anInt4983); - } - - } - - private void method831(int var1) { - this.anInt4983 = var1; - if (var1 < 0) { - this.setLabel(this.aTextManager4982.getShared("Key_NotSet")); - this.setBackground(aColor4981); - } else { - String var2 = this.method832(); - if (var2 != null) { - this.setLabel(this.aTextManager4982.getShared("Key_" + var2)); - this.setBackground(aColor4980); - } else if ((var1 < 65 || var1 > 90) && var1 < 48 && var1 > 57) { - if (var1 >= 112 && var1 <= 123) { - this.setLabel("F" + (var1 - 112 + 1)); - this.setBackground(aColor4980); - } else { - this.method831(-1); - } - } else { - this.setLabel("" + (char) var1); - this.setBackground(aColor4980); - } - } - } - - private String method832() { - for (int var1 = 0; var1 < anInt4978; ++var1) { - if (this.anInt4983 == anIntArray4976[var1]) { - return aStringArray4977[var1]; - } - } - - return null; - } - - static { - aStringArray4984[0] = "Key_EnterNew"; - aStringArray4984[1] = "Key_"; - aStringArray4984[2] = "Key_NotSet"; - anIntArray4976 = new int[]{38, 40, 37, 39, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 107, 109, 106, 111, 155, 127, 36, 35, 33, 34, 32, 8, 10, 154, 145, 19, 16, 17, 18, 9, 27}; - aStringArray4977 = new String[35]; - aStringArray4977[0] = "ArrowUp"; - aStringArray4977[1] = "ArrowDown"; - aStringArray4977[2] = "ArrowLeft"; - aStringArray4977[3] = "ArrowRight"; - aStringArray4977[4] = "Numpad0"; - aStringArray4977[5] = "Numpad1"; - aStringArray4977[6] = "Numpad2"; - aStringArray4977[7] = "Numpad3"; - aStringArray4977[8] = "Numpad4"; - aStringArray4977[9] = "Numpad5"; - aStringArray4977[10] = "Numpad6"; - aStringArray4977[11] = "Numpad7"; - aStringArray4977[12] = "Numpad8"; - aStringArray4977[13] = "Numpad9"; - aStringArray4977[14] = "Add"; - aStringArray4977[15] = "Subtrack"; - aStringArray4977[16] = "Multiply"; - aStringArray4977[17] = "Divide"; - aStringArray4977[18] = "Insert"; - aStringArray4977[19] = "Delete"; - aStringArray4977[20] = "Home"; - aStringArray4977[21] = "End"; - aStringArray4977[22] = "PageUp"; - aStringArray4977[23] = "PageDown"; - aStringArray4977[24] = "Space"; - aStringArray4977[25] = "BackSpace"; - aStringArray4977[26] = "Enter"; - aStringArray4977[27] = "PrintScreen"; - aStringArray4977[28] = "ScrollLock"; - aStringArray4977[29] = "Pause"; - aStringArray4977[30] = "Shift"; - aStringArray4977[31] = "Control"; - aStringArray4977[32] = "Alt"; - aStringArray4977[33] = "Tab"; - aStringArray4977[34] = "Escape"; - anInt4978 = anIntArray4976.length; - aColor4979 = new Color(192, 192, 192); - aColor4980 = new Color(160, 160, 224); - aColor4981 = new Color(224, 160, 160); - } - - private static char[] method833(String var0) { - char[] var10000 = var0.toCharArray(); - char[] var10001 = var10000; - - while (true) { - int var10002 = var10001.length; - var10001 = var10000; - int var4 = var10002; - if (var10002 >= 2) { - break; - } - - char[] var1 = var10001; - int var2 = var4; - var10000 = var1; - char[] var10003 = var1; - var10002 = var2; - var10001 = var10003; - if (var10002 != 0) { - var10001 = var10000; - boolean var3 = false; - var10003[0] = (char) (var10003[0] ^ 49); - break; - } - } - - return var10001; - } - - private static String method834(char[] var0) { - int var10000 = var0.length; - int var1 = 0; - char[] var10001 = var0; - if (var10000 > 1) { - var10001 = var0; - if (var10000 <= var1) { - return (new String(var0)).intern(); - } - } - - do { - char[] var10002 = var10001; - int var10003 = var1; - - while (true) { - char var10004 = var10002[var10003]; - byte var10005; - switch (var1 % 5) { - case 0: - var10005 = 92; - break; - case 1: - var10005 = 113; - break; - case 2: - var10005 = 36; - break; - case 3: - var10005 = 90; - break; - default: - var10005 = 49; - } - - var10002[var10003] = (char) (var10004 ^ var10005); - ++var1; - if (var10000 != 0) { - break; - } - - var10003 = var10000; - var10002 = var10001; - } - } while (var10000 > var1); - - return (new String(var10001)).intern(); - } -} diff --git a/client/src/main/java/com/aapeli/client/Match.java b/client/src/main/java/com/aapeli/client/Match.java deleted file mode 100644 index bc911bf7..00000000 --- a/client/src/main/java/com/aapeli/client/Match.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.Parameters; - -import java.applet.Applet; -import java.util.StringTokenizer; - -public class Match { - - public static final int STATUS_NOMATCH = 0; - public static final int STATUS_ERROR = 1; - public static final int STATUS_MATCH = 2; - public static final int ROLE_NONE = -1; - public static final int ROLE_CHALLENGER = 1; - public static final int ROLE_CHALLENGED = 0; - private int anInt1383; - private int anInt1384; - private int anInt1385; - private int anInt1386; - private int anInt1387; - private String aString1388; - private String aString1389; - private String aString1390; - private int[] anIntArray1391; - private static final String[] aStringArray1392 = new String[17]; - - - public Match(Parameters var1, int var2, int var3) { - this(var1, 0, var2, var3); - } - - public Match(Parameters var1, int var2, int var3, int var4) { - this.anInt1383 = this.method1618(var1, var2, var3, var4); - } - - public int getStatus() { - return this.anInt1383; - } - - public int getMatchId() { - return this.anInt1384; - } - - public int getSubGame() { - return this.anInt1385; - } - - public int getPlayerCount() { - return this.anInt1386; - } - - public boolean isChallengeGame() { - return this.anInt1387 != -1 && this.aString1388 != null; - } - - public boolean isChallenger() { - return this.anInt1387 == 1; - } - - public String getOpponent() { - return this.aString1388; - } - - public String getGameName() { - return this.aString1389; - } - - public String getGamePassword() { - return this.aString1390; - } - - public int[] getSettings() { - return this.anIntArray1391; - } - - public boolean isChallengeAcceptable(int var1, String var2) { - return this.anInt1386 != 2 ? false : (this.anInt1387 != 0 ? false : (var1 != this.anInt1384 ? false : var2.equalsIgnoreCase(this.aString1388))); - } - - public boolean isChallengeAcceptable(int var1, int var2, String var3) { - return !this.isChallengeAcceptable(var1, var3) ? false : var2 == this.anInt1385; - } - - private int method1618(Parameters var1, int var2, int var3, int var4) { - Applet var5 = var1.getApplet(); - String var6 = var5.getParameter("match_data"); - String var7 = var5.getParameter("match_challenge"); - String var8 = var5.getParameter("match_string"); - String var9 = var5.getParameter("match_settings"); - if (var6 == null && var7 == null && var8 == null && var9 == null) { - return 0; - } else { - try { - if (var1.getSession() == null) { - throw new Exception("Match game without user session"); - } else { - this.method1619(var6, var2, var3); - this.method1620(var7); - this.method1621(var8); - this.method1622(var9, var4); - return 2; - } - } catch (Exception var11) { - return 1; - } - } - } - - private void method1619(String var1, int var2, int var3) throws Exception { - StringTokenizer var4 = new StringTokenizer(var1, ","); - this.anInt1384 = Integer.parseInt(var4.nextToken()); - if (this.anInt1384 <= 0) { - throw new Exception("Invalid match id (" + this.anInt1384 + ")"); - } else { - if (var2 > 0) { - this.anInt1385 = Integer.parseInt(var4.nextToken()); - if (this.anInt1385 < 0 || this.anInt1385 >= var2) { - throw new Exception("Invalid subgame (" + this.anInt1385 + ")"); - } - } else { - this.anInt1385 = -1; - } - - this.anInt1386 = Integer.parseInt(var4.nextToken()); - if (this.anInt1386 >= 2 && this.anInt1386 <= var3) { - if (var4.hasMoreTokens()) { - throw new Exception("Too much data in \'match_data\' (\"" + var1 + "\")"); - } - } else { - throw new Exception("Invalid playercount (" + this.anInt1386 + ")"); - } - } - } - - private void method1620(String var1) throws Exception { - if (this.anInt1386 > 2 && var1 != null) { - throw new Exception("Challenge-data set in 3+ players game"); - } else if (this.anInt1386 <= 2 && var1 != null) { - StringTokenizer var2 = new StringTokenizer(var1, ","); - this.anInt1387 = Integer.parseInt(var2.nextToken()); - if (this.anInt1387 != 1 && this.anInt1387 != 0) { - throw new Exception("Invalid role (" + this.anInt1387 + ")"); - } else { - this.aString1388 = var2.nextToken(); - int var3 = this.aString1388.length(); - if (var3 >= 3 && var3 <= 15) { - if (var2.hasMoreTokens()) { - throw new Exception("Too much data in \'match_challenge\' (\"" + var1 + "\")"); - } - } else { - throw new Exception("Invalid opponent (\"" + this.aString1388 + "\")"); - } - } - } else { - this.anInt1387 = -1; - this.aString1388 = null; - } - } - - private void method1621(String var1) throws Exception { - int var2 = var1.lastIndexOf(44); - if (var2 == -1) { - throw new Exception("Invalid match string (" + var1 + ")"); - } else { - this.aString1389 = var1.substring(0, var2); - this.aString1390 = var1.substring(var2 + 1); - } - } - - private void method1622(String var1, int var2) throws Exception { - StringTokenizer var3 = new StringTokenizer(var1, ","); - int var4 = var3.countTokens(); - if (var4 != var2) { - throw new Exception("Invalid settingcount (" + var2 + ")"); - } else { - this.anIntArray1391 = new int[var4]; - - for (int var5 = 0; var5 < var4; ++var5) { - this.anIntArray1391[var5] = Integer.parseInt(var3.nextToken()); - if (this.anIntArray1391[var5] < 0) { - throw new Exception("Invalid setting (" + this.anIntArray1391[var5] + ")"); - } - } - - } - } - - static { - aStringArray1392[0] = "Too much data in \'match_challenge\' (\""; - aStringArray1392[1] = "\")"; - aStringArray1392[2] = "Invalid opponent (\""; - aStringArray1392[3] = "Invalid role ("; - aStringArray1392[4] = "Challenge-data set in 3+ players game"; - aStringArray1392[5] = "Invalid match string ("; - aStringArray1392[6] = "match_settings"; - aStringArray1392[7] = "match_string"; - aStringArray1392[8] = "Match game without user session"; - aStringArray1392[9] = "match_challenge"; - aStringArray1392[10] = "match_data"; - aStringArray1392[11] = "Invalid subgame ("; - aStringArray1392[12] = "Invalid match id ("; - aStringArray1392[13] = "Too much data in \'match_data\' (\""; - aStringArray1392[14] = "Invalid playercount ("; - aStringArray1392[15] = "Invalid setting ("; - aStringArray1392[16] = "Invalid settingcount ("; - } -} diff --git a/client/src/main/java/com/aapeli/client/NeedAccountFrame.java b/client/src/main/java/com/aapeli/client/NeedAccountFrame.java deleted file mode 100644 index 90b2d61b..00000000 --- a/client/src/main/java/com/aapeli/client/NeedAccountFrame.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.applet.AApplet; - -import java.awt.Component; - -public final class NeedAccountFrame extends Frame_Sub3 { - - private AApplet anAApplet2893; - private Panel_Sub23 aPanel_Sub23_2894; - private static final String aString2895 = "NeedAccount_Title"; - - - public NeedAccountFrame(AApplet var1) { - super(var1.textManager); - this.anAApplet2893 = var1; - this.aPanel_Sub23_2894 = new Panel_Sub23(var1, this); - } - - public void open() { - this.open(this.anAApplet2893); - } - - public void open(Component var1) { - this.method238(var1, this.anAApplet2893.textManager.getShared("NeedAccount_Title"), this.aPanel_Sub23_2894); - } - - public void close() { - super.close(); - this.aPanel_Sub23_2894 = null; - this.anAApplet2893 = null; - } - -} diff --git a/client/src/main/java/com/aapeli/client/NickTextField.java b/client/src/main/java/com/aapeli/client/NickTextField.java deleted file mode 100644 index 3362c80a..00000000 --- a/client/src/main/java/com/aapeli/client/NickTextField.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.BadWordFilter; -import com.aapeli.client.InputTextField; -import com.aapeli.client.TextManager; - -public class NickTextField extends InputTextField { - - public static final int ERROR_NONE = 0; - public static final int ERROR_EMPTY = 1; - public static final int ERROR_TOOSHORT = 2; - public static final int ERROR_TOOLONG = 3; - public static final int ERROR_BADWORDS = 4; - public static final int ERROR_FORBIDDEN = 5; - public static final int NICK_MAX_LENGTH = 16; - private static final String aString3530 = "ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖÜÁÉÍÓÚÑabcdefghijklmnopqrstuvwxyzåäöüáéíóúñ0123456789- "; - private boolean aBoolean3531; - private BadWordFilter aBadWordFilter3532; - private BadWordFilter aBadWordFilter3533; - private int anInt3534; - private static final String aString3535 = "Anonymous"; - - - public NickTextField(TextManager var1) { - this(var1, false); - } - - public NickTextField(TextManager var1, boolean var2) { - super(15); - this.aBoolean3531 = var2; - this.aBadWordFilter3532 = new BadWordFilter(var1, true); - this.aBadWordFilter3533 = new BadWordFilter(var1, false); - this.anInt3534 = 0; - } - - public String getNick() { - this.anInt3534 = 0; - String var1 = this.getInputText(false); - var1 = this.method969(var1); - this.setText(var1); - int var2 = var1.length(); - if (var2 == 0) { - if (!this.aBoolean3531) { - this.anInt3534 = 1; - return null; - } - - var1 = "Anonymous"; - var2 = var1.length(); - } - - if (var2 < 3) { - this.anInt3534 = 2; - return null; - } else if (var2 > 15) { - this.anInt3534 = 3; - return null; - } else if (this.aBadWordFilter3532.containsBadWords(var1)) { - this.anInt3534 = 4; - return null; - } else if (this.aBadWordFilter3533.containsBadWords(var1)) { - this.anInt3534 = 5; - return null; - } else { - return var1; - } - } - - public int getLastError() { - return this.anInt3534; - } - - private String method969(String var1) { - var1 = var1.trim(); - int var2 = var1.length(); - StringBuffer var3 = new StringBuffer(var2); - - for (int var5 = 0; var5 < var2; ++var5) { - char var4 = var1.charAt(var5); - if ("ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖÜÁÉÍÓÚÑabcdefghijklmnopqrstuvwxyzåäöüáéíóúñ0123456789- ".indexOf(var4) == -1) { - var4 = 45; - } - - var3.append(var4); - } - - var1 = var3.toString(); - - do { - if ((var2 = var1.length()) <= 0) { - return var1; - } - - if (var1.charAt(0) == 45) { - var1 = var1.substring(1); - } else if (var1.charAt(var2 - 1) == 45) { - var1 = var1.substring(0, var2 - 1); - } - - var1 = var1.trim(); - } while (var1.length() != var2); - - return var1; - } - -} diff --git a/client/src/main/java/com/aapeli/client/Panel_Sub23.java b/client/src/main/java/com/aapeli/client/Panel_Sub23.java deleted file mode 100644 index 4b095508..00000000 --- a/client/src/main/java/com/aapeli/client/Panel_Sub23.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.applet.AApplet; -import com.aapeli.colorgui.RoundButton; -import com.aapeli.tools.DelayRepaint; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.LayoutManager; -import java.awt.Panel; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -class Panel_Sub23 extends Panel implements ActionListener { - - private static final Color aColor600; - private static final Color aColor601; - private static final Color aColor602; - private static final Color aColor603; - private static final Color aColor604; - private static final Color aColor605; - private static final Font aFont606; - private static final Font aFont607; - private AApplet anAApplet608; - private NeedAccountFrame aNeedAccountFrame609; - private RoundButton aRoundButton610; - private RoundButton aRoundButton611; - private RoundButton aRoundButton612; - private Image anImage613; - private Graphics aGraphics614; - private static final String[] aStringArray615 = new String[8]; - - - protected Panel_Sub23(AApplet var1, NeedAccountFrame var2) { - this.anAApplet608 = var1; - this.aNeedAccountFrame609 = var2; - this.setSize(500, 265); - this.setBackground(aColor600); - this.method479(); - } - - public void addNotify() { - super.addNotify(); - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - if (this.anImage613 == null) { - this.anImage613 = this.createImage(500, 265); - this.aGraphics614 = this.anImage613.getGraphics(); - } - - boolean var2 = false; - Image var3 = this.anAApplet608.imageManager.getShared("tf-background.gif", true); - if (var3 != null) { - this.aGraphics614.drawImage(var3, 0, 0, this); - } else { - this.aGraphics614.setColor(aColor600); - this.aGraphics614.fillRect(0, 0, 500, 265); - var2 = true; - } - - this.aGraphics614.setColor(aColor601); - this.aGraphics614.setFont(aFont606); - StringDraw.drawStringWithMaxWidth(this.aGraphics614, this.anAApplet608.textManager.getShared("NeedAccount_Info1"), 10, 35, -1, 480); - StringDraw.drawStringWithMaxWidth(this.aGraphics614, this.anAApplet608.textManager.getShared("NeedAccount_Info2"), 10, 97, -1, 480); - this.aGraphics614.setFont(aFont607); - StringDraw.drawStringWithMaxWidth(this.aGraphics614, this.anAApplet608.textManager.getShared("NeedAccount_NotLoggedIn"), 10, 215, -1, 480); - this.aGraphics614.setColor(aColor602); - this.aGraphics614.drawLine(5, 192, 495, 192); - var1.drawImage(this.anImage613, 0, 0, this); - if (var2) { - new DelayRepaint(this); - } - - } - - public synchronized void actionPerformed(ActionEvent var1) { - this.aNeedAccountFrame609.close(); - Object var2 = var1.getSource(); - if (var2 == this.aRoundButton610) { - this.anAApplet608.setEndState(AApplet.END_QUIT_REGISTER); - this.anAApplet608.param.showRegisterPage(); - } else if (var2 == this.aRoundButton612) { - this.anAApplet608.setEndState(AApplet.END_QUIT); - this.anAApplet608.param.showQuitPage(); - } - - } - - private void method479() { - this.setLayout((LayoutManager) null); - this.aRoundButton610 = new RoundButton(this.anAApplet608.textManager.getShared("NeedAccount_CreateButton")); - this.aRoundButton610.setBounds(10, 134, 200, 35); - this.aRoundButton610.setBackground(aColor603); - this.aRoundButton610.addActionListener(this); - this.add(this.aRoundButton610); - this.aRoundButton611 = new RoundButton(this.anAApplet608.textManager.getShared("NeedAccount_LaterButton")); - this.aRoundButton611.setBounds(360, 144, 125, 25); - this.aRoundButton611.setBackground(aColor604); - this.aRoundButton611.addActionListener(this); - this.add(this.aRoundButton611); - this.aRoundButton612 = new RoundButton(this.anAApplet608.textManager.getShared("NeedAccount_LoginButton")); - this.aRoundButton612.setBounds(10, 233, 125, 20); - this.aRoundButton612.setBackground(aColor605); - this.aRoundButton612.addActionListener(this); - this.add(this.aRoundButton612); - } - - static { - aStringArray615[0] = "NeedAccount_CreateButton"; - aStringArray615[1] = "NeedAccount_LoginButton"; - aStringArray615[2] = "NeedAccount_LaterButton"; - aStringArray615[3] = "NeedAccount_NotLoggedIn"; - aStringArray615[4] = "NeedAccount_Info2"; - aStringArray615[5] = "NeedAccount_Info1"; - aStringArray615[6] = "tf-background.gif"; - aStringArray615[7] = "Dialog"; - aColor600 = new Color(240, 240, 240); - aColor601 = new Color(0, 0, 0); - aColor602 = new Color(64, 64, 64); - aColor603 = new Color(128, 255, 128); - aColor604 = new Color(224, 224, 128); - aColor605 = new Color(144, 208, 144); - aFont606 = new Font("Dialog", 0, 14); - aFont607 = new Font("Dialog", 0, 11); - } -} diff --git a/client/src/main/java/com/aapeli/client/PersonalScore.java b/client/src/main/java/com/aapeli/client/PersonalScore.java deleted file mode 100644 index 14da026e..00000000 --- a/client/src/main/java/com/aapeli/client/PersonalScore.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.PersonalScoreUnit; - -import java.util.Hashtable; -import java.util.StringTokenizer; - -public class PersonalScore { - - private PersonalScoreUnit aPersonalScoreUnit1460; - private Hashtable aHashtable1461; - - - public PersonalScore() { - this((String) null); - } - - public PersonalScore(String var1) { - this.aPersonalScoreUnit1460 = null; - this.aHashtable1461 = new Hashtable(); - if (var1 != null) { - StringTokenizer var2 = new StringTokenizer(var1, "^"); - String var3 = var2.nextToken(); - if (var3.length() > 1) { - this.aPersonalScoreUnit1460 = new PersonalScoreUnit(var3); - } - - while (var2.hasMoreTokens()) { - var3 = var2.nextToken(); - int var4 = var3.indexOf(58); - String var5 = var3.substring(0, var4); - var3 = var3.substring(var4 + 1); - this.aHashtable1461.put(var5, new PersonalScoreUnit(var3)); - } - } - - } - - public boolean newScore(String var1, long var2, String var4) { - if (var1 == null) { - if (this.method1677(var2, this.aPersonalScoreUnit1460)) { - this.aPersonalScoreUnit1460 = new PersonalScoreUnit(var2, var4); - return true; - } - } else { - var1 = var1.toLowerCase(); - if (this.method1677(var2, (PersonalScoreUnit) ((PersonalScoreUnit) this.aHashtable1461.get(var1)))) { - this.aHashtable1461.put(var1, new PersonalScoreUnit(var2, var4)); - return true; - } - } - - return false; - } - - public PersonalScoreUnit getPersonalScore() { - return this.getPersonalScore((String) null); - } - - public PersonalScoreUnit getPersonalScore(String var1) { - return var1 == null ? this.aPersonalScoreUnit1460 : (PersonalScoreUnit) ((PersonalScoreUnit) this.aHashtable1461.get(var1.toLowerCase())); - } - - private boolean method1677(long var1, PersonalScoreUnit var3) { - return var3 == null ? true : var1 > var3.getCompScore(); - } -} diff --git a/client/src/main/java/com/aapeli/client/PersonalScoreUnit.java b/client/src/main/java/com/aapeli/client/PersonalScoreUnit.java deleted file mode 100644 index 1a8f8167..00000000 --- a/client/src/main/java/com/aapeli/client/PersonalScoreUnit.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.tools.Tools; - -public final class PersonalScoreUnit { - - private long aLong1462; - private long aLong1463; - private String aString1464; - - - protected PersonalScoreUnit(long var1, String var3) { - this.aLong1462 = System.currentTimeMillis(); - this.aLong1463 = var1; - this.aString1464 = var3; - } - - protected PersonalScoreUnit(String var1) { - int var2 = var1.indexOf(44); - int var3 = var1.indexOf(44, var2 + 1); - this.aLong1462 = Long.parseLong(var1.substring(0, var2)); - this.aLong1463 = Long.parseLong(var1.substring(var2 + 1, var3)); - this.aString1464 = Tools.changeFromSaveable(var1.substring(var3 + 1)); - } - - public long getTimeStamp() { - return this.aLong1462; - } - - public long getCompScore() { - return this.aLong1463; - } - - public String getClientData() { - return this.aString1464; - } -} diff --git a/client/src/main/java/com/aapeli/client/SoundPlayer.java b/client/src/main/java/com/aapeli/client/SoundPlayer.java deleted file mode 100644 index 4ee3f654..00000000 --- a/client/src/main/java/com/aapeli/client/SoundPlayer.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.tools.Tools; - -import java.util.Vector; - -public final class SoundPlayer implements Runnable { - - private final SoundManager soundManager; - private final Vector<ClipPlaybackTask>[] soundQueues; // index of queue == priority, higher == more important - private boolean stayAlive; - private final Thread thread; - - - public SoundPlayer(SoundManager soundManager) { - this.soundManager = soundManager; - this.soundQueues = new Vector[10]; - - for (int i = 0; i < 10; ++i) { - this.soundQueues[i] = new Vector<>(); - } - - this.stayAlive = true; - this.thread = new Thread(this); - this.thread.setDaemon(true); - this.thread.start(); - } - - @Override - public void run() { - if (this.soundManager.isDebug()) { - System.out.println("SoundPlayer: Started"); - } - - do { - Tools.sleep(1000L); - String nextClipName; - if (this.stayAlive) { - while ((nextClipName = this.getNextClip()) != null) { - this.soundManager.play(nextClipName); - } - } - } while (this.stayAlive); - - if (this.soundManager.isDebug()) { - System.out.println("SoundPlayer: Stopped"); - } - - } - - public void play(String clipName) { - this.play(clipName, 5, 1000); - } - - public void play(String clipName, int priority) { - this.play(clipName, priority, 1000); - } - - public void play(String clipName, int priority, int timeoutMs) { - if (priority < 0) { - priority = 0; - } - - if (priority >= 10) { - priority = 9; - } - - if (timeoutMs < 0) { - timeoutMs = 0; - } - - ClipPlaybackTask clipPlaybackTask = new ClipPlaybackTask(clipName, timeoutMs); - synchronized (this.soundQueues[priority]) { - this.soundQueues[priority].addElement(clipPlaybackTask); - } - - this.thread.interrupt(); - } - - public void stop() { - this.stayAlive = false; - } - - private String getNextClip() { - for (int i = 9; i >= 0; --i) { - String soundTask = this.getFirstTaskFromQueue(this.soundQueues[i]); - if (soundTask != null) { - return soundTask; - } - } - - return null; - } - - private String getFirstTaskFromQueue(Vector<ClipPlaybackTask> soundQueue) { - ClipPlaybackTask clipPlaybackTask; - synchronized (soundQueue) { - if (soundQueue.size() == 0) { - return null; - } - - clipPlaybackTask = soundQueue.elementAt(0); - soundQueue.removeElementAt(0); - } - - String clipName = clipPlaybackTask.getClipName(); - if (System.currentTimeMillis() > clipPlaybackTask.getTimeoutTimestamp()) { - if (this.soundManager.isDebug()) { - System.out.println("SoundPlayer: \"" + clipName + "\" timed out"); - } - - return this.getFirstTaskFromQueue(soundQueue); - } else { - return clipName; - } - } -} diff --git a/client/src/main/java/com/aapeli/client/Tournament.java b/client/src/main/java/com/aapeli/client/Tournament.java deleted file mode 100644 index ff208037..00000000 --- a/client/src/main/java/com/aapeli/client/Tournament.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.Parameters; - -public class Tournament { - - private long aLong1522; - private String aString1523; - private int anInt1524; - private String aString1525; - private static final String[] aStringArray1526 = new String[7]; - - - private Tournament(long var1, String var3, int var4, String var5) { - this.aLong1522 = var1; - this.aString1523 = var3; - this.anInt1524 = var4; - this.aString1525 = var5; - } - - public static Tournament getTournament(Parameters var0) { - return getTournament(var0, (String[]) null); - } - - public static Tournament getTournament(Parameters var0, String[] var1) { - String var2 = var0.method1658(); - if (var2 == null) { - return null; - } else { - int var3; - try { - var3 = Integer.parseInt(var2); - if (var3 <= 0) { - throw new Exception(); - } - } catch (Exception var8) { - System.out.println("Tournament: Tournament round was defined but it wasn\'t a valid number"); - return null; - } - - String var4 = var0.method1659(); - int var5 = -1; - if (var1 != null) { - if (var4 == null) { - System.out.println("Tournament: Tournament round was defined but \'subgame\' is not available"); - return null; - } - - var5 = method1736(var4, var1); - if (var5 == -1) { - System.out.println("Tournament: Tournament \'subgame\' didn\'t match any subgame in this game"); - return null; - } - } else if (var4 != null) { - System.out.println("Tournament: Tournament without subgame was requested but \'subgame\' was defined in applet parameters"); - return null; - } - - String var6 = var0.getTicket(); - if (var6 == null) { - System.out.println("Tournament: Tournament round was defined but \'ticket\' is not available"); - return null; - } else { - Tournament var7 = new Tournament(System.currentTimeMillis() + (long) var3 * 1000L, var4, var5, var6); - return var7; - } - } - } - - public boolean isActive() { - return System.currentTimeMillis() < this.aLong1522; - } - - public int getSubGameId() { - if (this.anInt1524 == -1) { - System.out.println("Tournament: Method getSubGameId() was called when no subgames are available"); - return -1; - } else { - return this.anInt1524; - } - } - - public String getSubGame() { - if (this.aString1523 == null) { - System.out.println("Tournament: Method getSubGame() was called when no subgame is defined"); - return null; - } else { - return this.aString1523; - } - } - - public String getTicket() { - return this.aString1525; - } - - private static int method1736(String var0, String[] var1) { - for (int var2 = 0; var2 < var1.length; ++var2) { - if (var0.equalsIgnoreCase(var1[var2])) { - return var2; - } - } - - return -1; - } - - static { - aStringArray1526[0] = "Tournament: Method getSubGame() was called when no subgame is defined"; - aStringArray1526[1] = "Tournament: Tournament without subgame was requested but \'subgame\' was defined in applet parameters"; - aStringArray1526[2] = "Tournament: Tournament round was defined but it wasn\'t a valid number"; - aStringArray1526[3] = "Tournament: Tournament round was defined but \'subgame\' is not available"; - aStringArray1526[4] = "Tournament: Tournament round was defined but \'ticket\' is not available"; - aStringArray1526[5] = "Tournament: Tournament \'subgame\' didn\'t match any subgame in this game"; - aStringArray1526[6] = "Tournament: Method getSubGameId() was called when no subgames are available"; - } -} diff --git a/client/src/main/java/com/aapeli/client/UrlLabelRegister.java b/client/src/main/java/com/aapeli/client/UrlLabelRegister.java deleted file mode 100644 index 4acc33fb..00000000 --- a/client/src/main/java/com/aapeli/client/UrlLabelRegister.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.aapeli.client; - -import com.aapeli.client.Parameters; -import com.aapeli.client.UrlLabel; - -public class UrlLabelRegister extends UrlLabel { - - public UrlLabelRegister(Parameters var1, String var2) { - super(var1.getApplet(), var2, var1.getRegisterPage()); - this.setTarget(0); - } -} diff --git a/client/src/main/java/com/aapeli/colorgui/KeyboardButton.java b/client/src/main/java/com/aapeli/colorgui/KeyboardButton.java deleted file mode 100644 index 79acceb0..00000000 --- a/client/src/main/java/com/aapeli/colorgui/KeyboardButton.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.aapeli.colorgui; - -import com.aapeli.client.IPanel; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.Enumeration; -import java.util.Vector; - -public final class KeyboardButton extends IPanel implements MouseListener { - - private static final Color aColor3354 = new Color(168, 168, 168); - private static final Color aColor3355 = new Color(208, 208, 208); - private static final Color aColor3356 = new Color(128, 128, 128); - private static final Color aColor3357 = new Color(0, 0, 0); - private String aString3358; - private boolean aBoolean3359; - private Vector aVector3360; - private Image anImage3361; - private Graphics aGraphics3362; - private int anInt3363; - private int anInt3364; - private static final String aString3365 = "Dialog"; - - - public KeyboardButton() { - this((String) null); - } - - public KeyboardButton(String var1) { - this.setLabel(var1); - this.aBoolean3359 = false; - this.aVector3360 = new Vector(); - this.addMouseListener(this); - } - - public void addNotify() { - super.addNotify(); - this.aBoolean3359 = false; - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - Dimension var2 = this.getSize(); - int var3 = var2.width; - int var4 = var2.height; - if (this.anImage3361 == null || this.aGraphics3362 == null || var3 != this.anInt3363 || var4 != this.anInt3364) { - this.anImage3361 = this.createImage(var3, var4); - this.aGraphics3362 = this.anImage3361.getGraphics(); - this.anInt3363 = var3; - this.anInt3364 = var4; - } - - boolean var5 = this.isEnabled(); - this.drawBackground(this.aGraphics3362); - this.method864(this.aGraphics3362, var3, var4, var5); - if (this.aString3358 != null) { - this.aGraphics3362.setColor(this.method865(aColor3357, var5)); - int var6 = Math.max(var4 - 8, 9); - Font var7 = new Font("Dialog", 0, var6); - this.aGraphics3362.setFont(var7); - this.aGraphics3362.drawString(this.aString3358, var3 / 2 - this.getFontMetrics(var7).stringWidth(this.aString3358) / 2, var4 / 2 + var6 * 3 / 8 + 1); - } - - var1.drawImage(this.anImage3361, 0, 0, this); - } - - public void mouseEntered(MouseEvent var1) { - } - - public void mouseExited(MouseEvent var1) { - } - - public void mousePressed(MouseEvent var1) { - this.aBoolean3359 = true; - this.repaint(); - } - - public void mouseReleased(MouseEvent var1) { - boolean var2 = this.aBoolean3359; - this.aBoolean3359 = false; - this.repaint(); - if (var2) { - this.method863(); - } - - } - - public void mouseClicked(MouseEvent var1) { - } - - public void setLabel(String var1) { - this.aString3358 = var1; - this.repaint(); - } - - public String getLabel() { - return this.aString3358; - } - - public void addActionListener(ActionListener var1) { - Vector var2 = this.aVector3360; - synchronized (this.aVector3360) { - this.aVector3360.addElement(var1); - } - } - - public void removeActionListener(ActionListener var1) { - Vector var2 = this.aVector3360; - synchronized (this.aVector3360) { - this.aVector3360.removeElement(var1); - } - } - - public void setEnabled(boolean var1) { - super.setEnabled(var1); - this.repaint(); - } - - protected void method863() { - Vector var1 = this.aVector3360; - synchronized (this.aVector3360) { - if (this.aVector3360.size() != 0) { - ActionEvent var2 = new ActionEvent(this, 1001, this.aString3358); - Enumeration var3 = this.aVector3360.elements(); - - while (var3.hasMoreElements()) { - ((ActionListener) ((ActionListener) var3.nextElement())).actionPerformed(var2); - } - - } - } - } - - private void method864(Graphics var1, int var2, int var3, boolean var4) { - var1.setColor(this.method865(aColor3354, var4)); - var1.fillRect(1, 1, var2 - 2, var3 - 2); - var1.setColor(this.method865(!this.aBoolean3359 ? aColor3355 : aColor3356, var4)); - var1.drawLine(1, 0, var2 - 2, 0); - var1.drawLine(0, 1, var2 - 2, 1); - var1.drawLine(0, 1, 0, var3 - 2); - var1.drawLine(1, 0, 1, var3 - 3); - var1.fillRect(2, 2, 1, 1); - var1.fillRect(var2 - 3, 2, 1, 1); - var1.setColor(this.method865(!this.aBoolean3359 ? aColor3356 : aColor3355, var4)); - var1.drawLine(1, var3 - 1, var2 - 2, var3 - 1); - var1.drawLine(1, var3 - 2, var2 - 1, var3 - 2); - var1.drawLine(var2 - 1, 1, var2 - 1, var3 - 2); - var1.drawLine(var2 - 2, 2, var2 - 2, var3 - 1); - var1.fillRect(2, var3 - 3, 1, 1); - var1.fillRect(var2 - 3, var3 - 3, 1, 1); - } - - private Color method865(Color var1, boolean var2) { - if (var2) { - return var1; - } else { - int var3 = var1.getRed(); - int var4 = var1.getGreen(); - int var5 = var1.getBlue(); - int var6 = aColor3354.getRed(); - int var7 = aColor3354.getGreen(); - int var8 = aColor3354.getBlue(); - int var9 = (var3 + var6) / 2; - int var10 = (var4 + var7) / 2; - int var11 = (var5 + var8) / 2; - return new Color(var9, var10, var11); - } - } - -} diff --git a/client/src/main/java/com/aapeli/colorgui/ProgressBar.java b/client/src/main/java/com/aapeli/colorgui/ProgressBar.java deleted file mode 100644 index 19cad195..00000000 --- a/client/src/main/java/com/aapeli/colorgui/ProgressBar.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.aapeli.colorgui; - -import com.aapeli.client.IPanel; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.Shape; - -public class ProgressBar extends IPanel { - - public static final int TYPE_SOLID = 0; - public static final int TYPE_SLIDE = 1; - public static final int TYPE_BOX = 2; - public static final int TYPE_GLOSSY = 3; - private static final Color aColor3366 = new Color(0, 0, 0); - private static final Color aColor3367 = new Color(255, 255, 255); - private static final Color aColor3368 = new Color(0, 0, 255); - private Color aColor3369; - private Color aColor3370; - private Color aColor3371; - private int anInt3372; - private int anInt3373; - private double aDouble3374; - private Image anImage3375; - private Graphics aGraphics3376; - private int anInt3377; - private int anInt3378; - - - public ProgressBar() { - this(0, 1, 0.0D); - } - - public ProgressBar(int var1) { - this(var1, 1, 0.0D); - } - - public ProgressBar(int var1, int var2) { - this(var1, var2, 0.0D); - } - - public ProgressBar(int var1, int var2, double var3) { - this.setBarType(var1); - this.setBorderSize(var2); - this.setBorderColor(aColor3366); - this.setBackgroundColor(aColor3367); - this.setBarColor(aColor3368); - this.setProgress(var3); - this.anInt3377 = this.anInt3378 = -1; - } - - public void update(Graphics var1) { - Dimension var2 = this.getSize(); - int var3 = var2.width; - int var4 = var2.height; - if (var3 != this.anInt3377 || var4 != this.anInt3378) { - this.anImage3375 = null; - } - - if (this.anImage3375 == null) { - try { - this.anImage3375 = this.createImage(var3, var4); - this.aGraphics3376 = this.anImage3375.getGraphics(); - } catch (NullPointerException var7) { - return; - } - } - - this.aGraphics3376.setColor(this.aColor3370); - this.aGraphics3376.fillRect(0, 0, var3, var4); - int var5 = this.anInt3373; - this.method866(this.aGraphics3376, var5, var5, var3 - var5 * 2, var4 - var5 * 2); - if (var5 > 0) { - this.aGraphics3376.setColor(this.aColor3369); - - for (int var6 = 0; var6 < var5; ++var6) { - this.aGraphics3376.drawRect(var6, var6, var3 - var6 - 1, var4 - var6 - 1); - } - } - - var1.drawImage(this.anImage3375, 0, 0, this); - } - - public void setBarType(int var1) { - this.anInt3372 = var1; - this.repaint(); - } - - public void setBorderSize(int var1) { - this.anInt3373 = var1; - } - - public void setBorderColor(Color var1) { - this.aColor3369 = var1; - this.repaint(); - } - - public void setBackgroundColor(Color var1) { - this.aColor3370 = var1; - this.setBackground(this.aColor3370); - this.repaint(); - } - - public void setBarColor(Color var1) { - this.aColor3371 = var1; - this.repaint(); - } - - public void setProgress(double var1) { - if (var1 < 1.0E-4D) { - var1 = 0.0D; - } else if (var1 > 0.9999D) { - var1 = 1.0D; - } - - this.aDouble3374 = var1; - this.repaint(); - } - - public double getProgress() { - return this.aDouble3374; - } - - public int getProgressPercent() { - int var1 = (int) (this.aDouble3374 * 100.0D + 0.5D); - if (var1 == 0 && this.aDouble3374 > 0.0D) { - var1 = 1; - } else if (var1 == 100 && this.aDouble3374 < 1.0D) { - var1 = 99; - } - - return var1; - } - - public boolean isCompleted() { - return this.getProgressPercent() == 100; - } - - private void method866(Graphics var1, int var2, int var3, int var4, int var5) { - int var6 = (int) ((double) var4 * this.aDouble3374 + 0.5D); - if (var6 != 0) { - if (this.anInt3372 == 0) { - this.method867(var1, var2, var3, var6, var5); - } else if (this.anInt3372 == 1) { - this.method868(var1, var2, var3, var6, var5); - } else if (this.anInt3372 == 2) { - this.method869(var1, var2, var3, var6, var5); - } else if (this.anInt3372 == 3) { - this.method870(var1, var2, var3, var6, var5); - } - - } - } - - private void method867(Graphics var1, int var2, int var3, int var4, int var5) { - var1.setColor(this.aColor3371); - var1.fillRect(var2, var3, var4, var5); - } - - private void method868(Graphics var1, int var2, int var3, int var4, int var5) { - int var6 = this.aColor3371.getRed(); - int var7 = this.aColor3371.getGreen(); - int var8 = this.aColor3371.getBlue(); - int var9 = (this.aColor3370.getRed() + var6) / 2; - int var10 = (this.aColor3370.getGreen() + var7) / 2; - int var11 = (this.aColor3370.getBlue() + var8) / 2; - int var12 = var6 - var9; - int var13 = var7 - var10; - int var14 = var8 - var11; - double var15 = 1.0D * (double) var12 / (double) var4; - double var17 = 1.0D * (double) var13 / (double) var4; - double var19 = 1.0D * (double) var14 / (double) var4; - - for (int var21 = 0; var21 < var4; ++var21) { - var1.setColor(new Color((int) ((double) var9 + var15 * (double) var21 + 0.5D), (int) ((double) var10 + var17 * (double) var21 + 0.5D), (int) ((double) var11 + var19 * (double) var21 + 0.5D))); - var1.drawLine(var2 + var21, var3, var2 + var21, var3 + var5 - 1); - } - - } - - private void method869(Graphics var1, int var2, int var3, int var4, int var5) { - int var6 = var5 * 2 / 3; - int var7 = (var4 + var6 / 2) / var6; - if (this.aDouble3374 > 0.0D && var7 == 0) { - var7 = 1; - } - - if (this.aDouble3374 == 1.0D && var7 * var6 < var4) { - ++var7; - } - - var1.setColor(this.aColor3371); - - for (int var8 = 0; var8 < var7; ++var8) { - var1.fillRect(var2 + var8 * var6 + 1, var3 + 1, var6 - 2, var5 - 2); - } - - } - - private void method870(Graphics var1, int var2, int var3, int var4, int var5) { - int var6 = this.aColor3371.getRed(); - int var7 = this.aColor3371.getGreen(); - int var8 = this.aColor3371.getBlue(); - var6 = (255 + var6) / 2; - var7 = (255 + var7) / 2; - var8 = (255 + var8) / 2; - var1.setColor(this.aColor3371); - var1.fillRect(var2, var3, var4, var5); - var1.setColor(new Color(var6, var7, var8)); - Shape var9 = var1.getClip(); - var1.setClip(var2, var3, var4, var5); - var1.fillRoundRect(var2, var3 - var5 / 2, var4, var5, 10, 10); - var1.setClip(var9); - } - -} diff --git a/client/src/main/java/com/aapeli/credit/BuyCreditsHandler.java b/client/src/main/java/com/aapeli/credit/BuyCreditsHandler.java deleted file mode 100644 index d3ff41c4..00000000 --- a/client/src/main/java/com/aapeli/credit/BuyCreditsHandler.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.aapeli.credit; - - -public interface BuyCreditsHandler { - - void quitToBuyCredits(); -} diff --git a/client/src/main/java/com/aapeli/credit/Canvas_Sub9.java b/client/src/main/java/com/aapeli/credit/Canvas_Sub9.java deleted file mode 100644 index b2653114..00000000 --- a/client/src/main/java/com/aapeli/credit/Canvas_Sub9.java +++ /dev/null @@ -1,278 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.client.ImageManager; -import com.aapeli.client.StringDraw; -import com.aapeli.credit.IPanel_Sub42; -import com.aapeli.tools.DelayRepaint; - -import java.awt.Canvas; -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.MouseMotionListener; - -class Canvas_Sub9 extends Canvas implements MouseMotionListener, MouseListener { - - private static final int[] anIntArray152; - private static final int[] anIntArray153; - private static final String[] aStringArray154; - private static final Color[] aColorArray155; - private static final Color aColor156; - private static final Font aFont157; - private static final Font aFont158; - private ImageManager anImageManager159; - private IPanel_Sub42 anIPanel_Sub42_160; - private int anInt161; - private String aString162; - private boolean aBoolean163; - private boolean aBoolean164; - private boolean aBoolean165; - private long aLong166; - private Image anImage167; - private Graphics aGraphics168; - private static final String[] aStringArray169 = new String[5]; - - - protected Canvas_Sub9(ImageManager var1, IPanel_Sub42 var2, int var3, String var4, boolean var5, boolean var6) { - this.anImageManager159 = var1; - this.anIPanel_Sub42_160 = var2; - this.anInt161 = var3; - this.aString162 = var4; - this.aBoolean163 = var5; - this.setSize(anIntArray152[var3], anIntArray153[var3]); - this.aLong166 = System.currentTimeMillis() + (long) (var6 ? 1250 : 0); - this.addMouseMotionListener(this); - this.addMouseListener(this); - } - - public void addNotify() { - super.addNotify(); - this.aBoolean164 = this.aBoolean165 = false; - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - if (this.anImage167 == null) { - this.anImage167 = this.createImage(anIntArray152[this.anInt161], anIntArray153[this.anInt161]); - this.aGraphics168 = this.anImage167.getGraphics(); - } - - boolean var2 = System.currentTimeMillis() >= this.aLong166; - boolean var3 = false; - Image var4 = this.anImageManager159.getShared("credit-background.jpg", true); - if (var4 != null) { - Point var5 = this.getLocation(); - this.aGraphics168.drawImage(var4, -var5.x, -var5.y, this); - } else { - var3 = true; - } - - var4 = this.method225(); - if (var2) { - if (var4 != null) { - this.aGraphics168.drawImage(var4, 0, 0, this); - } else { - Color var6 = aColorArray155[this.anInt161].brighter(); - if (this.aBoolean164) { - var6 = var6.brighter(); - } - - this.aGraphics168.setColor(var6); - this.aGraphics168.fillRect(0, 0, anIntArray152[this.anInt161], anIntArray153[this.anInt161]); - this.aGraphics168.setColor(aColorArray155[this.anInt161]); - this.aGraphics168.drawRect(0, 0, anIntArray152[this.anInt161] - 1, anIntArray153[this.anInt161] - 1); - var3 = true; - } - } - - if (this.anInt161 == 1) { - var4 = this.anImageManager159.getShared("credit-coins-btn.png", true); - if (var2) { - if (var4 != null) { - this.aGraphics168.drawImage(var4, 17, 3, this); - } else { - var3 = true; - } - } - } - - if (var2) { - this.aGraphics168.setFont(this.anInt161 == 3 ? aFont158 : aFont157); - this.aGraphics168.setColor(aColor156); - StringDraw.drawOutlinedString(this.aGraphics168, aColorArray155[this.anInt161], this.aString162, anIntArray152[this.anInt161] / 2 + (this.anInt161 == 3 && this.aBoolean163 ? 8 : 0), anIntArray153[this.anInt161] / 2 + 7, 0); - } - - var1.drawImage(this.anImage167, 0, 0, this); - if (!var2 || var3) { - new DelayRepaint(this); - } - - } - - public void mouseEntered(MouseEvent var1) { - this.aBoolean164 = true; - this.repaint(); - } - - public void mouseExited(MouseEvent var1) { - this.aBoolean164 = this.aBoolean165 = false; - this.repaint(); - } - - public void mousePressed(MouseEvent var1) { - this.aBoolean165 = true; - this.repaint(); - } - - public void mouseReleased(MouseEvent var1) { - boolean var2 = this.aBoolean165; - this.aBoolean165 = false; - this.repaint(); - if (var2 && System.currentTimeMillis() >= this.aLong166) { - this.method226(); - } - - } - - public void mouseClicked(MouseEvent var1) { - } - - public void mouseMoved(MouseEvent var1) { - } - - public void mouseDragged(MouseEvent var1) { - } - - protected int method223() { - return anIntArray152[this.anInt161]; - } - - protected int method224() { - return anIntArray153[this.anInt161]; - } - - private Image method225() { - String var1 = aStringArray154[this.anInt161]; - if (this.anInt161 != 2) { - var1 = var1 + "-" + (this.anInt161 != 1 && this.aBoolean163 ? "a" : "p"); - } - - if (this.aBoolean164) { - var1 = var1 + "-hl"; - } - - var1 = var1 + ".png"; - return this.anImageManager159.getShared(var1, true); - } - - private void method226() { - ActionEvent var1 = new ActionEvent(this, 1001, this.aString162); - this.anIPanel_Sub42_160.actionPerformed(var1); - } - - static { - aStringArray169[0] = ".png"; - aStringArray169[1] = "-hl"; - aStringArray169[2] = "credit-background.jpg"; - aStringArray169[3] = "credit-coins-btn.png"; - aStringArray169[4] = "Dialog"; - anIntArray152 = new int[]{304, 304, 304, 170}; - anIntArray153 = new int[]{42, 42, 42, 42}; - aStringArray154 = new String[4]; - aStringArray154[0] = "u wAbpF;4}_w v"; - aStringArray154[1] = "u wAbpF;4}_w v"; - aStringArray154[2] = "credit-btn-refresh"; - aStringArray154[3] = "credit-btn-return"; - aColorArray155 = new Color[]{new Color(7, 150, 6), new Color(7, 150, 6), new Color(54, 139, 128), new Color(191, 120, 14)}; - aColor156 = new Color(255, 255, 255); - aFont157 = new Font("Dialog", 1, 20); - aFont158 = new Font("Dialog", 1, 16); - } - - private static char[] method227(String var0) { - char[] var10000 = var0.toCharArray(); - char[] var10001 = var10000; - - while (true) { - int var10002 = var10001.length; - var10001 = var10000; - int var4 = var10002; - if (var10002 >= 2) { - break; - } - - char[] var1 = var10001; - int var2 = var4; - var10000 = var1; - char[] var10003 = var1; - var10002 = var2; - var10001 = var10003; - if (var10002 != 0) { - var10001 = var10000; - boolean var3 = false; - var10003[0] = (char) (var10003[0] ^ 40); - break; - } - } - - return var10001; - } - - private static String method228(char[] var0) { - int var10000 = var0.length; - int var1 = 0; - char[] var10001 = var0; - if (var10000 > 1) { - var10001 = var0; - if (var10000 <= var1) { - return (new String(var0)).intern(); - } - } - - do { - char[] var10002 = var10001; - int var10003 = var1; - - while (true) { - char var10004 = var10002[var10003]; - byte var10005; - switch (var1 % 5) { - case 0: - var10005 = 22; - break; - case 1: - var10005 = 82; - break; - case 2: - var10005 = 18; - break; - case 3: - var10005 = 111; - break; - default: - var10005 = 40; - } - - var10002[var10003] = (char) (var10004 ^ var10005); - ++var1; - if (var10000 != 0) { - break; - } - - var10003 = var10000; - var10002 = var10001; - } - } while (var10000 > var1); - - return (new String(var10001)).intern(); - } -} diff --git a/client/src/main/java/com/aapeli/credit/Class101.java b/client/src/main/java/com/aapeli/credit/Class101.java deleted file mode 100644 index d6cfb748..00000000 --- a/client/src/main/java/com/aapeli/credit/Class101.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.credit.Product; - -class Class101 { - - private long aLong1633; - private int anInt1634; - private final Product aProduct1635; - - - protected Class101(Product var1, int var2) { - this.aProduct1635 = var1; - this.method1802(var2); - } - - protected synchronized void method1802(int var1) { - if (var1 % 2 == 0) { - this.aLong1633 = 5169408336892311L - (long) var1 * 11L; - } else { - this.aLong1633 = -316683490563199L + (long) var1 * 7L; - } - - this.anInt1634 = var1; - } - - protected synchronized int method1803() { - return this.aLong1633 > 0L ? (int) ((5169408336892311L - this.aLong1633) / 11L) : (int) ((this.aLong1633 + 316683490563199L) / 7L); - } - - protected int method1804() { - return this.anInt1634; - } -} diff --git a/client/src/main/java/com/aapeli/credit/Class102.java b/client/src/main/java/com/aapeli/credit/Class102.java deleted file mode 100644 index 30cc66c4..00000000 --- a/client/src/main/java/com/aapeli/credit/Class102.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.credit.Class101; -import com.aapeli.credit.Product; - -class Class102 { - - private Class101 aClass101_1636; - private Class101 aClass101_1637; - private Class101 aClass101_1638; - private long aLong1639; - private final Product aProduct1640; - - - protected Class102(Product var1, long var2) { - this.aProduct1640 = var1; - this.aClass101_1636 = new Class101(var1, 0); - this.aClass101_1637 = new Class101(var1, 0); - this.aClass101_1638 = new Class101(var1, 0); - this.method1805(var2); - } - - protected synchronized void method1805(long var1) { - long var3 = var1 % 947213L; - long var5 = var1 / 947213L % 1086521L; - long var7 = var1 / 947213L / 1086521L; - this.aClass101_1636.method1802((int) var3); - this.aClass101_1637.method1802((int) var5); - this.aClass101_1638.method1802((int) var7); - this.aLong1639 = var1; - } - - protected synchronized long method1806() { - long var1 = (long) this.aClass101_1636.method1803(); - long var3 = (long) this.aClass101_1637.method1803(); - long var5 = (long) this.aClass101_1638.method1803(); - long var7 = var5 * 947213L * 1086521L + var3 * 947213L + var1; - return var7; - } - - protected long method1807() { - return this.aLong1639; - } -} diff --git a/client/src/main/java/com/aapeli/credit/Class103.java b/client/src/main/java/com/aapeli/credit/Class103.java deleted file mode 100644 index f4e167a7..00000000 --- a/client/src/main/java/com/aapeli/credit/Class103.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.credit.PurchaseFrame; - -class Class103 { - - private long aLong1641; - private int anInt1642; - private final PurchaseFrame aPurchaseFrame1643; - - - public Class103(PurchaseFrame var1, int var2) { - this.aPurchaseFrame1643 = var1; - this.method1808(var2); - } - - protected synchronized void method1808(int var1) { - if ((long) var1 % 2L == 0L) { - this.aLong1641 = 2558601322649768L - (long) var1 * 23L; - } else { - this.aLong1641 = -194632254967778L + (long) var1 * 11L; - } - - this.anInt1642 = var1; - } - - protected synchronized int method1809() { - return this.aLong1641 > 0L ? (int) ((2558601322649768L - this.aLong1641) / 23L) : (int) ((this.aLong1641 + 194632254967778L) / 11L); - } - - protected int method1810() { - return this.anInt1642; - } -} diff --git a/client/src/main/java/com/aapeli/credit/IPanel_Sub42.java b/client/src/main/java/com/aapeli/credit/IPanel_Sub42.java deleted file mode 100644 index 6d77fb53..00000000 --- a/client/src/main/java/com/aapeli/credit/IPanel_Sub42.java +++ /dev/null @@ -1,334 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.applet.AApplet; -import com.aapeli.bigtext.BigText; -import com.aapeli.client.IPanel; -import com.aapeli.client.ImageManager; -import com.aapeli.client.Parameters; -import com.aapeli.client.StringDraw; -import com.aapeli.client.TextManager; -import com.aapeli.credit.Canvas_Sub9; -import com.aapeli.credit.Product; -import com.aapeli.credit.PurchaseFrame; -import com.aapeli.tools.DelayRepaint; -import com.aapeli.tools.Tools; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.LayoutManager; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; - -class IPanel_Sub42 extends IPanel implements ItemListener, ActionListener { - - protected static final Color aColor3426; - private static final String aString3427 = "Product__"; - private static final Color aColor3428; - private static final Color aColor3429; - private static final Color aColor3430; - private static final Font aFont3431; - private static final Font aFont3432; - private PurchaseFrame aPurchaseFrame3433; - private Parameters aParameters3434; - private TextManager aTextManager3435; - private ImageManager anImageManager3436; - private Product aProduct3437; - private String aString3438; - private String aString3439; - private String aString3440; - private Canvas_Sub9 aCanvas_Sub9_3441; - private Canvas_Sub9 aCanvas_Sub9_3442; - private Canvas_Sub9 aCanvas_Sub9_3443; - private Canvas_Sub9 aCanvas_Sub9_3444; - private int anInt3445; - private int anInt3446; - private BigText aBigText3447; - private int anInt3448; - private int anInt3449; - private Image anImage3450; - private Graphics aGraphics3451; - private static final String[] aStringArray3452 = new String[17]; - - - protected IPanel_Sub42(PurchaseFrame var1, Parameters var2, TextManager var3, ImageManager var4, Product var5, String var6, String var7) { - this.aPurchaseFrame3433 = var1; - this.aParameters3434 = var2; - this.aTextManager3435 = var3; - this.anImageManager3436 = var4; - this.aProduct3437 = var5; - if (var5 != null) { - String var8 = var5.getProductName(); - String var9 = aString3427 + var8; - if (var3.isAvailable(var9)) { - int var10 = var5.getProductPrice(); - int var11 = var5.getProductDuration(); - this.aString3438 = var3.getWithQuantity(var9, new String[]{"" + var10, "" + var11}, var10); - } else { - this.aString3438 = var3.getShared("PurchaseFrame_NoProductDescription", var8); - } - } else { - this.aString3438 = null; - } - - this.aString3439 = var6; - this.aString3440 = var7; - this.setBackground(aColor3426); - this.setSharedBackground(var4, "credit-background.jpg", 0, 0); - this.setSize(500, 280); - BigText.initialize(var4); - this.aBigText3447 = null; - this.anInt3448 = -1; - this.anInt3449 = 0; - this.anInt3445 = 0; - } - - public void update(Graphics var1) { - if (this.anImage3450 == null) { - this.anImage3450 = this.createImage(500, 280); - this.aGraphics3451 = this.anImage3450.getGraphics(); - } - - this.drawBackground(this.aGraphics3451); - String var2; - if (this.anInt3445 == 2 || this.anInt3445 == 6 || this.anInt3445 == 3) { - this.aGraphics3451.setFont(aFont3432); - this.aGraphics3451.setColor(aColor3430); - var2 = null; - if (this.anInt3445 == 2) { - var2 = "OpeningCreditPurchase"; - } else if (this.anInt3445 == 6) { - var2 = "RefreshingCredits"; - } else if (this.anInt3445 == 3) { - var2 = "ProductPurchase"; - } - - if (var2 != null) { - StringDraw.drawStringWithMaxWidth(this.aGraphics3451, this.aTextManager3435.getShared("PurchaseFrame_Action" + var2), 250, 140, 0, 460); - } - } - - if (this.anInt3445 == 4) { - this.aGraphics3451.setFont(aFont3432); - this.aGraphics3451.setColor(aColor3430); - var2 = null; - if (this.anInt3446 == 1) { - var2 = "Ok"; - } else if (this.anInt3446 == 0) { - var2 = "NoBalance"; - } else if (this.anInt3446 == -1) { - var2 = "Failed"; - } - - if (var2 != null) { - StringDraw.drawStringWithMaxWidth(this.aGraphics3451, this.aTextManager3435.getShared("PurchaseFrame_Purchase" + var2), 250, 140, 0, 460); - } - } - - boolean var6 = false; - if (this.anInt3445 == 1) { - Image var3 = this.anImageManager3436.getShared("credit-coins-bg.png", true); - if (var3 != null) { - this.aGraphics3451.drawImage(var3, 7, 3, this); - } else { - var6 = true; - } - - this.aGraphics3451.setFont(aFont3431); - this.aGraphics3451.setColor(aColor3428); - StringDraw.drawOutlinedString(this.aGraphics3451, aColor3429, this.aTextManager3435.getShared("PurchaseFrame_Credits"), 77, 35, -1); - int var4 = this.aPurchaseFrame3433.method243(); - if (var4 != this.anInt3448) { - this.aBigText3447 = null; - } - - if (this.aBigText3447 == null) { - this.aBigText3447 = new BigText("" + this.aPurchaseFrame3433.method243(), Color.white, 255); - this.anInt3448 = var4; - } - - this.aBigText3447.drawText(this.aGraphics3451, 480, 47, 1, 1); - } - - String var5 = null; - if (this.anInt3445 == 1) { - var5 = this.aString3438; - } else if (this.anInt3445 == 5) { - var5 = this.aTextManager3435.getShared("PurchaseFrame_RefreshAfterGet"); - } else if (this.anInt3445 == -1) { - var5 = this.aTextManager3435.getShared("PurchaseFrame_Error_Message"); - } - - if (var5 != null) { - this.aGraphics3451.setFont(aFont3432); - this.aGraphics3451.setColor(aColor3430); - StringDraw.drawStringWithMaxWidth(this.aGraphics3451, var5, 20, 85, -1, 460); - } - - var1.drawImage(this.anImage3450, 0, 0, this); - if (var6) { - new DelayRepaint(this); - } - - } - - public void itemStateChanged(ItemEvent var1) { - this.method885(); - } - - public void actionPerformed(ActionEvent var1) { - Object var2 = var1.getSource(); - if (var2 == this.aCanvas_Sub9_3441) { - this.method886(); - } else if (var2 == this.aCanvas_Sub9_3442) { - this.method887(); - } else if (var2 == this.aCanvas_Sub9_3443) { - this.method888(); - } else if (var2 == this.aCanvas_Sub9_3444) { - this.aPurchaseFrame3433.method248(); - } - - } - - protected void method881(boolean var1, boolean var2) { - this.setLayout((LayoutManager) null); - this.aCanvas_Sub9_3441 = new Canvas_Sub9(this.anImageManager3436, this, 1, this.aTextManager3435.getShared("PurchaseFrame_ButtonGetCredits"), var1, var2); - this.aCanvas_Sub9_3441.setLocation(493 - this.aCanvas_Sub9_3441.method223(), 270 - this.aCanvas_Sub9_3441.method224()); - this.aCanvas_Sub9_3442 = new Canvas_Sub9(this.anImageManager3436, this, 2, this.aTextManager3435.getShared("PurchaseFrame_ButtonRefresh"), var1, var2); - this.aCanvas_Sub9_3442.setLocation(250 - this.aCanvas_Sub9_3442.method223() / 2, 270 - this.aCanvas_Sub9_3442.method224()); - this.aCanvas_Sub9_3443 = new Canvas_Sub9(this.anImageManager3436, this, 0, this.aString3439, var1, var2); - this.aCanvas_Sub9_3443.setLocation(493 - this.aCanvas_Sub9_3443.method223(), 270 - this.aCanvas_Sub9_3443.method224()); - this.aCanvas_Sub9_3444 = new Canvas_Sub9(this.anImageManager3436, this, 3, this.aString3440, var1, var2); - this.aCanvas_Sub9_3444.setLocation(7, 270 - this.aCanvas_Sub9_3444.method224()); - } - - protected void method882() { - if (this.aString3438 != null && this.aString3439 != null) { - this.method884(1); - } else { - this.method884(-1); - } - - } - - protected void method883(boolean var1) { - if (this.anInt3449 == 1) { - AApplet var2 = this.aParameters3434.getAApplet(); - if (var2 != null) { - var2.callJavaScriptJsonBuyConfirmAnswer(this.aProduct3437, var1); - } - - this.anInt3449 = 2; - } - - } - - private void method884(int var1) { - if (this.anInt3445 != var1) { - this.anInt3445 = var1; - this.setVisible(false); - this.removeAll(); - if (var1 == 1) { - this.add(this.aCanvas_Sub9_3443); - this.add(this.aCanvas_Sub9_3441); - this.method885(); - this.add(this.aCanvas_Sub9_3444); - } else if (var1 == 4) { - this.add(this.aCanvas_Sub9_3444); - } else { - if (var1 == 5) { - this.add(this.aCanvas_Sub9_3442); - } - - if (var1 == -1) { - this.add(this.aCanvas_Sub9_3444); - } - } - - this.setVisible(true); - if (var1 != 2 && var1 != 6 && var1 != 3) { - this.repaint(); - } else { - Tools.forcedRepaint(this); - } - - } - } - - private void method885() { - boolean var1 = false; - boolean var2 = false; - if (this.aProduct3437 != null) { - if (this.aPurchaseFrame3433.method242(this.aProduct3437)) { - var1 = true; - if (this.anInt3449 == 0) { - AApplet var3 = this.aParameters3434.getAApplet(); - if (var3 != null) { - var3.callJavaScriptJsonBuyConfirmNeeded(this.aProduct3437); - } - - this.anInt3449 = 1; - } - } else { - var2 = true; - } - } - - this.aCanvas_Sub9_3443.setVisible(var1); - this.aCanvas_Sub9_3441.setVisible(var2); - } - - private void method886() { - if (!this.aPurchaseFrame3433.method244()) { - this.method884(2); - Tools.sleep(500L); - this.aPurchaseFrame3433.method245(); - Tools.sleep(1000L); - this.method884(5); - } - } - - private void method887() { - this.method884(6); - Tools.sleep(500L); - this.aPurchaseFrame3433.method246(); - this.method884(1); - } - - private void method888() { - this.method884(3); - this.method883(true); - Tools.sleep(500L); - this.anInt3446 = this.aPurchaseFrame3433.method247(this.aProduct3437); - this.method884(4); - } - - static { - aStringArray3452[0] = "PurchaseFrame_NoProductDescription"; - aStringArray3452[1] = "credit-background.jpg"; - aStringArray3452[2] = "PurchaseFrame_ButtonGetCredits"; - aStringArray3452[3] = "PurchaseFrame_ButtonRefresh"; - aStringArray3452[4] = "Ok"; - aStringArray3452[5] = "OpeningCreditPurchase"; - aStringArray3452[6] = "PurchaseFrame_Credits"; - aStringArray3452[7] = "NoBalance"; - aStringArray3452[8] = "PurchaseFrame_Error_Message"; - aStringArray3452[9] = "Failed"; - aStringArray3452[10] = "credit-coins-bg.png"; - aStringArray3452[11] = "PurchaseFrame_Purchase"; - aStringArray3452[12] = "RefreshingCredits"; - aStringArray3452[13] = "PurchaseFrame_RefreshAfterGet"; - aStringArray3452[14] = "ProductPurchase"; - aStringArray3452[15] = "PurchaseFrame_Action"; - aStringArray3452[16] = "Dialog"; - aColor3426 = new Color(246, 222, 178); - aColor3428 = Color.white; - aColor3429 = new Color(184, 92, 0); - aColor3430 = Color.black; - aFont3431 = new Font("Dialog", 1, 24); - aFont3432 = new Font("Dialog", 1, 14); - } -} diff --git a/client/src/main/java/com/aapeli/credit/Product.java b/client/src/main/java/com/aapeli/credit/Product.java deleted file mode 100644 index 28897eca..00000000 --- a/client/src/main/java/com/aapeli/credit/Product.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.credit.Class101; -import com.aapeli.credit.Class102; - -public final class Product { - - private String aString1644; - private String aString1645; - private Class101 aClass101_1646; - private Class101 aClass101_1647; - private Class102 aClass102_1648; - private Class102 aClass102_1649; - private Class102 aClass102_1650; - private long aLong1651; - public static int anInt1652; - - - public Product(String var1, String var2, int var3, int var4, int var5, int var6) { - this.aString1644 = var1; - this.aString1645 = var2; - this.aClass101_1646 = new Class101(this, var3); - this.aClass101_1647 = new Class101(this, var4); - this.aClass102_1648 = new Class102(this, System.currentTimeMillis()); - this.aClass102_1649 = new Class102(this, this.aClass102_1648.method1806() + (long) var6 * 1000L); - this.aClass102_1650 = new Class102(this, 0L); - this.aLong1651 = (long) this.aClass101_1646.method1804() * this.aClass102_1648.method1807(); - } - - public Product(String var1, int var2, int var3, int var4, int var5) { - this(var1, (String) null, var2, var3, var4, var5); - } - - public Product(String var1, int var2, int var3, int var4) { - this.aString1644 = var1; - this.aClass101_1646 = new Class101(this, var2); - this.aClass101_1647 = new Class101(this, var3); - this.aClass102_1648 = new Class102(this, System.currentTimeMillis()); - this.aClass102_1649 = new Class102(this, this.aClass102_1648.method1806() + (long) var4 * 1000L); - this.aClass102_1650 = new Class102(this, 0L); - this.aLong1651 = (long) this.aClass101_1646.method1804() * this.aClass102_1648.method1807(); - } - - public String getProductName() { - return this.aString1644; - } - - public String getProductDescription() { - return this.aString1645; - } - - public int getProductPrice() { - return this.aClass101_1646.method1803(); - } - - public int getProductDuration() { - return this.aClass101_1647.method1803(); - } - - public int getType() { - return 3; - } - - public boolean userHaveProduct() { - this.method1811(); - if (this.aClass102_1650.method1806() > 300000L) { - this.aClass102_1649.method1805(0L); - } - - return this.aClass102_1648.method1806() < this.aClass102_1649.method1806(); - } - - public void userBoughtProduct() { - this.aClass102_1648.method1805(System.currentTimeMillis()); - this.aClass102_1649.method1805(this.aClass102_1648.method1806() + (long) this.aClass101_1647.method1803() * 60L * 1000L); - } - - protected void method1811() { - long var1 = System.currentTimeMillis(); - long var3 = this.aClass102_1648.method1806() - var1; - if (var3 > 0L) { - this.aClass102_1650.method1805(this.aClass102_1650.method1806() + var3); - } - - this.aClass102_1648.method1805(var1); - } -} diff --git a/client/src/main/java/com/aapeli/credit/ProductHandler.java b/client/src/main/java/com/aapeli/credit/ProductHandler.java deleted file mode 100644 index 7f29d94d..00000000 --- a/client/src/main/java/com/aapeli/credit/ProductHandler.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.credit.Product; -import com.aapeli.tools.Tools; - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.StringTokenizer; -import java.util.Vector; - -public class ProductHandler implements Runnable { - - private Hashtable aHashtable1653 = new Hashtable(); - private static final String[] aStringArray1654 = new String[2]; - - - public ProductHandler() { - this.method1812(); - } - - public ProductHandler(String var1) { - StringTokenizer var2 = new StringTokenizer(var1, "^"); - int var3 = Integer.parseInt(var2.nextToken()); - if (var3 != 2 && var3 != 3) { - System.out.println("ProductHandler: Unknown version of productdata!"); - } else { - int var4 = Integer.parseInt(var2.nextToken()); - - for (int var6 = 0; var6 < var4; ++var6) { - Product var5; - if (var3 == 2) { - var5 = new Product(Tools.changeFromSaveable(var2.nextToken()), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken())); - } else { - var5 = new Product(Tools.changeFromSaveable(var2.nextToken()), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken())); - } - - this.addProduct(var5); - } - - this.method1812(); - } - } - - public void run() { - while (true) { - Tools.sleep(5000L); - Enumeration var2 = this.aHashtable1653.elements(); - - while (var2.hasMoreElements()) { - Product var1 = (Product) ((Product) var2.nextElement()); - if (var1 != null) { - var1.method1811(); - } - } - } - } - - public void addProduct(Product var1) { - this.aHashtable1653.put(var1.getProductName().toLowerCase(), var1); - } - - public Product getProduct(String var1) { - return var1 == null ? null : (Product) ((Product) this.aHashtable1653.get(var1.toLowerCase())); - } - - public Product[] getMultipleProducts(String var1) { - String var2 = var1.toLowerCase(); - Product var3 = (Product) ((Product) this.aHashtable1653.get(var2)); - if (var3 == null) { - return null; - } else { - Vector var4 = new Vector(); - var4.addElement(var3); - var2 = var2 + "__"; - Enumeration var5 = this.aHashtable1653.elements(); - - while (var5.hasMoreElements()) { - var3 = (Product) ((Product) var5.nextElement()); - if (var3 != null && var3.getProductName().toLowerCase().startsWith(var2)) { - var4.addElement(var3); - } - } - - int var6 = var4.size(); - Product[] var7 = new Product[var6]; - - for (int var8 = 0; var8 < var6; ++var8) { - var7[var8] = (Product) ((Product) var4.elementAt(var8)); - } - - return var7; - } - } - - public boolean userHaveAnyProduct(String var1) { - String var2 = var1.toLowerCase(); - Enumeration var4 = this.aHashtable1653.elements(); - - Product var3; - do { - if (!var4.hasMoreElements()) { - return false; - } - - var3 = (Product) ((Product) var4.nextElement()); - } while (var3 == null || !var3.getProductName().toLowerCase().startsWith(var2) || !var3.userHaveProduct()); - - return true; - } - - private void method1812() { - Thread var1 = new Thread(this); - var1.setDaemon(true); - var1.start(); - } - - static { - aStringArray1654[0] = "ProductHandler: Unknown version of productdata!"; - aStringArray1654[1] = "__"; - } -} diff --git a/client/src/main/java/com/aapeli/credit/PurchaseFrame.java b/client/src/main/java/com/aapeli/credit/PurchaseFrame.java deleted file mode 100644 index 99a080c9..00000000 --- a/client/src/main/java/com/aapeli/credit/PurchaseFrame.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.applet.AApplet; -import com.aapeli.client.ImageManager; -import com.aapeli.client.Parameters; -import com.aapeli.client.TextManager; -import com.aapeli.tools.QuickTimer; -import com.aapeli.tools.QuickTimerListener; - -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.Point; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; - -public final class PurchaseFrame extends Frame implements WindowListener, QuickTimerListener { - - public static final int BUY_OK = 1; - public static final int BUY_NOBALANCE = 0; - public static final int BUY_FAILED = -1; - private Insets anInsets2579; - private int anInt2580; - private int anInt2581; - private AApplet anAApplet2582; - private PurchaseHandler aPurchaseHandler2583; - private IPanel_Sub42 anIPanel_Sub42_2584; - private Parameters aParameters2585; - private Class103 aClass103_2586; - private String aString2587; - private Object anObject2588; - private boolean aBoolean2589; - private BuyCreditsHandler aBuyCreditsHandler2590; - private int anInt2591; - private static final String[] aStringArray2592 = new String[9]; - - - public PurchaseFrame(PurchaseHandler var1, Parameters var2, TextManager var3, ImageManager var4, Product var5, int var6, Object var7) { - this((AApplet) null, var1, var2, var3, var4, var5, var6, (String) null, (String) null, (String) null, var7); - } - - public PurchaseFrame(AApplet var1, PurchaseHandler var2, Product var3, int var4, Object var5) { - this(var1, var2, var1.param, var1.textManager, var1.imageManager, var3, var4, (String) null, (String) null, (String) null, var5); - } - - public PurchaseFrame(PurchaseHandler var1, Parameters var2, TextManager var3, ImageManager var4, Product var5, int var6, String var7, String var8, String var9) { - this((AApplet) null, var1, var2, var3, var4, var5, var6, var7, var8, var9, (Object) null); - } - - public PurchaseFrame(PurchaseHandler var1, Parameters var2, TextManager var3, ImageManager var4, Product var5, int var6, String var7, String var8, String var9, Object var10) { - this((AApplet) null, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); - } - - public PurchaseFrame(AApplet var1, PurchaseHandler var2, Product var3, int var4, String var5, String var6, String var7) { - this(var1, var2, var1.param, var1.textManager, var1.imageManager, var3, var4, var5, var6, var7, (Object) null); - } - - private PurchaseFrame(AApplet var1, PurchaseHandler var2, Parameters var3, TextManager var4, ImageManager var5, Product var6, int var7, String var8, String var9, String var10, Object var11) { - this.anAApplet2582 = var1; - this.aPurchaseHandler2583 = var2; - this.aParameters2585 = var3; - this.aClass103_2586 = new Class103(this, var7); - this.anInt2591 = this.aClass103_2586.method1810(); - if (var8 == null) { - var8 = var4.getShared("PurchaseFrame_Default_FrameTitle"); - } - - if (var9 == null) { - var9 = var4.getShared("PurchaseFrame_Default_ButtonContinue"); - } - - if (var10 == null) { - var10 = var4.getShared("PurchaseFrame_Default_ButtonBack"); - } - - this.aString2587 = var8; - this.anObject2588 = var11; - if (var6 != null) { - this.anIPanel_Sub42_2584 = new IPanel_Sub42(this, var3, var4, var5, var6, var9, var10); - } else { - this.aString2587 = var4.getShared("PurchaseFrame_Error_FrameTitle"); - this.anIPanel_Sub42_2584 = new IPanel_Sub42(this, var3, var4, var5, (Product) null, (String) null, var10); - } - - this.aBoolean2589 = true; - this.aBuyCreditsHandler2590 = null; - this.anInt2580 = 500; - this.anInt2581 = 280; - if (var1 != null) { - var1.writeThriftLog("buywinopen", "productlabel:s:" + var6.getProductName() + "^coins:i:" + var7); - } - - } - - public void addNotify() { - super.addNotify(); - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - var1.setColor(IPanel_Sub42.aColor3426); - var1.fillRect(0, 0, this.anInt2580, this.anInt2581); - } - - public void windowOpened(WindowEvent var1) { - } - - public void windowClosed(WindowEvent var1) { - } - - public void windowClosing(WindowEvent var1) { - this.method248(); - } - - public void windowActivated(WindowEvent var1) { - } - - public void windowDeactivated(WindowEvent var1) { - } - - public void windowIconified(WindowEvent var1) { - } - - public void windowDeiconified(WindowEvent var1) { - } - - public void qtFinished() { - this.setSize(this.anInt2580, this.anInt2581); - this.requestFocus(); - } - - public void disableButtonArrows() { - this.aBoolean2589 = false; - } - - public void open(Component var1) { - this.open(var1, false); - } - - public void open(Component var1, boolean var2) { - this.setTitle(this.aString2587); - this.setVisible(true); - this.anInsets2579 = this.getInsets(); - this.anInt2580 = this.anInsets2579.left + 500 + this.anInsets2579.right; - this.anInt2581 = this.anInsets2579.top + 280 + this.anInsets2579.bottom; - this.setSize(this.anInt2580, this.anInt2581); - Point var3 = var1.getLocationOnScreen(); - Dimension var4 = var1.getSize(); - this.setLocation(var3.x + var4.width / 2 - this.anInt2580 / 2, var3.y + var4.height / 2 - this.anInt2581 / 2); - this.setBackground(IPanel_Sub42.aColor3426); - this.anIPanel_Sub42_2584.method881(this.aBoolean2589, var2); - this.setLayout((LayoutManager) null); - this.anIPanel_Sub42_2584.setLocation(this.anInsets2579.left, this.anInsets2579.top); - this.add(this.anIPanel_Sub42_2584); - this.anIPanel_Sub42_2584.method882(); - this.addWindowListener(this); - this.toFront(); - this.requestFocus(); - new QuickTimer(250, this); - } - - public void close() { - this.dispose(); - } - - public void setBuyCreditsHandler(BuyCreditsHandler var1) { - this.aBuyCreditsHandler2590 = var1; - } - - protected boolean method242(Product var1) { - return this.aClass103_2586.method1809() >= var1.getProductPrice(); - } - - protected int method243() { - return this.aClass103_2586 != null ? this.aClass103_2586.method1809() : this.anInt2591; - } - - protected boolean method244() { - if (this.aBuyCreditsHandler2590 != null) { - this.aBuyCreditsHandler2590.quitToBuyCredits(); - return true; - } else { - return false; - } - } - - protected void method245() { - this.aParameters2585.showCreditPurchasePage(); - } - - protected void method246() { - this.aClass103_2586.method1808(this.aPurchaseHandler2583.refreshCredits()); - } - - protected int method247(Product var1) { - if (this.anAApplet2582 != null) { - this.anAApplet2582.writeThriftLog("buywinok", (String) null); - this.anAApplet2582.callJavaScriptJsonBuyStarted(var1); - } - - int var2 = this.aPurchaseHandler2583.userBuyProduct(var1, this.anObject2588); - if (this.anAApplet2582 != null) { - this.anAApplet2582.callJavaScriptJsonBuyFinished(var1, var2); - } - - return var2; - } - - protected void method248() { - if (this.anAApplet2582 != null) { - this.anAApplet2582.writeThriftLog("buywincancel", (String) null); - } - - this.anIPanel_Sub42_2584.method883(false); - this.aPurchaseHandler2583.userCanceled(); - } - - static { - aStringArray2592[0] = "productlabel:s:"; - aStringArray2592[1] = "PurchaseFrame_Default_ButtonContinue"; - aStringArray2592[2] = "PurchaseFrame_Default_ButtonBack"; - aStringArray2592[3] = "buywinopen"; - aStringArray2592[4] = "PurchaseFrame_Default_FrameTitle"; - aStringArray2592[5] = "PurchaseFrame_Error_FrameTitle"; - aStringArray2592[6] = "^coins:i:"; - aStringArray2592[7] = "buywincancel"; - aStringArray2592[8] = "buywinok"; - } -} diff --git a/client/src/main/java/com/aapeli/credit/PurchaseHandler.java b/client/src/main/java/com/aapeli/credit/PurchaseHandler.java deleted file mode 100644 index 0adda64d..00000000 --- a/client/src/main/java/com/aapeli/credit/PurchaseHandler.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.aapeli.credit; - -import com.aapeli.credit.Product; - -public interface PurchaseHandler { - - int refreshCredits(); - - int userBuyProduct(Product var1, Object var2); - - void userCanceled(); -} diff --git a/client/src/main/java/com/aapeli/multiuser/ChatGame.java b/client/src/main/java/com/aapeli/multiuser/ChatGame.java deleted file mode 100644 index 0d3bcb69..00000000 --- a/client/src/main/java/com/aapeli/multiuser/ChatGame.java +++ /dev/null @@ -1,351 +0,0 @@ -package com.aapeli.multiuser; - -import com.aapeli.client.BadWordFilter; -import com.aapeli.client.ImageManager; -import com.aapeli.client.Parameters; -import com.aapeli.client.TextManager; -import com.aapeli.colorgui.ColorButton; -import com.aapeli.colorgui.ColorCheckbox; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Image; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.util.Vector; - -public class ChatGame extends ChatBase { - - private static final Color aColor3654; - private boolean aBoolean3655; - private ColorCheckbox aColorCheckbox3656; - private boolean aBoolean3657; - private Component aComponent3658; - private String aString3659; - private Vector aVector3660; - private Vector aVector3661; - private int anInt3662; - private static final String[] aStringArray3663 = new String[12]; - - - public ChatGame(Parameters var1, TextManager var2, ImageManager var3, BadWordFilter var4, boolean var5, boolean var6, int var7, int var8) { - this(var1, var2, var3, var4, var5, var6, false, var7, var8); - } - - public ChatGame(Parameters var1, TextManager var2, ImageManager var3, BadWordFilter var4, boolean var5, boolean var6, boolean var7, int var8, int var9) { - super(var1, var2, var3, var4, false, false, false, var7, var8, var9); - super.gui_userlist.disableSheriffMark(); - super.gui_userlist.disableDimmerNicks(); - this.aBoolean3655 = var5; - this.aBoolean3657 = var6; - this.aString3659 = null; - this.aVector3660 = new Vector(); - this.aVector3661 = new Vector(); - this.anInt3662 = 0; - this.method897(); - this.resizeLayout(); - } - - public void actionPerformed(ActionEvent var1) { - super.actionPerformed(var1); - if (this.aBoolean3657) { - if (var1.getSource() == this.aComponent3658) { - UserListItem var2 = super.gui_userlist.getSelectedUser(); - if (var2 == null) { - super.gui_output.addMessage(super.textManager.getShared("Chat_Game_CantRemoveNone")); - } else { - String var3 = var2.getNick(); - if (var3.equalsIgnoreCase(this.aString3659)) { - super.gui_output.addMessage(super.textManager.getShared("Chat_Game_CantRemoveSelf")); - } else if (this.aVector3660.contains(var3)) { - super.gui_output.addMessage(super.textManager.getShared("Chat_Game_CantRemovePlayer")); - } else { - ChatGameListener[] var4 = this.method898(); - - for (int var5 = 0; var5 < var4.length; ++var5) { - var4[var5].localUserBan(var3); - } - - } - } - } - } - } - - public void addChatGameListener(ChatListener var1) { - this.aVector3661.addElement(var1); - } - - public void removeChatGameListener(ChatListener var1) { - this.aVector3661.removeElement(var1); - } - - public void setBackground(Color var1) { - super.setBackground(var1); - if (this.aBoolean3655) { - this.aColorCheckbox3656.setBackground(var1); - } - - } - - public void setForeground(Color var1) { - super.setForeground(var1); - if (this.aBoolean3655) { - this.aColorCheckbox3656.setForeground(var1); - } - - } - - public void setUserListHeight(int var1) { - this.anInt3662 = var1; - this.resizeLayout(); - } - - public void setBackgroundImage(Image var1, int var2, int var3) { - super.setBackgroundImage(var1, var2, var3); - if (this.aBoolean3655) { - Point var4 = this.aColorCheckbox3656.getLocation(); - this.aColorCheckbox3656.setBackgroundImage(var1, var2 + var4.x, var3 + var4.y); - } - - } - - public int setFullPlayerList(String[] var1) { - super.gui_userlist.removeAllUsers(); - int var2 = var1.length; - - for (int var4 = 0; var4 < var2; ++var4) { - String var3 = this.addToUserList(var1[var4], false); - this.aVector3660.addElement(var3); - } - - return var2; - } - - public int setFullUserList(String[] list, int var2) { - if (var2 >= 0) { - this.aString3659 = UserList.getNickFromUserInfo(list[var2]); - } - - return super.setFullUserList(list, var2); - } - - public String localUserJoin(String var1) { - this.aString3659 = super.localUserJoin(var1); - return this.aString3659; - } - - public String localPlayerJoin(String var1) { - String var2 = this.localUserJoin(var1); - this.aVector3660.addElement(var2); - return var2; - } - - public String playerJoin(String var1) { - return this.playerJoin(var1, (String) null, true); - } - - public String playerJoin(String var1, String var2) { - return this.playerJoin(var1, var2, true); - } - - public String playerJoin(String var1, String var2, boolean var3) { - UserListItem var4 = this.addToUserListNew(var1, false); - String var5 = var4.getNick(); - this.aVector3660.addElement(var5); - if (var3) { - this.method889(var4, var2 != null ? super.textManager.getShared("Chat_Game_PlayerJoinedClan", var5, var2) : super.textManager.getShared("Chat_Game_PlayerJoined", var5)); - } - - return var5; - } - - public void playerLeft(String var1) { - this.playerLeft(var1, false); - } - - public void playerLeft(String var1, boolean var2) { - UserListItem var3 = super.gui_userlist.removeUserNew(var1); - this.aVector3660.removeElement(var1); - if (var3 != null) { - this.method889(var3, super.textManager.getShared("Chat_Game_PlayerLeft" + (var2 ? "ConnectionProblem" : ""), var1)); - } - - } - - public String spectatorJoin(String var1) { - UserListItem var2 = this.addToUserListNew(var1, false); - if (this.method899()) { - this.method889(var2, super.textManager.getShared("Chat_Game_SpectatorJoined", var2.getNick())); - } - - return var2.getNick(); - } - - public void spectatorLeft(String var1) { - this.spectatorLeft(var1, false); - } - - public void spectatorLeft(String var1, boolean var2) { - UserListItem var3 = super.gui_userlist.removeUserNew(var1); - if (var3 != null && this.method899()) { - this.method889(var3, super.textManager.getShared("Chat_Game_SpectatorLeft" + (var2 ? "RemovedByPlayer" : ""), var1)); - } - - } - - public void changeToPlayer(String var1) { - if (super.gui_userlist.getUser(var1) != null && !this.aVector3660.contains(var1)) { - this.aVector3660.addElement(var1); - } - - } - - public void changeToNonPlayer(String var1) { - if (super.gui_userlist.getUser(var1) != null) { - this.aVector3660.removeElement(var1); - } - - } - - public synchronized boolean useRoundButtons() { - if (!super.useRoundButtons()) { - return false; - } else { - if (this.aBoolean3657) { - this.aComponent3658 = this.copyColorButtonToRoundButton(this.aComponent3658); - } - - if (this.aBoolean3655) { - this.aColorCheckbox3656.setBoxPixelRoundedCorners(true); - } - - return true; - } - } - - public void resizeLayout() { - int var1 = super.width / 5; - if (var1 < 100) { - var1 = 100; - } - - if (var1 > 150) { - var1 = 150; - } - - double var2 = ((double) super.height - 100.0D) / 100.0D; - int var4 = (int) (20.0D + var2 * 5.0D); - if (var4 < 20) { - var4 = 20; - } - - if (var4 > 25) { - var4 = 25; - } - - int var5 = super.width - 0 - 3 - var1 - 0; - int var6 = super.height - 0 - var4 - 2 - 0; - int var7 = (int) (40.0D + ((double) var5 - 170.0D) / 430.0D * 60.0D); - int var8 = (int) (70.0D + ((double) var5 - 200.0D) / 500.0D * 80.0D); - if (var7 < 40) { - var7 = 40; - } - - if (var7 > 100) { - var7 = 100; - } - - if (var8 < 70) { - var8 = 70; - } - - if (var8 > 150) { - var8 = 150; - } - - int var9 = var5 - 1 - var7 - (this.aBoolean3655 ? 3 + var8 : 0); - int var10 = 15; - int var11 = super.height - 0 - (this.aBoolean3657 ? var10 + 2 : 0) - 0; - if (this.anInt3662 > 0) { - var11 = this.anInt3662; - var10 = super.height - this.anInt3662 - 0 - 2; - } - - super.gui_userlist.setBounds(0, 0, var1, var11); - if (this.aBoolean3657) { - this.aComponent3658.setBounds(0, super.height - 0 - var10, var1, var10); - } - - synchronized (this) { - if (super.gui_globaloutput == null) { - super.gui_output.setBounds(0 + var1 + 3, 0, var5, var6); - } else { - super.gui_globaloutput.setBounds(0 + var1 + 3, 0, var5, var6); - } - } - - int var12 = 0 + var1 + 3; - int var13 = 0 + var6 + 2; - super.gui_input.setBounds(var12, var13, var9, var4); - int var14 = 0 + var1 + 3 + var9 + 1; - super.gui_say.setBounds(var14, 0 + var6 + 2, var7, var4); - if (this.aBoolean3655) { - this.aColorCheckbox3656.setBounds(0 + var1 + 3 + var9 + 1 + var7 + 3, 0 + var6 + 2 + 1, var8, var4 - 2); - } - - super.gui_idnote.setBounds(var12, var13, var14 - var12 + var7, var4); - } - - private void method897() { - if (this.aBoolean3655) { - this.aColorCheckbox3656 = new ColorCheckbox(super.textManager.getShared("Chat_Game_NoSpectatorJoinPartMessages")); - this.add(this.aColorCheckbox3656); - } - - if (this.aBoolean3657) { - ColorButton var1 = new ColorButton(super.textManager.getShared("Chat_Game_RemoveSpectatorButton")); - var1.setBackground(aColor3654); - var1.addActionListener(this); - this.add(var1); - this.aComponent3658 = var1; - } - - } - - private ChatGameListener[] method898() { - int var1 = this.aVector3661.size(); - ChatGameListener[] var2 = new ChatGameListener[var1]; - - for (int var3 = 0; var3 < var1; ++var3) { - var2[var3] = (ChatGameListener) ((ChatGameListener) this.aVector3661.elementAt(var3)); - } - - return var2; - } - - private boolean method899() { - if (this.aBoolean3655) { - return !this.aColorCheckbox3656.getState(); - } else { - int var1 = super.gui_userlist.getUserCount() - this.aVector3660.size(); - return var1 < 20; - } - } - - static { - aStringArray3663[0] = "Chat_Game_PlayerJoined"; - aStringArray3663[1] = "Chat_Game_PlayerJoinedClan"; - aStringArray3663[2] = "Chat_Game_NoSpectatorJoinPartMessages"; - aStringArray3663[3] = "Chat_Game_RemoveSpectatorButton"; - aStringArray3663[4] = "Chat_Game_CantRemovePlayer"; - aStringArray3663[5] = "Chat_Game_CantRemoveSelf"; - aStringArray3663[6] = "Chat_Game_CantRemoveNone"; - aStringArray3663[7] = "ConnectionProblem"; - aStringArray3663[8] = "Chat_Game_PlayerLeft"; - aStringArray3663[9] = "RemovedByPlayer"; - aStringArray3663[10] = "Chat_Game_SpectatorLeft"; - aStringArray3663[11] = "Chat_Game_SpectatorJoined"; - aColor3654 = new Color(224, 144, 144); - } -} diff --git a/client/src/main/java/com/aapeli/multiuser/ChatGameListener.java b/client/src/main/java/com/aapeli/multiuser/ChatGameListener.java deleted file mode 100644 index ff1d56c7..00000000 --- a/client/src/main/java/com/aapeli/multiuser/ChatGameListener.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.aapeli.multiuser; - - -public interface ChatGameListener { - - void localUserKick(String var1); - - void localUserBan(String var1); -} diff --git a/client/src/main/java/com/aapeli/multiuser/ChatSimple.java b/client/src/main/java/com/aapeli/multiuser/ChatSimple.java deleted file mode 100644 index ca890b75..00000000 --- a/client/src/main/java/com/aapeli/multiuser/ChatSimple.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.aapeli.multiuser; - -import com.aapeli.client.BadWordFilter; -import com.aapeli.client.ImageManager; -import com.aapeli.client.Parameters; -import com.aapeli.client.TextManager; -import com.aapeli.colorgui.ColorCheckbox; - -import java.awt.Color; - -public class ChatSimple extends ChatBase { - - private ColorCheckbox aColorCheckbox3668; - private boolean aBoolean3669; - private boolean aBoolean3670; - private static final String[] aStringArray3671 = new String[5]; - - - public ChatSimple(Parameters var1, TextManager var2, ImageManager var3, BadWordFilter var4, int var5, int var6) { - this(var1, var2, var3, var4, false, var5, var6); - } - - public ChatSimple(Parameters var1, TextManager var2, ImageManager var3, BadWordFilter var4, boolean var5, int var6, int var7) { - super(var1, var2, var3, var4, true, true, false, true, true, var6, var7); - this.aBoolean3669 = var5; - this.method913(); - this.resizeLayout(); - this.aBoolean3670 = true; - } - - public void setBackground(Color var1) { - super.setBackground(var1); - this.aColorCheckbox3668.setBackground(var1); - } - - public void setForeground(Color var1) { - super.setForeground(var1); - this.aColorCheckbox3668.setForeground(var1); - } - - public int setFullUserList(String[] list) { - int var2 = super.setFullUserList(list); - if (this.aBoolean3670) { - if (var2 >= 30) { - this.aColorCheckbox3668.setState(true); - } - - this.aBoolean3670 = false; - } - - return var2; - } - - public String userJoin(String var1) { - UserListItem var2 = this.addToUserListNew(var1, false); - if (!this.aColorCheckbox3668.getState()) { - this.method889(var2, super.textManager.getShared("Chat_Simple_UserJoined", var2.getNick())); - } - - return var2.getNick(); - } - - public void userLeft(String var1) { - UserListItem var2 = super.gui_userlist.removeUserNew(var1); - if (var2 != null && !this.aColorCheckbox3668.getState()) { - this.method889(var2, super.textManager.getShared("Chat_Simple_UserLeft", var1)); - } - - } - - public void resizeLayout() { - int var1 = super.width / 5; - if (var1 < 100) { - var1 = 100; - } - - if (var1 > 150) { - var1 = 150; - } - - double var2 = ((double) super.height - 100.0D) / 100.0D; - int var4 = (int) (20.0D + var2 * 5.0D); - int var5 = this.aBoolean3669 ? 0 : 18; - if (var4 < 20) { - var4 = 20; - } - - if (var4 > 25) { - var4 = 25; - } - - int var6 = super.width - 3 - var1; - int var7 = super.height - var5 - 3 - var4 - 2; - int var8 = (int) (50.0D + ((double) var6 - 200.0D) / 300.0D * 70.0D); - if (var8 < 50) { - var8 = 50; - } - - if (var8 > 100) { - var8 = 100; - } - - int var9 = var6 - 1 - var8; - int var10 = (var6 - 2) / 2; - super.gui_userlist.setBounds(0, 0, var1, super.height); - synchronized (this) { - if (super.gui_globaloutput == null) { - super.gui_output.setBounds(var1 + 3, 0, var6, var7); - } else { - super.gui_globaloutput.setBounds(var1 + 3, 0, var6, var7); - } - } - - int var11 = var1 + 3; - int var12 = var7 + 2; - super.gui_input.setBounds(var11, var12, var9, var4); - int var13 = var1 + 3 + var9 + 1; - super.gui_say.setBounds(var13, var7 + 2, var8, var4); - this.aColorCheckbox3668.setBounds(var1 + 3, super.height - var5, var10 + 2 + var10, var5); - super.gui_idnote.setBounds(var11, var12, var13 - var11 + var8, var4); - } - - public String getRegisterationNeededText() { - return super.textManager.getShared("Chat_Simple_ChatRequiresRegisteration"); - } - - public String getConfirmationNeededText() { - return super.textManager.getShared("Chat_Simple_ChatRequiresConfirmation"); - } - - private void method913() { - this.aColorCheckbox3668 = new ColorCheckbox(super.textManager.getShared("Chat_Simple_NoJoinPartMessages"), this.aBoolean3669); - this.add(this.aColorCheckbox3668); - } - - static { - aStringArray3671[0] = "Chat_Simple_UserJoined"; - aStringArray3671[1] = "Chat_Simple_ChatRequiresRegisteration"; - aStringArray3671[2] = "Chat_Simple_UserLeft"; - aStringArray3671[3] = "Chat_Simple_ChatRequiresConfirmation"; - aStringArray3671[4] = "Chat_Simple_NoJoinPartMessages"; - } -} diff --git a/client/src/main/java/com/aapeli/multiuser/QuitConfirm.java b/client/src/main/java/com/aapeli/multiuser/QuitConfirm.java deleted file mode 100644 index c19429ff..00000000 --- a/client/src/main/java/com/aapeli/multiuser/QuitConfirm.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.aapeli.multiuser; - -import com.aapeli.client.StringDraw; -import com.aapeli.client.TextManager; -import com.aapeli.colorgui.ColorButton; -import com.aapeli.colorgui.RoundButton; -import com.aapeli.multiuser.QuitHandler; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; - -public class QuitConfirm extends Frame implements WindowListener, ActionListener { - - private static final Font aFont216; - private static final Color aColor217; - private static final Color aColor218; - private static final Color aColor219; - private TextManager aTextManager220; - private QuitHandler aQuitHandler221; - private Insets anInsets222; - private int anInt223; - private int anInt224; - private Component aComponent225; - private Component aComponent226; - private static final String[] aStringArray227 = new String[5]; - - - public QuitConfirm(TextManager var1, QuitHandler var2) { - this.aTextManager220 = var1; - this.aQuitHandler221 = var2; - this.anInt223 = 250; - this.anInt224 = 125; - } - - public void addNotify() { - super.addNotify(); - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - double var2 = 64.0D / (double) this.anInt224; - double var4 = var2 * (double) this.anInt224 * 0.5D; - - for (int var6 = 0; var6 < this.anInt224; ++var6) { - var1.setColor(this.method258(216.0D + var4 - var2 * (double) var6, 208.0D + var4 - var2 * (double) var6, 208.0D + var4 - var2 * (double) var6)); - var1.drawLine(0, var6, this.anInt223, var6); - } - - if (this.anInsets222 != null) { - var1.setFont(aFont216); - var1.setColor(aColor217); - StringDraw.drawStringWithMaxWidth(var1, this.aTextManager220.getShared("QuitConfirm_Text"), this.anInsets222.left + 10, this.anInsets222.top + 30, -1, 230); - } - - } - - public void windowOpened(WindowEvent var1) { - } - - public void windowClosed(WindowEvent var1) { - } - - public void windowClosing(WindowEvent var1) { - this.aQuitHandler221.userCancel(); - } - - public void windowActivated(WindowEvent var1) { - } - - public void windowDeactivated(WindowEvent var1) { - } - - public void windowIconified(WindowEvent var1) { - } - - public void windowDeiconified(WindowEvent var1) { - } - - public void actionPerformed(ActionEvent var1) { - Object var2 = var1.getSource(); - if (var2 == this.aComponent225) { - this.aQuitHandler221.userQuit(); - } else { - this.aQuitHandler221.userCancel(); - } - - } - - public void open(Component var1) { - this.open(var1, false); - } - - public void open(Component var1, boolean var2) { - this.setTitle(this.aTextManager220.getShared("QuitConfirm_Title")); - this.setVisible(true); - this.anInsets222 = this.getInsets(); - this.anInt223 = this.anInsets222.left + 250 + this.anInsets222.right; - this.anInt224 = this.anInsets222.top + 125 + this.anInsets222.bottom; - this.setSize(this.anInt223, this.anInt224); - this.setResizable(false); - Point var3 = var1.getLocationOnScreen(); - Dimension var4 = var1.getSize(); - this.setLocation(var3.x + var4.width / 2 - this.anInt223 / 2, var3.y + var4.height / 2 - this.anInt224 / 2); - this.setBackground(aColor219); - this.setLayout((LayoutManager) null); - if (var2) { - RoundButton var5 = new RoundButton(this.aTextManager220.getShared("QuitConfirm_ButtonYes")); - RoundButton var6 = new RoundButton(this.aTextManager220.getShared("QuitConfirm_ButtonNo")); - var5.addActionListener(this); - var6.addActionListener(this); - this.aComponent225 = var5; - this.aComponent226 = var6; - } else { - ColorButton var7 = new ColorButton(this.aTextManager220.getShared("QuitConfirm_ButtonYes")); - ColorButton var8 = new ColorButton(this.aTextManager220.getShared("QuitConfirm_ButtonNo")); - var7.addActionListener(this); - var8.addActionListener(this); - this.aComponent225 = var7; - this.aComponent226 = var8; - } - - this.aComponent225.setBounds(this.anInsets222.left + 10, this.anInsets222.top + 125 - 10 - 25, 100, 25); - this.aComponent225.setBackground(aColor218); - this.aComponent226.setBounds(this.anInsets222.left + 250 - 10 - 100, this.anInsets222.top + 125 - 10 - 25, 100, 25); - this.aComponent226.setBackground(aColor218); - this.add(this.aComponent225); - this.add(this.aComponent226); - this.addWindowListener(this); - this.toFront(); - this.requestFocus(); - } - - public void close() { - this.dispose(); - } - - private Color method258(double var1, double var3, double var5) { - int var7 = (int) (var1 + 0.5D); - int var8 = (int) (var3 + 0.5D); - int var9 = (int) (var5 + 0.5D); - if (var7 < 0) { - var7 = 0; - } - - if (var7 > 255) { - var7 = 255; - } - - if (var8 < 0) { - var8 = 0; - } - - if (var8 > 255) { - var8 = 255; - } - - if (var9 < 0) { - var9 = 0; - } - - if (var9 > 255) { - var9 = 255; - } - - return new Color(var7, var8, var9); - } - - static { - aStringArray227[0] = "QuitConfirm_Text"; - aStringArray227[1] = "QuitConfirm_Title"; - aStringArray227[2] = "QuitConfirm_ButtonYes"; - aStringArray227[3] = "QuitConfirm_ButtonNo"; - aStringArray227[4] = "Dialog"; - aFont216 = new Font("Dialog", 0, 14); - aColor217 = new Color(64, 0, 0); - aColor218 = new Color(208, 208, 16); - aColor219 = new Color(12827579); - } -} diff --git a/client/src/main/java/com/aapeli/multiuser/QuitHandler.java b/client/src/main/java/com/aapeli/multiuser/QuitHandler.java deleted file mode 100644 index 394de20d..00000000 --- a/client/src/main/java/com/aapeli/multiuser/QuitHandler.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.aapeli.multiuser; - - -public interface QuitHandler { - - void userQuit(); - - void userCancel(); -} diff --git a/client/src/main/java/com/aapeli/order/OrderCanvas.java b/client/src/main/java/com/aapeli/order/OrderCanvas.java deleted file mode 100644 index f6ea3f9f..00000000 --- a/client/src/main/java/com/aapeli/order/OrderCanvas.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.aapeli.order; - -import com.aapeli.client.HtmlText; -import com.aapeli.client.ImageManager; -import com.aapeli.client.StringDraw; -import com.aapeli.client.TextManager; - -import java.awt.Canvas; -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Image; - -class OrderCanvas extends Canvas { - - protected static final Color aColor170 = new Color(255, 231, 212); - private static final Font fontDialog18b = new Font("Dialog", Font.BOLD, 18); - private static final Font fontDialog14 = new Font("Dialog", Font.PLAIN, 14); - private static final Font fontDialog13 = new Font("Dialog", Font.PLAIN, 13); - private static final Color aColor174 = Color.black; - private static final Color aColor175 = Color.gray; - private TextManager textManager; - private int anInt177; - private String aString178; - private long aLong179; - private HtmlText htmlText; - private Image image; - private Graphics graphics; - - - protected OrderCanvas(TextManager var1, ImageManager var2) { - this.textManager = var1; - this.setBackground(aColor170); - this.setSize(500, 280); - this.anInt177 = 0; - } - - public void addNotify() { - super.addNotify(); - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - if (this.image == null) { - this.image = this.createImage(500, 280); - this.graphics = this.image.getGraphics(); - } - - this.graphics.setColor(aColor170); - this.graphics.fillRect(0, 0, 500, 280); - this.graphics.setColor(aColor174); - if (this.anInt177 == 1) { - int var2 = this.method233(this.graphics, 20, 45, 460, this.aString178); - this.graphics.setColor(aColor175); - this.graphics.setFont(fontDialog13); - StringDraw.drawStringWithMaxWidth(this.graphics, this.textManager.getShared("OrderFrame_AfterOrderInstructions"), 20, var2 + 20, -1, 460); - int var3 = (int) ((this.aLong179 - System.currentTimeMillis() + 500L) / 1000L); - if (var3 >= 0 && var3 <= 120) { - StringDraw.drawStringWithMaxWidth(this.graphics, this.textManager.getShared("OrderFrame_TimeOutNote", this.textManager.getTime((long) var3)), 20, var2 + 20 + 50, -1, 460); - } - } else { - String var4 = null; - String var5 = null; - if (this.anInt177 == 0) { - var4 = this.textManager.getShared("OrderFrame_Wait"); - } else if (this.anInt177 == 2) { - var4 = this.textManager.getShared("OrderFrame_Bought"); - } else if (this.anInt177 == 3) { - var4 = this.textManager.getShared("OrderFrame_TimeOut"); - var5 = this.textManager.getShared("OrderFrame_TimeOut_Info"); - } else if (this.anInt177 == 4) { - var4 = this.textManager.getShared("OrderFrame_Error"); - var5 = this.textManager.getShared("OrderFrame_Error_Info"); - } - - if (var4 != null) { - this.graphics.setFont(fontDialog18b); - StringDraw.drawStringWithMaxWidth(this.graphics, var4, 250, 110, 0, 460); - if (var5 != null) { - this.graphics.setFont(fontDialog13); - StringDraw.drawStringWithMaxWidth(this.graphics, var5, 250, 140, 0, 460); - } - } - } - - var1.drawImage(this.image, 0, 0, this); - } - - protected void method229(String var1) { - this.aString178 = var1; - this.aLong179 = System.currentTimeMillis() + 900000L; - this.anInt177 = 1; - this.repaint(); - } - - protected void method230() { - this.anInt177 = 2; - this.repaint(); - } - - protected void method231() { - this.anInt177 = 4; - this.repaint(); - } - - protected boolean method232() { - if (this.anInt177 != 1) { - return true; - } else { - if (System.currentTimeMillis() >= this.aLong179) { - this.anInt177 = 3; - } - - this.repaint(); - return this.anInt177 == 3; - } - } - - private int method233(Graphics var1, int var2, int var3, int var4, String var5) { - if (this.htmlText == null) { - var1.setFont(fontDialog14); - this.htmlText = new HtmlText(var1, var4, var5); - } - - return this.htmlText.print(var1, var2, var3); - } -} diff --git a/client/src/main/java/com/aapeli/order/OrderFrame.java b/client/src/main/java/com/aapeli/order/OrderFrame.java deleted file mode 100644 index 09eb7a66..00000000 --- a/client/src/main/java/com/aapeli/order/OrderFrame.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.aapeli.order; - -import com.aapeli.client.ImageManager; -import com.aapeli.client.TextManager; -import com.aapeli.singleclient.SingleClient; -import com.aapeli.tools.Tools; - -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.Point; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; - -public class OrderFrame extends Frame implements Runnable, WindowListener { - - private Insets anInsets228; - private int anInt229; - private int anInt230; - private OrderHandler anOrderHandler231; - private TextManager aTextManager232; - private String aString233; - private SingleClient aSingleClient234; - private OrderCanvas aOrderCanvas__235; - private int anInt236; - public static int anInt237; - private static final String[] aStringArray238 = new String[2]; - - - public OrderFrame(OrderHandler var1, TextManager var2, ImageManager var3, String var4, SingleClient var5) { - this.setResizable(false); - this.anOrderHandler231 = var1; - this.aTextManager232 = var2; - this.aString233 = var4; - this.aSingleClient234 = var5; - this.aOrderCanvas__235 = new OrderCanvas(var2, var3); - this.anInt236 = 0; - } - - public void addNotify() { - super.addNotify(); - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - var1.setColor(OrderCanvas.aColor170); - var1.fillRect(0, 0, this.anInt229, this.anInt230); - } - - public void run() { - this.requestFocus(); - String[] var1 = this.aSingleClient234.createOrderCode(this.aString233); - if (var1 == null) { - this.aOrderCanvas__235.method231(); - synchronized (this) { - this.anInt236 = 4; - } - } else { - String var2 = var1[0]; - String var3 = this.aTextManager232.getShared("OrderFrame_Instructions", var1[1], var1[2], var1[3], var1[4]); - this.aOrderCanvas__235.method229(var3); - if (this.anInt236 == 1) { - boolean var9 = true; - - do { - Tools.sleep(2000L); - if (this.anInt236 == 1 && !this.method259(var2) && this.aOrderCanvas__235.method232()) { - var9 = false; - } - } while (this.anInt236 == 1 && var9); - } - - if (this.anInt236 == 1) { - long var10 = System.currentTimeMillis() + 30000L; - - do { - Tools.sleep(2000L); - if (this.anInt236 == 1 && !this.method259(var2) && System.currentTimeMillis() > var10) { - synchronized (this) { - this.anInt236 = 3; - } - } - } while (this.anInt236 == 1); - } - - if (this.anInt236 == 3) { - this.aSingleClient234.cancelOrderCode(var2); - } - - } - } - - public void windowOpened(WindowEvent var1) { - } - - public void windowClosed(WindowEvent var1) { - } - - public void windowClosing(WindowEvent var1) { - this.close(); - } - - public void windowActivated(WindowEvent var1) { - } - - public void windowDeactivated(WindowEvent var1) { - } - - public void windowIconified(WindowEvent var1) { - } - - public void windowDeiconified(WindowEvent var1) { - } - - public void open(Component var1) { - this.open(var1, this.aTextManager232.getShared("OrderFrame_Title")); - } - - public void open(Component var1, String var2) { - this.setTitle(var2); - this.setVisible(true); - this.anInsets228 = this.getInsets(); - this.anInt229 = this.anInsets228.left + 500 + this.anInsets228.right; - this.anInt230 = this.anInsets228.top + 280 + this.anInsets228.bottom; - this.setSize(this.anInt229, this.anInt230); - Point var3 = var1.getLocationOnScreen(); - Dimension var4 = var1.getSize(); - this.setLocation(var3.x + var4.width / 2 - this.anInt229 / 2, var3.y + var4.height / 2 - this.anInt230 / 2); - this.setBackground(OrderCanvas.aColor170); - this.setLayout((LayoutManager) null); - this.aOrderCanvas__235.setLocation(this.anInsets228.left, this.anInsets228.top); - this.add(this.aOrderCanvas__235); - this.addWindowListener(this); - this.toFront(); - this.requestFocus(); - synchronized (this) { - this.anInt236 = 1; - } - - Thread var5 = new Thread(this); - var5.setDaemon(true); - var5.start(); - } - - public void close() { - this.method260(); - this.dispose(); - } - - private boolean method259(String var1) { - boolean var2 = this.aSingleClient234.pollOrderCode(var1); - if (!var2) { - return false; - } else { - synchronized (this) { - this.anInt236 = 2; - } - - this.aOrderCanvas__235.method230(); - Tools.sleep(2000L); - this.anOrderHandler231.orderCompleted(); - return true; - } - } - - private void method260() { - synchronized (this) { - if (this.anInt236 == 1) { - this.anInt236 = 3; - this.anOrderHandler231.orderCanceled(false); - } - - } - } - - static { - aStringArray238[0] = "OrderFrame_Title"; - aStringArray238[1] = "OrderFrame_Instructions"; - } -} diff --git a/client/src/main/java/com/aapeli/order/OrderHandler.java b/client/src/main/java/com/aapeli/order/OrderHandler.java deleted file mode 100644 index c183ae10..00000000 --- a/client/src/main/java/com/aapeli/order/OrderHandler.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.aapeli.order; - - -public interface OrderHandler { - - void orderCompleted(); - - void orderCanceled(boolean var1); -} diff --git a/client/src/main/java/com/aapeli/settingsgui/GuiListener.java b/client/src/main/java/com/aapeli/settingsgui/GuiListener.java deleted file mode 100644 index 8b22114f..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/GuiListener.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.aapeli.settingsgui; - - -public interface GuiListener { - - void unitValueChanged(); - - void unitButtonClicked(); -} diff --git a/client/src/main/java/com/aapeli/settingsgui/GuiListenerExt.java b/client/src/main/java/com/aapeli/settingsgui/GuiListenerExt.java deleted file mode 100644 index bf300ac9..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/GuiListenerExt.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.settingsgui.Unit; - -public interface GuiListenerExt { - - void unitValueChanged(Unit var1); - - void unitButtonClicked(Unit var1); -} diff --git a/client/src/main/java/com/aapeli/settingsgui/LobbyRoomSettingsPanel.java b/client/src/main/java/com/aapeli/settingsgui/LobbyRoomSettingsPanel.java deleted file mode 100644 index 4b4762df..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/LobbyRoomSettingsPanel.java +++ /dev/null @@ -1,343 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.client.IPanel; -import com.aapeli.client.StringDraw; -import com.aapeli.settingsgui.GuiListener; -import com.aapeli.settingsgui.GuiListenerExt; -import com.aapeli.settingsgui.Rule; -import com.aapeli.settingsgui.Unit; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.LayoutManager; -import java.util.Enumeration; -import java.util.StringTokenizer; -import java.util.Vector; - -public final class LobbyRoomSettingsPanel extends IPanel { - - private static final Font[] aFontArray3506 = new Font[]{new Font("Dialog", 0, 11), new Font("Dialog", 0, 12), new Font("Dialog", 1, 12), new Font("Dialog", 1, 15)}; - private Vector aVector3507 = new Vector(); - private Vector aVector3508 = new Vector(); - private boolean aBoolean3509 = false; - private int anInt3510; - private int anInt3511; - private Unit[] anUnitArray3512; - private Rule[] aRuleArray3513; - private int anInt3514; - private int anInt3515; - private int anInt3516; - private int anInt3517; - private int anInt3518; - private Vector aVector3519 = new Vector(); - private Vector aVector3520 = new Vector(); - private Color aColor3521; - private Image anImage3522; - private int anInt3523; - private int anInt3524; - private Image anImage3525; - private Graphics aGraphics3526; - private static final String aString3527 = "Dialog"; - - - public void addNotify() { - super.addNotify(); - this.repaint(); - } - - public void paint(Graphics var1) { - this.update(var1); - } - - public void update(Graphics var1) { - if (this.aBoolean3509) { - if (this.anImage3525 == null) { - this.anImage3525 = this.createImage(this.anInt3514, this.anInt3515); - this.aGraphics3526 = this.anImage3525.getGraphics(); - } - - if (this.anImage3522 != null) { - this.aGraphics3526.drawImage(this.anImage3522, 0, 0, this.anInt3514, this.anInt3515, this.anInt3523, this.anInt3524, this.anInt3523 + this.anInt3514, this.anInt3524 + this.anInt3515, this); - } else { - this.drawBackground(this.aGraphics3526); - } - - this.aGraphics3526.setColor(this.getForeground()); - int var2 = this.anInt3518; - - for (int var7 = 0; var7 < this.anInt3510; ++var7) { - int var3 = this.anUnitArray3512[var7].method1833(); - if (this.anUnitArray3512[var7].method1831()) { - int var4 = this.anUnitArray3512[var7].method1839(); - if (var4 != 0) { - this.aGraphics3526.setFont(aFontArray3506[this.anUnitArray3512[var7].method1840()]); - String var6 = this.anUnitArray3512[var7].method1838(); - int var5 = var2 + var3 / 2 + 4; - if (var4 == 1) { - StringDraw.drawOutlinedStringWithMaxWidth(this.aGraphics3526, this.aColor3521, var6, this.anInt3517, var5, 0, this.anInt3514 - this.anInt3516 * 2); - } - - if (var4 == 2) { - StringDraw.drawOutlinedString(this.aGraphics3526, this.aColor3521, var6, this.anInt3517 - this.anInt3516 / 2, var5, 1); - } - - if (var4 == 3) { - StringDraw.drawOutlinedString(this.aGraphics3526, this.aColor3521, var6, this.anInt3517 + this.anInt3516 / 2, var5, -1); - } - } - } - - var2 += var3 + this.anInt3518; - } - - var1.drawImage(this.anImage3525, 0, 0, this); - } - } - - public void setBackgroundImage(Image var1, int var2, int var3) { - this.anImage3522 = var1; - this.anInt3523 = var2; - this.anInt3524 = var3; - if (this.aBoolean3509) { - this.method943(); - } - - this.repaint(); - } - - public void setOutlineColor(Color var1) { - this.aColor3521 = var1; - } - - public void addUnit(Unit var1) { - if (!this.aBoolean3509) { - var1.method1829(this); - this.aVector3507.addElement(var1); - } - } - - public void addRule(Rule var1) { - if (!this.aBoolean3509) { - this.aVector3508.addElement(var1); - } - } - - public void ready() { - if (!this.aBoolean3509) { - this.aBoolean3509 = true; - this.anInt3510 = this.aVector3507.size(); - this.anUnitArray3512 = new Unit[this.anInt3510]; - - int var1; - for (var1 = 0; var1 < this.anInt3510; ++var1) { - this.anUnitArray3512[var1] = (Unit) ((Unit) this.aVector3507.elementAt(var1)); - } - - this.aVector3507 = null; - this.anInt3511 = this.aVector3508.size(); - this.aRuleArray3513 = new Rule[this.anInt3511]; - - for (var1 = 0; var1 < this.anInt3511; ++var1) { - this.aRuleArray3513[var1] = (Rule) ((Rule) this.aVector3508.elementAt(var1)); - } - - this.aVector3508 = null; - Dimension var9 = this.getSize(); - this.anInt3514 = var9.width; - this.anInt3515 = var9.height; - double var2 = this.method941(); - this.anInt3516 = 6; - this.anInt3517 = this.anInt3514 / 2; - this.anInt3518 = (int) (5.0D * var2 + 0.1D); - this.setLayout((LayoutManager) null); - Color var4 = this.getBackground(); - Color var5 = this.getForeground(); - int var6 = this.anInt3518; - - for (int var8 = 0; var8 < this.anInt3510; ++var8) { - int var7 = this.anUnitArray3512[var8].method1836(); - if (!this.anUnitArray3512[var8].method1837()) { - var7 = (int) ((double) var7 * var2 + 0.1D); - } - - this.anUnitArray3512[var8].method1846(var4, var5); - this.method942(this.anUnitArray3512[var8], var6, var7); - this.anUnitArray3512[var8].method1832(var7); - var6 += var7 + this.anInt3518; - } - - if (this.anImage3522 != null) { - this.method943(); - } - - this.repaint(); - } - } - - public void addGuiListener(GuiListener var1) { - this.aVector3519.addElement(var1); - } - - public void removeGuiListener(GuiListener var1) { - this.aVector3519.removeElement(var1); - } - - public void addGuiListenerExt(GuiListenerExt var1) { - this.aVector3520.addElement(var1); - } - - public void removeGuiListenerExt(GuiListenerExt var1) { - this.aVector3520.removeElement(var1); - } - - public String getSaveableData() { - String var1 = ""; - boolean var3 = true; - - for (int var4 = 0; var4 < this.anInt3510; ++var4) { - String var2 = this.anUnitArray3512[var4].method1844(); - if (var2 != null) { - if (!var3) { - var1 = var1 + "^"; - } else { - var3 = false; - } - - var1 = var1 + var2; - } - } - - return var1; - } - - public void setSaveableData(String var1) { - if (var1 != null) { - StringTokenizer var2 = new StringTokenizer(var1, "^"); - - for (int var3 = 0; var3 < this.anInt3510; ++var3) { - if (this.anUnitArray3512[var3].method1843()) { - this.anUnitArray3512[var3].method1845(var2.nextToken()); - } - } - } - - this.checkAllRules(); - } - - public void checkAllRules() { - int var1 = 0; - - boolean var2; - do { - var2 = false; - - for (int var3 = 0; var3 < this.anInt3511; ++var3) { - if (this.aRuleArray3513[var3].method1827()) { - var2 = true; - } - } - - ++var1; - } while (var2 && var1 < this.anInt3510); - - this.repaint(); - } - - protected void method938(Unit var1) { - this.checkAllRules(); - this.method939(var1); - } - - protected void method939(Unit var1) { - Enumeration var2 = this.aVector3519.elements(); - - while (var2.hasMoreElements()) { - ((GuiListener) ((GuiListener) var2.nextElement())).unitValueChanged(); - } - - var2 = this.aVector3520.elements(); - - while (var2.hasMoreElements()) { - ((GuiListenerExt) ((GuiListenerExt) var2.nextElement())).unitValueChanged(var1); - } - - } - - protected void method940(Unit var1) { - Enumeration var2 = this.aVector3519.elements(); - - while (var2.hasMoreElements()) { - ((GuiListener) ((GuiListener) var2.nextElement())).unitButtonClicked(); - } - - var2 = this.aVector3520.elements(); - - while (var2.hasMoreElements()) { - ((GuiListenerExt) ((GuiListenerExt) var2.nextElement())).unitButtonClicked(var1); - } - - } - - private double method941() { - int var1 = 0; - int var2 = 0; - - for (int var4 = 0; var4 < this.anInt3510; ++var4) { - int var3 = this.anUnitArray3512[var4].method1836(); - if (this.anUnitArray3512[var4].method1837()) { - var1 += var3; - } else { - var2 += var3; - } - - if (var4 < this.anInt3510 - 1) { - var2 += 5; - } - } - - if (var1 + var2 <= this.anInt3515) { - return 1.0D; - } else { - double var6 = 1.0D * (double) (this.anInt3515 - var1) / (double) var2; - if (var6 < 0.5D) { - var6 = 0.5D; - } - - return var6; - } - } - - private void method942(Unit var1, int var2, int var3) { - Component var4 = var1.method1841(); - if (var4 != null) { - var4.setBounds(this.anInt3517 + this.anInt3516 / 2, var2, (int) ((double) (this.anInt3514 - this.anInt3516 - this.anInt3516 / 2 - this.anInt3517) * var1.method1834() + 0.5D), var3); - this.add(var4); - } else { - Component[] var5 = var1.method1842(); - if (var5 != null) { - int var6 = var5.length; - int var7 = this.anInt3517 + this.anInt3516 / 2; - int var8 = (int) ((double) (this.anInt3514 - this.anInt3516 - this.anInt3516 / 2 - this.anInt3517) * var1.method1834() + 0.5D); - int var9 = var8 / var6; - - for (int var10 = 0; var10 < var6; ++var10) { - var5[var10].setBounds(var7 + var10 * var9, var2, var9 - 5, var3); - this.add(var5[var10]); - } - } - - } - } - - private void method943() { - for (int var1 = 0; var1 < this.anInt3510; ++var1) { - this.anUnitArray3512[var1].method1835(this.anImage3522, this.anInt3523, this.anInt3524); - } - - } - -} diff --git a/client/src/main/java/com/aapeli/settingsgui/Rule.java b/client/src/main/java/com/aapeli/settingsgui/Rule.java deleted file mode 100644 index b477dcdd..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/Rule.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.settingsgui.Unit; - -public final class Rule { - - private int anInt1685; - private Unit anUnit1686; - private Unit anUnit1687; - private int anInt1688; - private int anInt1689; - private boolean aBoolean1690; - - - public Rule(Unit var1, int var2, Unit var3, int var4) { - this.anInt1685 = 0; - this.anUnit1686 = var1; - this.anInt1688 = var2; - this.anUnit1687 = var3; - this.anInt1689 = var4; - } - - public Rule(Unit var1, int var2, Unit var3, boolean var4) { - this.anInt1685 = 1; - this.anUnit1686 = var1; - this.anInt1688 = var2; - this.anUnit1687 = var3; - this.aBoolean1690 = var4; - } - - protected boolean method1827() { - return this.method1828(this.anUnit1686); - } - - protected boolean method1828(Unit var1) { - return var1 != this.anUnit1686 ? false : (var1.getItemState() != this.anInt1688 ? false : (this.anInt1685 == 0 ? this.anUnit1687.setItemState(this.anInt1689) : this.anUnit1687.method1830(this.aBoolean1690))); - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/Unit.java b/client/src/main/java/com/aapeli/settingsgui/Unit.java deleted file mode 100644 index fe1598af..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/Unit.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.aapeli.settingsgui; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Image; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; - -public class Unit implements FocusListener, ItemListener, ActionListener { - - private LobbyRoomSettingsPanel anLobbyRoomSettingsPanel__1691; - private String aString1692; - private boolean aBoolean1693; - private double aDouble1694; - private int anInt1695; - public static boolean aBoolean1696; - - - protected Unit(String var1) { - this.aString1692 = var1; - this.aBoolean1693 = true; - this.aDouble1694 = 1.0D; - } - - public void focusGained(FocusEvent var1) { - } - - public void focusLost(FocusEvent var1) { - this.anLobbyRoomSettingsPanel__1691.method939(this); - } - - public void itemStateChanged(ItemEvent var1) { - this.anLobbyRoomSettingsPanel__1691.method938(this); - } - - public void actionPerformed(ActionEvent var1) { - this.anLobbyRoomSettingsPanel__1691.method940(this); - } - - public void setRelativeWidth(double var1) { - if (var1 <= 0.0D || var1 > 1.0D) { - var1 = 1.0D; - } - - this.aDouble1694 = var1; - } - - protected void method1829(LobbyRoomSettingsPanel var1) { - this.anLobbyRoomSettingsPanel__1691 = var1; - } - - protected boolean method1830(boolean var1) { - if (var1 == this.aBoolean1693) { - return false; - } else { - this.aBoolean1693 = var1; - Component var2 = this.method1841(); - if (var2 != null) { - var2.setVisible(var1); - } - - return true; - } - } - - protected boolean method1831() { - return this.aBoolean1693; - } - - protected void method1832(int var1) { - this.anInt1695 = var1; - } - - protected int method1833() { - return this.anInt1695; - } - - protected double method1834() { - return this.aDouble1694; - } - - protected void method1835(Image var1, int var2, int var3) { - } - - protected int method1836() { - return 0; - } - - protected boolean method1837() { - return false; - } - - protected String method1838() { - return this.aString1692; - } - - protected int method1839() { - return 0; - } - - protected int method1840() { - return 1; - } - - protected Component method1841() { - return null; - } - - protected Component[] method1842() { - return null; - } - - protected int getItemState() { - return -1; - } - - protected boolean setItemState(int var1) { - return false; - } - - protected boolean method1843() { - return false; - } - - protected String method1844() { - return null; - } - - protected void method1845(String var1) { - } - - protected void method1846(Color var1, Color var2) { - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/UnitButton.java b/client/src/main/java/com/aapeli/settingsgui/UnitButton.java deleted file mode 100644 index 99bd0a20..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/UnitButton.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.colorgui.ColorButton; -import com.aapeli.colorgui.RoundButton; -import com.aapeli.settingsgui.Unit; - -import java.awt.Color; -import java.awt.Component; - -public final class UnitButton extends Unit { - - private Component aComponent3593; - - - public UnitButton(String var1, Color var2) { - this(var1, var2, false); - } - - public UnitButton(String var1, Color var2, boolean var3) { - super((String) null); - if (var3) { - RoundButton var4 = new RoundButton(var1); - var4.setBackground(var2); - var4.addActionListener(this); - this.aComponent3593 = var4; - } else { - ColorButton var5 = new ColorButton(var1); - var5.setBackground(var2); - var5.addActionListener(this); - this.aComponent3593 = var5; - } - - } - - public void setButtonLabel(String var1) { - if (this.aComponent3593 instanceof RoundButton) { - ((RoundButton) ((RoundButton) this.aComponent3593)).setLabel(var1); - } else { - ((ColorButton) ((ColorButton) this.aComponent3593)).setLabel(var1); - } - - } - - protected int method1836() { - return 25; - } - - protected Component method1841() { - return this.aComponent3593; - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/UnitCheckbox.java b/client/src/main/java/com/aapeli/settingsgui/UnitCheckbox.java deleted file mode 100644 index b0fe209e..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/UnitCheckbox.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.colorgui.ColorCheckbox; -import com.aapeli.settingsgui.Unit; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Image; -import java.awt.Point; - -public final class UnitCheckbox extends Unit { - - private ColorCheckbox aColorCheckbox3594; - - - public UnitCheckbox(String var1) { - super((String) null); - this.aColorCheckbox3594 = new ColorCheckbox(var1); - this.aColorCheckbox3594.addItemListener(this); - } - - protected void method1835(Image var1, int var2, int var3) { - Point var4 = this.aColorCheckbox3594.getLocation(); - this.aColorCheckbox3594.setBackgroundImage(var1, var2 + var4.x, var3 + var4.y); - } - - public int getItemState() { - return this.aColorCheckbox3594.getState() ? 1 : 0; - } - - public boolean setItemState(int var1) { - if (this.getItemState() == var1) { - return false; - } else { - this.aColorCheckbox3594.setState(var1 == 1); - return true; - } - } - - protected int method1836() { - return 20; - } - - protected Component method1841() { - return this.aColorCheckbox3594; - } - - protected boolean method1843() { - return true; - } - - protected String method1844() { - return this.aColorCheckbox3594.getState() ? "t" : "f"; - } - - protected void method1845(String var1) { - this.aColorCheckbox3594.setState(var1.equals("t")); - } - - protected void method1846(Color var1, Color var2) { - this.aColorCheckbox3594.setBackground(var1); - this.aColorCheckbox3594.setForeground(var2); - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/UnitCheckboxGroup.java b/client/src/main/java/com/aapeli/settingsgui/UnitCheckboxGroup.java deleted file mode 100644 index b42c5a63..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/UnitCheckboxGroup.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.colorgui.ColorCheckbox; -import com.aapeli.colorgui.ColorCheckboxGroup; -import com.aapeli.settingsgui.Unit; - -import java.awt.Color; -import java.awt.Component; -import java.util.Vector; - -public final class UnitCheckboxGroup extends Unit { - - private ColorCheckboxGroup aColorCheckboxGroup3595 = new ColorCheckboxGroup(); - private Vector aVector3596 = new Vector(); - - - public UnitCheckboxGroup(String var1) { - super(var1); - } - - public void addItem(String var1) { - ColorCheckbox var2 = new ColorCheckbox(var1); - var2.setGroup(this.aColorCheckboxGroup3595); - var2.addItemListener(this); - this.aVector3596.addElement(var2); - } - - public int getItemState() { - int var1 = this.aVector3596.size(); - - for (int var2 = 0; var2 < var1; ++var2) { - if (((ColorCheckbox) ((ColorCheckbox) this.aVector3596.elementAt(var2))).getState()) { - return var2; - } - } - - return -1; - } - - public boolean setItemState(int var1) { - if (this.getItemState() == var1) { - return false; - } else { - ((ColorCheckbox) ((ColorCheckbox) this.aVector3596.elementAt(var1))).setState(true); - return true; - } - } - - protected int method1836() { - return 20; - } - - protected int method1839() { - return 2; - } - - protected Component[] method1842() { - int var1 = this.aVector3596.size(); - Component[] var2 = new Component[var1]; - - for (int var3 = 0; var3 < var1; ++var3) { - var2[var3] = (ColorCheckbox) ((ColorCheckbox) this.aVector3596.elementAt(var3)); - } - - return var2; - } - - protected boolean method1843() { - return true; - } - - protected String method1844() { - return "" + this.getItemState(); - } - - protected void method1845(String var1) { - this.setItemState(Integer.parseInt(var1)); - } - - protected void method1846(Color var1, Color var2) { - int var3 = this.aVector3596.size(); - - for (int var4 = 0; var4 < var3; ++var4) { - this.method1847((ColorCheckbox) ((ColorCheckbox) this.aVector3596.elementAt(var4)), var1, var2); - } - - } - - private void method1847(ColorCheckbox var1, Color var2, Color var3) { - var1.setBackground(var2); - var1.setForeground(var3); - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/UnitChoice.java b/client/src/main/java/com/aapeli/settingsgui/UnitChoice.java deleted file mode 100644 index cb3f50a9..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/UnitChoice.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.colorgui.Choicer; -import com.aapeli.settingsgui.Unit; - -import java.awt.Component; -import java.util.Vector; - -public final class UnitChoice extends Unit { - - private Choicer aChoicer3597 = new Choicer(); - private Vector aVector3598; - - - public UnitChoice(String var1) { - super(var1); - this.aChoicer3597.addItemListener(this); - this.aVector3598 = new Vector(); - } - - public synchronized void addItem(String var1) { - this.aChoicer3597.addItem(var1); - } - - public synchronized void addInvisibleItem() { - this.aVector3598.addElement(new Integer(this.aChoicer3597.getItemCount())); - } - - public synchronized int getItemState() { - int var1 = this.aChoicer3597.getSelectedIndex(); - int var2 = this.aVector3598.size(); - - for (int var4 = 0; var4 < var2; ++var4) { - Integer var3 = (Integer) ((Integer) this.aVector3598.elementAt(var4)); - if (var3.intValue() <= var1) { - ++var1; - } - } - - return var1; - } - - public synchronized boolean setItemState(int var1) { - if (this.getItemState() == var1) { - return false; - } else { - int var2 = this.aVector3598.size(); - int var4 = 0; - - for (int var6 = 0; var6 < var2; ++var6) { - Integer var5 = (Integer) ((Integer) this.aVector3598.elementAt(var6)); - int var3 = var5.intValue(); - if (var3 == var1) { - return false; - } - - if (var3 < var1) { - ++var4; - } - } - - this.aChoicer3597.setSelectedIndex(var1 - var4); - return true; - } - } - - protected int method1836() { - return 20; - } - - protected int method1839() { - return 2; - } - - protected Component method1841() { - return this.aChoicer3597; - } - - protected boolean method1843() { - return true; - } - - protected String method1844() { - return "" + this.getItemState(); - } - - protected void method1845(String var1) { - this.setItemState(Integer.parseInt(var1)); - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/UnitData.java b/client/src/main/java/com/aapeli/settingsgui/UnitData.java deleted file mode 100644 index 28827672..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/UnitData.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.settingsgui.Unit; -import com.aapeli.tools.Tools; - -public final class UnitData extends Unit { - - private String aString3599; - - - public UnitData() { - this((String) null); - } - - public UnitData(String var1) { - super((String) null); - this.aString3599 = var1; - } - - protected int method1836() { - return 25; - } - - protected boolean method1843() { - return true; - } - - protected String method1844() { - return this.aString3599 == null ? "-" : (this.aString3599.length() == 0 ? "-" : Tools.changeToSaveable(this.aString3599)); - } - - protected void method1845(String var1) { - this.aString3599 = Tools.changeFromSaveable(var1); - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/UnitLabel.java b/client/src/main/java/com/aapeli/settingsgui/UnitLabel.java deleted file mode 100644 index c00f7956..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/UnitLabel.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.settingsgui.Unit; - -public final class UnitLabel extends Unit { - - public static final int POSITION_MIDDLE = 1; - public static final int POSITION_LEFT = 2; - public static final int POSITION_RIGHT = 3; - public static final int LABELSIZE_SMALL = 0; - public static final int LABELSIZE_NORMAL = 1; - public static final int LABELSIZE_BOLD = 2; - public static final int LABELSIZE_BIG = 3; - private int anInt3600 = 1; - private int anInt3601 = 1; - private String[] aStringArray3602; - private int anInt3603; - - - public UnitLabel(String var1) { - super(var1); - } - - public UnitLabel(String[] var1) { - super((String) null); - this.aStringArray3602 = var1; - this.anInt3603 = 0; - } - - public void setLabelPosition(int var1) { - this.anInt3600 = var1; - } - - public void setLabelSize(int var1) { - this.anInt3601 = var1; - } - - protected int method1836() { - return 14 - (this.anInt3601 == 0 ? 1 : 0) + 2; - } - - protected boolean method1837() { - return true; - } - - protected String method1838() { - return this.aStringArray3602 == null ? super.method1838() : this.aStringArray3602[this.anInt3603]; - } - - protected int method1839() { - return this.anInt3600; - } - - protected int method1840() { - return this.anInt3601; - } - - protected boolean setItemState(int var1) { - if (this.anInt3603 == var1) { - return false; - } else { - this.anInt3603 = var1; - return true; - } - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/UnitSpace.java b/client/src/main/java/com/aapeli/settingsgui/UnitSpace.java deleted file mode 100644 index 15b74a7b..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/UnitSpace.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.settingsgui.Unit; - -public final class UnitSpace extends Unit { - - private int anInt3604; - - - public UnitSpace(int var1) { - super((String) null); - this.anInt3604 = var1; - } - - protected int method1836() { - return this.anInt3604; - } - - protected boolean method1837() { - return true; - } -} diff --git a/client/src/main/java/com/aapeli/settingsgui/UnitTextField.java b/client/src/main/java/com/aapeli/settingsgui/UnitTextField.java deleted file mode 100644 index ab612ad8..00000000 --- a/client/src/main/java/com/aapeli/settingsgui/UnitTextField.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.aapeli.settingsgui; - -import com.aapeli.client.FilterTextField; -import com.aapeli.client.InputTextField; -import com.aapeli.client.TextManager; -import com.aapeli.settingsgui.Unit; -import com.aapeli.tools.Tools; - -import java.awt.Color; -import java.awt.Component; - -public final class UnitTextField extends Unit { - - private InputTextField anInputTextField3605; - - - public UnitTextField(String var1, int var2) { - this(var1, (TextManager) null, "", var2); - } - - public UnitTextField(String var1, String var2, int var3) { - this(var1, (TextManager) null, var2, var3); - } - - public UnitTextField(String var1, TextManager var2, int var3) { - this(var1, var2, "", var3); - } - - public UnitTextField(String var1, TextManager var2, String var3, int var4) { - super(var1); - if (var2 != null) { - this.anInputTextField3605 = new FilterTextField(var2, var3, var4); - } else { - this.anInputTextField3605 = new InputTextField(var3, var4); - } - - this.anInputTextField3605.setBackground(Color.white); - this.anInputTextField3605.setForeground(Color.black); - this.anInputTextField3605.addFocusListener(this); - } - - protected int method1836() { - return 25; - } - - protected int method1839() { - return 2; - } - - protected Component method1841() { - return this.anInputTextField3605; - } - - protected boolean method1843() { - return true; - } - - protected String method1844() { - String var1 = this.anInputTextField3605.getInputText(false); - if (var1.length() < 1) { - var1 = "-"; - } - - return Tools.changeToSaveable(var1); - } - - protected void method1845(String var1) { - this.anInputTextField3605.setText(Tools.changeFromSaveable(var1)); - } -} diff --git a/client/src/main/java/com/aapeli/singleclient/Class105.java b/client/src/main/java/com/aapeli/singleclient/Class105.java deleted file mode 100644 index 273195b1..00000000 --- a/client/src/main/java/com/aapeli/singleclient/Class105.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.aapeli.singleclient; - -class Class105 { - - private static final String aString1698 = "ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖabcdefghijklmnopqrstuvwxyzåäö0123456789§+\t\'<,.-½!\"#¤%&/()=?*>;:_@£${[]}\\|~`´^ "; - private static final String aString1699 = "S]gL\\vm>xö-1Yo#OA4;<E`3+äu?_e§iZrV)FR{ktI:\"6Ž&8\tXU 0^2!dW%J,q5pM=å7(c9Q@PzDG.Hj£C|*n~lb$Öh´wT[ya¤\'Ä}NKfB/s"; - private static final int anInt1700 = aString1698.length(); - private Class106 aClass106_1701 = new Class106(); - private int anInt1702 = 17; - private boolean aBoolean1703; - - - protected Class105(String var1) { - int var2 = var1.length(); - - for (int var4 = 0; var4 < var2; ++var4) { - char var3 = var1.charAt(var4); - this.anInt1702 += var3 * (var4 % 2 == 0 ? 1 : -1); - } - - this.aBoolean1703 = false; - } - - protected void method1850() { - this.aBoolean1703 = true; - } - - protected String method1851(String var1) { - if (!this.aBoolean1703) { - return var1; - } else { - var1 = this.aClass106_1701.method1854(var1); - int var2 = (int) (Math.random() * (double) anInt1700); - int var3 = var1.length(); - StringBuffer var5 = new StringBuffer(var3 + 1); - var5.append(aString1699.charAt(var2)); - - for (int var7 = 0; var7 < var3; ++var7) { - char var6 = var1.charAt(var7); - int var4 = aString1698.indexOf(var6); - if (var4 >= 0) { - var4 = method1853(var4 + var2 - this.anInt1702 + var7); - var6 = aString1699.charAt(var4); - } - - var5.append(var6); - } - - return var5.toString(); - } - } - - protected String method1852(String var1) { - if (!this.aBoolean1703) { - return var1; - } else { - int var2 = aString1699.indexOf(var1.charAt(0)); - int var3 = var1.length(); - StringBuffer var5 = new StringBuffer(var3 - 1); - - for (int var7 = 1; var7 < var3; ++var7) { - char var6 = var1.charAt(var7); - int var4 = aString1699.indexOf(var6); - if (var4 >= 0) { - var4 = method1853(var4 - var2 + this.anInt1702 - var7 + 1); - var6 = aString1698.charAt(var4); - } - - var5.append(var6); - } - - return this.aClass106_1701.method1855(var5.toString()); - } - } - - private static int method1853(int var0) { - if (var0 >= anInt1700) { - return var0 % anInt1700; - } else if (var0 < 0) { - int var1 = (-var0 - 1) / anInt1700 + 1; - return var0 + var1 * anInt1700; - } else { - return var0; - } - } - -} diff --git a/client/src/main/java/com/aapeli/singleclient/Class106.java b/client/src/main/java/com/aapeli/singleclient/Class106.java deleted file mode 100644 index 2e09f94d..00000000 --- a/client/src/main/java/com/aapeli/singleclient/Class106.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.aapeli.singleclient; - - -class Class106 { - - private static final String[] aStringArray1704 = new String[48]; - private static final int anInt1705; - - - protected String method1854(String var1) { - char var2 = this.method1856(var1); - if (var2 == 0) { - return " " + var1; - } else { - for (int var4 = 0; var4 < anInt1705; ++var4) { - int var3 = 0; - - while ((var3 = var1.indexOf(aStringArray1704[var4], var3)) >= 0) { - if (!this.method1857(var1, var3, var2)) { - var1 = var1.substring(0, var3) + var2 + (char) (32 + var4) + var1.substring(var3 + aStringArray1704[var4].length()); - var3 += 2; - } else { - ++var3; - } - } - } - - var1 = var2 + var1; - return var1; - } - } - - protected String method1855(String var1) { - char var2 = var1.charAt(0); - var1 = var1.substring(1); - if (var2 == 0) { - return var1; - } else { - int var3; - while ((var3 = var1.indexOf(var2)) >= 0) { - var1 = var1.substring(0, var3) + aStringArray1704[var1.charAt(var3 + 1) - 32] + var1.substring(var3 + 2); - } - - return var1; - } - } - - private char method1856(String var1) { - for (char var2 = 33; var2 < 127; ++var2) { - if (var1.indexOf(var2) == -1) { - return var2; - } - } - - return '\u0000'; - } - - private boolean method1857(String var1, int var2, char var3) { - return var2 == 0 ? false : var1.charAt(var2 - 1) == var3; - } - - static { - aStringArray1704[0] = "error-debug\t"; - aStringArray1704[1] = "localip\t"; - aStringArray1704[2] = "gamename\t"; - aStringArray1704[3] = "logintype\treg"; - aStringArray1704[4] = "logintype\tnr"; - aStringArray1704[5] = "reglogin\t"; - aStringArray1704[6] = "login\t"; - aStringArray1704[7] = "userdata\t"; - aStringArray1704[8] = "badges\t"; - aStringArray1704[9] = "products"; - aStringArray1704[10] = "ps\t"; - aStringArray1704[11] = "bitmaps\t"; - aStringArray1704[12] = "started"; - aStringArray1704[13] = "finished\ttime"; - aStringArray1704[14] = "finished"; - aStringArray1704[15] = "score\t"; - aStringArray1704[16] = "toplist\t"; - aStringArray1704[17] = "ok\t"; - aStringArray1704[18] = "ok"; - aStringArray1704[19] = "serverfull"; - aStringArray1704[20] = "failed"; - aStringArray1704[21] = "tooshort"; - aStringArray1704[22] = "toolong"; - aStringArray1704[23] = "forbidden"; - aStringArray1704[24] = "inuse"; - aStringArray1704[25] = "notstarted"; - aStringArray1704[26] = "overflow"; - aStringArray1704[27] = "nolist"; - aStringArray1704[28] = "ab\t"; - aStringArray1704[29] = "credits"; - aStringArray1704[30] = "buy\t"; - aStringArray1704[31] = "nobalance"; - aStringArray1704[32] = "quit"; - aStringArray1704[33] = "http://java."; - aStringArray1704[34] = "playray."; - aStringArray1704[35] = "aapeli.com"; - aStringArray1704[36] = "/var/bitmap/"; - aStringArray1704[37] = "occreate\t"; - aStringArray1704[38] = "noproduct"; - aStringArray1704[39] = "ocpoll\t"; - aStringArray1704[40] = "unpaid"; - aStringArray1704[41] = "paid"; - aStringArray1704[42] = "error"; - aStringArray1704[43] = "occancel\t"; - aStringArray1704[44] = "reqpd"; - aStringArray1704[45] = "endpd"; - aStringArray1704[46] = "savepd\t"; - aStringArray1704[47] = "pd\t"; - anInt1705 = aStringArray1704.length; - } -} diff --git a/client/src/main/java/com/aapeli/singleclient/HashTableContainer.java b/client/src/main/java/com/aapeli/singleclient/HashTableContainer.java deleted file mode 100644 index d3434190..00000000 --- a/client/src/main/java/com/aapeli/singleclient/HashTableContainer.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.aapeli.singleclient; - -import java.util.Hashtable; - -class HashtableContainer { - - private Hashtable hashTable = new Hashtable(); - - - protected boolean contains(String key, String value) { - if (value == null) { - return false; - } else { - String valueExisting = this.get(key); - if (valueExisting != null && valueExisting.equals(value)) { - return false; - } else { - this.hashTable.put(key.toLowerCase(), value); - return true; - } - } - } - - protected String get(String key) { - return (String) ((String) this.hashTable.get(key.toLowerCase())); - } -} diff --git a/client/src/main/java/com/aapeli/singleclient/SingleClient.java b/client/src/main/java/com/aapeli/singleclient/SingleClient.java deleted file mode 100644 index e2e5961d..00000000 --- a/client/src/main/java/com/aapeli/singleclient/SingleClient.java +++ /dev/null @@ -1,1200 +0,0 @@ -package com.aapeli.singleclient; - -import com.aapeli.applet.AApplet; -import com.aapeli.client.AutoPopups; -import com.aapeli.client.Badge; -import com.aapeli.client.BadgeHandler; -import com.aapeli.client.ImageManager; -import com.aapeli.client.Parameters; -import com.aapeli.client.PersonalScore; -import com.aapeli.client.PersonalScoreUnit; -import com.aapeli.client.TextManager; -import com.aapeli.client.Tournament; -import com.aapeli.connection.ConnListener; -import com.aapeli.connection.Connection; -import com.aapeli.credit.Product; -import com.aapeli.credit.ProductHandler; -import com.aapeli.tools.Tools; - -import java.util.StringTokenizer; -import java.util.Vector; - -public class SingleClient implements ConnListener { - - public static final int anInt2380 = 1; - public static final int ERROR = 10; - public static final int ERROR_STATUS = 11; - public static final int ERROR_DISCONNECTED = 12; - public static final int ERROR_VERSIONCONFLICT = 20; - public static final int ERROR_SERVERFULL = 21; - public static final int ERROR_REGLOGINFAILED = 30; - public static final int ERROR_NICKTOOSHORT = 40; - public static final int ERROR_NICKTOOLONG = 41; - public static final int ERROR_FORBIDDENNICK = 42; - public static final int ERROR_NICKINUSE = 43; - public static final int ERROR_UNBUYABLE = 50; - public static final int ERROR_NOBALANCE = 51; - public static final int ERROR_BUYFAILED = 52; - public static final int LISTTYPE_REGISTERED = 0; - public static final int LISTTYPE_ALLTIME = 1; - public static final int LISTTYPE_MONTH = 2; - public static final int LISTTYPE_WEEK = 3; - public static final int LISTTYPE_DAY = 4; - public static final int LISTTYPE_COUNT = 5; - public static final int USERLEVEL_UNREG = 0; - public static final int USERLEVEL_REG = 1; - public static final int USERLEVEL_VIP = 2; - public static final int USERLEVEL_ADMIN = 3; - public static final int FINISHED_NOTIME = 0; - public static final int FINISHED_NOTSTARTED = -1; - public static final int FINISHED_OVERFLOW = -2; - public static final int FINISHED_INVALIDSTATUS = -3; - public static final int FINISHED_SERVERERROR = -4; - private AApplet gameApplet; - private Parameters aParameters2382; - private Tournament aTournament2383; - private Class105 aClass105_2384; - private SingleGame singleGame; - private String aString2386; - private int anInt2387; - private Connection aConnection2388; - private Vector aVector2389; - private PersonalScore aPersonalScore2390; - private HashtableContainer aHashtableContainer_2391; - private BadgeHandler aBadgeHandler2392; - private ProductHandler aProductHandler2393; - private String aString2394; - private String aString2395; - private int anInt2396; - private boolean aBoolean2397; - private String aString2398; - private String aString2399; - private String aString2400; - private String aString2401; - private int anInt2402; - private int anInt2403; - private int anInt2404; - private AutoPopups autoPopups; - private static final String[] aStringArray2406 = new String[81]; - - - public SingleClient(Parameters var1, SingleGame var2, String var3, int var4, String[] var5) { - this((AApplet) null, var1, var2, var3, var4, var5); - } - - public SingleClient(AApplet var1, SingleGame var2, String var3, int var4, String[] var5) { - this(var1, var1.param, var2, var3, var4, var5); - } - - private SingleClient(AApplet var1, Parameters var2, SingleGame var3, String var4, int var5, String[] var6) { - this.gameApplet = var1; - this.aParameters2382 = var2; - this.singleGame = var3; - this.aString2386 = var4; - this.anInt2387 = var5; - this.aPersonalScore2390 = new PersonalScore(); - this.aHashtableContainer_2391 = new HashtableContainer(); - this.aVector2389 = new Vector(); - this.aString2398 = this.aString2399 = this.aString2394 = this.aString2395 = null; - this.anInt2402 = 0; - this.anInt2403 = 0; - this.anInt2404 = 0; - this.aString2400 = this.aString2401 = "-"; - this.anInt2396 = 1; - this.aBoolean2397 = false; - this.aTournament2383 = Tournament.getTournament(var2, var6); - this.aClass105_2384 = new Class105("DolphinTherapy"); - } - - public void dataReceived(String var1) { - try { - if (this.anInt2396 <= 4) { - if (this.singleGame.isDebugMode()) { - System.out.println("C <= " + var1); - } - - var1 = this.aClass105_2384.method1852(var1); - if (this.singleGame.isDebugMode()) { - System.out.println("C <- " + var1); - } - - this.method1860(var1); - this.aString2395 = var1; - } - } catch (Exception var5) { - Exception var2 = var5; - if (this.anInt2396 <= 4) { - this.anInt2396 = 5; - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.run(): e=\"" + var5 + "\""); - var5.printStackTrace(); - } - - try { - this.method1858("error-debug\t" + var2.toString().trim() + "\t" + var1.replace('\t', '\\') + "\t" + this.aString2395.replace('\t', '\\') + "\t" + this.aString2394.replace('\t', '\\')); - } catch (Exception var4) { - ; - } - } - } - - } - - public void connectionLost(int var1) { - if (var1 == 2 || var1 == 3) { - this.singleGame.connectionError(); - } - - this.anInt2396 = 7; - } - - public void notifyConnectionDown() { - } - - public void notifyConnectionUp() { - } - - public void simulateServerConnection() { - if (this.anInt2396 == 1) { - this.aBoolean2397 = true; - } - } - - public void enableAutoPopups() { - if (this.gameApplet != null) { - this.autoPopups = new AutoPopups(this.gameApplet); - } - - } - - public void enableAutoPopups(Parameters var1, TextManager var2, ImageManager var3) { - this.autoPopups = new AutoPopups(var1, var2, var3); - } - - public synchronized int connect(boolean var1) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.openConnection(" + var1 + ")"); - } - - if (this.anInt2396 != 1) { - return 11; - } else if (this.aBoolean2397) { - this.anInt2396 = var1 ? 2 : 3; - return 1; - } else { - String[] var2 = new String[]{"version\t"}; - if (this.gameApplet != null) { - this.aConnection2388 = new Connection(this.gameApplet, this, var2); - } else { - this.aConnection2388 = new Connection(this.aParameters2382, this, var2); - } - - if (!this.aConnection2388.openConnection()) { - this.method1859(); - return 10; - } else { - this.method1858("version\t20"); - String var3 = this.method1861(); - if (var3 == null) { - return 12; - } else if (!var3.equals("versionok")) { - this.method1859(); - return 20; - } else { - this.method1858("gamename\t" + this.aString2386 + "\t" + this.anInt2387); - var3 = this.method1861(); - if (var3 == null) { - return 12; - } else if (!var3.equals("ok")) { - this.method1859(); - return var3.equals("error") ? 20 : 10; - } else { - if (var1) { - this.method1858("logintype\treg"); - this.anInt2396 = 2; - } else { - this.method1858("logintype\tnr"); - this.anInt2396 = 3; - } - - var3 = this.method1861(); - if (!var3.equals("ok")) { - this.method1859(); - return var3.equals("serverfull") ? 21 : 10; - } else { - String var4 = null; - if (this.aTournament2383 != null) { - var4 = this.aTournament2383.getTicket(); - } else { - var4 = this.aParameters2382.getTicket(); - } - - if (var4 != null) { - this.method1858("ticket\t" + var4); - var3 = this.method1861(); - if (!var3.equals("ok")) { - this.method1859(); - return 10; - } - } - - return 1; - } - } - } - } - } - } - - public synchronized int loginAsRegistered(String var1) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.loginAsRegistered(\"" + var1 + "\")"); - } - - if (this.anInt2396 != 2) { - return 11; - } else if (this.aBoolean2397) { - this.aString2398 = "Simulation"; - this.anInt2402 = 1; - this.anInt2403 = 0; - this.anInt2404 = 0; - this.method1866((String) null); - this.anInt2396 = 4; - return 1; - } else { - this.method1858("reglogin\t" + var1); - String var2 = this.method1861(); - if (var2 == null) { - return 12; - } else if (!var2.startsWith("ok\t")) { - if (var2.equals("failed")) { - this.anInt2396 = 3; - return 30; - } else if (var2.equals("serverfull")) { - this.method1859(); - return 21; - } else { - this.method1859(); - return 10; - } - } else { - StringTokenizer var3 = new StringTokenizer(var2, "\t"); - var3.nextToken(); - this.aString2398 = var3.nextToken(); - String var4 = var3.nextToken(); - this.anInt2402 = 1; - if (var4.indexOf(86) >= 0) { - this.anInt2402 = 2; - } - - this.anInt2403 = 0; - if (var4.indexOf(83) >= 0) { - this.anInt2403 = 1; - } - - if (var4.indexOf(65) >= 0) { - this.anInt2403 = 2; - } - - this.anInt2404 = Integer.parseInt(var3.nextToken()); - if (var3.hasMoreTokens()) { - this.aString2399 = var3.nextToken(); - } - - var2 = this.method1861(); - if (var2 == null) { - return 12; - } else if (!var2.startsWith("bitmaps\t")) { - return 10; - } else { - var3 = new StringTokenizer(var2, "\t"); - var3.nextToken(); - this.aString2400 = var3.nextToken(); - this.aString2401 = var3.nextToken(); - var2 = this.method1861(); - if (var2 == null) { - return 12; - } else if (!var2.startsWith("ps\t")) { - return 10; - } else { - this.method1866(var2.substring(3)); - var2 = this.method1861(); - if (var2 == null) { - return 12; - } else if (!var2.startsWith("badges\t")) { - return 10; - } else { - this.method1868(var2.substring(7)); - var2 = this.method1861(); - if (var2 == null) { - return 12; - } else { - if (var2.startsWith("products\t")) { - this.method1869(var2.substring(9)); - } - - this.anInt2396 = 4; - return 1; - } - } - } - } - } - } - } - - public synchronized int autoLoginAsGuest() { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.autoLoginAsGuest()"); - } - - if (this.anInt2396 != 3) { - return 11; - } else if (this.aBoolean2397) { - this.aString2398 = "~Simulation"; - this.anInt2402 = 0; - this.anInt2403 = 0; - this.anInt2404 = 0; - this.anInt2396 = 4; - return 1; - } else { - this.method1858("autologin"); - String var1 = this.method1861(); - if (var1 == null) { - return 12; - } else if (!var1.startsWith("ok\t")) { - this.method1859(); - return 10; - } else { - this.aString2398 = var1.substring(3); - var1 = this.method1861(); - if (var1 == null) { - return 12; - } else if (!var1.startsWith("badges\t")) { - return 10; - } else { - this.method1868(var1.substring(7)); - var1 = this.method1861(); - if (var1 == null) { - return 12; - } else { - if (var1.startsWith("products\t")) { - this.method1869(var1.substring(9)); - } - - this.anInt2402 = 0; - this.anInt2403 = 0; - this.anInt2404 = 0; - this.anInt2396 = 4; - return 1; - } - } - } - } - } - - public synchronized int loginAsGuest(String var1) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.loginAsGuest(\"" + var1 + "\")"); - } - - if (this.anInt2396 != 3) { - return 11; - } else if (this.aBoolean2397) { - this.aString2398 = "~Simulation"; - this.anInt2402 = 0; - this.anInt2403 = 0; - this.anInt2404 = 0; - this.anInt2396 = 4; - return 1; - } else { - this.method1858("login\t" + var1); - String var2 = this.method1861(); - if (var2 == null) { - return 12; - } else if (!var2.startsWith("ok\t")) { - if (var2.equals("tooshort")) { - return 40; - } else if (var2.equals("toolong")) { - return 41; - } else if (var2.equals("forbidden")) { - return 42; - } else if (var2.equals("inuse")) { - return 43; - } else { - this.method1859(); - return 10; - } - } else { - this.aString2398 = var2.substring(3); - var2 = this.method1861(); - if (var2 == null) { - return 12; - } else if (!var2.startsWith("badges\t")) { - return 10; - } else { - this.method1868(var2.substring(7)); - var2 = this.method1861(); - if (var2 == null) { - return 12; - } else { - if (var2.startsWith("products\t")) { - this.method1869(var2.substring(9)); - } - - this.anInt2402 = 0; - this.anInt2403 = 0; - this.anInt2404 = 0; - this.anInt2396 = 4; - return 1; - } - } - } - } - } - - public String getNick() { - return this.aString2398; - } - - public int getUserLevel() { - return this.anInt2402; - } - - public boolean isRegistered() { - return this.anInt2402 >= 1; - } - - public boolean isVip() { - return this.anInt2402 >= 2; - } - - public boolean isSheriff() { - return this.anInt2403 >= 1; - } - - public boolean isAdmin() { - return this.anInt2403 >= 2; - } - - public PersonalScoreUnit getPersonalScore() { - return this.aPersonalScore2390.getPersonalScore(); - } - - public PersonalScoreUnit getPersonalScore(String var1) { - return this.aPersonalScore2390.getPersonalScore(var1); - } - - public synchronized int requestPlayerData(String[] var1) { - if (this.anInt2396 != 4) { - return 11; - } else if (this.aBoolean2397) { - return 1; - } else { - String var2 = "reqpd"; - - for (int var3 = 0; var3 < var1.length; ++var3) { - var2 = var2 + "\t" + var1[var3]; - } - - this.method1858(var2); - - while (true) { - var2 = this.method1861(); - if (var2 == null) { - return 12; - } - - if (var2.equals("endpd")) { - return 1; - } - - if (!var2.startsWith("pd\t")) { - return 10; - } - - this.method1867(var2.substring(3)); - } - } - } - - public String getPlayerData(String var1) { - return this.aHashtableContainer_2391.get(var1); - } - - public int getCredits() { - return this.anInt2404; - } - - public int refreshCredits() { - if (this.anInt2396 != 4) { - return -1; - } else if (this.aBoolean2397) { - return this.anInt2404; - } else { - this.method1858("credits"); - String var1 = this.method1861(); - if (var1 == null) { - return -1; - } else if (!var1.startsWith("credits\t")) { - return -1; - } else { - this.anInt2404 = Integer.parseInt(var1.substring(8)); - this.aParameters2382.updateWebPageInfoBox(this.anInt2404, -1, -1); - return this.anInt2404; - } - } - } - - public String getBitmapUrlSmall() { - return this.aString2400; - } - - public String getBitmapUrlMedium() { - return this.aString2401; - } - - public void gameStarted() { - if (this.anInt2396 == 4) { - if (!this.aBoolean2397) { - this.method1858("started"); - } - } - } - - public int gameNormallyFinished() { - return this.gameNormallyFinished(false); - } - - public int gameNormallyFinished(boolean var1) { - if (this.anInt2396 != 4) { - return -3; - } else if (this.aBoolean2397) { - return var1 ? 1 : 0; - } else if (!var1) { - this.method1858("finished"); - if (this.autoPopups != null) { - this.autoPopups.gameFinished(false); - } - - return 0; - } else { - String var2; - synchronized (this) { - this.method1858("finished\ttime"); - var2 = this.method1861(); - } - - if (var2 == null) { - return -4; - } else if (!var2.startsWith("ok\t")) { - if (var2.equals("notstarted")) { - return -1; - } else if (var2.equals("overflow")) { - return -2; - } else { - this.method1859(); - return -4; - } - } else { - if (this.autoPopups != null) { - this.autoPopups.gameFinished(false); - } - - return Integer.parseInt(var2.substring(3)); - } - } - } - - public int[] addScore(String var1, long var2, String[] var4) { - return this.addScore(var1, var2, var4, (String) null, (String) null, false); - } - - public int[] addScore(String var1, long var2, String[] var4, String var5) { - return this.addScore(var1, var2, var4, var5, (String) null, false); - } - - public int[] addScore(String var1, long var2, String[] var4, String var5, boolean var6) { - return this.addScore(var1, var2, var4, var5, (String) null, var6); - } - - public int[] addScore(String var1, long var2, String[] var4, String var5, String var6) { - return this.addScore(var1, var2, var4, var5, var6, false); - } - - public synchronized int[] addScore(String var1, long var2, String[] var4, String var5, String var6, boolean var7) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.addScore(\"" + var1 + "\"," + var2 + ",...)"); - } - - if (this.anInt2396 != 4) { - return null; - } else { - if (this.gameApplet != null) { - this.gameApplet.callJavaScriptJSON("{\"scorenotify\":{\"subgame\":\"" + var1 + "\",\"compscore\":\"" + var2 + "\"}}"); - } - - int var9; - if (this.aBoolean2397) { - int[] var13 = new int[5]; - - for (var9 = 0; var9 < 5; ++var9) { - var13[var9] = Integer.MAX_VALUE; - } - - return var13; - } else { - if (var6 != null) { - this.addPersonalScore(var1, var2, var6); - } - - String var8 = var1 + "\t" + var2; - var9 = var4.length; - - for (int var10 = 0; var10 < var9; ++var10) { - var8 = var8 + "\t" + var4[var10]; - } - - var8 = var8 + "\t" + (var5 != null ? var5 : "-"); - var8 = var8 + "\t" + (var6 != null ? var6 : "-"); - var8 = var8 + "\t" + (var7 ? "t" : "f"); - var8 = this.method1862(var8, true); - this.method1858("score\t" + var8); - var8 = this.method1861(); - if (var8 == null) { - return null; - } else if (!var8.startsWith("ok\t")) { - return null; - } else { - int[] var14 = new int[5]; - StringTokenizer var11 = new StringTokenizer(var8, "\t"); - var11.nextToken(); - - for (int var12 = 0; var12 < 5; ++var12) { - var14[var12] = Integer.parseInt(var11.nextToken()); - } - - return var14; - } - } - } - } - - public synchronized void addPersonalScore(String var1, long var2, String var4) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.addPersonalScore(\"" + var1 + "\"," + var2 + "," + "\"" + var4 + "\")"); - } - - if (this.aPersonalScore2390.newScore(var1, var2, var4) && this.autoPopups != null) { - this.autoPopups.personalRecord(); - } - - } - - public boolean setPlayerData(String var1, String var2) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.setPlayerData(\"" + var1 + "\",\"" + var2 + "\")"); - } - - if (this.anInt2396 != 4) { - return false; - } else { - boolean var3 = this.aHashtableContainer_2391.contains(var1, var2); - if (!var3) { - return true; - } else if (this.aBoolean2397) { - return true; - } else { - this.method1858("savepd\t" + var1 + "\t" + var2); - return true; - } - } - } - - public String[][] getTopList(String var1, int var2) { - return this.getTopList(var1, 1, var2); - } - - public synchronized String[][] getTopList(String var1, int var2, int var3) { - if (this.aBoolean2397) { - return new String[0][0]; - } else { - TopListUnit[] var4 = this.getTopListUnits(var1, var2, var3); - if (var4 == null) { - return (String[][]) null; - } else { - int var5 = var4.length; - if (var5 == 0) { - return new String[0][0]; - } else { - int var6 = var4[0].getExtraColumnsCount(); - String[][] var7 = new String[var5][1 + var6]; - - for (int var8 = 0; var8 < var5; ++var8) { - var7[var8][0] = var4[var8].getName(); - - for (int var9 = 0; var9 < var6; ++var9) { - var7[var8][1 + var9] = var4[var8].getColumn(var9); - } - } - - return var7; - } - } - } - } - - public TopListUnit[] getTopListUnits(String var1, int var2) { - return this.getTopListUnits(var1, 1, var2); - } - - public synchronized TopListUnit[] getTopListUnits(String var1, int var2, int var3) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.getTopListUnits(\"" + var1 + "\"," + var2 + "," + var3 + ")"); - } - - if (this.anInt2396 != 4) { - return null; - } else if (this.aBoolean2397) { - return new TopListUnit[0]; - } else { - this.method1858("toplist\t" + var1 + "\t" + var2 + "\t" + var3); - String var4 = this.method1861(); - if (var4 == null) { - return null; - } else if (var4.equals("nolist")) { - return new TopListUnit[0]; - } else if (!var4.startsWith("ok\t")) { - return null; - } else { - StringTokenizer var5 = new StringTokenizer(var4, "\t"); - var5.nextToken(); - int var6 = Integer.parseInt(var5.nextToken()); - int var7 = Integer.parseInt(var5.nextToken()) - 4; - TopListUnit[] var8 = new TopListUnit[var6]; - - for (int var9 = 0; var9 < var6; ++var9) { - var8[var9] = new TopListUnit(var5, var7); - } - - return var8; - } - } - } - - public void setUserData(String var1) { - if (this.anInt2396 == 4) { - this.aString2399 = var1; - if (!this.aBoolean2397) { - this.method1858("userdata\t" + var1); - } - } - } - - public String getUserData() { - return this.aString2399; - } - - public Product getProduct(String var1) { - return !this.isRegistered() ? null : (this.aProductHandler2393 == null ? null : this.aProductHandler2393.getProduct(var1)); - } - - public Product getProductForAnyOne(String var1) { - return this.aProductHandler2393 == null ? null : this.aProductHandler2393.getProduct(var1); - } - - public Product[] getMultipleProducts(String var1) { - return !this.isRegistered() ? null : (this.aProductHandler2393 == null ? null : this.aProductHandler2393.getMultipleProducts(var1)); - } - - public boolean userHaveAnyProduct(String var1) { - return !this.isRegistered() ? false : (this.aProductHandler2393 == null ? false : this.aProductHandler2393.userHaveAnyProduct(var1)); - } - - public synchronized int buyProduct(Product var1) { - String var2 = var1.getProductName(); - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.buyProduct(...): \"" + var2 + "\""); - } - - if (this.anInt2396 != 4) { - return 11; - } else if (this.aBoolean2397) { - return 1; - } else if (this.anInt2404 < var1.getProductPrice()) { - return 51; - } else { - this.method1858("buy\t" + var2); - String var3 = this.method1861(); - if (var3 == null) { - return 12; - } else if (!var3.startsWith("ok\t")) { - if (var3.equals("nobalance")) { - return 51; - } else if (var3.equals("failed")) { - return 52; - } else { - this.method1859(); - return 10; - } - } else { - var1.userBoughtProduct(); - this.anInt2404 = Integer.parseInt(var3.substring(3)); - this.aParameters2382.updateWebPageInfoBox(this.anInt2404, -1, -1); - return 1; - } - } - } - - public boolean awardBadge(String var1) { - if (this.anInt2396 != 4) { - return false; - } else if (this.aBadgeHandler2392 == null) { - return false; - } else { - Badge var2 = this.aBadgeHandler2392.awardBadge(var1); - if (var2 == null) { - return false; - } else if (this.aBoolean2397) { - return true; - } else { - this.method1858("ab\t" + this.method1862(var1, false)); - return true; - } - } - } - - public boolean awardBadges(String var1, int var2, int var3) { - if (this.anInt2396 != 4) { - return false; - } else if (this.aBadgeHandler2392 == null) { - return false; - } else { - Badge[] var4 = this.aBadgeHandler2392.awardBadges(var1, var2, var3); - if (var4 == null) { - return false; - } else if (this.aBoolean2397) { - return true; - } else { - this.method1858("ab\t" + this.method1862(var1 + "\t" + var2 + "\t" + var3, false)); - return true; - } - } - } - - public Badge getBadge(String var1) { - return this.aBadgeHandler2392 == null ? null : this.aBadgeHandler2392.getBadge(var1); - } - - public Tournament getTournament() { - return this.aTournament2383; - } - - public void quit() { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.quit()"); - } - - if (this.anInt2396 != 7) { - if (this.autoPopups != null) { - this.autoPopups.close(); - } - - if (this.aBoolean2397) { - this.anInt2396 = 7; - } else { - this.method1858("quit"); - this.method1859(); - } - } - } - - public String[] createOrderCode(String var1) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.createOrderCode(\"" + var1 + "\")"); - } - - if (this.anInt2396 != 4) { - return null; - } else if (this.aBoolean2397) { - return new String[]{"1234", "Sim: Instructions here (code=\"%1\")"}; - } else { - this.method1858("occreate\t" + var1); - String var2 = this.method1861(); - if (var2 == null) { - return null; - } else if (!var2.startsWith("ok\t")) { - if (var2.equals("noproduct")) { - return null; - } else if (var2.equals("error")) { - return null; - } else { - this.method1859(); - return null; - } - } else { - var2 = var2.substring(3); - String[] var3 = Tools.separateString(var2, "\t"); - return var3; - } - } - } - - public boolean pollOrderCode(String var1) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.pollOrderCode(\"" + var1 + "\")"); - } - - if (this.anInt2396 != 4) { - return false; - } else if (this.aBoolean2397) { - return Math.random() < 0.1D; - } else { - this.method1858("ocpoll\t" + var1); - String var2 = this.method1861(); - return var2 == null ? false : var2.equals("paid"); - } - } - - public void cancelOrderCode(String var1) { - if (this.singleGame.isDebugMode()) { - System.out.println("SingleClient.cancelOrderCode(\"" + var1 + "\")"); - } - - if (this.anInt2396 == 4) { - if (!this.aBoolean2397) { - this.method1858("occancel\t" + var1); - this.method1861(); - } - } - } - - private void method1858(String var1) { - if (this.aConnection2388 != null) { - if (this.singleGame.isDebugMode()) { - System.out.println("C -> " + var1); - } - - var1 = this.aClass105_2384.method1851(var1); - this.aClass105_2384.method1850(); - if (this.singleGame.isDebugMode()) { - System.out.println("C => " + var1); - } - - this.aString2394 = var1; - this.aConnection2388.writeData(var1); - } - } - - private void method1859() { - if (this.anInt2396 < 6) { - this.anInt2396 = 6; - if (this.aConnection2388 != null) { - this.aConnection2388.closeConnection(); - } - - } - } - - private void method1860(String var1) { - Vector var2 = this.aVector2389; - synchronized (this.aVector2389) { - this.aVector2389.addElement(var1); - } - } - - private String method1861() { - while (this.aVector2389.size() == 0 && this.anInt2396 <= 4) { - Tools.sleep(100L); - } - - if (this.anInt2396 >= 5) { - this.method1859(); - return null; - } else { - Vector var1 = this.aVector2389; - synchronized (this.aVector2389) { - String var2 = (String) ((String) this.aVector2389.elementAt(0)); - this.aVector2389.removeElementAt(0); - return var2; - } - } - } - - private String method1862(String var1, boolean var2) { - char var3 = this.method1863(var1, '\t'); - char var4 = this.method1863(var1, var3); - String var5 = var1.replace('\t', var3); - var5 = var5.replace('1', var4); - int var6 = 1 + (int) (Math.random() * 9.0D); - int var7 = var5.length(); - StringBuffer var8 = new StringBuffer(var7 + 3); - - int var9; - for (var9 = 1; var9 < var7; var9 += 2) { - var8.append((char) (var5.charAt(var9) + var6)); - } - - for (var9 = 0; var9 < var7; var9 += 2) { - var8.append((char) (var5.charAt(var9) + var6)); - } - - var8.append(var3); - var8.append(var4); - var8.append((char) (34 + var6)); - var5 = var8.toString(); - if (this.singleGame.isDebugMode()) { - System.out.println("LightObfuscate1: \"" + var1 + "\" -> \"" + var5 + "\""); - } - - return var2 ? this.method1865(var5) : var5; - } - - private char method1863(String var1, char var2) { - char var3; - for (var3 = (char) (35 + (int) (Math.random() * 10.0D)); var3 == var2 || !this.method1864(var1, var3); ++var3) { - ; - } - - return var3; - } - - private boolean method1864(String var1, char var2) { - int var3 = var1.length(); - - for (int var4 = 0; var4 < var3; ++var4) { - if (var1.charAt(var4) == var2) { - return false; - } - } - - return true; - } - - private String method1865(String var1) { - int var2 = 2 + (int) (Math.random() * 10.0D); - int var3 = var1.length(); - StringBuffer var4 = new StringBuffer(var3 + 1); - var4.append((char) (43 + var2)); - - for (int var5 = 0; var5 < var3; ++var5) { - var4.append((char) (var1.charAt(var5) + var2)); - } - - String var6 = var4.toString(); - if (this.singleGame.isDebugMode()) { - System.out.println("LightObfuscate2: \"" + var1 + "\" -> \"" + var6 + "\""); - } - - return var6; - } - - private void method1866(String var1) { - this.aPersonalScore2390 = new PersonalScore(var1); - } - - private void method1867(String var1) { - int var2 = var1.indexOf(9); - this.aHashtableContainer_2391.contains(var1.substring(0, var2), var1.substring(var2 + 1)); - } - - private void method1868(String var1) { - this.aBadgeHandler2392 = new BadgeHandler(this.gameApplet, var1); - } - - private void method1869(String var1) { - this.aProductHandler2393 = new ProductHandler(); - StringTokenizer var2 = new StringTokenizer(var1, "\t"); - int var3 = Integer.parseInt(var2.nextToken()); - - for (int var5 = 0; var5 < var3; ++var5) { - Product var4 = new Product(var2.nextToken(), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken())); - this.aProductHandler2393.addProduct(var4); - } - - } - - static { - aStringArray2406[0] = "\")"; - aStringArray2406[1] = "SingleClient.addPersonalScore(\""; - aStringArray2406[2] = "\","; - aStringArray2406[3] = "paid"; - aStringArray2406[4] = "SingleClient.pollOrderCode(\""; - aStringArray2406[5] = "ocpoll\t"; - aStringArray2406[6] = "\"}}"; - aStringArray2406[7] = "{\"scorenotify\":{\"subgame\":\""; - aStringArray2406[8] = "SingleClient.addScore(\""; - aStringArray2406[9] = "score\t"; - aStringArray2406[10] = "\",\"compscore\":\""; - aStringArray2406[11] = ",...)"; - aStringArray2406[12] = "ok\t"; - aStringArray2406[13] = "started"; - aStringArray2406[14] = "SingleClient.quit()"; - aStringArray2406[15] = "quit"; - aStringArray2406[16] = "savepd\t"; - aStringArray2406[17] = "\",\""; - aStringArray2406[18] = "SingleClient.setPlayerData(\""; - aStringArray2406[19] = "versionok"; - aStringArray2406[20] = "ok"; - aStringArray2406[21] = "logintype\treg"; - aStringArray2406[22] = "logintype\tnr"; - aStringArray2406[23] = "error"; - aStringArray2406[24] = "SingleClient.openConnection("; - aStringArray2406[25] = "version\t"; - aStringArray2406[26] = "version\t20"; - aStringArray2406[27] = "ticket\t"; - aStringArray2406[28] = "serverfull"; - aStringArray2406[29] = "gamename\t"; - aStringArray2406[30] = "failed"; - aStringArray2406[31] = "nobalance"; - aStringArray2406[32] = "buy\t"; - aStringArray2406[33] = "SingleClient.buyProduct(...): \""; - aStringArray2406[34] = "finished"; - aStringArray2406[35] = "notstarted"; - aStringArray2406[36] = "finished\ttime"; - aStringArray2406[37] = "overflow"; - aStringArray2406[38] = "\" -> \""; - aStringArray2406[39] = "LightObfuscate1: \""; - aStringArray2406[40] = "ab\t"; - aStringArray2406[41] = "autologin"; - aStringArray2406[42] = "~Simulation"; - aStringArray2406[43] = "products\t"; - aStringArray2406[44] = "badges\t"; - aStringArray2406[45] = "SingleClient.autoLoginAsGuest()"; - aStringArray2406[46] = "login\t"; - aStringArray2406[47] = "toolong"; - aStringArray2406[48] = "forbidden"; - aStringArray2406[49] = "inuse"; - aStringArray2406[50] = "SingleClient.loginAsGuest(\""; - aStringArray2406[51] = "tooshort"; - aStringArray2406[52] = "C -> "; - aStringArray2406[53] = "C => "; - aStringArray2406[54] = "Simulation"; - aStringArray2406[55] = "ps\t"; - aStringArray2406[56] = "SingleClient.loginAsRegistered(\""; - aStringArray2406[57] = "bitmaps\t"; - aStringArray2406[58] = "reglogin\t"; - aStringArray2406[59] = "reqpd"; - aStringArray2406[60] = "endpd"; - aStringArray2406[61] = "pd\t"; - aStringArray2406[62] = "SingleClient.getTopListUnits(\""; - aStringArray2406[63] = "nolist"; - aStringArray2406[64] = "toplist\t"; - aStringArray2406[65] = "C <- "; - aStringArray2406[66] = "C <= "; - aStringArray2406[67] = "SingleClient.run(): e=\""; - aStringArray2406[68] = "error-debug\t"; - aStringArray2406[69] = "occancel\t"; - aStringArray2406[70] = "SingleClient.cancelOrderCode(\""; - aStringArray2406[71] = "credits\t"; - aStringArray2406[72] = "credits"; - aStringArray2406[73] = "LightObfuscate2: \""; - aStringArray2406[74] = "userdata\t"; - aStringArray2406[75] = "1234"; - aStringArray2406[76] = "SingleClient.createOrderCode(\""; - aStringArray2406[77] = "Sim: Instructions here (code=\"%1\")"; - aStringArray2406[78] = "occreate\t"; - aStringArray2406[79] = "noproduct"; - aStringArray2406[80] = "DolphinTherapy"; - } -} diff --git a/client/src/main/java/com/aapeli/singleclient/SingleGame.java b/client/src/main/java/com/aapeli/singleclient/SingleGame.java deleted file mode 100644 index db2a8abc..00000000 --- a/client/src/main/java/com/aapeli/singleclient/SingleGame.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.aapeli.singleclient; - - -public interface SingleGame { - - boolean isDebugMode(); - - void connectionError(); -} diff --git a/client/src/main/java/com/aapeli/singleclient/TopListUnit.java b/client/src/main/java/com/aapeli/singleclient/TopListUnit.java deleted file mode 100644 index 058c42f3..00000000 --- a/client/src/main/java/com/aapeli/singleclient/TopListUnit.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.aapeli.singleclient; - -import java.util.StringTokenizer; - -public final class TopListUnit { - - private String name; - private long time; - private String avatarUrlSmall; - private String avatarUrlMedium; - private String[] extraColumns; - private int extraColumnsCount; - - - protected TopListUnit(StringTokenizer player, int extraCols) { - this.name = player.nextToken(); - this.time = Long.parseLong(player.nextToken()); - this.avatarUrlSmall = player.nextToken(); - this.avatarUrlMedium = player.nextToken(); - this.extraColumnsCount = extraCols; - this.extraColumns = new String[extraCols]; - - for (int var3 = 0; var3 < extraCols; ++var3) { - this.extraColumns[var3] = player.nextToken(); - } - - } - - public String getName() { - return this.name; - } - - public long getTime() { - return this.time; - } - - public String getColumn(int var1) { - return this.extraColumns[var1]; - } - - public String getBitmapUrlSmall() { - return this.avatarUrlSmall; - } - - public String getBitmapUrlMedium() { - return this.avatarUrlMedium; - } - - protected int getExtraColumnsCount() { - return this.extraColumnsCount; - } -} diff --git a/client/src/main/java/com/aapeli/tilt/MoneyTextField.java b/client/src/main/java/com/aapeli/tilt/MoneyTextField.java deleted file mode 100644 index e94128b1..00000000 --- a/client/src/main/java/com/aapeli/tilt/MoneyTextField.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.aapeli.tilt; - -import java.awt.Color; -import java.awt.TextField; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; - -public class MoneyTextField extends TextField implements FocusListener { - - private static final Color aColor732 = Color.white; - private static final Color aColor733 = Color.black; - private int valueLimitLow; - private int valueLimitHigh; - public static int anInt736; - - - public MoneyTextField(int var1, int var2, int var3) { - this.valueLimitLow = var1; - this.valueLimitHigh = var2; - this.setText(getValueString(this.getValueLimited(var3))); - this.setBackground(aColor732); - this.setForeground(aColor733); - this.setEditable(true); - this.addFocusListener(this); - } - - public void focusGained(FocusEvent var1) { - } - - public void focusLost(FocusEvent var1) { - this.setText(getValueString(this.getValueLimited(this.parseValue(this.getText())))); - } - - public static String getValueString(int var0) { - int var1 = var0 / 100; - int var2 = var0 % 100; - return var1 + "," + (var2 < 10 ? "0" : "") + var2; - } - - public int getAmount() { - return this.getValueLimited(this.parseValue(this.getText())); - } - - private int getValueLimited(int var1) { - if (var1 < this.valueLimitLow) { - var1 = this.valueLimitLow; - } - - if (var1 > this.valueLimitHigh) { - var1 = this.valueLimitHigh; - } - - return var1; - } - - private int parseValue(String text) { - text = this.parseDoubleString(text); - if (text == null) { - return 0; - } else { - int commaPos = text.indexOf(','); - if (commaPos == -1) { - return this.parseInt(text + "00"); - } else { - String whole = text.substring(0, commaPos); - String digits = text.substring(commaPos + 1); - int digitsLen = digits.length(); - if (digitsLen > 2) { - return 0; - } else { - text = whole; - if (digitsLen == 0) { - text = whole + "00"; - } else if (digitsLen == 1) { - text = whole + digits + "0"; - } else if (digitsLen == 2) { - text = whole + digits; - } - - return this.parseInt(text); - } - } - } - } - - private String parseDoubleString(String str) { - int len = str.length(); - StringBuffer output = new StringBuffer(len); - boolean putComma = false; - - for (int i = 0; i < len; ++i) { - char c = str.charAt(i); - if (c == '.') { - c = ','; - } - - if (c == ',') { - if (putComma) { - return null; - } - - putComma = true; - output.append(c); - } else if (c != ' ') { - if (c < '0' || c > '9') { - return null; - } - - output.append(c); - } - } - - return output.toString(); - } - - private int parseInt(String var1) { - try { - return Integer.parseInt(var1); - } catch (NumberFormatException var3) { - return 0; - } - } - -} diff --git a/client/src/main/java/com/aapeli/tools/DelayTimer.java b/client/src/main/java/com/aapeli/tools/DelayTimer.java deleted file mode 100644 index df4c013c..00000000 --- a/client/src/main/java/com/aapeli/tools/DelayTimer.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.aapeli.tools; - -public class DelayTimer { - - private double aDouble1713; - private int delayCount; - private int anInt1715; - private long aLong1716; - private long aLong1717; - private long aLong1718; - private long aLong1719; - private boolean debug; - - - public DelayTimer(int var1) { - this(var1, false); - } - - public DelayTimer(int var1, boolean var2) { - this.aDouble1713 = 1000.0D / (double) var1; - this.delayCount = this.anInt1715 = 0; - this.aLong1716 = this.aLong1719 = this.aLong1718 = 0L; - this.aLong1717 = System.currentTimeMillis(); - this.debug = var2; - } - - public synchronized boolean doDelay() { - if (this.aLong1718 > 0L) { - return false; - } else { - ++this.delayCount; - int delay = (int) ((double) (this.aLong1717 + this.aLong1719) + (double) this.delayCount * this.aDouble1713 - (double) System.currentTimeMillis()); - if ((double) delay < (double) (this.aLong1716 / (long) this.delayCount) - this.aDouble1713 * 5.0D) { - if (this.debug) { - System.out.println("DelayTimer.doDelay(): Delay skipped (delay=" + delay + ")"); - } - - this.aLong1719 -= (long) delay; - delay = 0; - } - - double var2 = this.aDouble1713 * 10.0D; - if ((double) delay > var2) { - if (this.debug) { - System.out.println("DelayTimer.doDelay(): Delay limited (delay=" + delay + ")"); - } - - this.aLong1719 -= (long) ((double) delay - var2); - delay = (int) (var2 + 0.5D); - } - - this.anInt1715 = delay; - this.aLong1716 += (long) delay; - if (delay > 0) { - Tools.sleep((long) delay); - return true; - } else { - return false; - } - } - } - - public synchronized void startPause() { - if (this.debug) { - System.out.println("DelayTimer.startPause()"); - } - - if (this.aLong1718 <= 0L) { - this.aLong1718 = System.currentTimeMillis(); - } - } - - public synchronized void endPause() { - if (this.debug) { - System.out.println("DelayTimer.endPause()"); - } - - if (this.aLong1718 > 0L) { - this.aLong1719 += System.currentTimeMillis() - this.aLong1718; - this.aLong1718 = 0L; - } - } - - public int getLastDelay() { - return this.delayCount == 0 ? 0 : this.anInt1715; - } - - public int getAverageDelay() { - return this.delayCount == 0 ? 0 : (int) (this.aLong1716 / (long) this.delayCount); - } -} diff --git a/client/src/main/java/com/aapeli/tools/Sort.java b/client/src/main/java/com/aapeli/tools/Sort.java deleted file mode 100644 index 5a1e5d2d..00000000 --- a/client/src/main/java/com/aapeli/tools/Sort.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.aapeli.tools; - -import com.aapeli.tools.Sortable; - -import java.util.Vector; - -public class Sort { - - public static Vector quickSort(Vector var0) { - int var1 = var0.size(); - Sortable[] var2 = new Sortable[var1]; - - for (int var3 = 0; var3 < var1; ++var3) { - var2[var3] = (Sortable) ((Sortable) var0.elementAt(var3)); - } - - quickSort(var2, 0, var1 - 1); - Vector var5 = new Vector(); - - for (int var4 = 0; var4 < var1; ++var4) { - var5.addElement(var2[var4]); - } - - return var5; - } - - public static void quickSort(Sortable[] var0) { - quickSort(var0, 0, var0.length - 1); - } - - public static void quickSort(Sortable[] var0, int var1, int var2) { - if (var1 < var2) { - Sortable var3; - if (var1 == var2 - 1) { - if (var0[var1].compareTo(var0[var2]) > 0) { - var3 = var0[var1]; - var0[var1] = var0[var2]; - var0[var2] = var3; - } - - } else { - int var4 = var1; - int var5 = var2; - int var6 = (var1 + var2) / 2; - Sortable var7 = var0[var6]; - var0[var6] = var0[var2]; - var0[var2] = var7; - - while (var4 < var5) { - while (var0[var4].compareTo(var7) <= 0 && var4 < var5) { - ++var4; - } - - while (var7.compareTo(var0[var5]) <= 0 && var4 < var5) { - --var5; - } - - if (var4 < var5) { - var3 = var0[var4]; - var0[var4] = var0[var5]; - var0[var5] = var3; - } - } - - var0[var2] = var0[var5]; - var0[var5] = var7; - quickSort(var0, var1, var4 - 1); - quickSort(var0, var5 + 1, var2); - } - } - } -} diff --git a/client/src/main/java/com/aapeli/tools/Sortable.java b/client/src/main/java/com/aapeli/tools/Sortable.java deleted file mode 100644 index 4fc23a62..00000000 --- a/client/src/main/java/com/aapeli/tools/Sortable.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.aapeli.tools; - - -public interface Sortable { - - int compareTo(Sortable var1); -}