Interface AudienceProvider


public interface AudienceProvider
Provides various Audience instances.
  • Method Details

    • getEveryone

      Audience getEveryone()
      Returns an Audience instance representing everything and everyone. Will dynamically update as players join and leave.
    • getPlayer

      Audience getPlayer(MUUID muuid)
      Returns an Audience instance representing the player with the given MUUID. Will return an empty audience if the player is not online.
      Parameters:
      muuid - the player's MUUID
      Returns:
      the player's audience or an empty audience
    • getPlayer

      Audience getPlayer(String uuid)
      Returns an Audience instance representing the player with the given uuid.

      Keep in mind this method is not secure, especially if strict mode is disabled.

      Parameters:
      uuid - the player uuid
      Returns:
      the player's audience or an empty audience
    • getPlayer

      PlayerAudience getPlayer(mindustry.gen.Player player)
      Returns an Audience instance representing the player with the given Player. Unlike getPlayer(MUUID), this method will never return an empty audience.
      Parameters:
      player - the player
      Returns:
      the player's audience
    • getConnection

      Audience getConnection(mindustry.net.NetConnection connection)
      Returns an audience from a raw NetConnection.
      If called before the Player instance is created, most of the player metadata will be missing. But will be partially populated after EventType.ConnectPacketEvent is fired.
      Otherwise, it will be the same as calling getPlayer(Player).
      Parameters:
      connection - the connection
      Returns:
      the player's audience
    • getServer

      Audience getServer()
      Returns an Audience instance representing the server.
    • getPlayers

      Audience getPlayers()
      Returns an Audience instance representing all players. Will dynamically update as players join and leave.
    • getTeam

      Audience getTeam(mindustry.game.Team team)
      Returns an Audience instance representing the team with the given Team. Will dynamically update as players join and leave.
      Parameters:
      team - the team
      Returns:
      the team's audience