From 1578d22e4660afa662bb776ba7ba433e6ef105c9 Mon Sep 17 00:00:00 2001 From: Sen Date: Mon, 12 May 2025 19:13:37 +0200 Subject: [PATCH] specify client and server --- client/src/client/Client.java | 10 +++++----- client/src/client/gui/GuiConnect.java | 1 - client/src/client/gui/GuiInfo.java | 2 +- client/src/client/gui/GuiMenu.java | 5 +++-- client/src/client/gui/GuiServer.java | 2 +- common/src/common/init/Config.java | 2 ++ server/src/server/Server.java | 2 +- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/client/src/client/Client.java b/client/src/client/Client.java index e0ab9f0..33f7fc3 100755 --- a/client/src/client/Client.java +++ b/client/src/client/Client.java @@ -1216,14 +1216,14 @@ public class Client implements IThreadListener, IClient { // SKC.setGuiMenu(); // else // SKC.setGuiAny(); - Window.setTitle(String.format("%s - %s", Config.VERSION, gui.getTitle())); + Window.setTitle(String.format("%s - %s", Config.CLIENT_VERSION, gui.getTitle())); } else { this.menu(false); this.leftClickCounter = 10000; Bind.disableMouse(); - Window.setTitle(String.format("%s - %s%s", Config.VERSION, "Welt / Render", this.nograb ? "" : " (Maus gefangen)")); + Window.setTitle(String.format("%s - %s%s", Config.CLIENT_VERSION, "Welt / Render", this.nograb ? "" : " (Maus gefangen)")); // SKC.setGuiNone(); } } @@ -2139,8 +2139,8 @@ public class Client implements IThreadListener, IClient { public void run() { Log.SYSTEM.info("Java " + System.getProperty("java.version")); - Log.SYSTEM.info(Config.VERSION); - if(!Window.createWindow(Config.VERSION, System.getProperty("opengl.debug") != null)) + Log.SYSTEM.info(Config.CLIENT_VERSION); + if(!Window.createWindow(Config.CLIENT_VERSION, System.getProperty("opengl.debug") != null)) System.exit(1); Log.SYSTEM.info("OpenGL %s", GL11.glGetString(GL11.GL_VERSION)); Log.SYSTEM.info("GL_VENDOR: %s", GL11.glGetString(GL11.GL_VENDOR)); @@ -2912,7 +2912,7 @@ public class Client implements IThreadListener, IClient { } public void reset() { - this.buffer = TextColor.NEON + "*** " + Config.VERSION + " ***"; + this.buffer = TextColor.NEON + "*** " + Config.CLIENT_VERSION + " ***"; this.console.clear(); this.chat.clear(); this.feed.clear(); diff --git a/client/src/client/gui/GuiConnect.java b/client/src/client/gui/GuiConnect.java index 339a92e..9d0eb3e 100644 --- a/client/src/client/gui/GuiConnect.java +++ b/client/src/client/gui/GuiConnect.java @@ -181,7 +181,6 @@ public class GuiConnect extends GuiList implements ActBut this.add(this.deleteButton = new ActButton(width / 2 - 75, height - 28, 150, 24, this, "Löschen")); this.add(this.editButton = new ActButton(width / 2 + 79, height - 28, 150, 24, this, "Bearbeiten")); this.add(this.copyButton = new ActButton(width / 2 - 229, height - 28, 150, 24, this, "Kopieren")); - this.add(new NavButton(4, 4, 200, 24, GuiServer.INSTANCE, "Schnellverbindung ...")); this.add(new NavButton(width / 2 + 233, height - 28, 150, 24, GuiMenu.INSTANCE, "Abbrechen")); this.selectButton.enabled = false; diff --git a/client/src/client/gui/GuiInfo.java b/client/src/client/gui/GuiInfo.java index 9b18880..7d64ac4 100644 --- a/client/src/client/gui/GuiInfo.java +++ b/client/src/client/gui/GuiInfo.java @@ -8,7 +8,7 @@ import common.log.Log; public class GuiInfo extends Gui { private static final String VER = - TextColor.GREEN + "" + TextColor.BUG + "" + TextColor.BUG + "" + TextColor.BUG + " " + TextColor.VIOLET + "" + Config.VERSION + "" + + TextColor.GREEN + "" + TextColor.BUG + "" + TextColor.BUG + "" + TextColor.BUG + " " + TextColor.VIOLET + "" + Config.CLIENT_VERSION + "" + TextColor.GREEN + " " + TextColor.BUG + "" + TextColor.BUG + "" + TextColor.BUG; private static final String INFO = "Ein Spiel zur Simulation, zum Testen, für Rollenspiele, Mehrspieler und vieles mehr." + "\n" + diff --git a/client/src/client/gui/GuiMenu.java b/client/src/client/gui/GuiMenu.java index 54cbb34..e562003 100644 --- a/client/src/client/gui/GuiMenu.java +++ b/client/src/client/gui/GuiMenu.java @@ -52,7 +52,7 @@ public class GuiMenu extends Gui { this.ticks = 0; this.hacked = 0; this.resetAnimation(); - this.add(new ActButton(0, 0, 400, 24, new ActButton.Callback() { + this.add(new ActButton(0, -28, 400, 24, new ActButton.Callback() { public void use(ActButton elem, Mode action) { if(GuiMenu.this.hacked == 9) { GuiMenu.this.hacked++; @@ -63,6 +63,7 @@ public class GuiMenu extends Gui { } } }, "Server beitreten")); + this.add(new NavButton(0, 0, 400, 24, GuiServer.INSTANCE, "Schnellverbindung")); this.add(new ActButton(0, 28, 400, 24, new ActButton.Callback() { public void use(ActButton elem, Mode action) { if(GuiMenu.this.hacked == 8) @@ -100,7 +101,7 @@ public class GuiMenu extends Gui { } }, "Client schließen")); this.shift(); - this.add(new Label(4, /* this.gm.fb_y - 2 */ 0, 200, 20, TextColor.VIOLET + Config.VERSION, true)); + this.add(new Label(4, /* this.gm.fb_y - 2 */ 0, 200, 20, TextColor.VIOLET + Config.CLIENT_VERSION, true)); this.splashLabel = this.add(new Label(0, 160, width, 24, "")); this.pickSplash(); } diff --git a/client/src/client/gui/GuiServer.java b/client/src/client/gui/GuiServer.java index 42dcdeb..6fc3495 100644 --- a/client/src/client/gui/GuiServer.java +++ b/client/src/client/gui/GuiServer.java @@ -58,7 +58,7 @@ public class GuiServer extends Gui implements Textbox.Callback { GuiServer.this.connect(); } }, this.server == null ? "Verbinden" : (this.server.getName().isEmpty() ? "Hinzufügen" : "Übernehmen"))); - this.add(new NavButton(0, 250, 480, 24, GuiConnect.INSTANCE, "Zurück")); + this.add(new NavButton(0, 250, 480, 24, this.server != null ? GuiConnect.INSTANCE : GuiMenu.INSTANCE, "Zurück")); if(this.server != null) this.nameLabel = this.add(new Label(0, -70, 410, 20, "Name", true)); this.addrLabel = this.add(new Label(0, 0, 410, 20, "Adresse", true)); diff --git a/common/src/common/init/Config.java b/common/src/common/init/Config.java index 5415de3..ca82a82 100755 --- a/common/src/common/init/Config.java +++ b/common/src/common/init/Config.java @@ -129,7 +129,9 @@ public abstract class Config { public static final int PROTOCOL = 666; public static final int PORT = 26666; + public static final String NAME = "TCR"; public static final String VERSION = "v2.2.1-alpha"; + public static final String CLIENT_VERSION = NAME + " Client " + VERSION; public static final Map VARS = new TreeMap(); diff --git a/server/src/server/Server.java b/server/src/server/Server.java index 5fb29ea..52675ce 100755 --- a/server/src/server/Server.java +++ b/server/src/server/Server.java @@ -314,7 +314,7 @@ public final class Server implements IThreadListener, IServer { public void run(int port) { long time = System.currentTimeMillis(); - Log.JNI.info("Starte Server Version " + Config.VERSION); + Log.JNI.info("Starte " + Config.NAME + " Server Version " + Config.VERSION); if(!this.debug) { Converter.convert(); this.setMessage("Welt wird erstellt und geladen");