Interface BanIPManager


public interface BanIPManager
Ban or unban the ip
  • Method Details

    • getBanned

      List<String> getBanned()
      Get all banned host
      Returns:
      hosts (Unbanned not included)
    • getBannedWithPlayer

      List<String> getBannedWithPlayer()
      Get all player name which is connected with a banned host
      Returns:
      player names (Lowercase)
    • getPunishments

      List<BanIPPunishment> getPunishments(String host)
      Get the punishments of a host
      Parameters:
      host - the owner of punishments
      Returns:
      all punishments including unbanned
    • getPunishmentsWithPlayer

      List<BanIPPunishment> getPunishmentsWithPlayer(String playerName)
      Get the punishments of a host connected with the player
      Parameters:
      playerName - the player name connected to the owner of punishments
      Returns:
      all punishments including unbanned
    • getCurrent

      net.deechael.useless.objs.DuObj<Boolean,BanIPPunishment> getCurrent(String host)
      To get the current punishment of the host
      Parameters:
      host - the owner of punishments
      Returns:
      if host not banned, return (false, null), else return (true, BanIPPunishment)
    • getCurrentWithPlayer

      net.deechael.useless.objs.DuObj<Boolean,BanIPPunishment> getCurrentWithPlayer(String playerName)
      To get the current punishment of the host connected with the player
      Parameters:
      playerName - the player name connected to the owner of punishments
      Returns:
      if host not banned, return (false, null), else return (true, BanIPPunishment)
    • isBanned

      boolean isBanned(String host)
      To check whether the host is banned
      Parameters:
      host - the owner of punishments
      Returns:
      the banned status
    • isBannedWithPlayer

      boolean isBannedWithPlayer(PlayerUser user)
      To check whether the host connected with the player is banned
      Parameters:
      user - the user connected with the owner of punishments
      Returns:
      the banned status
    • isBannedWithPlayer

      boolean isBannedWithPlayer(String playerName)
      To check whether the host connected with the player is banned
      Parameters:
      playerName - the user connected with the owner of punishments
      Returns:
      the banned status
    • get

      BanIPPunishment get(String banId)
      Get the punishment by id
      Parameters:
      banId - the id of punishment
      Returns:
      if id not exists, return null, else BanIPPunishment
    • banIP

      BanIPPunishment banIP(String host, String operator, String reason, Date start, Date end)
      Ban the host
      Parameters:
      host - the host to be banned
      operator - the operator, should be the name of a player or "CONSOLE"
      reason - the reason why ban the player
      start - the start time, should be new Date()
      end - the end time, if is null, means forever
      Returns:
      the punishment object
    • banIP

      BanIPPunishment banIP(InetSocketAddress address, String operator, String reason, Date start, Date end)
      Ban the host
      Parameters:
      address - the host to be banned
      operator - the operator, should be the name of a player or "CONSOLE"
      reason - the reason why ban the player
      start - the start time, should be new Date()
      end - the end time, if is null, means forever
      Returns:
      the punishment object
    • banIPWithPlayer

      BanIPPunishment banIPWithPlayer(PlayerUser user, String operator, String reason, Date start, Date end)
      Ban the host connected with the player
      Parameters:
      user - the player connected with the host
      operator - the operator, should be the name of a player or "CONSOLE"
      reason - the reason why ban the player
      start - the start time, should be new Date()
      end - the end time, if is null, means forever
      Returns:
      the punishment object
    • unbanIPWithId

      void unbanIPWithId(String id)
      Unban the host by the id of punishment
      Parameters:
      id - the id of punishment
    • unbanIP

      void unbanIP(String host)
      Unban the host by host
      Parameters:
      host - the host to be unbanned
    • unbanIP

      void unbanIP(InetSocketAddress address)
      Unban the host by host
      Parameters:
      address - the host to be unbanned
    • unbanIPWithPlayer

      void unbanIPWithPlayer(UUID uuid)
      Unban the host connected with the player
      Parameters:
      uuid - the player connected with the host
    • unbanIPWithPlayer

      void unbanIPWithPlayer(String playerName)
      Unban the host connected with the player
      Parameters:
      playerName - the player connected with the host