Merge pull request #3041 from summetdev/admin-chat

Admin chat.
This commit is contained in:
Anuken 2020-10-20 09:10:18 -04:00 committed by GitHub
commit e68d28ef51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import mindustry.game.EventType.*;
import mindustry.game.*;
import mindustry.game.Teams.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.net.*;
import mindustry.net.Administration.*;
import mindustry.net.Packets.*;
@ -299,6 +300,15 @@ public class NetServer implements ApplicationListener{
}
});
clientCommands.<Player>register("a", "<message...>", "Send a message only to admins.", (args, player) -> {
if(!player.admin){
player.sendMessage("[scarlet]You must be admin to use this command.");
return;
}
Groups.player.each(Player::admin, a -> a.sendMessage(args[0], player, "[#" + Pal.adminChat.toString() + "]<A>" + NetClient.colorizeName(player.id, player.name)));
});
//duration of a a kick in seconds
int kickDuration = 60 * 60;
//voting round duration in seconds

View File

@ -94,5 +94,7 @@ public class Pal{
redDust = Color.valueOf("ffa480"),
redderDust = Color.valueOf("ff7b69"),
plasticSmoke = Color.valueOf("f1e479");
plasticSmoke = Color.valueOf("f1e479"),
adminChat = Color.valueOf("ff4000");
}