server.sendData( "BungeeCord", payload, false );
}
}
} else
{
ServerInfo server = bungee.getServerInfo( target );
if ( server != null )
{
server.sendData( "BungeeCord", payload );
}
}
}
if ( subChannel.equals( "Connect" ) )
{
ServerInfo server = bungee.getServerInfo( in.readUTF() );
if ( server != null )
{
con.connect( server );
}
}
if ( subChannel.equals( "ConnectOther" ) )
{
ProxiedPlayer player = bungee.getPlayer( in.readUTF() );
if ( player != null )
{
ServerInfo server = bungee.getServerInfo( in.readUTF() );
if ( server != null )
{
player.connect( server );
}
}
}
if ( subChannel.equals( "IP" ) )
{
out.writeUTF( "IP" );
out.writeUTF( con.getAddress().getHostString() );
out.writeInt( con.getAddress().getPort() );
}
if ( subChannel.equals( "PlayerCount" ) )
{
String target = in.readUTF();
out.writeUTF( "PlayerCount" );
if ( target.equals( "ALL" ) )
{
out.writeUTF( "ALL" );
out.writeInt( bungee.getOnlineCount() );
} else
{
ServerInfo server = bungee.getServerInfo( target );
if ( server != null )
{
out.writeUTF( server.getName() );
out.writeInt( server.getPlayers().size() );
}
}
}
if ( subChannel.equals( "PlayerList" ) )
{
String target = in.readUTF();
out.writeUTF( "PlayerList" );
if ( target.equals( "ALL" ) )
{
out.writeUTF( "ALL" );
out.writeUTF( Util.csv( bungee.getPlayers() ) );
} else
{
ServerInfo server = bungee.getServerInfo( target );
if ( server != null )
{
out.writeUTF( server.getName() );
out.writeUTF( Util.csv( server.getPlayers() ) );
}
}
}
if ( subChannel.equals( "GetServers" ) )
{
out.writeUTF( "GetServers" );
out.writeUTF( Util.csv( bungee.getServers().keySet() ) );
}
if ( subChannel.equals( "Message" ) )
{
ProxiedPlayer target = bungee.getPlayer( in.readUTF() );
if ( target != null )
{
target.sendMessage( in.readUTF() );
}
}
if ( subChannel.equals( "GetServer" ) )
{
out.writeUTF( "GetServer" );
out.writeUTF( server.getInfo().getName() );
}
if ( subChannel.equals( "UUID" ) )
{
out.writeUTF( "UUID" );
out.writeUTF( con.getUUID() );
}
if ( subChannel.equals( "UUIDOther" ) )
{
ProxiedPlayer player = bungee.getPlayer( in.readUTF() );
if ( player != null )
{
out.writeUTF( "UUIDOther" );
out.writeUTF( player.getName() );
out.writeUTF( player.getUUID() );
}
}
if ( subChannel.equals( "ServerIP" ) )
{
ServerInfo info = bungee.getServerInfo( in.readUTF() );
if ( info != null )
{
out.writeUTF( "ServerIP" );
out.writeUTF( info.getName() );
out.writeUTF( info.getAddress().getAddress().getHostAddress() );
out.writeShort( info.getAddress().getPort() );
}
}
if ( subChannel.equals( "KickPlayer" ) )
{
ProxiedPlayer player = bungee.getPlayer( in.readUTF() );