Merge pull request #372 from roblabla/patch-2
Add global PlayerCount if target is "ALL"
This commit is contained in:
commit
4cb46c6e5c
@ -264,12 +264,19 @@ public class DownstreamBridge extends PacketHandler
|
|||||||
}
|
}
|
||||||
if ( subChannel.equals( "PlayerCount" ) )
|
if ( subChannel.equals( "PlayerCount" ) )
|
||||||
{
|
{
|
||||||
ServerInfo server = bungee.getServerInfo( in.readUTF() );
|
String target = in.readUTF();
|
||||||
if ( server != null )
|
out.writeUTF( "PlayerCount" );
|
||||||
|
if ( target.equals( "ALL" ) )
|
||||||
{
|
{
|
||||||
out.writeUTF( "PlayerCount" );
|
out.writeInt( bungee.getPlayers().size() );
|
||||||
out.writeUTF( server.getName() );
|
} else
|
||||||
out.writeInt( server.getPlayers().size() );
|
{
|
||||||
|
ServerInfo server = bungee.getServerInfo( target );
|
||||||
|
if ( server != null )
|
||||||
|
{
|
||||||
|
out.writeUTF( server.getName() );
|
||||||
|
out.writeInt( server.getPlayers().size() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( subChannel.equals( "PlayerList" ) )
|
if ( subChannel.equals( "PlayerList" ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user