parent
841c81cdc4
commit
e556fd7150
@ -51,6 +51,14 @@ public interface Connection
|
|||||||
*/
|
*/
|
||||||
void disconnect(BaseComponent reason);
|
void disconnect(BaseComponent reason);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether this connection is currently open, ie: not disconnected, and
|
||||||
|
* able to send / receive data.
|
||||||
|
*
|
||||||
|
* @return current connection status
|
||||||
|
*/
|
||||||
|
boolean isConnected();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the unsafe methods of this class.
|
* Get the unsafe methods of this class.
|
||||||
*
|
*
|
||||||
|
@ -77,6 +77,12 @@ public class ServerConnection implements Server
|
|||||||
return getInfo().getAddress();
|
return getInfo().getAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isConnected()
|
||||||
|
{
|
||||||
|
return !ch.isClosed();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Unsafe unsafe()
|
public Unsafe unsafe()
|
||||||
{
|
{
|
||||||
|
@ -274,9 +274,7 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
{
|
{
|
||||||
sendMessage( bungee.getTranslation( "fallback_lobby" ) );
|
sendMessage( bungee.getTranslation( "fallback_lobby" ) );
|
||||||
connect( def, null, false );
|
connect( def, null, false );
|
||||||
} else
|
} else if ( dimensionChange )
|
||||||
{
|
|
||||||
if ( dimensionChange )
|
|
||||||
{
|
{
|
||||||
disconnect( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) );
|
disconnect( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) );
|
||||||
} else
|
} else
|
||||||
@ -285,7 +283,6 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
Bootstrap b = new Bootstrap()
|
Bootstrap b = new Bootstrap()
|
||||||
.channel( PipelineUtils.getChannel() )
|
.channel( PipelineUtils.getChannel() )
|
||||||
@ -592,4 +589,10 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
ch.setCompressionThreshold( compressionThreshold );
|
ch.setCompressionThreshold( compressionThreshold );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isConnected()
|
||||||
|
{
|
||||||
|
return !ch.isClosed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -606,4 +606,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
{
|
{
|
||||||
return "[" + ( ( getName() != null ) ? getName() : getAddress() ) + "] <-> InitialHandler";
|
return "[" + ( ( getName() != null ) ? getName() : getAddress() ) + "] <-> InitialHandler";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isConnected()
|
||||||
|
{
|
||||||
|
return !ch.isClosed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user