From 5ea52e00f03d5faf63fbc4f3710ddc34657e4d9c Mon Sep 17 00:00:00 2001 From: Cube Date: Sat, 3 Jun 2017 19:30:22 +0300 Subject: [PATCH] Convert messaging commands to Kotlin --- game/src/plugins/cmd/src/messaging-cmd.plugin.kts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 game/src/plugins/cmd/src/messaging-cmd.plugin.kts diff --git a/game/src/plugins/cmd/src/messaging-cmd.plugin.kts b/game/src/plugins/cmd/src/messaging-cmd.plugin.kts new file mode 100644 index 00000000..883d7a51 --- /dev/null +++ b/game/src/plugins/cmd/src/messaging-cmd.plugin.kts @@ -0,0 +1,11 @@ +import org.apollo.game.model.entity.setting.PrivilegeLevel + +on_command("broadcast", PrivilegeLevel.ADMINISTRATOR) + .then { player -> + val message = arguments.joinToString(" ") + val broadcast = "[Broadcast] ${player.username.capitalize()}: $message" + + player.world.playerRepository.forEach { other -> + other.sendMessage(broadcast) + } + }