Rename filter plugin to messaging, add broadcast command.

This commit is contained in:
Major-
2014-07-25 04:08:54 +01:00
parent 394d9fe55a
commit d5c19d7e31
4 changed files with 27 additions and 14 deletions
-14
View File
@@ -1,14 +0,0 @@
<?xml version="1.0"?>
<plugin>
<id>cmd-filter</id>
<version>1</version>
<name>Filter commandr</name>
<description>Adds a command to toggle a server-side message filter, for clients that have not been edited.</description>
<authors>
<author>Major</author>
</authors>
<scripts>
<script>filter.rb</script>
</scripts>
<dependencies />
</plugin>
+11
View File
@@ -0,0 +1,11 @@
require_java
java_import 'org.apollo.game.model.World'
java_import 'org.apollo.game.model.entity.Player'
# Adds a command to broadcast a message to every player on the server.
on :command, :broadcast, RIGHTS_ADMIN do |player, command|
message = command.arguments.to_a.join(" ")
broadcast = "[Broadcast] #{player.get_username.capitalize}: #{message}"
World.world.player_repository.each { |player| player.send_message(broadcast) }
end
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<plugin>
<id>message</id>
<version>1</version>
<name>Messaging commands</name>
<description>Adds various message-related commands, such as enabling the server-side chat filter or broadcasting a message.</description>
<authors>
<author>Major</author>
<author>xEliqa</author>
</authors>
<scripts>
<script>filter.rb</script>
<script>broadcast.rb</script>
</scripts>
<dependencies />
</plugin>