Skip to content

Commit

Permalink
Properly validate target
Browse files Browse the repository at this point in the history
  • Loading branch information
Warriorrrr committed Oct 3, 2024
1 parent 8b6a3f4 commit 06bf7f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<name>Queue</name>
<groupId>net.earthmc</groupId>
<version>0.1.3</version>
<version>0.1.4</version>
<artifactId>queue-velocity</artifactId>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/earthmc/queue/QueuePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

@Plugin(id = "queue", name = "Queue", version = "0.1.2", authors = {"Warriorrr"})
@Plugin(id = "queue", name = "Queue", version = "0.1.4", authors = {"Warriorrr"})
public class QueuePlugin {

private static QueuePlugin instance;
Expand Down Expand Up @@ -261,7 +261,7 @@ public void processAutoQueue(ServerConnectedEvent event, QueuedPlayer player) {
private String validateAutoQueueTarget(Player player, String target) {
// Validate that the target is known to the proxy, it isn't an auto queue server, and the player has permissions to join it, otherwise just return the default target.
return proxy.getServer(target).map(server -> server.getServerInfo().getName())
.filter(name -> !config.autoQueueSettings().autoQueueServers().contains(name.toLowerCase(Locale.ROOT)))
.filter(name -> config.autoQueueSettings().autoQueueServers().contains(name.toLowerCase(Locale.ROOT)))
.filter(name -> BaseCommand.hasPrefixedPermission(player, "queue.join.", name))
.orElse(config.autoQueueSettings().defaultTarget());
}
Expand Down

0 comments on commit 06bf7f0

Please sign in to comment.