Package mindustry.net
Class Administration
java.lang.Object
mindustry.net.Administration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAllows or disallows player actions.static enumstatic interfaceHandles chat messages from players and changes their contents.static classServer configuration definition.static classDefines a (potentially dangerous) action that a player has done in the world.static classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionarc.struct.Seq<Administration.ActionFilter>arc.struct.Seq<String>arc.struct.Seq<Administration.ChatFilter>arc.struct.ObjectSet<String>arc.struct.ObjectMap<String,Administration.PlayerInfo> All player info.arc.struct.Seq<String>arc.struct.Seq<String> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a filter to actions, preventing things such as breaking or configuring blocks.voidAdds a chat filter.voidaddSubnetBan(String ip) booleanadminPlayer(String id, String usid) Makes a player an admin.booleanallowAction(mindustry.gen.Player player, Administration.ActionType type, arc.func.Cons<Administration.PlayerAction> setter) booleanallowAction(mindustry.gen.Player player, Administration.ActionType type, Tile tile, arc.func.Cons<Administration.PlayerAction> setter) booleanbooleanbooleanbanPlayerID(String id) Bans a player by UUID; returns whether this player was already banned.booleanbanPlayerIP(String ip) Bans a player by IP; returns whether this player was already banned.voidblacklistDos(String address) filterMessage(mindustry.gen.Player player, String message) Filters out a chat message.arc.struct.Seq<Administration.PlayerInfo>arc.struct.ObjectSet<Administration.PlayerInfo>findByName(String name) Finds player info by IP, UUID and name.voidarc.struct.Seq<Administration.PlayerInfo>Returns list of all players with admin statusarc.struct.Seq<Administration.PlayerInfo>Returns list of all players which are bannedarc.struct.Seq<String>Returns all banned IPs.longgetKickTime(String uuid, String ip) intarc.struct.Seq<String>arc.struct.Seq<Administration.PlayerInfo>voidhandleKicked(String uuid, String ip, long duration) Sets up kick duration for a player.booleanbooleanisDosBlacklisted(String address) booleanisIDBanned(String uuid) booleanisIPBanned(String ip) booleanisStrict()booleanisSubnetBanned(String ip) booleanisWhitelisted(String id, String usid) booleanvoidvoidsave()arc.struct.ObjectSet<Administration.PlayerInfo>searchNames(String name) Finds by name, using contains().voidsetPlayerLimit(int limit) booleanunAdminPlayer(String id) Makes a player no longer an admin.booleanunbanPlayerID(String id) Unbans a player by ID; returns whether this player was banned in the first place.booleanunbanPlayerIP(String ip) Unbans a player by IP; returns whether this player was banned in the first place.voidunBlacklistDos(String address) booleanunwhitelist(String id) voidupdatePlayerJoined(String id, String ip, String name) Call when a player joins to update their information here.boolean
-
Field Details
-
bannedIPs
-
whitelist
-
chatFilters
-
actionFilters
-
subnetBans
-
dosBlacklist
-
kickedIPs
-
playerInfo
All player info. Maps UUIDs to info. This persists throughout restarts. Do not modify directly.
-
-
Constructor Details
-
Administration
public Administration()
-
-
Method Details
-
blacklistDos
-
unBlacklistDos
-
isDosBlacklisted
-
getKickTime
- Returns:
- time at which a player would be pardoned for a kick (0 means they were never kicked)
-
handleKicked
Sets up kick duration for a player. -
getSubnetBans
-
removeSubnetBan
-
addSubnetBan
-
isSubnetBanned
-
addChatFilter
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
Filters out a chat message. -
addActionFilter
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, arc.func.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, arc.func.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
Call when a player joins to update their information here. -
banPlayer
-
banPlayerIP
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
Bans a player by UUID; returns whether this player was already banned. -
unbanPlayerIP
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
Unbans a player by ID; returns whether this player was banned in the first place. This also unbans all IPs the player used. -
getAdmins
Returns list of all players with admin status -
getBanned
Returns list of all players which are banned -
getBannedIPs
Returns all banned IPs. This does not include the IPs of ID-banned players. -
adminPlayer
Makes a player an admin.- Returns:
- whether this player was already an admin.
-
unAdminPlayer
Makes a player no longer an admin.- Returns:
- whether this player was an admin in the first place.
-
isWhitelistEnabled
public boolean isWhitelistEnabled() -
isWhitelisted
-
whitelist
-
unwhitelist
-
isIPBanned
-
isIDBanned
-
isAdmin
-
findByName
Finds player info by IP, UUID and name. -
searchNames
Finds by name, using contains(). -
findByIPs
-
getInfo
-
getInfoOptional
-
findByIP
-
getWhitelisted
-
save
public void save() -
forceSave
public void forceSave()
-