Created
March 20, 2020 16:56
-
-
Save TobiasGrether/c8e0aa8cecd445ec6a96c1c84087c0c5 to your computer and use it in GitHub Desktop.
Adding Servers on Runtime for Waterdog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void registerServer(String servername, String ip, int port) { | |
| ServerInfo info = Main.getInstance().getProxy().constructServerInfo(servername, new InetSocketAddress(ip, port), servername, false, true, "bedrock"); | |
| Main.getInstance().getProxy().getServers().put(servername, info); | |
| if (servername.startsWith("Lobby") || servername.startsWith("BetaLobby")) { | |
| Main.lobbys.put(info.getName(), info); | |
| Iterables.get(Main.getInstance().getProxy().getConfig().getListeners(), 0).getServerPriority().add(info.getName()); | |
| } | |
| System.out.println("Registered Server " + servername); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment