From 19bd727b9376d30b8243d577ffbd5e200c9dc353 Mon Sep 17 00:00:00 2001 From: LAX1DUDE Date: Fri, 12 Aug 2022 22:09:38 -0700 Subject: [PATCH] finished the relay list (not including ping) --- lwjgl-rundir/_eagstorage.g.dat | Bin 1426 -> 1440 bytes lwjgl-rundir/resources/gui/icons.png | Bin 7115 -> 9448 bytes lwjgl-rundir/resources/lang/en_US.lang | 11 ++ .../net/lax1dude/eaglercraft/GuiNoRelays.java | 37 ++++++ .../eaglercraft/GuiScreenAddRelay.java | 124 +++++++++++++++++- .../eaglercraft/GuiScreenConnectOption.java | 7 +- .../lax1dude/eaglercraft/GuiScreenRelay.java | 60 +++++++-- .../lax1dude/eaglercraft/RelayManager.java | 79 +++++++++-- .../java/net/minecraft/src/GuiSlotServer.java | 46 ++++--- .../java/net/minecraft/src/ServerList.java | 3 + 10 files changed, 321 insertions(+), 46 deletions(-) create mode 100644 src/main/java/net/lax1dude/eaglercraft/GuiNoRelays.java diff --git a/lwjgl-rundir/_eagstorage.g.dat b/lwjgl-rundir/_eagstorage.g.dat index 123d63667830516f62a9eb5e6efa6a432a4b3f70..4ea5a1f2e7e83dbcab15db9c5ebee1acc918c0c5 100644 GIT binary patch delta 26 hcmbQly?}dz6f-X;16xsQPGV&-BLf4&W=ZBsCIDDV1`PlJ delta 12 TcmZ3$J&AjR6!T^c<_abN8GZw9 diff --git a/lwjgl-rundir/resources/gui/icons.png b/lwjgl-rundir/resources/gui/icons.png index 5a6dd786727c7929d10a240ad3dc2c108085e492..a075f9eb922f8e84740ea62b801b188946451733 100644 GIT binary patch literal 9448 zcmcI~bySpJ@b|N@NS8}@gCHRw-Q6kO3W!Q0T??Wh9nv5OsB}o@0@B?`ch^#q%l_8y z@4WxK|Gwuv=h=Opotg98nYnZCe0Ju3*3nYN$DzUj003WAML`b$K&VF$fb|G*StacGf%)+Hg3|o#q3XL8ETx@X`lXl0n z4iY{gY@5pa_{ygyb(cYPblgSLWo>u8t@WOFx647hTgNje`kv}WM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FO8sAM-m)bxm9We|!U?tj|wZ=L&N-L`4w zK}5xGcCYq<9b%P!V7YyU74w@qUZ>YMEJ0ko6WqCK=Ca#uC2x-y#VEjpUy1K z7R?x2)PF`h+xRA{W;BGjVG_4Qsw^1Q@nmsZG|q+|TV0)?g0@p(2KW?oX_)@cH7)`( z@Q|o5I0PQ^exD587Tb-eC!9HJl`05904vH zgbZ%k26Az8_c9riBjRyZz)Skn4Itb#4@fo!+Sd@-uLXc~8lK)3aB~7mS$Y;SPi&9P z#`R)u)AzFX4cCYpv9PHwV3vDlIsD0 zX&>$>E_t>sIGg`S6qb9aJYfjLpPU~ada5I~AZ7noixI6GJA%T(nyF(?58Xhtx}NmN z5Ck7K?nO? 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; + this.parentGui.addNewName = IntegratedServer.relayManager.makeNewRelayName(); + this.parentGui.addNewAddr = ""; + this.parentGui.addNewPrimary = IntegratedServer.relayManager.count() == 0; + this.serverName.setText(this.parentGui.addNewName); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() { + EaglerAdapter.enableRepeatEvents(false); + } + + /** + * Fired when a control is clicked. This is the equivalent of + * ActionListener.actionPerformed(ActionEvent e). + */ + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if (par1GuiButton.id == 1) { + this.parentGui.confirmClicked(false, 0); + } else if (par1GuiButton.id == 0) { + this.parentGui.addNewName = this.serverName.getText(); + this.parentGui.addNewAddr = this.serverAddress.getText(); + this.parentGui.confirmClicked(true, 0); + } else if (par1GuiButton.id == 2) { + StringTranslate var2 = StringTranslate.getInstance(); + this.parentGui.addNewPrimary = !this.parentGui.addNewPrimary; + ((GuiButton) this.buttonList.get(2)).displayString = var2.translateKey("addRelay.primary") + ": " + (this.parentGui.addNewPrimary ? var2.translateKey("gui.yes") : var2.translateKey("gui.no")); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char par1, int par2) { + this.serverName.textboxKeyTyped(par1, par2); + this.serverAddress.textboxKeyTyped(par1, par2); + + if (par1 == 9) { + if (this.serverName.isFocused()) { + this.serverName.setFocused(false); + this.serverAddress.setFocused(true); + } else { + this.serverName.setFocused(true); + this.serverAddress.setFocused(false); + } + } + + if (par1 == 13) { + this.actionPerformed((GuiButton) this.buttonList.get(0)); + } + + ((GuiButton) this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int par1, int par2, int par3) { + super.mouseClicked(par1, par2, par3); + this.serverAddress.mouseClicked(par1, par2, par3); + this.serverName.mouseClicked(par1, par2, par3); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int par1, int par2, float par3) { + StringTranslate var4 = StringTranslate.getInstance(); + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, var4.translateKey("addRelay.title"), this.width / 2, 17, 16777215); + this.drawString(this.fontRenderer, var4.translateKey("addRelay.address"), this.width / 2 - 100, 53, 10526880); + this.drawString(this.fontRenderer, var4.translateKey("addRelay.name"), this.width / 2 - 100, 94, 10526880); + if(EaglerAdapter.isSSLPage()) { + this.drawCenteredString(this.fontRenderer, var4.translateKey("addServer.SSLWarn1"), this.width / 2, 169, 0xccccff); + this.drawCenteredString(this.fontRenderer, var4.translateKey("addServer.SSLWarn2"), this.width / 2, 181, 0xccccff); + } + this.serverName.drawTextBox(); + this.serverAddress.drawTextBox(); + super.drawScreen(par1, par2, par3); } } diff --git a/src/main/java/net/lax1dude/eaglercraft/GuiScreenConnectOption.java b/src/main/java/net/lax1dude/eaglercraft/GuiScreenConnectOption.java index 3ebae76..355abd8 100644 --- a/src/main/java/net/lax1dude/eaglercraft/GuiScreenConnectOption.java +++ b/src/main/java/net/lax1dude/eaglercraft/GuiScreenConnectOption.java @@ -35,7 +35,12 @@ public class GuiScreenConnectOption extends GuiScreen { }else if(par1GuiButton.id == 1) { mc.displayGuiScreen(new GuiScreenDirectConnect(guiScreen, guiScreen.getTheServerData())); }else if(par1GuiButton.id == 2) { - mc.displayGuiScreen(new GuiScreenLANConnect(guiScreen)); + GuiScreen scn = new GuiScreenLANConnect(guiScreen); + if(IntegratedServer.relayManager.count() == 0) { + mc.displayGuiScreen(new GuiNoRelays(guiScreen)); + }else { + mc.displayGuiScreen(scn); + } } } diff --git a/src/main/java/net/lax1dude/eaglercraft/GuiScreenRelay.java b/src/main/java/net/lax1dude/eaglercraft/GuiScreenRelay.java index a9bb5b8..6ca7674 100644 --- a/src/main/java/net/lax1dude/eaglercraft/GuiScreenRelay.java +++ b/src/main/java/net/lax1dude/eaglercraft/GuiScreenRelay.java @@ -1,9 +1,11 @@ package net.lax1dude.eaglercraft; import net.minecraft.client.Minecraft; +import net.minecraft.src.EnumChatFormatting; import net.minecraft.src.Gui; import net.minecraft.src.GuiButton; import net.minecraft.src.GuiScreen; +import net.minecraft.src.GuiScreenConfirmation; import net.minecraft.src.StringTranslate; public class GuiScreenRelay extends GuiScreen { @@ -11,13 +13,12 @@ public class GuiScreenRelay extends GuiScreen { private final GuiScreen screen; private GuiSlotRelay slots; private boolean hasPinged; + private boolean addingNew = false; + private boolean deleting = false; int selected; - private GuiButton addRelay; private GuiButton deleteRelay; private GuiButton setPrimary; - private GuiButton refresh; - private GuiButton loadDefault; private String tooltipString = null; @@ -29,12 +30,12 @@ public class GuiScreenRelay extends GuiScreen { selected = -1; StringTranslate var1 = StringTranslate.getInstance(); buttonList.clear(); - buttonList.add(new GuiButton(0, this.width / 2 + 54, this.height - 28, 100, 20, var1.translateKey("gui.cancel"))); - buttonList.add(addRelay = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, var1.translateKey("networkSettings.add"))); + buttonList.add(new GuiButton(0, this.width / 2 + 54, this.height - 28, 100, 20, var1.translateKey("gui.done"))); + buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, var1.translateKey("networkSettings.add"))); buttonList.add(deleteRelay = new GuiButton(2, this.width / 2 - 50, this.height - 52, 100, 20, var1.translateKey("networkSettings.delete"))); buttonList.add(setPrimary = new GuiButton(3, this.width / 2 + 54, this.height - 52, 100, 20, var1.translateKey("networkSettings.default"))); - buttonList.add(refresh = new GuiButton(4, this.width / 2 - 50, this.height - 28, 100, 20, var1.translateKey("networkSettings.refresh"))); - buttonList.add(loadDefault = new GuiButton(5, this.width / 2 - 154, this.height - 28, 100, 20, var1.translateKey("networkSettings.loadDefaults"))); + buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 28, 100, 20, var1.translateKey("networkSettings.refresh"))); + buttonList.add(new GuiButton(5, this.width / 2 - 154, this.height - 28, 100, 20, var1.translateKey("networkSettings.loadDefaults"))); updateButtons(); this.slots = new GuiSlotRelay(this); if(!hasPinged) { @@ -45,28 +46,37 @@ public class GuiScreenRelay extends GuiScreen { void updateButtons() { if(selected < 0) { - addRelay.enabled = false; deleteRelay.enabled = false; setPrimary.enabled = false; - loadDefault.enabled = false; }else { - addRelay.enabled = true; deleteRelay.enabled = true; setPrimary.enabled = true; - loadDefault.enabled = true; } } public void actionPerformed(GuiButton btn) { if(btn.id == 0) { mc.displayGuiScreen(screen); - } else if(btn.id == 4) { - slots.relayManager.ping(); + } else if(btn.id == 1) { + addingNew = true; + mc.displayGuiScreen(new GuiScreenAddRelay(this)); + } else if(btn.id == 2) { + StringTranslate var1 = StringTranslate.getInstance(); + if(selected >= 0) { + RelayServer srv = IntegratedServer.relayManager.get(selected); + mc.displayGuiScreen(new GuiScreenConfirmation(this, var1.translateKey("networkSettings.delete"), var1.translateKey("addRelay.removeText1"), + EnumChatFormatting.GRAY + "'" + srv.comment + "' (" + srv.address + ")", selected)); + deleting = true; + } } else if(btn.id == 3) { if(selected >= 0) { slots.relayManager.setPrimary(selected); selected = 0; } + } else if(btn.id == 4) { + slots.relayManager.ping(); + } else if(btn.id == 5) { + slots.relayManager.loadDefaults(); } } @@ -107,6 +117,30 @@ public class GuiScreenRelay extends GuiScreen { void setToolTip(String str) { tooltipString = str; } + + String addNewName; + String addNewAddr; + boolean addNewPrimary; + + public void confirmClicked(boolean par1, int par2) { + if(par1) { + if(addingNew) { + IntegratedServer.relayManager.addNew(addNewAddr, addNewName, addNewPrimary); + addNewAddr = null; + addNewName = null; + addNewPrimary = false; + selected = -1; + updateButtons(); + }else if(deleting) { + IntegratedServer.relayManager.remove(par2); + selected = -1; + updateButtons(); + } + } + addingNew = false; + deleting = false; + this.mc.displayGuiScreen(this); + } static Minecraft getMinecraft(GuiScreenRelay screen) { return screen.mc; diff --git a/src/main/java/net/lax1dude/eaglercraft/RelayManager.java b/src/main/java/net/lax1dude/eaglercraft/RelayManager.java index 875fd9d..75d911b 100644 --- a/src/main/java/net/lax1dude/eaglercraft/RelayManager.java +++ b/src/main/java/net/lax1dude/eaglercraft/RelayManager.java @@ -13,18 +13,12 @@ public class RelayManager { private final List relays = new ArrayList(); private long lastPingThrough = 0l; - public RelayManager() { - relays.add(new RelayServer("wss://addr1/", "relay #1", true)); - relays.add(new RelayServer("wss://addr2/", "relay #2", false)); - relays.add(new RelayServer("wss://addr3/", "relay #3", false)); - } - public void load(NBTTagList relayConfig) { relays.clear(); if(relayConfig.tagCount() > 0) { boolean gotAPrimary = false; for(int i = 0, l = relayConfig.tagCount(); i < l; ++i) { - NBTBase relay = relayConfig.tagAt(l); + NBTBase relay = relayConfig.tagAt(i); if(relay instanceof NBTTagCompound) { NBTTagCompound relayee = (NBTTagCompound) relay; boolean p = relayee.getBoolean("primary"); @@ -47,6 +41,20 @@ public class RelayManager { sort(); } + public void save() { + NBTTagList lst = new NBTTagList(); + for(int i = 0, l = relays.size(); i < l; ++i) { + RelayServer srv = relays.get(i); + NBTTagCompound etr = new NBTTagCompound(); + etr.setString("addr", srv.address); + etr.setString("comment", srv.comment); + etr.setBoolean("primary", srv.isPrimary()); + lst.appendTag(etr); + } + LocalStorageManager.gameSettingsStorage.setTag("relays", lst); + LocalStorageManager.saveStorageG(); + } + private void sort() { if(relays.size() == 0) { return; @@ -112,11 +120,30 @@ public class RelayManager { int i = relays.size(); relays.add(new RelayServer(addr, comment, false)); if(primary) { - setPrimary(i); + setPrimary0(i); } + save(); + } + + public void addNew(String addr, String comment, boolean primary) { + lastPingThrough = 0l; + int i = relays.size(); + int j = primary || i == 0 ? 0 : 1; + RelayServer newServer = new RelayServer(addr, comment, false); + relays.add(j, newServer); + newServer.ping(); + if(primary) { + setPrimary0(j); + } + save(); + } + + public void setPrimary(int idx) { + setPrimary0(idx); + save(); } - public void setPrimary(int idx) { + private void setPrimary0(int idx) { if(idx >= 0 && idx < relays.size()) { for(int i = 0, l = relays.size(); i < l; ++i) { RelayServer srv = relays.get(i); @@ -134,6 +161,7 @@ public class RelayManager { RelayServer srv = relays.remove(idx); srv.close(); sort(); + save(); } public RelayServer getPrimary() { @@ -145,6 +173,7 @@ public class RelayManager { } } sort(); + save(); return getPrimary(); }else { return null; @@ -198,4 +227,36 @@ public class RelayManager { } } + public void loadDefaults() { + int setPrimary = relays.size(); + eee: for(RelayEntry etr : ConfigConstants.relays) { + for(RelayServer exEtr : relays) { + if(exEtr.address.equalsIgnoreCase(etr.address)) { + continue eee; + } + } + relays.add(new RelayServer(etr)); + } + setPrimary(setPrimary); + } + + public String makeNewRelayName() { + String str = "Relay Server #" + (relays.size() + 1); + for(int i = relays.size() + 2, l = relays.size() + 50; i < l; ++i) { + if(str.equalsIgnoreCase("Relay Server #" + i)) { + str = "Relay Server #" + (i + 1); + } + } + eee: while(true) { + for(int i = 0, l = relays.size(); i < l; ++i) { + if(str.equalsIgnoreCase(relays.get(i).comment)) { + str = str + "_"; + continue eee; + } + } + break; + } + return str; + } + } diff --git a/src/main/java/net/minecraft/src/GuiSlotServer.java b/src/main/java/net/minecraft/src/GuiSlotServer.java index 056bda2..90b1375 100644 --- a/src/main/java/net/minecraft/src/GuiSlotServer.java +++ b/src/main/java/net/minecraft/src/GuiSlotServer.java @@ -1,6 +1,7 @@ package net.minecraft.src; import net.lax1dude.eaglercraft.EaglerAdapter; +import net.lax1dude.eaglercraft.IntegratedServer; import net.lax1dude.eaglercraft.TextureLocation; import net.lax1dude.eaglercraft.adapter.Tessellator; import net.minecraft.client.Minecraft; @@ -74,26 +75,33 @@ class GuiSlotServer extends GuiSlot { } private void func_77249_c(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { - this.parentGui.drawCenteredString(this.parentGui.fontRenderer, - StatCollector.translateToLocal("lanServer.scanning"), this.parentGui.width / 2, par3 + 6, 16777215); - String var6; - - switch (GuiMultiplayer.getTicksOpened(this.parentGui) / 3 % 4) { - case 0: - default: - var6 = "O o o"; - break; - - case 1: - case 3: - var6 = "o O o"; - break; - - case 2: - var6 = "o o O"; + if(IntegratedServer.relayManager.count() == 0) { + this.parentGui.drawCenteredString(this.parentGui.fontRenderer, + StatCollector.translateToLocal("noRelay.noRelay1"), this.parentGui.width / 2, par3 + 6, 16777215); + this.parentGui.drawCenteredString(this.parentGui.fontRenderer, + StatCollector.translateToLocal("noRelay.noRelay2"), this.parentGui.width / 2, par3 + 18, 0xFFAAAAAA); + }else { + this.parentGui.drawCenteredString(this.parentGui.fontRenderer, + StatCollector.translateToLocal("lanServer.scanning"), this.parentGui.width / 2, par3 + 6, 16777215); + String var6; + + switch (GuiMultiplayer.getTicksOpened(this.parentGui) / 3 % 4) { + case 0: + default: + var6 = "O o o"; + break; + + case 1: + case 3: + var6 = "o O o"; + break; + + case 2: + var6 = "o o O"; + } + + this.parentGui.drawCenteredString(this.parentGui.fontRenderer, var6, this.parentGui.width / 2, par3 + 18, 8421504); } - - this.parentGui.drawCenteredString(this.parentGui.fontRenderer, var6, this.parentGui.width / 2, par3 + 18, 8421504); } private static final TextureLocation icons = new TextureLocation("/gui/icons.png"); diff --git a/src/main/java/net/minecraft/src/ServerList.java b/src/main/java/net/minecraft/src/ServerList.java index 1edc7d0..48dc9bb 100644 --- a/src/main/java/net/minecraft/src/ServerList.java +++ b/src/main/java/net/minecraft/src/ServerList.java @@ -13,6 +13,7 @@ import org.json.JSONObject; import net.lax1dude.eaglercraft.Base64; import net.lax1dude.eaglercraft.ConfigConstants; import net.lax1dude.eaglercraft.EaglerAdapter; +import net.lax1dude.eaglercraft.IntegratedServer; import net.lax1dude.eaglercraft.LocalStorageManager; import net.lax1dude.eaglercraft.RelayEntry; import net.lax1dude.eaglercraft.ServerQuery.QueryResponse; @@ -67,6 +68,7 @@ public class ServerList { tag.setBoolean("default", true); forcedServers.add(ServerData.getServerDataFromNBTCompound(tag)); } + ConfigConstants.relays = new ArrayList(); } catch (IOException e) { e.printStackTrace(); } @@ -162,6 +164,7 @@ public class ServerList { this.servers.add(dat); this.allServers.add(dat); } + IntegratedServer.relayManager.load(LocalStorageManager.gameSettingsStorage.getTagList("relays")); } /**