From 6181aa8ba9509268d570115735ecfd2f6dd32790 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Thu, 8 Sep 2011 09:44:21 +0800 Subject: [PATCH] Add version check for javascript files versus plugin version --- src/main/java/org/dynmap/ClientConfigurationComponent.java | 1 + web/js/map.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/org/dynmap/ClientConfigurationComponent.java b/src/main/java/org/dynmap/ClientConfigurationComponent.java index 51f3f9f7..8e93fcd6 100644 --- a/src/main/java/org/dynmap/ClientConfigurationComponent.java +++ b/src/main/java/org/dynmap/ClientConfigurationComponent.java @@ -21,6 +21,7 @@ public class ClientConfigurationComponent extends Component { s(t, "webprefix", unescapeString(c.getString("webprefix", "[WEB] "))); s(t, "defaultzoom", c.getInteger("defaultzoom", 0)); s(t, "sidebaropened", c.getString("sidebaropened", "false")); + s(t, "dynmapversion", plugin.getDescription().getVersion()); DynmapWorld defaultWorld = null; String defmap = null; diff --git a/web/js/map.js b/web/js/map.js index 60d35a2e..e1342f01 100644 --- a/web/js/map.js +++ b/web/js/map.js @@ -1,6 +1,7 @@ "use strict"; //if (!console) console = { log: function() {} }; +var dynmapversion = "0.22"; // This needs to match plugin verison var componentconstructors = {}; var maptypes = {}; var map = null; // Leaflet assumes top-level 'map'... @@ -286,6 +287,12 @@ DynMap.prototype = { .addClass('alertbox') .hide() .appendTo(container); + + if(dynmapversion != me.options.dynmapversion) { + me.alertbox + .text('Web files are not matched with plugin version: All files need to be same version (' + me.options.dynmapverion + ')') + .show(); + } me.selectMap(me.defaultworld.defaultmap);