diff --git a/java/src/game/Game.java b/java/src/game/Game.java index 09a17a2..4335f79 100755 --- a/java/src/game/Game.java +++ b/java/src/game/Game.java @@ -369,7 +369,7 @@ public class Game implements IThreadListener { public int tickTimeout = 2000; @Variable(name = "srv_port", category = CVarCategory.WORLD, min = 0, max = 65535) - public int port = 26666; + public int port = Config.PORT; public int bind = -1; @Variable(name = "snd_device_type", category = CVarCategory.SOUND, display = "Tonausgabe") diff --git a/java/src/game/Server.java b/java/src/game/Server.java index d8ae864..7cc3dcc 100755 --- a/java/src/game/Server.java +++ b/java/src/game/Server.java @@ -89,7 +89,6 @@ import game.world.WorldPos; import game.world.WorldServer; public final class Server implements Runnable, IThreadListener { -// public static final int PORT = 26666; private static final LazyLoadBase SERVER_NIO_EVENTLOOP = new LazyLoadBase() { protected NioEventLoopGroup load() { return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Server IO #%d").setDaemon(true).build()); diff --git a/java/src/game/gui/GuiConnect.java b/java/src/game/gui/GuiConnect.java index 8295c23..4fccfc7 100644 --- a/java/src/game/gui/GuiConnect.java +++ b/java/src/game/gui/GuiConnect.java @@ -5,6 +5,7 @@ import game.gui.element.ActButton; import game.gui.element.Label; import game.gui.element.Textbox; import game.gui.element.Textbox.Action; +import game.init.Config; import game.network.NetHandlerPlayServer; public class GuiConnect extends Gui implements Textbox.Callback { @@ -62,7 +63,7 @@ public class GuiConnect extends Gui implements Textbox.Callback { } int port = -1; if(this.portBox.getText().isEmpty()) { - port = 26666; + port = Config.PORT; } else { try { diff --git a/java/src/game/gui/world/GuiWorlds.java b/java/src/game/gui/world/GuiWorlds.java index 27f5335..3a6297c 100755 --- a/java/src/game/gui/world/GuiWorlds.java +++ b/java/src/game/gui/world/GuiWorlds.java @@ -201,19 +201,19 @@ public class GuiWorlds extends GuiList implements ActButton. this.warningMessage = "Welten-Ordner nicht lesbar!"; } - this.add(this.selectButton = new ActButton(width / 2 - 153 - 39, height - 52, 72, 20, (ActButton.Callback)this, "Welt spielen")); - this.add(this.createButton = new ActButton(width / 2 + 81 + 72 + 6 - 39, height - 52, 72, 20, (ActButton.Callback)this, + this.add(this.selectButton = new ActButton(width / 2 - 383, height - 52, 150, 20, (ActButton.Callback)this, "Welt spielen")); + this.add(this.createButton = new ActButton(width / 2 + 233, height - 52, 150, 20, (ActButton.Callback)this, (create ? "" : "" + TextColor.DRED) + (create ? "Neue Welt ..." : "Fehler!"))); - this.add(this.deleteButton = new ActButton(width / 2 - 75 - 39, height - 28, 72, 20, (ActButton.Callback)this, "Löschen")); - this.add(this.pruneButton = new ActButton(width / 2 + 3 - 39, height - 28, 72, 20, (ActButton.Callback)this, "Leeren")); - this.add(this.copyButton = new ActButton(width / 2 - 153 - 39, height - 28, 72, 20, (ActButton.Callback)this, "Kopieren")); - this.add(this.moveButton = new ActButton(width / 2 + 81 - 39, height - 28, 72, 20, (ActButton.Callback)this, "Verschieben")); - this.add(this.seedButton = new ActButton(width / 2 + 3 - 39, height - 52, 72, 20, (ActButton.Callback)this, "Startwert")); - this.add(this.userButton = new ActButton(width / 2 - 75 - 39, height - 52, 72, 20, (ActButton.Callback)this, "Spieler")); - this.add(this.dupeButton = new ActButton(width / 2 + 81 - 39, height - 52, 72, 20, (ActButton.Callback)this, "Duplizieren")); - this.add(new ActButton(width / 2 + 81 + 72 + 6 - 39, height - 28, 72, 20, GuiMenu.INSTANCE, "Abbrechen")); + this.add(this.deleteButton = new ActButton(width / 2 - 229, height - 28, 150, 20, (ActButton.Callback)this, "Löschen")); + this.add(this.pruneButton = new ActButton(width / 2 - 75, height - 28, 150, 20, (ActButton.Callback)this, "Leeren")); + this.add(this.copyButton = new ActButton(width / 2 - 383, height - 28, 150, 20, (ActButton.Callback)this, "Kopieren")); + this.add(this.moveButton = new ActButton(width / 2 + 79, height - 28, 150, 20, (ActButton.Callback)this, "Verschieben")); + this.add(this.seedButton = new ActButton(width / 2 - 75, height - 52, 150, 20, (ActButton.Callback)this, "Startwert")); + this.add(this.userButton = new ActButton(width / 2 - 229, height - 52, 150, 20, (ActButton.Callback)this, "Spieler")); + this.add(this.dupeButton = new ActButton(width / 2 + 79, height - 52, 150, 20, (ActButton.Callback)this, "Duplizieren")); + this.add(new ActButton(width / 2 + 233, height - 28, 150, 20, GuiMenu.INSTANCE, "Abbrechen")); - this.add(new ActButton(20, 20, 200, 24, new ActButton.Callback() { + this.add(new ActButton(20, 20, 200, 20, new ActButton.Callback() { public void use(ActButton elem, ActButton.Mode action) { if(GuiWorlds.this.gm.theWorld != null) return; diff --git a/java/src/game/init/Config.java b/java/src/game/init/Config.java index 82a3444..9233ea2 100755 --- a/java/src/game/init/Config.java +++ b/java/src/game/init/Config.java @@ -129,6 +129,7 @@ public abstract class Config { } public static final int PROTOCOL = 666; + public static final int PORT = 26666; public static final String VERSION = "v2.2.1-alpha"; public static final Map VARS = new TreeMap();