Merge pull request #2 from ajgeiss0702/dev

2.2.5
This commit is contained in:
ajgeiss0702
2022-03-05 09:36:45 -07:00
committed by GitHub
16 changed files with 104 additions and 28 deletions
+16 -1
View File
@@ -24,7 +24,7 @@ jobs:
- name: Build with Gradle - name: Build with Gradle
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
with: with:
arguments: :free:shadowJar arguments: :free:shadowJar :premium:shadowJar
- name: Upload plugin jar artifact - name: Upload plugin jar artifact
uses: actions/upload-artifact@v2.3.1 uses: actions/upload-artifact@v2.3.1
with: with:
@@ -60,3 +60,18 @@ jobs:
run: './gradlew :api:publish' run: './gradlew :api:publish'
- name: Deploy common with Gradle - name: Deploy common with Gradle
run: './gradlew :common:publish' 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
+3 -3
View File
@@ -14,11 +14,11 @@ repositories {
} }
dependencies { dependencies {
implementation("net.kyori:adventure-api:4.8.1") implementation("net.kyori:adventure-api:4.9.3")
implementation("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT") implementation("net.kyori:adventure-text-serializer-plain:4.9.3")
compileOnly("com.google.guava:guava:30.1.1-jre") compileOnly("com.google.guava:guava:30.1.1-jre")
compileOnly("us.ajg0702:ajUtils:1.1.17") compileOnly("us.ajg0702:ajUtils:1.1.20")
} }
publishing { publishing {
+1 -1
View File
@@ -12,7 +12,7 @@ repositories {
} }
allprojects { allprojects {
version = "2.2.4" version = "2.2.5"
group = "us.ajg0702" group = "us.ajg0702"
plugins.apply("java") plugins.apply("java")
+3 -3
View File
@@ -14,11 +14,11 @@ repositories {
dependencies { dependencies {
testImplementation("junit:junit:4.12") testImplementation("junit:junit:4.12")
compileOnly("net.kyori:adventure-api:4.8.1") compileOnly("net.kyori:adventure-api:4.9.3")
compileOnly("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT") compileOnly("net.kyori:adventure-text-serializer-plain:4.9.3")
compileOnly("com.google.guava:guava:30.1.1-jre") 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") compileOnly("org.slf4j:slf4j-log4j12:1.7.29")
@@ -14,14 +14,21 @@ public class SlashServerCommand extends BaseCommand {
final QueueMain main; final QueueMain main;
final String server; final String server;
final String command;
public SlashServerCommand(QueueMain main, String server) { public SlashServerCommand(QueueMain main, String server) {
this.main = main; this.main = main;
this.server = server; this.server = server;
this.command = server;
}
public SlashServerCommand(QueueMain main, String command, String server) {
this.main = main;
this.server = server;
this.command = command;
} }
@Override @Override
public String getName() { public String getName() {
return server; return command;
} }
@Override @Override
@@ -13,6 +13,7 @@ import us.ajg0702.queue.api.server.AdaptedServer;
import us.ajg0702.queue.commands.commands.PlayerSender; import us.ajg0702.queue.commands.commands.PlayerSender;
import us.ajg0702.queue.common.players.QueuePlayerImpl; import us.ajg0702.queue.common.players.QueuePlayerImpl;
import us.ajg0702.queue.common.utils.Debug; import us.ajg0702.queue.common.utils.Debug;
import us.ajg0702.utils.common.TimeUtils;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.DataInputStream; import java.io.DataInputStream;
@@ -83,6 +84,28 @@ public class EventHandlerImpl implements EventHandler {
} }
main.getPlatformMethods().sendPluginMessage(recievingPlayer, "positionof", pos); 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")) { if(subchannel.equals("inqueue")) {
QueueServer server = main.getQueueManager().getSingleServer(recievingPlayer); QueueServer server = main.getQueueManager().getSingleServer(recievingPlayer);
main.getPlatformMethods().sendPluginMessage(recievingPlayer, "inqueue", (server != null)+""); main.getPlatformMethods().sendPluginMessage(recievingPlayer, "inqueue", (server != null)+"");
@@ -235,6 +235,7 @@ public class QueueMain extends AjQueueAPI {
d.put("placeholders.queued.none", "None"); d.put("placeholders.queued.none", "None");
d.put("placeholders.position.none", "None"); d.put("placeholders.position.none", "None");
d.put("placeholders.estimated_time.none", "None");
d.put("title.title", ""); d.put("title.title", "");
d.put("title.subtitle", "<gold>You are <green>#{POS} <gold>in the queue!"); d.put("title.subtitle", "<gold>You are <green>#{POS} <gold>in the queue!");
@@ -22,10 +22,20 @@ public class SlashServerManager {
serverCommands.clear(); serverCommands.clear();
List<String> slashServerServers = main.getConfig().getStringList("slash-servers"); List<String> slashServerServers = main.getConfig().getStringList("slash-servers");
for(String server : slashServerServers) { for(String rawServer : slashServerServers) {
SlashServerCommand command = new SlashServerCommand(main, server); if(rawServer.contains(":") && main.isPremium()) {
serverCommands.add(command); String[] parts = rawServer.split(":");
implementation.registerCommand(command); 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);
}
} }
} }
} }
+5 -1
View File
@@ -1,5 +1,5 @@
# Dont touch this number please # Dont touch this number please
config-version: 33 config-version: 34
# This is the main config for ajQueue. # 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 # For example, if survival is in this list, then if a player executes /survival
# then they will be put in the queue for survival # then they will be put in the queue for survival
# This works for both servers and groups # 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: [] slash-servers: []
# What balancer should we use? # What balancer should we use?
+2 -2
View File
@@ -14,11 +14,11 @@ repositories {
} }
dependencies { 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("com.google.guava:guava:30.1.1-jre")
compileOnly("org.spongepowered:configurate-yaml:4.0.0") 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:velocity"))
implementation(project(":platforms:bungeecord")) implementation(project(":platforms:bungeecord"))
+4 -4
View File
@@ -14,16 +14,16 @@ repositories {
} }
dependencies { 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("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") 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") 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") compileOnly("com.viaversion:viaversion-api:4.2.0-SNAPSHOT")
+3 -3
View File
@@ -14,13 +14,13 @@ repositories {
} }
dependencies { 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("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") compileOnly("com.velocitypowered:velocity-api:3.0.0")
annotationProcessor("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") compileOnly("com.viaversion:viaversion-api:4.2.0-SNAPSHOT")
+2 -2
View File
@@ -23,9 +23,9 @@ dependencies {
compileOnly("me.TechsCode:FakeUltraPerms:1.0.2") 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/private", "include" to listOf("*.jar"))))
compileOnly(fileTree(mapOf("dir" to "../libs/public", "include" to listOf("*.jar")))) compileOnly(fileTree(mapOf("dir" to "../libs/public", "include" to listOf("*.jar"))))
+2 -2
View File
@@ -19,12 +19,12 @@ repositories {
} }
dependencies { 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("com.google.guava:guava:30.1.1-jre")
compileOnly("org.spongepowered:configurate-yaml:4.0.0") 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(group = "org.spigotmc", name = "spigot", version = "1.16.5-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.10.4") compileOnly("me.clip:placeholderapi:2.10.4")
@@ -195,6 +195,9 @@ public class Placeholders extends PlaceholderExpansion {
if(identifier.equalsIgnoreCase("inqueue")) { if(identifier.equalsIgnoreCase("inqueue")) {
plugin.sendMessage(player, "inqueue", ""); plugin.sendMessage(player, "inqueue", "");
} }
if(identifier.equalsIgnoreCase("estimated_time")) {
plugin.sendMessage(player, "estimated_time", "");
}
if(identifier.matches("queuedfor_*.*")) { if(identifier.matches("queuedfor_*.*")) {
plugin.sendMessage(player, "queuedfor", identifier.split("_")[1]); plugin.sendMessage(player, "queuedfor", identifier.split("_")[1]);
} }
@@ -165,6 +165,19 @@ public class SpigotMain extends JavaPlugin implements PluginMessageListener,List
phs.put("queuedfor_"+queuename, number+""); phs.put("queuedfor_"+queuename, number+"");
placeholders.responseCache.put(p, phs); 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<String, String> phs = placeholders.responseCache.get(p);
if(phs == null) phs = new HashMap<>();
phs.put("estimated_time", time);
placeholders.responseCache.put(p, phs);
}
} }