Fix server ping method.
This commit is contained in:
parent
154722eacc
commit
c5e15697a4
@ -48,24 +48,21 @@ public class BungeeServerInfo extends ServerInfo
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
try
|
try ( Socket socket = new Socket(); )
|
||||||
{
|
{
|
||||||
Socket socket = new Socket();
|
|
||||||
socket.connect( getAddress() );
|
socket.connect( getAddress() );
|
||||||
try ( DataOutputStream out = new DataOutputStream( socket.getOutputStream() ) )
|
|
||||||
{
|
DataOutputStream out = new DataOutputStream( socket.getOutputStream() );
|
||||||
out.write( 0xFE );
|
out.write( 0xFE );
|
||||||
out.write( 0x01 );
|
out.write( 0x01 );
|
||||||
}
|
|
||||||
try ( PacketStream in = new PacketStream( socket.getInputStream() ) )
|
PacketStream in = new PacketStream( socket.getInputStream() );
|
||||||
{
|
|
||||||
PacketFFKick response = new PacketFFKick( in.readPacket() );
|
PacketFFKick response = new PacketFFKick( in.readPacket() );
|
||||||
|
|
||||||
String[] split = response.message.split( "\00" );
|
String[] split = response.message.split( "\00" );
|
||||||
|
|
||||||
ServerPing ping = new ServerPing( Byte.parseByte( split[1] ), split[2], split[3], Integer.parseInt( split[4] ), Integer.parseInt( split[5] ) );
|
ServerPing ping = new ServerPing( Byte.parseByte( split[1] ), split[2], split[3], Integer.parseInt( split[4] ), Integer.parseInt( split[5] ) );
|
||||||
callback.done( ping, null );
|
callback.done( ping, null );
|
||||||
}
|
|
||||||
} catch ( Throwable t )
|
} catch ( Throwable t )
|
||||||
{
|
{
|
||||||
callback.done( null, t );
|
callback.done( null, t );
|
||||||
|
Loading…
Reference in New Issue
Block a user