From d25676bda64961ef896c2159f54ccaee4964b28c Mon Sep 17 00:00:00 2001 From: Benjamin Schulte Date: Sun, 10 Jan 2021 17:16:04 +0100 Subject: [PATCH] Server versioning --- README.md | 10 ++++++++-- server/build.gradle | 2 +- server/gradle/wrapper/gradle-wrapper.properties | 2 +- .../golfgl/lightblocks/server/LightblocksServer.java | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 31a0ea3a..fade1308 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,12 @@ make it more difficult for you. I didn't plan to open the source from the beginn write notes for myself in my native tongue. ## Server -Deploy to Heroku or dokku with +To set up a multiplayer server with a vserver, you can deploy to Heroku or dokku with - git subtree push --prefix server remotename master \ No newline at end of file + git subtree push --prefix server remotename master + +For local play or other setups, you can build a jar file with + + gradlew server:build + +OpenJDK8 for building and using recommended. \ No newline at end of file diff --git a/server/build.gradle b/server/build.gradle index c1ec7dbc..d27eaeb5 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -46,7 +46,7 @@ task run(dependsOn: classes, type: JavaExec) { task stage(dependsOn: ['build', 'clean']) build.mustRunAfter clean jar { - archiveBaseName = "server" + archiveFileName.set("server.jar") manifest { attributes 'Main-Class': mainClassNameServer } diff --git a/server/gradle/wrapper/gradle-wrapper.properties b/server/gradle/wrapper/gradle-wrapper.properties index dd501c7e..225a14bd 100644 --- a/server/gradle/wrapper/gradle-wrapper.properties +++ b/server/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip diff --git a/server/src/de/golfgl/lightblocks/server/LightblocksServer.java b/server/src/de/golfgl/lightblocks/server/LightblocksServer.java index 67527b6d..fb7675a3 100644 --- a/server/src/de/golfgl/lightblocks/server/LightblocksServer.java +++ b/server/src/de/golfgl/lightblocks/server/LightblocksServer.java @@ -23,7 +23,7 @@ import de.golfgl.lightblocks.server.model.ServerInfo; public class LightblocksServer extends WebSocketServer implements ApplicationListener { - public static final int SERVER_VERSION = 1; // reported to the clients, don't mess with it + public static final int SERVER_VERSION = 2102; // reported to the clients, don't mess with it final ServerConfiguration serverConfig; final Serializer serializer = new Serializer(); @@ -131,6 +131,8 @@ public void onStart() { Gdx.app.error("Server", "Could not register for service discovery.", e); } } + + Gdx.app.log("Server", "Server version: " + SERVER_VERSION); } @Override