Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Seperate sudo-queueing and normal queueing on spigot side. `/queue <p…
…layer> <server>` on the spigot side now acts the same as `/ajqueue send`
- Loading branch information
1 parent
80289de
commit 2414c69
Showing
6 changed files
with
85 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
common/src/main/java/us/ajg0702/queue/common/communication/handlers/ServerQueueHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package us.ajg0702.queue.common.communication.handlers; | ||
|
||
import us.ajg0702.queue.api.communication.ComResponse; | ||
import us.ajg0702.queue.api.players.AdaptedPlayer; | ||
import us.ajg0702.queue.api.queues.QueueServer; | ||
import us.ajg0702.queue.common.QueueMain; | ||
import us.ajg0702.queue.common.communication.MessageHandler; | ||
|
||
public class ServerQueueHandler extends MessageHandler { | ||
public ServerQueueHandler(QueueMain main) { | ||
super(main); | ||
} | ||
|
||
@Override | ||
public ComResponse handleMessage(AdaptedPlayer player, String data) { | ||
QueueServer server = main.getQueueManager().findServer(data); | ||
if(server == null) { | ||
return ComResponse | ||
.from("serverqueue") | ||
.id(player.getUniqueId()) | ||
.with("invalid_server"); | ||
} | ||
return ComResponse | ||
.from("serverqueue") | ||
.id(player.getUniqueId()) | ||
.with(main.getQueueManager().addToQueue(player, server)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters