Add server registration API.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.velocitypowered.api.proxy;
|
||||
|
||||
import com.velocitypowered.api.server.ServerInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
@@ -29,4 +31,29 @@ public interface ProxyServer {
|
||||
* @return the players online on this proxy
|
||||
*/
|
||||
Collection<Player> getAllPlayers();
|
||||
|
||||
/**
|
||||
* Retrieves a registered {@link ServerInfo} instance by its name.
|
||||
* @param name the name of the server
|
||||
* @return the server
|
||||
*/
|
||||
Optional<ServerInfo> getServerInfo(@Nonnull String name);
|
||||
|
||||
/**
|
||||
* Retrieves all {@link ServerInfo}s registered with this proxy.
|
||||
* @return the servers registered with this proxy
|
||||
*/
|
||||
Collection<ServerInfo> getAllServers();
|
||||
|
||||
/**
|
||||
* Registers a server with this proxy. A server with this name should not already exist.
|
||||
* @param server the server to register
|
||||
*/
|
||||
void registerServer(@Nonnull ServerInfo server);
|
||||
|
||||
/**
|
||||
* Unregisters this server from the proxy.
|
||||
* @param server the server to unregister
|
||||
*/
|
||||
void unregisterServer(@Nonnull ServerInfo server);
|
||||
}
|
||||
|
Reference in New Issue
Block a user