Skip to content

Commit

Permalink
Simplified license header and print more info on start
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim203 committed Jul 12, 2024
1 parent 27c4a2a commit 6172b13
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 74 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 2 additions & 21 deletions license_header.txt
Original file line number Diff line number Diff line change
@@ -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
37 changes: 9 additions & 28 deletions src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java
Original file line number Diff line number Diff line change
@@ -1,48 +1,28 @@
/*
* 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;
import org.geysermc.globallinkserver.java.JavaServer;
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();

Expand All @@ -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());
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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());
Expand All @@ -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;
}
Expand Down

0 comments on commit 6172b13

Please sign in to comment.