Implement a connect callback - see #760

This commit is contained in:
md_5
2013-12-21 13:11:27 +11:00
parent f7d3dfd61d
commit 075518b643
3 changed files with 32 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
package net.md_5.bungee.api.connection;
import net.md_5.bungee.api.Callback;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.tab.TabListHandler;
@@ -35,6 +36,18 @@ public interface ProxiedPlayer extends Connection, CommandSender
*/
void connect(ServerInfo target);
/**
* 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 target the new server to connect to
* @param callback the method called when the connection is complete, or
* when an exception is encountered. The boolean parameter denotes success
* or failure.
*/
void connect(ServerInfo target, Callback<Boolean> callback);
/**
* Gets the server this player is connected to.
*