diff --git a/LICENSE b/LICENSE index 8aee4e8..6efc431 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2021-2023 GeyserMC +Copyright (c) 2021-2024 GeyserMC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/license_header.txt b/license_header.txt index 3bf3c66..a334811 100644 --- a/license_header.txt +++ b/license_header.txt @@ -1,22 +1,3 @@ -Copyright (c) 2021-$YEAR GeyserMC - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -@author GeyserMC +Copyright (c) $YEAR GeyserMC +Licensed under the MIT license @link https://github.com/GeyserMC/GlobalLinkServer \ No newline at end of file diff --git a/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java b/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java index 308fe66..c2ac3cb 100644 --- a/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java +++ b/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java @@ -1,30 +1,13 @@ /* - * Copyright (c) 2021-2021 GeyserMC. http://geysermc.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * @author GeyserMC + * Copyright (c) 2021-2024 GeyserMC + * Licensed under the MIT license * @link https://github.com/GeyserMC/GlobalLinkServer */ - package org.geysermc.globallinkserver; +import java.util.Timer; +import java.util.TimerTask; +import java.util.logging.Logger; import org.geysermc.globallinkserver.bedrock.BedrockServer; import org.geysermc.globallinkserver.config.Config; import org.geysermc.globallinkserver.config.ConfigReader; @@ -32,17 +15,14 @@ import org.geysermc.globallinkserver.link.LinkManager; import org.geysermc.globallinkserver.player.PlayerManager; -import java.util.Timer; -import java.util.TimerTask; -import java.util.logging.Logger; - public class GlobalLinkServer { private static final Timer TIMER = new Timer(); public static final Logger LOGGER = Logger.getGlobal(); public static void main(String... args) { // Make logging more simple, adopted from https://stackoverflow.com/a/5937929 - System.setProperty("java.util.logging.SimpleFormatter.format", "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %5$s%6$s%n"); + System.setProperty( + "java.util.logging.SimpleFormatter.format", "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %5$s%6$s%n"); Config config = ConfigReader.readConfig(); @@ -60,6 +40,7 @@ public void run() { }; TIMER.scheduleAtFixedRate(task, 0L, 60_000L); - LOGGER.info("Started Global Linking Server"); + LOGGER.info( + "Started Global Linking Server on java: " + config.javaPort() + ", bedrock: " + config.bedrockPort()); } } diff --git a/src/main/java/org/geysermc/globallinkserver/config/ConfigReader.java b/src/main/java/org/geysermc/globallinkserver/config/ConfigReader.java index 5cdbf12..a7c186d 100644 --- a/src/main/java/org/geysermc/globallinkserver/config/ConfigReader.java +++ b/src/main/java/org/geysermc/globallinkserver/config/ConfigReader.java @@ -1,25 +1,6 @@ /* - * Copyright (c) 2021-2023 GeyserMC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * @author GeyserMC + * Copyright (c) 2021-2024 GeyserMC + * Licensed under the MIT license * @link https://github.com/GeyserMC/GlobalLinkServer */ package org.geysermc.globallinkserver.config; @@ -28,14 +9,13 @@ import com.google.gson.Gson; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class ConfigReader { private static final Gson GSON = new Gson(); - private static final Path CONFIG_PATH = Paths.get("./config.json"); + private static final Path CONFIG_PATH = Paths.get("config.json"); public static Config readConfig() { LOGGER.info("Reading config from " + CONFIG_PATH.toAbsolutePath()); @@ -50,7 +30,7 @@ public static Config readConfig() { private static String configContent() { try { - return new String(Files.readAllBytes(CONFIG_PATH), StandardCharsets.UTF_8); + return Files.readString(CONFIG_PATH); } catch (IOException exception) { return null; }