From c3bea940a54967973b3833643f01eaaffc3667fa Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Mon, 28 Feb 2022 10:51:25 -0700 Subject: [PATCH 1/5] upload to updater --- .github/workflows/gradle.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index f42d243..81c42cd 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -24,7 +24,7 @@ jobs: - name: Build with Gradle uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 with: - arguments: :free:shadowJar + arguments: :free:shadowJar :premim:shadowJar - name: Upload plugin jar artifact uses: actions/upload-artifact@v2.3.1 with: @@ -59,4 +59,19 @@ jobs: - name: Deploy api with Gradle run: './gradlew :api:publish' - name: Deploy common with Gradle - run: './gradlew :common:publish' \ No newline at end of file + run: './gradlew :common:publish' + updater: + runs-on: ubuntu-latest + environment: upload-to-updater + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: build-files + - run: cp free/build/libs/ajQueue*.jar jars/ + - run: cp premium/build/libs/ajQueue*.jar jars/ + - run: cd jars + - run: files=(*) + - run: curl -i -F "submit=true" -F "secret=${{ secrets.UPLOAD_TOKEN }}" -F "file=@${files[0]}" https://ajg0702.us/pl/updater/upload.php + - run: curl -i -F "submit=true" -F "secret=${{ secrets.UPLOAD_TOKEN }}" -F "file=@${files[1]}" https://ajg0702.us/pl/updater/upload.php \ No newline at end of file From 5adbc0f1e71cfdb4acebbd21535c2acd3b6baef3 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Mon, 28 Feb 2022 11:06:00 -0700 Subject: [PATCH 2/5] add slash-server aliases --- .../SlashServer/SlashServerCommand.java | 9 ++++++++- .../queue/common/SlashServerManager.java | 18 ++++++++++++++---- common/src/main/resources/config.yml | 6 +++++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/us/ajg0702/queue/commands/commands/SlashServer/SlashServerCommand.java b/common/src/main/java/us/ajg0702/queue/commands/commands/SlashServer/SlashServerCommand.java index 8d4dbc6..c43a8d0 100644 --- a/common/src/main/java/us/ajg0702/queue/commands/commands/SlashServer/SlashServerCommand.java +++ b/common/src/main/java/us/ajg0702/queue/commands/commands/SlashServer/SlashServerCommand.java @@ -14,14 +14,21 @@ public class SlashServerCommand extends BaseCommand { final QueueMain main; final String server; + final String command; public SlashServerCommand(QueueMain main, String server) { this.main = main; this.server = server; + this.command = server; + } + public SlashServerCommand(QueueMain main, String command, String server) { + this.main = main; + this.server = server; + this.command = command; } @Override public String getName() { - return server; + return command; } @Override diff --git a/common/src/main/java/us/ajg0702/queue/common/SlashServerManager.java b/common/src/main/java/us/ajg0702/queue/common/SlashServerManager.java index 584e92a..b29bebf 100644 --- a/common/src/main/java/us/ajg0702/queue/common/SlashServerManager.java +++ b/common/src/main/java/us/ajg0702/queue/common/SlashServerManager.java @@ -22,10 +22,20 @@ public class SlashServerManager { serverCommands.clear(); List slashServerServers = main.getConfig().getStringList("slash-servers"); - for(String server : slashServerServers) { - SlashServerCommand command = new SlashServerCommand(main, server); - serverCommands.add(command); - implementation.registerCommand(command); + for(String rawServer : slashServerServers) { + if(rawServer.contains(":") && main.isPremium()) { + String[] parts = rawServer.split(":"); + String command = parts[0]; + String server = parts[1]; + SlashServerCommand slashServerCommand = new SlashServerCommand(main, command, server); + serverCommands.add(slashServerCommand); + implementation.registerCommand(slashServerCommand); + } else { + SlashServerCommand command = new SlashServerCommand(main, rawServer); + serverCommands.add(command); + implementation.registerCommand(command); + } + } } } diff --git a/common/src/main/resources/config.yml b/common/src/main/resources/config.yml index 9153d00..07dd3f7 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: 33 +config-version: 34 # This is the main config for ajQueue. @@ -274,6 +274,10 @@ enable-updater: true # For example, if survival is in this list, then if a player executes /survival # then they will be put in the queue for survival # This works for both servers and groups +# If you have ajQueuePlus, you can also make aliases. +# For example, if you have a server called lobby, and you want people to be able to use /hub, you can use this: +# - "hub:lobby" +# If you have the free version, you can only put the server name, no aliases. slash-servers: [] # What balancer should we use? From c3ccf7db4b45774e102dcd3005b230a9db26a9b6 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Mon, 28 Feb 2022 11:08:41 -0700 Subject: [PATCH 3/5] whoops --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 81c42cd..1a9976f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -24,7 +24,7 @@ jobs: - name: Build with Gradle uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 with: - arguments: :free:shadowJar :premim:shadowJar + arguments: :free:shadowJar :premium:shadowJar - name: Upload plugin jar artifact uses: actions/upload-artifact@v2.3.1 with: From 03b99bcd554b7bc932aa275057e82c974ac74993 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Mon, 28 Feb 2022 12:27:47 -0700 Subject: [PATCH 4/5] added $ajqueue_estimated_time% --- .../queue/common/EventHandlerImpl.java | 23 +++++++++++++++++++ .../us/ajg0702/queue/common/QueueMain.java | 1 + .../us/ajg0702/queue/spigot/Placeholders.java | 3 +++ .../us/ajg0702/queue/spigot/SpigotMain.java | 13 +++++++++++ 4 files changed, 40 insertions(+) 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 3d9dddf..8797c86 100644 --- a/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java +++ b/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java @@ -13,6 +13,7 @@ import us.ajg0702.queue.api.server.AdaptedServer; import us.ajg0702.queue.commands.commands.PlayerSender; import us.ajg0702.queue.common.players.QueuePlayerImpl; import us.ajg0702.queue.common.utils.Debug; +import us.ajg0702.utils.common.TimeUtils; import java.io.ByteArrayInputStream; import java.io.DataInputStream; @@ -83,6 +84,28 @@ public class EventHandlerImpl implements EventHandler { } main.getPlatformMethods().sendPluginMessage(recievingPlayer, "positionof", pos); } + if(subchannel.equals("estimated_time")) { + QueueServer server = main.getQueueManager().getSingleServer(recievingPlayer); + + int time; + String timeString; + if(server != null) { + QueuePlayer queuePlayer = server.findPlayer(recievingPlayer); + time = (int) Math.round(queuePlayer.getPosition() * main.getTimeBetweenPlayers()); + timeString = TimeUtils.timeString( + time, + main.getMessages().getString("format.time.mins"), + main.getMessages().getString("format.time.secs") + ); + } else { + timeString = main.getMessages().getString("placeholders.estimated_time.none"); + } + main.getPlatformMethods().sendPluginMessage( + recievingPlayer, + "estimated_time", + timeString + ); + } if(subchannel.equals("inqueue")) { QueueServer server = main.getQueueManager().getSingleServer(recievingPlayer); main.getPlatformMethods().sendPluginMessage(recievingPlayer, "inqueue", (server != null)+""); 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 e8e64b0..cb4b7ae 100644 --- a/common/src/main/java/us/ajg0702/queue/common/QueueMain.java +++ b/common/src/main/java/us/ajg0702/queue/common/QueueMain.java @@ -235,6 +235,7 @@ public class QueueMain extends AjQueueAPI { d.put("placeholders.queued.none", "None"); d.put("placeholders.position.none", "None"); + d.put("placeholders.estimated_time.none", "None"); d.put("title.title", ""); d.put("title.subtitle", "You are #{POS} in the queue!"); diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/Placeholders.java b/spigot/src/main/java/us/ajg0702/queue/spigot/Placeholders.java index 5945862..1a5d757 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/Placeholders.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/Placeholders.java @@ -195,6 +195,9 @@ public class Placeholders extends PlaceholderExpansion { if(identifier.equalsIgnoreCase("inqueue")) { plugin.sendMessage(player, "inqueue", ""); } + if(identifier.equalsIgnoreCase("estimated_time")) { + plugin.sendMessage(player, "estimated_time", ""); + } if(identifier.matches("queuedfor_*.*")) { plugin.sendMessage(player, "queuedfor", identifier.split("_")[1]); } diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/SpigotMain.java b/spigot/src/main/java/us/ajg0702/queue/spigot/SpigotMain.java index d72db5f..0a8783b 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/SpigotMain.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/SpigotMain.java @@ -165,6 +165,19 @@ public class SpigotMain extends JavaPlugin implements PluginMessageListener,List phs.put("queuedfor_"+queuename, number+""); placeholders.responseCache.put(p, phs); } + if(subchannel.equals("estimated_time")) { + String playername = in.readUTF(); + + Player p = Bukkit.getPlayer(playername); + if(p == null) return; + if(!p.isOnline()) return; + + String time = in.readUTF(); + HashMap phs = placeholders.responseCache.get(p); + if(phs == null) phs = new HashMap<>(); + phs.put("estimated_time", time); + placeholders.responseCache.put(p, phs); + } } From 211b127e42202200bad019c249374efaa73964f7 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Fri, 4 Mar 2022 08:06:08 -0700 Subject: [PATCH 5/5] Update adventure --- api/build.gradle.kts | 6 +++--- build.gradle.kts | 2 +- common/build.gradle.kts | 6 +++--- free/build.gradle.kts | 4 ++-- platforms/bungeecord/build.gradle.kts | 8 ++++---- platforms/velocity/build.gradle.kts | 6 +++--- premium/build.gradle.kts | 4 ++-- spigot/build.gradle.kts | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 1b47919..8e788e4 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -14,11 +14,11 @@ repositories { } dependencies { - implementation("net.kyori:adventure-api:4.8.1") - implementation("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT") + implementation("net.kyori:adventure-api:4.9.3") + implementation("net.kyori:adventure-text-serializer-plain:4.9.3") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.1.17") + compileOnly("us.ajg0702:ajUtils:1.1.20") } publishing { diff --git a/build.gradle.kts b/build.gradle.kts index e9b0f94..485393b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ repositories { } allprojects { - version = "2.2.4" + version = "2.2.5" group = "us.ajg0702" plugins.apply("java") diff --git a/common/build.gradle.kts b/common/build.gradle.kts index eaa382c..f7391ea 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -14,11 +14,11 @@ repositories { dependencies { testImplementation("junit:junit:4.12") - compileOnly("net.kyori:adventure-api:4.8.1") - compileOnly("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT") + compileOnly("net.kyori:adventure-api:4.9.3") + compileOnly("net.kyori:adventure-text-serializer-plain:4.9.3") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.1.17") + compileOnly("us.ajg0702:ajUtils:1.1.20") compileOnly("org.slf4j:slf4j-log4j12:1.7.29") diff --git a/free/build.gradle.kts b/free/build.gradle.kts index dd265c0..ed42785 100644 --- a/free/build.gradle.kts +++ b/free/build.gradle.kts @@ -14,11 +14,11 @@ repositories { } dependencies { - compileOnly("net.kyori:adventure-api:4.8.1") + compileOnly("net.kyori:adventure-api:4.9.3") compileOnly("com.google.guava:guava:30.1.1-jre") compileOnly("org.spongepowered:configurate-yaml:4.0.0") - implementation("us.ajg0702:ajUtils:1.1.17") + implementation("us.ajg0702:ajUtils:1.1.20") implementation(project(":platforms:velocity")) implementation(project(":platforms:bungeecord")) diff --git a/platforms/bungeecord/build.gradle.kts b/platforms/bungeecord/build.gradle.kts index b58820d..83df0e3 100644 --- a/platforms/bungeecord/build.gradle.kts +++ b/platforms/bungeecord/build.gradle.kts @@ -14,16 +14,16 @@ repositories { } dependencies { - compileOnly("net.kyori:adventure-api:4.8.1") + compileOnly("net.kyori:adventure-api:4.9.3") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.1.17") + compileOnly("us.ajg0702:ajUtils:1.1.20") compileOnly("net.md-5:bungeecord-api:1.16-R0.4") - implementation("net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT") + implementation("net.kyori:adventure-text-minimessage:4.10.0") implementation("net.kyori:adventure-platform-bungeecord:4.0.0") - compileOnly("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT") + compileOnly("net.kyori:adventure-text-serializer-plain:4.9.3") compileOnly("com.viaversion:viaversion-api:4.2.0-SNAPSHOT") diff --git a/platforms/velocity/build.gradle.kts b/platforms/velocity/build.gradle.kts index 07f38ad..daeae7b 100644 --- a/platforms/velocity/build.gradle.kts +++ b/platforms/velocity/build.gradle.kts @@ -14,13 +14,13 @@ repositories { } dependencies { - compileOnly("net.kyori:adventure-api:4.8.1") + compileOnly("net.kyori:adventure-api:4.9.3") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.1.17") + compileOnly("us.ajg0702:ajUtils:1.1.20") compileOnly("com.velocitypowered:velocity-api:3.0.0") annotationProcessor("com.velocitypowered:velocity-api:3.0.0") - implementation("net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT") + implementation("net.kyori:adventure-text-minimessage:4.10.0") compileOnly("com.viaversion:viaversion-api:4.2.0-SNAPSHOT") diff --git a/premium/build.gradle.kts b/premium/build.gradle.kts index f57a292..203b280 100644 --- a/premium/build.gradle.kts +++ b/premium/build.gradle.kts @@ -23,9 +23,9 @@ dependencies { compileOnly("me.TechsCode:FakeUltraPerms:1.0.2") - compileOnly("us.ajg0702:ajUtils:1.1.17") + compileOnly("us.ajg0702:ajUtils:1.1.20") - compileOnly("net.kyori:adventure-api:4.8.1") + compileOnly("net.kyori:adventure-api:4.9.3") compileOnly(fileTree(mapOf("dir" to "../libs/private", "include" to listOf("*.jar")))) compileOnly(fileTree(mapOf("dir" to "../libs/public", "include" to listOf("*.jar")))) diff --git a/spigot/build.gradle.kts b/spigot/build.gradle.kts index 33e6d64..3e3c779 100644 --- a/spigot/build.gradle.kts +++ b/spigot/build.gradle.kts @@ -19,12 +19,12 @@ repositories { } dependencies { - implementation("net.kyori:adventure-api:4.8.1") + implementation("net.kyori:adventure-api:4.9.3") compileOnly("com.google.guava:guava:30.1.1-jre") compileOnly("org.spongepowered:configurate-yaml:4.0.0") - compileOnly("us.ajg0702:ajUtils:1.1.17") + compileOnly("us.ajg0702:ajUtils:1.1.20") compileOnly(group = "org.spigotmc", name = "spigot", version = "1.16.5-R0.1-SNAPSHOT") compileOnly("me.clip:placeholderapi:2.10.4")