mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-06 07:30:35 +07:00
This commit is contained in:
parent
9c29706297
commit
4c4c361093
@ -595,41 +595,42 @@ public class ServerControl implements ApplicationListener{
|
||||
netServer.admins.removeSubnetBan(arg[1]);
|
||||
info("Unbanned @**", arg[1]);
|
||||
}else{
|
||||
err("Incorrect usage. You must provide add/remove as the second argument.");
|
||||
err("Incorrect usage. Provide add/remove as the second argument.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
handler.register("whitelisted", "List the entire whitelist.", arg -> {
|
||||
if(netServer.admins.getWhitelisted().isEmpty()){
|
||||
info("No whitelisted players found.");
|
||||
return;
|
||||
handler.register("whitelist", "[add/remove] [ID]", "Add/remove players from the whitelist using their ID.", arg -> {
|
||||
if(arg.length == 0){
|
||||
var whitelist = netServer.admins.getWhitelisted();
|
||||
|
||||
if(whitelist.isEmpty()){
|
||||
info("No whitelisted players found.");
|
||||
}else{
|
||||
info("Whitelist:");
|
||||
whitelist.each(p -> info("- Name: @ / UUID: @", p.lastName, p.id));
|
||||
}
|
||||
}else{
|
||||
if(arg.length == 2){
|
||||
PlayerInfo info = netServer.admins.getInfoOptional(arg[1]);
|
||||
|
||||
if(info == null){
|
||||
err("Player ID not found. You must use the ID displayed when a player joins a server.");
|
||||
}else{
|
||||
if(arg[0].equals("add")){
|
||||
netServer.admins.whitelist(arg[1]);
|
||||
info("Player '@' has been whitelisted.", info.lastName);
|
||||
}else if(arg[0].equals("remove")){
|
||||
netServer.admins.unwhitelist(arg[1]);
|
||||
info("Player '@' has been un-whitelisted.", info.lastName);
|
||||
}else{
|
||||
err("Incorrect usage. Provide add/remove as the second argument.");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
err("Incorrect usage. Provide an ID to add or remove.");
|
||||
}
|
||||
}
|
||||
|
||||
info("Whitelist:");
|
||||
netServer.admins.getWhitelisted().each(p -> info("- @", p.lastName));
|
||||
});
|
||||
|
||||
handler.register("whitelist-add", "<ID>", "Add a player to the whitelist by ID.", arg -> {
|
||||
PlayerInfo info = netServer.admins.getInfoOptional(arg[0]);
|
||||
if(info == null){
|
||||
err("Player ID not found. You must use the ID displayed when a player joins a server.");
|
||||
return;
|
||||
}
|
||||
|
||||
netServer.admins.whitelist(arg[0]);
|
||||
info("Player '@' has been whitelisted.", info.lastName);
|
||||
});
|
||||
|
||||
handler.register("whitelist-remove", "<ID>", "Remove a player to the whitelist by ID.", arg -> {
|
||||
PlayerInfo info = netServer.admins.getInfoOptional(arg[0]);
|
||||
if(info == null){
|
||||
err("Player ID not found. You must use the ID displayed when a player joins a server.");
|
||||
return;
|
||||
}
|
||||
|
||||
netServer.admins.unwhitelist(arg[0]);
|
||||
info("Player '@' has been un-whitelisted.", info.lastName);
|
||||
});
|
||||
|
||||
handler.register("shuffle", "[none/all/custom/builtin]", "Set map shuffling mode.", arg -> {
|
||||
|
Loading…
Reference in New Issue
Block a user