Add support for edited clients; Properly support chat filtering; Fix issue #11; Make certain Mining messages filterable.

This commit is contained in:
Major-
2014-02-15 22:40:00 +00:00
parent 2ed1477d2c
commit 9d82797bd6
7 changed files with 99 additions and 11 deletions
+9
View File
@@ -0,0 +1,9 @@
require 'java'
java_import 'org.apollo.game.event.impl.ForwardPrivateMessageEvent'
java_import 'org.apollo.game.model.World'
java_import 'org.apollo.game.model.settings.PrivacyState'
on :command, :filter do |player, command|
player.send_message('Your message filter is now ' + (player.toggle_message_filter ? 'enabled.' : 'disabled.'))
end
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<plugin>
<id>message-filter</id>
<version>1</version>
<name>Message Filter</name>
<description>Adds support for 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>
+3 -3
View File
@@ -38,7 +38,7 @@ class MiningAction < DistancedAction
# the ore
def start_mine(pickaxe)
@started = true
mob.send_message "You swing your pick at the rock."
mob.send_message("You swing your pick at the rock.", true)
mob.turn_to @position
mob.play_animation pickaxe.animation
@counter = pickaxe.pulses
@@ -51,14 +51,14 @@ class MiningAction < DistancedAction
# verify the mob can mine with their pickaxe
if not (pickaxe != nil and level >= pickaxe.level)
mob.send_message "You do not have a pickaxe for which you have the level to use."
mob.send_message('You do not have a pickaxe for which you have the level to use.')
stop
return
end
# verify the mob can mine the ore
if ore.level > level
mob.send_message "You do not have the required level to mine this rock."
mob.send_message('You do not have the required level to mine this rock.')
stop
return
end