Add publicURL setting and '/dynmap url' command

This commit is contained in:
Mike Primm 2022-02-12 01:30:00 -06:00
parent de344869b7
commit d941aec6eb
14 changed files with 76 additions and 6 deletions

View File

@ -131,6 +131,7 @@ public class DynmapCore implements DynmapCommonAPI {
private int config_hashcode; /* Used to signal need to reload web configuration (world changes, config update, etc) */
private int fullrenderplayerlimit; /* Number of online players that will cause fullrender processing to pause */
private int updateplayerlimit; /* Number of online players that will cause update processing to pause */
private String publicURL; // If set, public HRL for accessing dynmap (declared by administrator)
private boolean didfullpause;
private boolean didupdatepause;
private Map<String, LinkedList<String>> ids_by_ip = new HashMap<String, LinkedList<String>>();
@ -557,6 +558,8 @@ public class DynmapCore implements DynmapCommonAPI {
if (migrate_chunks)
Log.info("EXPERIMENTAL: chunk migration enabled");
publicURL = configuration.getString("publicURL", "");
/* Load preupdate/postupdate commands */
ImageIOManager.preUpdateCommand = configuration.getString("custom-commands/image-updates/preupdatecommand", "");
ImageIOManager.postUpdateCommand = configuration.getString("custom-commands/image-updates/postupdatecommand", "");
@ -1210,6 +1213,7 @@ public class DynmapCore implements DynmapCommonAPI {
"del-id-for-ip",
"webregister",
"dumpmemory",
"url",
"help"}));
private static class CommandInfo {
@ -1277,6 +1281,7 @@ public class DynmapCore implements DynmapCommonAPI {
new CommandInfo("dynmap", "webregister", "<player>", "Start registration process for creating web login account for player <player>"),
new CommandInfo("dynmap", "version", "Return version information"),
new CommandInfo("dynmap", "dumpmemory", "Return mempry use information"),
new CommandInfo("dynmap", "url", "Return confgured URL for Dynmap web"),
new CommandInfo("dmarker", "", "Manipulate map markers."),
new CommandInfo("dmarker", "add", "<label>", "Add new marker with label <label> at current location (use double-quotes if spaces needed)."),
new CommandInfo("dmarker", "add", "id:<id> <label>", "Add new marker with ID <id> at current location (use double-quotes if spaces needed)."),
@ -1584,7 +1589,7 @@ public class DynmapCore implements DynmapCommonAPI {
printCommandHelp(sender, cmd, "");
return true;
}
if (c.equals("render") && checkPlayerPermission(sender,"render")) {
if (player != null) {
DynmapLocation loc = player.getLocation();
@ -1907,12 +1912,20 @@ public class DynmapCore implements DynmapCommonAPI {
else if(c.equals("help")) {
printCommandHelp(sender, cmd, (args.length > 1)?args[1]:"");
}
else if(c.equals("dumpmemory")) {
else if(c.equals("dumpmemory") && checkPlayerPermission(sender, "dumpmemory")) {
TexturePack.tallyMemory(sender);
}
else if(c.equals("version")) {
sender.sendMessage("Dynmap version: core=" + this.getDynmapCoreVersion() + ", plugin=" + this.getDynmapPluginVersion());
}
else if (c.equals("url")) {
if (publicURL.length() > 0) {
sender.sendMessage("Dynmap URL for this server is: " + publicURL);
}
else {
sender.sendMessage("URL of Dynmap not configured");
}
}
return true;
}
printCommandHelp(sender, cmd, (args.length > 0)?args[0]:"");

View File

@ -453,6 +453,10 @@ soft-ref-cache: true
#enterexitUseTitle: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# Set to true to enable verbose startup messages - can help with debugging map configuration problems
# Set to false for a much quieter startup log

View File

@ -453,7 +453,11 @@ soft-ref-cache: true
#enterexitUseTitle: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# 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: false

View File

@ -461,7 +461,11 @@ soft-ref-cache: true
#enterexitUseTitle: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# 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: false

View File

@ -461,7 +461,11 @@ soft-ref-cache: true
#enterexitUseTitle: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# 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: false

View File

@ -459,7 +459,11 @@ soft-ref-cache: true
#enterexitUseTitle: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# 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: false

View File

@ -461,6 +461,10 @@ soft-ref-cache: true
#enterexitUseTitle: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# Set to true to enable verbose startup messages - can help with debugging map configuration problems
# Set to false for a much quieter startup log

View File

@ -462,6 +462,10 @@ soft-ref-cache: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# 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: false

View File

@ -462,6 +462,10 @@ soft-ref-cache: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# 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: false

View File

@ -461,6 +461,10 @@ soft-ref-cache: true
#enterexitUseTitle: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# Set to true to enable verbose startup messages - can help with debugging map configuration problems
# Set to false for a much quieter startup log

View File

@ -462,6 +462,10 @@ soft-ref-cache: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# 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: false

View File

@ -461,6 +461,10 @@ soft-ref-cache: true
#enterexitUseTitle: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# Set to true to enable verbose startup messages - can help with debugging map configuration problems
# Set to false for a much quieter startup log

View File

@ -489,6 +489,10 @@ soft-ref-cache: true
# Set true if new enter messages should supercede pending exit messages (vs being queued in order), default false
#enterReplacesExits: true
# Published public URL for Dynmap server (allows users to use 'dynmap url' command to get public URL usable to access server
# If not set, 'dynmap url' will not return anything. URL should be fully qualified (e.g. https://mc.westeroscraft.com/)
#publicURL: http://my.greatserver.com/dynmap
# 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: false

View File

@ -42,6 +42,7 @@ commands:
/<command> add-id-for-ip <playerid> <ipaddress> - Add player ID to given IP address
/<command> del-id-for-ip <playerid> <ipaddress> - Delete player ID from given IP address
/<command> webregister - Start registration process for creating web login account
/<command> url - Returns public URL for dynmap, if published
dmarker:
description: Manipulate map markers
@ -153,6 +154,8 @@ permissions:
dynmap.ips-for-id: true
dynmap.webregister: true
dynmap.webregister.other: true
dynmap.dumpmemory: true
dynmap.url: true
dynmap.pause: true
dynmap.marker.add: true
dynmap.marker.update: true
@ -258,6 +261,12 @@ permissions:
dynmap.webregister.other:
description: Allows /dynmap webregister userid
default: op
dynmap.dumpmemory:
description: Allows /dynmap dumpmemory
default: op
dynmap.url:
description: Allows /dynmap url
default: true
dynmap.marker.add:
description: Allows /dmarker add
default: op