mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 21:25:46 +01:00
Merge pull request #316 from mikeprimm/master
Add escape sequence '&color;' support for webprefix/websuffix - avoid frequent editor code page problems
This commit is contained in:
commit
4cacc3f92c
@ -10,4 +10,12 @@ public abstract class Component {
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
/* Substitute proper values for escape sequences */
|
||||
public static String unescapeString(String v) {
|
||||
/* Replace color code &color; */
|
||||
v = v.replaceAll("&color;", "\u00A7");
|
||||
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public class SimpleWebChatComponent extends Component {
|
||||
DynmapWebChatEvent evt = new DynmapWebChatEvent(t.source, t.name, t.message);
|
||||
plugin.getServer().getPluginManager().callEvent(evt);
|
||||
if(evt.isCancelled() == false)
|
||||
plugin.getServer().broadcastMessage(plugin.configuration.getString("webprefix", "\u00A72[WEB] ") + t.name + ": " + plugin.configuration.getString("websuffix", "\u00A7f") + t.message);
|
||||
plugin.getServer().broadcastMessage(unescapeString(plugin.configuration.getString("webprefix", "\u00A72[WEB] ")) + t.name + ": " + unescapeString(plugin.configuration.getString("websuffix", "\u00A7f")) + t.message);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class HeroWebChatComponent extends Component {
|
||||
if(evt.isCancelled() == false) {
|
||||
/* Let HeroChat take a look - only broadcast to players if it doesn't handle it */
|
||||
if (!handler.sendWebMessageToHeroChat(t.name, t.message)) {
|
||||
plugin.getServer().broadcastMessage(plugin.configuration.getString("webprefix", "\u00A72[WEB] ") + t.name + ": " + plugin.configuration.getString("websuffix", "\u00A7f") + t.message);
|
||||
plugin.getServer().broadcastMessage(unescapeString(plugin.configuration.getString("webprefix", "\u00A72[WEB] ")) + t.name + ": " + unescapeString(plugin.configuration.getString("websuffix", "\u00A7f")) + t.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,8 +139,9 @@ showplayerfacesinmenu: true
|
||||
joinmessage: "%playername% joined"
|
||||
quitmessage: "%playername% quit"
|
||||
spammessage: "You may only chat once every %interval% seconds."
|
||||
webprefix: "§2[WEB] "
|
||||
websuffix: "§f"
|
||||
# webprefix and websuffix support using '&color;' as escape code for color code
|
||||
webprefix: "&color;2[WEB] "
|
||||
websuffix: "&color;f"
|
||||
# Enable checking for banned IPs via banned-ips.txt (internal web server only)
|
||||
check-banned-ips: true
|
||||
|
||||
@ -149,7 +150,7 @@ defaultworld: world
|
||||
|
||||
# Set to true to enable verbose startup messages - can help with debugging map configuration problems
|
||||
# Set to false for a much quieter startup log
|
||||
verbose: true
|
||||
verbose: false
|
||||
|
||||
# Enables debugging.
|
||||
#debuggers:
|
||||
|
Loading…
Reference in New Issue
Block a user