mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-30 22:24:18 +01:00
Add API to support #468 - force setting of reconnect server
This commit is contained in:
parent
47b5631562
commit
702f434db1
@ -85,4 +85,18 @@ public interface ProxiedPlayer extends Connection, CommandSender
|
|||||||
* @return the tab list in use by this user
|
* @return the tab list in use by this user
|
||||||
*/
|
*/
|
||||||
TabListHandler getTabList();
|
TabListHandler getTabList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the server which this player will be sent to next time the log in.
|
||||||
|
*
|
||||||
|
* @return the server, or null if default
|
||||||
|
*/
|
||||||
|
ServerInfo getReconnectServer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the server which this player will be sent to next time the log in.
|
||||||
|
*
|
||||||
|
* @param server the server to set
|
||||||
|
*/
|
||||||
|
void setReconnectServer(ServerInfo server);
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,9 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
private int ping = 100;
|
private int ping = 100;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private ServerInfo reconnectServer;
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
private final Collection<String> groups = new CaseInsensitiveSet();
|
private final Collection<String> groups = new CaseInsensitiveSet();
|
||||||
private final Collection<String> permissions = new CaseInsensitiveSet();
|
private final Collection<String> permissions = new CaseInsensitiveSet();
|
||||||
|
@ -71,7 +71,7 @@ public class YamlReconnectHandler extends AbstractReconnectManager
|
|||||||
lock.writeLock().lock();
|
lock.writeLock().lock();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
data.put( key( player ), player.getServer().getInfo().getName() );
|
data.put( key( player ), ( player.getReconnectServer() != null ) ? player.getReconnectServer().getName() : player.getServer().getInfo().getName() );
|
||||||
} finally
|
} finally
|
||||||
{
|
{
|
||||||
lock.writeLock().unlock();
|
lock.writeLock().unlock();
|
||||||
|
Loading…
Reference in New Issue
Block a user