Seperate sudo-queueing and normal queueing on spigot side. /queue <player> <server> on the spigot side now acts the same as /ajqueue send
This commit is contained in:
+2
-2
@@ -4,7 +4,6 @@ import us.ajg0702.queue.api.communication.ComResponse;
|
||||
import us.ajg0702.queue.api.players.AdaptedPlayer;
|
||||
import us.ajg0702.queue.common.QueueMain;
|
||||
import us.ajg0702.queue.common.communication.handlers.*;
|
||||
import us.ajg0702.queue.common.utils.Debug;
|
||||
import us.ajg0702.queue.common.utils.MapBuilder;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
@@ -33,7 +32,8 @@ public class CommunicationManager {
|
||||
"inqueue", new InQueueHandler(main),
|
||||
"queuedfor", new QueuedForHandler(main),
|
||||
"status", new StatusHandler(main),
|
||||
"playerstatus", new PlayerStatusHandler(main)
|
||||
"playerstatus", new PlayerStatusHandler(main),
|
||||
"serverqueue", new ServerQueueHandler(main)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ import us.ajg0702.queue.common.QueueMain;
|
||||
import us.ajg0702.queue.api.communication.ComResponse;
|
||||
import us.ajg0702.queue.common.communication.MessageHandler;
|
||||
|
||||
/**
|
||||
* Actually SudoQueue. Confusing naming is due to legacy support and will be removed next major revision.
|
||||
*/
|
||||
public class QueueHandler extends MessageHandler {
|
||||
private final IBaseCommand moveCommand;
|
||||
|
||||
|
||||
+28
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user