Package mindustry.net
Class Administration
java.lang.Object
mindustry.net.Administration
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Allows or disallows player actions.static enum
static interface
Handles chat messages from players and changes their contents.static class
Server configuration definition.static class
Defines a (potentially dangerous) action that a player has done in the world.static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionAll player info. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a filter to actions, preventing things such as breaking or configuring blocks.void
Adds a chat filter.void
addSubnetBan
(String ip) boolean
adminPlayer
(String id, String usid) Makes a player an admin.boolean
allowAction
(mindustry.gen.Player player, Administration.ActionType type, Cons<Administration.PlayerAction> setter) boolean
allowAction
(mindustry.gen.Player player, Administration.ActionType type, Tile tile, Cons<Administration.PlayerAction> setter) boolean
boolean
boolean
banPlayerID
(String id) Bans a player by UUID; returns whether this player was already banned.boolean
banPlayerIP
(String ip) Bans a player by IP; returns whether this player was already banned.void
blacklistDos
(String address) filterMessage
(mindustry.gen.Player player, String message) Filters out a chat message.findByName
(String name) Finds player info by IP, UUID and name.void
Returns list of all players with admin statusReturns list of all players which are bannedReturns all banned IPs.long
getKickTime
(String uuid, String ip) int
void
handleKicked
(String uuid, String ip, long duration) Sets up kick duration for a player.boolean
boolean
isDosBlacklisted
(String address) boolean
isIDBanned
(String uuid) boolean
isIPBanned
(String ip) boolean
isStrict()
boolean
isSubnetBanned
(String ip) boolean
isWhitelisted
(String id, String usid) boolean
void
void
save()
searchNames
(String name) Finds by name, using contains().void
setPlayerLimit
(int limit) boolean
unAdminPlayer
(String id) Makes a player no longer an admin.boolean
unbanPlayerID
(String id) Unbans a player by ID; returns whether this player was banned in the first place.boolean
unbanPlayerIP
(String ip) Unbans a player by IP; returns whether this player was banned in the first place.boolean
unwhitelist
(String id) void
updatePlayerJoined
(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
-
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, 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
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()
-