Common should be done

This commit is contained in:
ajgeiss0702
2021-07-08 10:29:06 -07:00
parent ff9a2965c1
commit 18d0c72b89
4 changed files with 211 additions and 38 deletions
@@ -4,7 +4,9 @@ import com.google.common.collect.ImmutableList;
import us.ajg0702.queue.api.players.AdaptedPlayer;
import us.ajg0702.queue.api.players.QueuePlayer;
import us.ajg0702.queue.api.server.AdaptedServer;
import us.ajg0702.queue.api.server.AdaptedServerPing;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
@@ -48,7 +50,7 @@ public interface QueueServer {
* Gets how long since the last person was sent
* @return The number of miliseconds since the last person was sent
*/
int getLastSentTime();
long getLastSentTime();
@@ -190,8 +192,19 @@ public interface QueueServer {
QueuePlayer findPlayer(AdaptedPlayer player);
/**
* Gets the most ideal server in this group to join
* @param player The player that would be joining
* @return The ideal server to join
*/
AdaptedServer getIdealServer(AdaptedPlayer player);
/**
* Gets the last server pings
* @return The last server pings for this server/group
*/
HashMap<AdaptedServer, AdaptedServerPing> getLastPings();
/**
* elliot is bad
@@ -12,6 +12,12 @@ public interface AdaptedServer {
*/
AdaptedServerInfo getServerInfo();
/**
* Gets the server's name
* @return the server's name
*/
String getName();
/**
* Pings the server and gets info back
* @return A CompletableFuture with the ServerPing