From 4ce799ac9bea4875620c14d1b774b834399461c3 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 12 Jan 2013 14:03:50 +1100 Subject: [PATCH] I think that just about sums up the API, requesting comments from everyone before I start implementing it. --- .../bungee/api/connection/ProxiedPlayer.java | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java b/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java index 166b43a6..efa662ad 100644 --- a/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java +++ b/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java @@ -1,11 +1,52 @@ package net.md_5.bungee.api.connection; +import lombok.Getter; +import lombok.Setter; import net.md_5.bungee.api.CommandSender; /** * Represents a player who's connection is being connected to somewhere else, * whether it be a remote or embedded server. */ -public interface ProxiedPlayer extends Connection, CommandSender +public abstract class ProxiedPlayer implements Connection, CommandSender { + + /** + * Name displayed to other users in areas such as the tab list. + */ + @Getter + @Setter + private String displayName; + + /** + * Connects / transfers this user to the specified connection, gracefully + * closing the current one. Depending on the implementation, this method + * might return before the user has been connected. + * + * @param server the new server to connect to + */ + public abstract void connect(Server server); + + /** + * Gets the ping time between the proxy and this connection. + * + * @return the current ping time + */ + public abstract int getPing(); + + /** + * Completely kick this user from the proxy and all of its child + * connections. + * + * @param reason the disconnect reason displayed to the player + */ + public abstract void disconnect(String reason); + + /** + * Send a plugin message to this player. + * + * @param channel the channel to send this data via + * @param data the data to send + */ + public abstract void sendData(String channel, byte[] data); }