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
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
with:
arguments: :free:shadowJar
arguments: :free:shadowJar :premium:shadowJar
- name: Upload plugin jar artifact
uses: actions/upload-artifact@v2.3.1
with:
@@ -60,3 +60,18 @@ jobs:
run: './gradlew :api:publish'
- name: Deploy common with Gradle
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 {
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 {
+1 -1
View File
@@ -12,7 +12,7 @@ repositories {
}
allprojects {
version = "2.2.4"
version = "2.2.5"
group = "us.ajg0702"
plugins.apply("java")
+3 -3
View File
@@ -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")
@@ -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
@@ -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)+"");
@@ -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", "<gold>You are <green>#{POS} <gold>in the queue!");
@@ -22,10 +22,20 @@ public class SlashServerManager {
serverCommands.clear();
List<String> 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);
}
}
}
}
+5 -1
View File
@@ -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?
+2 -2
View File
@@ -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"))
+4 -4
View File
@@ -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")
+3 -3
View File
@@ -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")
+2 -2
View File
@@ -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"))))
+2 -2
View File
@@ -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")
@@ -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]);
}
@@ -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<String, String> phs = placeholders.responseCache.get(p);
if(phs == null) phs = new HashMap<>();
phs.put("estimated_time", time);
placeholders.responseCache.put(p, phs);
}
}