From acc1a28c20b448680f7581ed7753decd61a99ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C4=B1rat=20Kaya?= <48600092+benfiratkaya@users.noreply.github.com> Date: Mon, 1 Apr 2024 19:13:15 +0300 Subject: [PATCH] 1.0.16 --- bukkit/src/main/java/net/leaderos/plugin/Bukkit.java | 2 ++ .../java/net/leaderos/plugin/configuration/Language.java | 2 ++ .../java/net/leaderos/plugin/configuration/lang/en.java | 2 ++ .../java/net/leaderos/plugin/configuration/lang/tr.java | 2 ++ bungee/src/main/java/net/leaderos/bungee/Bungee.java | 2 ++ .../java/net/leaderos/bungee/configuration/Language.java | 2 ++ .../java/net/leaderos/bungee/configuration/lang/en.java | 2 ++ .../java/net/leaderos/bungee/configuration/lang/tr.java | 2 ++ pom.xml | 2 +- .../shared/modules/connect/socket/SocketClient.java | 4 ++++ .../src/main/java/net/leaderos/velocity/Velocity.java | 8 ++++++-- .../net/leaderos/velocity/configuration/Language.java | 2 ++ .../java/net/leaderos/velocity/configuration/lang/en.java | 2 ++ .../java/net/leaderos/velocity/configuration/lang/tr.java | 2 ++ 14 files changed, 33 insertions(+), 3 deletions(-) diff --git a/bukkit/src/main/java/net/leaderos/plugin/Bukkit.java b/bukkit/src/main/java/net/leaderos/plugin/Bukkit.java index 43239e8b43..7e34d0aeea 100644 --- a/bukkit/src/main/java/net/leaderos/plugin/Bukkit.java +++ b/bukkit/src/main/java/net/leaderos/plugin/Bukkit.java @@ -112,6 +112,8 @@ public void onEnable() { if (getConfigFile().getSettings().getUrl().equals("https://yourwebsite.com")) { getLogger().warning(ChatUtil.getMessage(getLangFile().getMessages().getChangeApiUrl())); + } else if (getConfigFile().getSettings().getUrl().startsWith("http://")) { + getLogger().warning(ChatUtil.getMessage(getLangFile().getMessages().getChangeApiUrlHttps())); } else { LeaderOSAPI.getModuleManager().enableModules(); } diff --git a/bukkit/src/main/java/net/leaderos/plugin/configuration/Language.java b/bukkit/src/main/java/net/leaderos/plugin/configuration/Language.java index 87e16ddf1a..0e743bc71a 100644 --- a/bukkit/src/main/java/net/leaderos/plugin/configuration/Language.java +++ b/bukkit/src/main/java/net/leaderos/plugin/configuration/Language.java @@ -44,6 +44,8 @@ public static class Messages extends OkaeriConfig { private String changeApiUrl = "{prefix} &cPlease change the API URL in the config."; + private String changeApiUrlHttps = "{prefix} &cPlease change the API URL to HTTPS (https://) in the config."; + private String playerNotOnline = "{prefix} &cTarget player is not online."; private String playerNotAvailable = "{prefix} &cPlayer is not available."; diff --git a/bukkit/src/main/java/net/leaderos/plugin/configuration/lang/en.java b/bukkit/src/main/java/net/leaderos/plugin/configuration/lang/en.java index 0587a4df9e..7de4a14f76 100644 --- a/bukkit/src/main/java/net/leaderos/plugin/configuration/lang/en.java +++ b/bukkit/src/main/java/net/leaderos/plugin/configuration/lang/en.java @@ -44,6 +44,8 @@ public static class Messages extends Language.Messages { private String changeApiUrl = "{prefix} &cPlease change the API URL in the config."; + private String changeApiUrlHttps = "{prefix} &cPlease change the API URL to HTTPS (https://) in the config."; + private String playerNotOnline = "{prefix} &cTarget player is not online."; private String playerNotAvailable = "{prefix} &cPlayer is not available."; diff --git a/bukkit/src/main/java/net/leaderos/plugin/configuration/lang/tr.java b/bukkit/src/main/java/net/leaderos/plugin/configuration/lang/tr.java index 668ac7bf1b..6428a53c39 100644 --- a/bukkit/src/main/java/net/leaderos/plugin/configuration/lang/tr.java +++ b/bukkit/src/main/java/net/leaderos/plugin/configuration/lang/tr.java @@ -44,6 +44,8 @@ public static class Messages extends Language.Messages { private String changeApiUrl = "{prefix} &cLütfen API URL adresini değiştirin!"; + private String changeApiUrlHttps = "{prefix} &cAPI URL adresi HTTPS (https://) ile başlamalıdır!"; + private String playerNotOnline = "{prefix} &cOyuncu çevrimiçi değil."; private String playerNotAvailable = "{prefix} &cOyuncu mevcut değil."; diff --git a/bungee/src/main/java/net/leaderos/bungee/Bungee.java b/bungee/src/main/java/net/leaderos/bungee/Bungee.java index e2ef9f6a6c..c71649544c 100644 --- a/bungee/src/main/java/net/leaderos/bungee/Bungee.java +++ b/bungee/src/main/java/net/leaderos/bungee/Bungee.java @@ -88,6 +88,8 @@ public void onEnable() { if (getConfigFile().getSettings().getUrl().equals("https://yourwebsite.com")) { getLogger().warning(ChatUtil.getMessage(getLangFile().getMessages().getChangeApiUrl())); + } else if (getConfigFile().getSettings().getUrl().startsWith("http://")) { + getLogger().warning(ChatUtil.getMessage(getLangFile().getMessages().getChangeApiUrlHttps())); } else { getModuleManager().enableModules(); } diff --git a/bungee/src/main/java/net/leaderos/bungee/configuration/Language.java b/bungee/src/main/java/net/leaderos/bungee/configuration/Language.java index ec014ef6f7..2b2e528831 100644 --- a/bungee/src/main/java/net/leaderos/bungee/configuration/Language.java +++ b/bungee/src/main/java/net/leaderos/bungee/configuration/Language.java @@ -43,6 +43,8 @@ public static class Messages extends OkaeriConfig { private String changeApiUrl = "{prefix} &cPlease change the API URL in the config."; + private String changeApiUrlHttps = "{prefix} &cPlease change the API URL to HTTPS (https://) in the config."; + private String playerNotOnline = "{prefix} &cTarget player is not online."; private String playerNotAvailable = "{prefix} &cPlayer is not available."; diff --git a/bungee/src/main/java/net/leaderos/bungee/configuration/lang/en.java b/bungee/src/main/java/net/leaderos/bungee/configuration/lang/en.java index 4b56e86083..a5ba44b9b2 100644 --- a/bungee/src/main/java/net/leaderos/bungee/configuration/lang/en.java +++ b/bungee/src/main/java/net/leaderos/bungee/configuration/lang/en.java @@ -43,6 +43,8 @@ public static class Messages extends Language.Messages { private String changeApiUrl = "{prefix} &cPlease change the API URL in the config."; + private String changeApiUrlHttps = "{prefix} &cPlease change the API URL to HTTPS (https://) in the config."; + private String playerNotOnline = "{prefix} &cTarget player is not online."; private String playerNotAvailable = "{prefix} &cPlayer is not available."; diff --git a/bungee/src/main/java/net/leaderos/bungee/configuration/lang/tr.java b/bungee/src/main/java/net/leaderos/bungee/configuration/lang/tr.java index 42b0497d14..aa4d4cdea7 100644 --- a/bungee/src/main/java/net/leaderos/bungee/configuration/lang/tr.java +++ b/bungee/src/main/java/net/leaderos/bungee/configuration/lang/tr.java @@ -43,6 +43,8 @@ public static class Messages extends Language.Messages { private String changeApiUrl = "{prefix} &cLütfen API URL adresini değiştirin!"; + private String changeApiUrlHttps = "{prefix} &cAPI URL adresi HTTPS (https://) ile başlamalıdır!"; + private String playerNotOnline = "{prefix} &cOyuncu çevrimiçi değil."; private String playerNotAvailable = "{prefix} &cOyuncu mevcut değil."; diff --git a/pom.xml b/pom.xml index d12328c7fa..4274cbe798 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 8 8 UTF-8 - 1.0.5 + 1.0.6 diff --git a/shared/src/main/java/net/leaderos/shared/modules/connect/socket/SocketClient.java b/shared/src/main/java/net/leaderos/shared/modules/connect/socket/SocketClient.java index a51c58ac7f..3eed5d965e 100644 --- a/shared/src/main/java/net/leaderos/shared/modules/connect/socket/SocketClient.java +++ b/shared/src/main/java/net/leaderos/shared/modules/connect/socket/SocketClient.java @@ -2,6 +2,7 @@ import io.socket.client.IO; import io.socket.client.Socket; +import io.socket.engineio.client.transports.WebSocket; import lombok.Getter; import lombok.Setter; import net.leaderos.shared.model.request.PostRequest; @@ -41,6 +42,9 @@ public SocketClient(String apiKey, String serverToken) throws URISyntaxException auth.put("token", serverToken); opts.auth = auth; + // Set transports + opts.transports = new String[] {WebSocket.NAME}; + this.socket = IO.socket(url, opts); // Error listener diff --git a/velocity/src/main/java/net/leaderos/velocity/Velocity.java b/velocity/src/main/java/net/leaderos/velocity/Velocity.java index 5c9905014b..271cf16878 100644 --- a/velocity/src/main/java/net/leaderos/velocity/Velocity.java +++ b/velocity/src/main/java/net/leaderos/velocity/Velocity.java @@ -45,7 +45,7 @@ @Plugin( id = "leaderos", name = "LeaderOS", - version = "1.0.5", + version = "1.0.6", url = "https://leaderos.net", description = "LeaderOS Plugin for Velocity", authors = {"leaderos"} @@ -146,6 +146,10 @@ public void onProxyInitialize(ProxyInitializeEvent event) { getLogger().warn(ChatUtil.componentToString( ChatUtil.getMessage(getLangFile().getMessages().getChangeApiUrl()) )); + } else if (getConfigFile().getSettings().getUrl().startsWith("http://")) { + getLogger().warn(ChatUtil.componentToString( + ChatUtil.getMessage(getLangFile().getMessages().getChangeApiUrlHttps()) + )); } else { getModuleManager().enableModules(); } @@ -205,7 +209,7 @@ public void setupFiles() { public void checkUpdate() { Velocity.getInstance().getServer().getScheduler().buildTask(Velocity.getInstance(), () -> { - PluginUpdater updater = new PluginUpdater("1.0.5"); + PluginUpdater updater = new PluginUpdater("1.0.6"); try { if (updater.checkForUpdates()) { Component msg = ChatUtil.replacePlaceholders( diff --git a/velocity/src/main/java/net/leaderos/velocity/configuration/Language.java b/velocity/src/main/java/net/leaderos/velocity/configuration/Language.java index 995baacf83..3b402faa08 100644 --- a/velocity/src/main/java/net/leaderos/velocity/configuration/Language.java +++ b/velocity/src/main/java/net/leaderos/velocity/configuration/Language.java @@ -43,6 +43,8 @@ public static class Messages extends OkaeriConfig { private String changeApiUrl = "{prefix} &cPlease change the API URL in the config."; + private String changeApiUrlHttps = "{prefix} &cPlease change the API URL to HTTPS (https://) in the config."; + private String playerNotOnline = "{prefix} &cTarget player is not online."; private String playerNotAvailable = "{prefix} &cPlayer is not available."; diff --git a/velocity/src/main/java/net/leaderos/velocity/configuration/lang/en.java b/velocity/src/main/java/net/leaderos/velocity/configuration/lang/en.java index 5b9b98f438..2520fb499b 100644 --- a/velocity/src/main/java/net/leaderos/velocity/configuration/lang/en.java +++ b/velocity/src/main/java/net/leaderos/velocity/configuration/lang/en.java @@ -43,6 +43,8 @@ public static class Messages extends Language.Messages { private String changeApiUrl = "{prefix} &cPlease change the API URL in the config."; + private String changeApiUrlHttps = "{prefix} &cPlease change the API URL to HTTPS (https://) in the config."; + private String playerNotOnline = "{prefix} &cTarget player is not online."; private String playerNotAvailable = "{prefix} &cPlayer is not available."; diff --git a/velocity/src/main/java/net/leaderos/velocity/configuration/lang/tr.java b/velocity/src/main/java/net/leaderos/velocity/configuration/lang/tr.java index 56ab2a8690..d467f7bfd0 100644 --- a/velocity/src/main/java/net/leaderos/velocity/configuration/lang/tr.java +++ b/velocity/src/main/java/net/leaderos/velocity/configuration/lang/tr.java @@ -43,6 +43,8 @@ public static class Messages extends Language.Messages { private String changeApiUrl = "{prefix} &cLütfen API URL adresini değiştirin!"; + private String changeApiUrlHttps = "{prefix} &cAPI URL adresi HTTPS (https://) ile başlamalıdır!"; + private String playerNotOnline = "{prefix} &cOyuncu çevrimiçi değil."; private String playerNotAvailable = "{prefix} &cOyuncu mevcut değil.";