WebChat enhancement and fixes

Added Spam Message config
Internal server now replies a spam message
Fixed getting webchat-interval to get int rather than double then cast
Fixed holding down "enter" on the empty chat line would spam chat attempts
Fixed so jsonip.appspot query is only done once
This commit is contained in:
Jason Booth 2011-03-15 19:17:58 -05:00
parent 07cb3ad1b3
commit 2cef9731ed
6 changed files with 48 additions and 30 deletions

View file

@ -145,7 +145,8 @@ public class DynmapPlugin extends JavaPlugin {
if (configuration.getNode("web").getBoolean("allowwebchat", false)) {
SendMessageHandler messageHandler = new SendMessageHandler() {{
maximumMessageInterval = (int)(configuration.getNode("web").getDouble("webchat-interval", 1.0) * 1000);
maximumMessageInterval = (configuration.getNode("web").getInt("webchat-interval", 1) * 1000);
spamMessage = "\""+configuration.getNode("web").getString("spammessage", "You may only chat once every %interval% seconds.")+"\"";
onMessageReceived.addListener(new Listener<SendMessageHandler.Message>() {
@Override
public void triggered(Message t) {