Add global PlayerCount if target is "ALL"
This allows bukkit servers to get the global bungeecord player count.
This commit is contained in:
parent
9be44d51a6
commit
c1dfd0fb7b
@ -264,12 +264,19 @@ public class DownstreamBridge extends PacketHandler
|
||||
}
|
||||
if ( subChannel.equals( "PlayerCount" ) )
|
||||
{
|
||||
ServerInfo server = bungee.getServerInfo( in.readUTF() );
|
||||
if ( server != null )
|
||||
String target = in.readUTF();
|
||||
out.writeUTF( "PlayerCount" );
|
||||
if ( target.equals( "ALL" ) )
|
||||
{
|
||||
out.writeUTF( "PlayerCount" );
|
||||
out.writeUTF( server.getName() );
|
||||
out.writeInt( server.getPlayers().size() );
|
||||
out.writeInt( bungee.getPlayers().size() );
|
||||
} else
|
||||
{
|
||||
ServerInfo server = bungee.getServerInfo( target );
|
||||
if ( server != null )
|
||||
{
|
||||
out.writeUTF( server.getName() );
|
||||
out.writeInt( server.getPlayers().size() );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( subChannel.equals( "PlayerList" ) )
|
||||
|
Loading…
Reference in New Issue
Block a user