From d154f23bab049e3e0cac1d7e8ca0719e730f71ae Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 3 Apr 2012 23:23:29 -0500 Subject: [PATCH] Add 'chatlengthlimit' setting - control max chat message length --- .../org/dynmap/bukkit/permissions/NijikokunPermissions.java | 3 +++ .../java/org/dynmap/bukkit/permissions/PEXPermissions.java | 2 ++ .../org/dynmap/bukkit/permissions/PermBukkitPermissions.java | 3 +++ .../java/org/dynmap/bukkit/permissions/bPermPermissions.java | 3 +++ src/main/resources/configuration.txt | 4 ++++ 5 files changed, 15 insertions(+) diff --git a/src/main/java/org/dynmap/bukkit/permissions/NijikokunPermissions.java b/src/main/java/org/dynmap/bukkit/permissions/NijikokunPermissions.java index 2a0dfc81..1fcbaafe 100644 --- a/src/main/java/org/dynmap/bukkit/permissions/NijikokunPermissions.java +++ b/src/main/java/org/dynmap/bukkit/permissions/NijikokunPermissions.java @@ -25,6 +25,9 @@ public class NijikokunPermissions implements PermissionProvider { return null; server.getPluginManager().enablePlugin(permissionsPlugin); + if(permissionsPlugin.isEnabled() == false) + return null; + Log.info("Using Permissions " + permissionsPlugin.getDescription().getVersion() + " for access control"); return new NijikokunPermissions(permissionsPlugin, name); } diff --git a/src/main/java/org/dynmap/bukkit/permissions/PEXPermissions.java b/src/main/java/org/dynmap/bukkit/permissions/PEXPermissions.java index a32c4444..4840bf12 100644 --- a/src/main/java/org/dynmap/bukkit/permissions/PEXPermissions.java +++ b/src/main/java/org/dynmap/bukkit/permissions/PEXPermissions.java @@ -22,6 +22,8 @@ public class PEXPermissions implements PermissionProvider { if (permissionsPlugin == null) return null; server.getPluginManager().enablePlugin(permissionsPlugin); + if(permissionsPlugin.isEnabled() == false) + return null; if(PermissionsEx.isAvailable() == false) return null; Log.info("Using PermissionsEx " + permissionsPlugin.getDescription().getVersion() + " for access control"); diff --git a/src/main/java/org/dynmap/bukkit/permissions/PermBukkitPermissions.java b/src/main/java/org/dynmap/bukkit/permissions/PermBukkitPermissions.java index 13614a3a..db9c6ec4 100644 --- a/src/main/java/org/dynmap/bukkit/permissions/PermBukkitPermissions.java +++ b/src/main/java/org/dynmap/bukkit/permissions/PermBukkitPermissions.java @@ -28,6 +28,9 @@ public class PermBukkitPermissions extends BukkitPermissions { return null; server.getPluginManager().enablePlugin(permissionsPlugin); + if(permissionsPlugin.isEnabled() == false) + return null; + Log.info("Using PermissionsBukkit " + permissionsPlugin.getDescription().getVersion() + " for access control"); Log.info("Web interface permissions only available for online users"); return new PermBukkitPermissions(permissionsPlugin, name, pd); diff --git a/src/main/java/org/dynmap/bukkit/permissions/bPermPermissions.java b/src/main/java/org/dynmap/bukkit/permissions/bPermPermissions.java index b85b220f..d6aebd3e 100644 --- a/src/main/java/org/dynmap/bukkit/permissions/bPermPermissions.java +++ b/src/main/java/org/dynmap/bukkit/permissions/bPermPermissions.java @@ -28,6 +28,9 @@ public class bPermPermissions extends BukkitPermissions { if (permissionsPlugin == null) return null; server.getPluginManager().enablePlugin(permissionsPlugin); + if(permissionsPlugin.isEnabled() == false) + return null; + Log.info("Using bPermissions " + permissionsPlugin.getDescription().getVersion() + " for access control"); return new bPermPermissions(name, pd); } diff --git a/src/main/resources/configuration.txt b/src/main/resources/configuration.txt index f1746ad6..b71d643c 100644 --- a/src/main/resources/configuration.txt +++ b/src/main/resources/configuration.txt @@ -32,6 +32,8 @@ components: webchat-requires-login: false # If set to true, users must have dynmap.webchat permission in order to chat webchat-permissions: false + # Limit length of single chat messages + chatlengthlimit: 256 # # Optional - make players hidden when they are inside/underground/in shadows (#=light level: 0=full shadow,15=sky) # hideifshadow: 4 # # Optional - make player hidden when they are under cover (#=sky light level,0=underground,15=open to sky) @@ -56,6 +58,8 @@ components: # webchat-requires-login: false # # If set to true, users must have dynmap.webchat permission in order to chat # webchat-permissions: false + # # Limit length of single chat messages + # chatlengthlimit: 256 - class: org.dynmap.SimpleWebChatComponent allowchat: true