From 5bf56ceddf73202ab149ca9f22146e84d1be39fd Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sun, 29 Aug 2021 12:56:28 -0700 Subject: [PATCH 01/11] fix check-last-player-sent-time not working --- .../src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java b/common/src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java index 6ba1415..15ee6af 100644 --- a/common/src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java +++ b/common/src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java @@ -176,7 +176,7 @@ public class QueueManagerImpl implements QueueManager { boolean sendInstant = main.getConfig().getStringList("send-instantly").contains(server.getName()) || server.isJoinable(player); boolean sendInstantp = list.size() <= 1 && server.isJoinable(player); - boolean timeGood = !main.getConfig().getBoolean("check-last-player-sent-time") || System.currentTimeMillis() - server.getLastSentTime() > Math.floor(main.getConfig().getDouble("wait-time") * 1000); + boolean timeGood = !main.getConfig().getBoolean("check-last-player-sent-time") || server.getLastSentTime() > Math.floor(main.getTimeBetweenPlayers() * 1000); if((sendInstant && (sendInstantp && timeGood))) { sendPlayers(server); From 8c9533882efabdccab0cd677b5827b634f1ce195 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sun, 29 Aug 2021 16:03:43 -0700 Subject: [PATCH 02/11] ultraperms no longer required to compile ajqueueplus --- .gitlab-ci.yml | 8 ++++++-- README.md | 3 --- build.gradle.kts | 2 +- libs/private/README.md | 7 +------ premium/build.gradle.kts | 2 ++ 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcd3c01..2f10833 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,10 +13,13 @@ build: stage: build script: - gradle clean :free:shadowJar + - mv free/build/libs/ajQueue*.jar jars/ + - gradle :premium:shadowJar + - mv premium/build/libs/ajQueue*.jar jars/ artifacts: untracked: true paths: - - free/build/libs + - jars pages: stage: build @@ -54,6 +57,7 @@ upload to updater: dependencies: - build script: - - cd free/build/libs + - cd jars - files=(*) - curl -i -F "submit=true" -F "secret=$UPLOAD_SECRET" -F "file=@${files[0]}" https://ajg0702.us/pl/updater/upload.php + - curl -i -F "submit=true" -F "secret=$UPLOAD_SECRET" -F "file=@${files[1]}" https://ajg0702.us/pl/updater/upload.php diff --git a/README.md b/README.md index 556f3b5..05ec4a6 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,3 @@ updating my plugin. If you need *any* help making your changes, feel free to contact me on discord. The invite link is on the plugin page ;) - -# Note on compiling ajQueuePlus -If you want to compile ajQueuePlus, please read the readme file that is in libs/private \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 800730e..f9159a5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ repositories { } allprojects { - version = "2.0.6" + version = "2.0.7-pre1" group = "us.ajg0702" plugins.apply("java") diff --git a/libs/private/README.md b/libs/private/README.md index d84eb3f..3b81388 100644 --- a/libs/private/README.md +++ b/libs/private/README.md @@ -1,6 +1 @@ -If you want to compile ajQueuePlus, you will need to put the UltraPermissions jar here. - -Either that, or remove the UltraPermissionsHook and its 1 reference - -eventually I will make a fake dependency with just the class structure so you dont have to do this, -but i havent done that yet :p \ No newline at end of file +This is where premium dependencies would go. Currently there is none required. \ No newline at end of file diff --git a/premium/build.gradle.kts b/premium/build.gradle.kts index 14d53f7..871b61e 100644 --- a/premium/build.gradle.kts +++ b/premium/build.gradle.kts @@ -21,6 +21,8 @@ dependencies { compileOnly("com.google.guava:guava:30.1.1-jre") + compileOnly("me.TechsCode:FakeUltraPerms:1.0.2") + compileOnly("us.ajg0702:ajUtils:1.1.10") compileOnly("net.kyori:adventure-api:4.8.1") From f29c9502c5fe4507e83f01cae040d73953d713f9 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sun, 29 Aug 2021 16:09:38 -0700 Subject: [PATCH 03/11] whoops --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f10833..b3d196a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,9 +13,10 @@ build: stage: build script: - gradle clean :free:shadowJar - - mv free/build/libs/ajQueue*.jar jars/ + - mkdir jars + - cp free/build/libs/ajQueue*.jar jars/ - gradle :premium:shadowJar - - mv premium/build/libs/ajQueue*.jar jars/ + - cp premium/build/libs/ajQueue*.jar jars/ artifacts: untracked: true paths: From e946a0dba6bf223c5289e6afb09b55ea640d1edd Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Fri, 3 Sep 2021 17:58:50 -0700 Subject: [PATCH 04/11] option to send kick message on velocity --- .../us/ajg0702/queue/common/QueueMain.java | 2 ++ common/src/main/resources/config.yml | 9 +++++++-- .../velocity/players/VelocityPlayer.java | 19 ++++++++++++++++--- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/us/ajg0702/queue/common/QueueMain.java b/common/src/main/java/us/ajg0702/queue/common/QueueMain.java index 092ba4e..4816c74 100644 --- a/common/src/main/java/us/ajg0702/queue/common/QueueMain.java +++ b/common/src/main/java/us/ajg0702/queue/common/QueueMain.java @@ -225,6 +225,8 @@ public class QueueMain extends AjQueueAPI { d.put("max-tries-reached", "&cUnable to connect to {SERVER}. Max retries reached."); d.put("auto-queued", "&aYou've been auto-queued for {SERVER} because you were kicked."); + d.put("velocity-kick-message", "You were kicked while trying to join {SERVER}: {REASON}"); + messages = new Messages(dataFolder, new LogConverter(logger), d); } } diff --git a/common/src/main/resources/config.yml b/common/src/main/resources/config.yml index ec92773..3dca2cb 100644 --- a/common/src/main/resources/config.yml +++ b/common/src/main/resources/config.yml @@ -1,5 +1,5 @@ # Dont touch this number please -config-version: 26 +config-version: 27 # This is the main config for ajQueue. @@ -252,4 +252,9 @@ protocol-names: - "108:1.9.1" - "107:1.9" - "47:1.8.9" - - "5:1.7.10" \ No newline at end of file + - "5:1.7.10" + +# On velocity, should we end a player a message when they are kicked while trying to connect to a server with the queue? +# This has no effect on bungee, because the message is sent from bungee and theres no way to change that in ajQueue +# Default: false +velocity-kick-message: false \ No newline at end of file diff --git a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java index b430cb9..e9ae34c 100644 --- a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java +++ b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java @@ -94,7 +94,7 @@ public class VelocityPlayer implements AdaptedPlayer, Audience { @Override public void sendMessage(String message) { - handle.sendMessage(Component.text().content(message)); + sendMessage(Component.text().content(message)); } @Override @@ -120,10 +120,23 @@ public class VelocityPlayer implements AdaptedPlayer, Audience { handle.createConnectionRequest((RegisteredServer) server.getHandle()).connect().thenAcceptAsync( result -> { if(!result.isSuccessful()) { - QueueMain.getInstance().getEventHandler().onServerKick( + QueueMain main = QueueMain.getInstance(); + Component reason = result.getReasonComponent().orElseGet( + () -> Component.text("Connection failed") + ); + if(main.getConfig().getBoolean("velocity-kick-message")) { + handle.sendMessage( + main.getMessages().getComponent( + "velocity-kick-message", + "SERVER:"+server.getName(), + "REASON:"+reason + ) + ); + } + main.getEventHandler().onServerKick( this, server, - result.getReasonComponent().orElseGet(() -> Component.text("Connection failed")), + reason, false ); } From bb1df1a5869cd44162bf84bc59a652d5db5dbdb7 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sat, 4 Sep 2021 09:03:58 -0700 Subject: [PATCH 05/11] clarify example in config --- common/src/main/resources/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/resources/config.yml b/common/src/main/resources/config.yml index 3dca2cb..8f9d524 100644 --- a/common/src/main/resources/config.yml +++ b/common/src/main/resources/config.yml @@ -22,9 +22,10 @@ offline-time: 120 message-time: 10 # If a player is in a server, you can have the plugin make them automatically join a queue for another server -# Example with the default values: Player joins survivalqueue server, they will auto-join the queue for survival +# Example with the default values: Player joins the limbo server, they will auto-join the queue for the lobbys group +# Note that you dont have to use groups. Just put the name of a server to use a single server instead. queue-servers: - - 'survivalqueue:survival' + - 'limbo:lobbys' # Should the plugin send an actionbar to the player? # The actionbar contains some info such as which server they are queued for, what position they are in, estimated time remaining, etc. From 2a874888c60cf727ba1526810a1f13632e492d43 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sat, 4 Sep 2021 09:05:16 -0700 Subject: [PATCH 06/11] retry ci --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b3d196a..54ca3d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,7 @@ build: - jars pages: + retry: 2 stage: build image: gradle:6.8.3-jdk15 only: @@ -35,6 +36,7 @@ pages: - public test: + retry: 2 stage: test dependencies: - build From f06145ea5fd3e50c0e4610b84e2d3ceabfaea974 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sat, 4 Sep 2021 14:10:15 -0700 Subject: [PATCH 07/11] more connection fail reasons on bungee --- .../velocity/players/VelocityPlayer.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java index e9ae34c..d4c64ba 100644 --- a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java +++ b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/players/VelocityPlayer.java @@ -121,9 +121,27 @@ public class VelocityPlayer implements AdaptedPlayer, Audience { result -> { if(!result.isSuccessful()) { QueueMain main = QueueMain.getInstance(); - Component reason = result.getReasonComponent().orElseGet( - () -> Component.text("Connection failed") - ); + Component reason = result.getReasonComponent().orElse(null); + if(reason == null) { + switch (result.getStatus()) { + case SUCCESS: + reason = Component.text("Success"); + break; + case ALREADY_CONNECTED: + reason = Component.text("Already connected"); + break; + case CONNECTION_IN_PROGRESS: + reason = Component.text("Already connecting"); + break; + case CONNECTION_CANCELLED: + reason = Component.text("Connection canceled"); + break; + case SERVER_DISCONNECTED: + reason = Component.text("Connection failed with unknown reason"); + break; + } + } + if(main.getConfig().getBoolean("velocity-kick-message")) { handle.sendMessage( main.getMessages().getComponent( From 76b726943f8663eca1648220be3522a77de33885 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Mon, 6 Sep 2021 09:47:27 -0700 Subject: [PATCH 08/11] made queue command filter completion --- build.gradle.kts | 2 +- .../main/java/us/ajg0702/queue/commands/BaseCommand.java | 7 +++++++ .../queue/commands/commands/queue/QueueCommand.java | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f9159a5..12c2b48 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ repositories { } allprojects { - version = "2.0.7-pre1" + version = "2.0.7-pre2" group = "us.ajg0702" plugins.apply("java") diff --git a/common/src/main/java/us/ajg0702/queue/commands/BaseCommand.java b/common/src/main/java/us/ajg0702/queue/commands/BaseCommand.java index b2e0718..e8ffc3d 100644 --- a/common/src/main/java/us/ajg0702/queue/commands/BaseCommand.java +++ b/common/src/main/java/us/ajg0702/queue/commands/BaseCommand.java @@ -7,7 +7,9 @@ import us.ajg0702.queue.api.commands.ICommandSender; import us.ajg0702.queue.api.commands.ISubCommand; import us.ajg0702.utils.common.Messages; +import java.util.Iterator; import java.util.List; +import java.util.Locale; public class BaseCommand implements IBaseCommand { @Override @@ -64,4 +66,9 @@ public class BaseCommand implements IBaseCommand { public List autoComplete(ICommandSender sender, String[] args) { return null; } + + public List filterCompletion(List in, String current) { + in.removeIf(t -> !t.toLowerCase(Locale.ROOT).contains(current.toLowerCase(Locale.ROOT))); + return in; + } } diff --git a/common/src/main/java/us/ajg0702/queue/commands/commands/queue/QueueCommand.java b/common/src/main/java/us/ajg0702/queue/commands/commands/queue/QueueCommand.java index 474aeb1..baf1071 100644 --- a/common/src/main/java/us/ajg0702/queue/commands/commands/queue/QueueCommand.java +++ b/common/src/main/java/us/ajg0702/queue/commands/commands/queue/QueueCommand.java @@ -75,7 +75,7 @@ public class QueueCommand extends BaseCommand { return new ArrayList<>(); } if(args.length == 1) { - return main.getQueueManager().getServerNames(); + return filterCompletion(main.getQueueManager().getServerNames(), args[0]); } return new ArrayList<>(); } From 64c403baca5f825ae3925c12b281fed7b100e8e4 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Mon, 6 Sep 2021 09:58:28 -0700 Subject: [PATCH 09/11] whoops --- .../main/java/us/ajg0702/queue/commands/BaseCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/us/ajg0702/queue/commands/BaseCommand.java b/common/src/main/java/us/ajg0702/queue/commands/BaseCommand.java index e8ffc3d..9529eeb 100644 --- a/common/src/main/java/us/ajg0702/queue/commands/BaseCommand.java +++ b/common/src/main/java/us/ajg0702/queue/commands/BaseCommand.java @@ -7,6 +7,7 @@ import us.ajg0702.queue.api.commands.ICommandSender; import us.ajg0702.queue.api.commands.ISubCommand; import us.ajg0702.utils.common.Messages; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -68,7 +69,8 @@ public class BaseCommand implements IBaseCommand { } public List filterCompletion(List in, String current) { - in.removeIf(t -> !t.toLowerCase(Locale.ROOT).contains(current.toLowerCase(Locale.ROOT))); - return in; + List out = new ArrayList<>(in); + out.removeIf(t -> !t.toLowerCase(Locale.ROOT).contains(current.toLowerCase(Locale.ROOT))); + return out; } } From 6dd2cf7fb1c118e905b319092e1c2f5f7350d01e Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Tue, 7 Sep 2021 15:37:48 -0700 Subject: [PATCH 10/11] Added updater --- api/build.gradle.kts | 2 +- .../ajg0702/queue/api/util/QueueLogger.java | 4 +- build.gradle.kts | 2 +- common/build.gradle.kts | 2 +- .../commands/manage/ManageCommand.java | 1 + .../commands/commands/manage/Reload.java | 2 + .../commands/commands/manage/Update.java | 66 +++++++++++++++++++ .../queue/common/EventHandlerImpl.java | 10 +++ .../us/ajg0702/queue/common/QueueMain.java | 21 ++++++ common/src/main/resources/config.yml | 7 +- free/build.gradle.kts | 3 +- platforms/bungeecord/build.gradle.kts | 4 +- platforms/velocity/build.gradle.kts | 5 +- premium/build.gradle.kts | 2 +- spigot/build.gradle.kts | 2 +- 15 files changed, 120 insertions(+), 13 deletions(-) create mode 100644 common/src/main/java/us/ajg0702/queue/commands/commands/manage/Update.java diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 59da92f..d4e7035 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { implementation("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.1.10") + compileOnly("us.ajg0702:ajUtils:1.1.16") } publishing { diff --git a/api/src/main/java/us/ajg0702/queue/api/util/QueueLogger.java b/api/src/main/java/us/ajg0702/queue/api/util/QueueLogger.java index 412b468..8c3da1d 100644 --- a/api/src/main/java/us/ajg0702/queue/api/util/QueueLogger.java +++ b/api/src/main/java/us/ajg0702/queue/api/util/QueueLogger.java @@ -1,6 +1,8 @@ package us.ajg0702.queue.api.util; -public interface QueueLogger { +import us.ajg0702.utils.common.UtilsLogger; + +public interface QueueLogger extends UtilsLogger { void warn(String message); void warning(String message); void info(String message); diff --git a/build.gradle.kts b/build.gradle.kts index 12c2b48..06cabdd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ repositories { } allprojects { - version = "2.0.7-pre2" + version = "2.0.5" group = "us.ajg0702" plugins.apply("java") diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 9a812b2..716fe44 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { compileOnly("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.1.10") + compileOnly("us.ajg0702:ajUtils:1.1.16") compileOnly("org.slf4j:slf4j-log4j12:1.7.29") diff --git a/common/src/main/java/us/ajg0702/queue/commands/commands/manage/ManageCommand.java b/common/src/main/java/us/ajg0702/queue/commands/commands/manage/ManageCommand.java index 6a5c701..0432b97 100644 --- a/common/src/main/java/us/ajg0702/queue/commands/commands/manage/ManageCommand.java +++ b/common/src/main/java/us/ajg0702/queue/commands/commands/manage/ManageCommand.java @@ -30,6 +30,7 @@ public class ManageCommand extends BaseCommand { addSubCommand(new Send(main)); addSubCommand(new PermissionList(main)); addSubCommand(new Whitelist(main)); + addSubCommand(new Update(main)); } diff --git a/common/src/main/java/us/ajg0702/queue/commands/commands/manage/Reload.java b/common/src/main/java/us/ajg0702/queue/commands/commands/manage/Reload.java index 6793df3..90c8bc7 100644 --- a/common/src/main/java/us/ajg0702/queue/commands/commands/manage/Reload.java +++ b/common/src/main/java/us/ajg0702/queue/commands/commands/manage/Reload.java @@ -55,6 +55,8 @@ public class Reload extends SubCommand { main.getQueueManager().reloadServers(); main.getMessages().reload(); + main.getUpdater().setEnabled(main.getConfig().getBoolean("enable-updater")); + sender.sendMessage(getMessages().getComponent("commands.reload")); } diff --git a/common/src/main/java/us/ajg0702/queue/commands/commands/manage/Update.java b/common/src/main/java/us/ajg0702/queue/commands/commands/manage/Update.java new file mode 100644 index 0000000..3dfed05 --- /dev/null +++ b/common/src/main/java/us/ajg0702/queue/commands/commands/manage/Update.java @@ -0,0 +1,66 @@ +package us.ajg0702.queue.commands.commands.manage; + +import com.google.common.collect.ImmutableList; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; +import org.spongepowered.configurate.ConfigurateException; +import us.ajg0702.queue.api.commands.ICommandSender; +import us.ajg0702.queue.commands.SubCommand; +import us.ajg0702.queue.common.QueueMain; +import us.ajg0702.utils.common.Messages; +import us.ajg0702.utils.common.Updater; + +import java.util.ArrayList; +import java.util.List; + +public class Update extends SubCommand { + + final QueueMain main; + public Update(QueueMain main) { + this.main = main; + } + + @Override + public String getName() { + return "update"; + } + + @Override + public ImmutableList getAliases() { + return ImmutableList.of(); + } + + @Override + public String getPermission() { + return "ajqueue.manage.update"; + } + + @Override + public Messages getMessages() { + return main.getMessages(); + } + + @Override + public void execute(ICommandSender sender, String[] args) { + if(!checkPermission(sender)) return; + Updater updater = main.getUpdater(); + if(updater.isAlreadyDownloaded()) { + sender.sendMessage(getMessages().getComponent("updater.already-downloaded")); + return; + } + if(!updater.isUpdateAvailable()) { + sender.sendMessage(getMessages().getComponent("updater.no-update")); + return; + } + if(updater.downloadUpdate()) { + sender.sendMessage(getMessages().getComponent("updater.success")); + } else { + sender.sendMessage(getMessages().getComponent("updater.fail")); + } + } + + @Override + public List autoComplete(ICommandSender sender, String[] args) { + return new ArrayList<>(); + } +} diff --git a/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java b/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java index f405d95..aac4a69 100644 --- a/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java +++ b/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java @@ -103,6 +103,16 @@ public class EventHandlerImpl implements EventHandler { @Override public void onPlayerJoin(AdaptedPlayer player) { + new Thread(() -> { + try { + TimeUnit.SECONDS.sleep(2); + } catch (InterruptedException ignored) { + } + if (main.getUpdater().isUpdateAvailable() && player.hasPermission("ajqueue.manage.update")) { + player.sendMessage(main.getMessages().getComponent("updater.update-available")); + } + }).start(); + ImmutableList queues = main.getQueueManager().findPlayerInQueues(player); for(QueuePlayer queuePlayer : queues) { queuePlayer.setPlayer(player); diff --git a/common/src/main/java/us/ajg0702/queue/common/QueueMain.java b/common/src/main/java/us/ajg0702/queue/common/QueueMain.java index 4816c74..3df14c6 100644 --- a/common/src/main/java/us/ajg0702/queue/common/QueueMain.java +++ b/common/src/main/java/us/ajg0702/queue/common/QueueMain.java @@ -9,6 +9,7 @@ import us.ajg0702.queue.common.utils.LogConverter; import us.ajg0702.queue.logic.LogicGetterImpl; import us.ajg0702.utils.common.Config; import us.ajg0702.utils.common.Messages; +import us.ajg0702.utils.common.Updater; import java.io.File; import java.util.LinkedHashMap; @@ -100,9 +101,15 @@ public class QueueMain extends AjQueueAPI { return protocolNameManager; } + private Updater updater; + public Updater getUpdater() { + return updater; + } + @Override public void shutdown() { taskManager.shutdown(); + updater.shutdown(); } @@ -150,6 +157,8 @@ public class QueueMain extends AjQueueAPI { taskManager.rescheduleTasks(); + updater = new Updater(logger, platformMethods.getPluginVersion(), isPremium() ? "ajQueuePlus" : "ajQueue", config.getBoolean("enable-updater"), isPremium() ? 79123 : 78266, dataFolder.getParentFile(), "ajQueue update"); + } private void constructMessages() { @@ -227,6 +236,18 @@ public class QueueMain extends AjQueueAPI { d.put("velocity-kick-message", "You were kicked while trying to join {SERVER}: {REASON}"); + d.put("updater.update-available", + " \n" + + " An update is available for ajQueue!\n" + + " You can download it by " + + "clicking here\n or running /ajQueue update\n" + + " " + ); + d.put("updater.no-update", "There is not an update available"); + d.put("updater.success", "The update has been downloaded! Now just restart the server"); + d.put("updater.fail", "An error occurred while downloading the update. Check the console for more info."); + d.put("updater.already-downloaded", "The update has already been downloaded."); + messages = new Messages(dataFolder, new LogConverter(logger), d); } } diff --git a/common/src/main/resources/config.yml b/common/src/main/resources/config.yml index 8f9d524..bc75f67 100644 --- a/common/src/main/resources/config.yml +++ b/common/src/main/resources/config.yml @@ -1,5 +1,5 @@ # Dont touch this number please -config-version: 27 +config-version: 28 # This is the main config for ajQueue. @@ -258,4 +258,7 @@ protocol-names: # On velocity, should we end a player a message when they are kicked while trying to connect to a server with the queue? # This has no effect on bungee, because the message is sent from bungee and theres no way to change that in ajQueue # Default: false -velocity-kick-message: false \ No newline at end of file +velocity-kick-message: false + +# Should the updater be enabled? +enable-updater: true \ No newline at end of file diff --git a/free/build.gradle.kts b/free/build.gradle.kts index 642c029..46ec7ae 100644 --- a/free/build.gradle.kts +++ b/free/build.gradle.kts @@ -7,6 +7,7 @@ plugins { group = "us.ajg0702.queue" repositories { + //mavenLocal() maven { url = uri("https://repo.ajg0702.us") } maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") } mavenCentral() @@ -17,7 +18,7 @@ dependencies { compileOnly("com.google.guava:guava:30.1.1-jre") compileOnly("org.spongepowered:configurate-yaml:4.0.0") - implementation("us.ajg0702:ajUtils:1.1.10") + implementation("us.ajg0702:ajUtils:1.1.16") implementation(project(":platforms:velocity")) implementation(project(":platforms:bungeecord")) diff --git a/platforms/bungeecord/build.gradle.kts b/platforms/bungeecord/build.gradle.kts index 0b3934d..fea1640 100644 --- a/platforms/bungeecord/build.gradle.kts +++ b/platforms/bungeecord/build.gradle.kts @@ -15,11 +15,11 @@ repositories { dependencies { compileOnly("net.kyori:adventure-api:4.8.1") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.1.10") + compileOnly("us.ajg0702:ajUtils:1.1.16") compileOnly("net.md-5:bungeecord-api:1.16-R0.4") - compileOnly("net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT") + implementation("net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT") implementation("net.kyori:adventure-platform-bungeecord:4.0.0-SNAPSHOT") compileOnly("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT") diff --git a/platforms/velocity/build.gradle.kts b/platforms/velocity/build.gradle.kts index 2c4df54..8d7a070 100644 --- a/platforms/velocity/build.gradle.kts +++ b/platforms/velocity/build.gradle.kts @@ -6,6 +6,7 @@ plugins { group = "us.ajg0702.queue.platforms.velocity" repositories { + //mavenLocal() maven { url = uri("https://repo.ajg0702.us") } maven { url = uri("https://nexus.velocitypowered.com/repository/maven-public/") } mavenCentral() @@ -14,11 +15,11 @@ repositories { dependencies { compileOnly("net.kyori:adventure-api:4.8.1") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.1.10") + compileOnly("us.ajg0702:ajUtils:1.1.16") compileOnly("com.velocitypowered:velocity-api:3.0.0") annotationProcessor("com.velocitypowered:velocity-api:3.0.0") - compileOnly("net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT") + implementation("net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT") implementation("org.bstats:bstats-velocity:2.2.1") diff --git a/premium/build.gradle.kts b/premium/build.gradle.kts index 871b61e..fd961e7 100644 --- a/premium/build.gradle.kts +++ b/premium/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { compileOnly("me.TechsCode:FakeUltraPerms:1.0.2") - compileOnly("us.ajg0702:ajUtils:1.1.10") + compileOnly("us.ajg0702:ajUtils:1.1.16") compileOnly("net.kyori:adventure-api:4.8.1") diff --git a/spigot/build.gradle.kts b/spigot/build.gradle.kts index 576b723..4d18524 100644 --- a/spigot/build.gradle.kts +++ b/spigot/build.gradle.kts @@ -24,7 +24,7 @@ dependencies { compileOnly("org.spongepowered:configurate-yaml:4.0.0") - compileOnly("us.ajg0702:ajUtils:1.1.10") + compileOnly("us.ajg0702:ajUtils:1.1.16") compileOnly(group = "org.spigotmc", name = "spigot", version = "1.16.5-R0.1-SNAPSHOT") compileOnly("me.clip:placeholderapi:2.10.4") From 5ceba7ba0cac53a938922c6065d87ae36df419d3 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Tue, 7 Sep 2021 15:41:23 -0700 Subject: [PATCH 11/11] 2.0.7 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 06cabdd..e5a4e12 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ repositories { } allprojects { - version = "2.0.5" + version = "2.0.7" group = "us.ajg0702" plugins.apply("java")