Package mindustry.net

Class Administration

java.lang.Object
mindustry.net.Administration

public class Administration extends Object
  • Field Details

  • Constructor Details

    • Administration

      public Administration()
  • Method Details

    • blacklistDos

      public void blacklistDos(String address)
    • isDosBlacklisted

      public boolean isDosBlacklisted(String address)
    • getKickTime

      public long getKickTime(String uuid, String ip)
      Returns:
      time at which a player would be pardoned for a kick (0 means they were never kicked)
    • handleKicked

      public void handleKicked(String uuid, String ip, long duration)
      Sets up kick duration for a player.
    • getSubnetBans

      public Seq<String> getSubnetBans()
    • removeSubnetBan

      public void removeSubnetBan(String ip)
    • addSubnetBan

      public void addSubnetBan(String ip)
    • isSubnetBanned

      public boolean isSubnetBanned(String ip)
    • addChatFilter

      public void addChatFilter(Administration.ChatFilter filter)
      Adds a chat filter. This will transform the chat messages of every player. This functionality can be used to implement things like swear filters and special commands. Note that commands (starting with /) are not filtered.
    • filterMessage

      @Nullable public String filterMessage(mindustry.gen.Player player, String message)
      Filters out a chat message.
    • addActionFilter

      public void addActionFilter(Administration.ActionFilter filter)
      Add a filter to actions, preventing things such as breaking or configuring blocks.
    • allowAction

      public boolean allowAction(mindustry.gen.Player player, Administration.ActionType type, Tile tile, Cons<Administration.PlayerAction> setter)
      Returns:
      whether this action is allowed by the action filters.
    • allowAction

      public boolean allowAction(mindustry.gen.Player player, Administration.ActionType type, Cons<Administration.PlayerAction> setter)
      Returns:
      whether this action is allowed by the action filters.
    • getPlayerLimit

      public int getPlayerLimit()
    • setPlayerLimit

      public void setPlayerLimit(int limit)
    • isStrict

      public boolean isStrict()
    • allowsCustomClients

      public boolean allowsCustomClients()
    • updatePlayerJoined

      public void updatePlayerJoined(String id, String ip, String name)
      Call when a player joins to update their information here.
    • banPlayer

      public boolean banPlayer(String uuid)
    • banPlayerIP

      public boolean banPlayerIP(String ip)
      Bans a player by IP; returns whether this player was already banned. If there are players who at any point had this IP, they will be UUID banned as well.
    • banPlayerID

      public boolean banPlayerID(String id)
      Bans a player by UUID; returns whether this player was already banned.
    • unbanPlayerIP

      public boolean unbanPlayerIP(String ip)
      Unbans a player by IP; returns whether this player was banned in the first place. This method also unbans any player that was banned and had this IP.
    • unbanPlayerID

      public boolean unbanPlayerID(String id)
      Unbans a player by ID; returns whether this player was banned in the first place. This also unbans all IPs the player used.
    • getAdmins

      public Seq<Administration.PlayerInfo> getAdmins()
      Returns list of all players with admin status
    • getBanned

      public Seq<Administration.PlayerInfo> getBanned()
      Returns list of all players which are banned
    • getBannedIPs

      public Seq<String> getBannedIPs()
      Returns all banned IPs. This does not include the IPs of ID-banned players.
    • adminPlayer

      public boolean adminPlayer(String id, String usid)
      Makes a player an admin.
      Returns:
      whether this player was already an admin.
    • unAdminPlayer

      public boolean unAdminPlayer(String id)
      Makes a player no longer an admin.
      Returns:
      whether this player was an admin in the first place.
    • isWhitelistEnabled

      public boolean isWhitelistEnabled()
    • isWhitelisted

      public boolean isWhitelisted(String id, String usid)
    • whitelist

      public boolean whitelist(String id)
    • unwhitelist

      public boolean unwhitelist(String id)
    • isIPBanned

      public boolean isIPBanned(String ip)
    • isIDBanned

      public boolean isIDBanned(String uuid)
    • isAdmin

      public boolean isAdmin(String id, String usid)
    • findByName

      public ObjectSet<Administration.PlayerInfo> findByName(String name)
      Finds player info by IP, UUID and name.
    • searchNames

      public ObjectSet<Administration.PlayerInfo> searchNames(String name)
      Finds by name, using contains().
    • findByIPs

      public Seq<Administration.PlayerInfo> findByIPs(String ip)
    • getInfo

      public Administration.PlayerInfo getInfo(String id)
    • getInfoOptional

      public Administration.PlayerInfo getInfoOptional(String id)
    • findByIP

      public Administration.PlayerInfo findByIP(String ip)
    • getWhitelisted

      public Seq<Administration.PlayerInfo> getWhitelisted()
    • save

      public void save()
    • forceSave

      public void forceSave()