mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-01 06:33:38 +01:00
Fix config hashcode inconsistency on world loads (UI reload loop in JSON mode)
This commit is contained in:
parent
6a86b81417
commit
aea2d29c98
@ -665,8 +665,8 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onWorldLoad(WorldLoadEvent event) {
|
public void onWorldLoad(WorldLoadEvent event) {
|
||||||
mapManager.activateWorld(event.getWorld());
|
|
||||||
updateConfigHashcode();
|
updateConfigHashcode();
|
||||||
|
mapManager.activateWorld(event.getWorld());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
|||||||
|
|
||||||
private HashMap<String,String> useralias = new HashMap<String,String>();
|
private HashMap<String,String> useralias = new HashMap<String,String>();
|
||||||
private int aliasindex = 1;
|
private int aliasindex = 1;
|
||||||
|
private long last_confighash;
|
||||||
|
|
||||||
private Charset cs_utf8 = Charset.forName("UTF-8");
|
private Charset cs_utf8 = Charset.forName("UTF-8");
|
||||||
public JsonFileClientUpdateComponent(final DynmapPlugin plugin, final ConfigurationNode configuration) {
|
public JsonFileClientUpdateComponent(final DynmapPlugin plugin, final ConfigurationNode configuration) {
|
||||||
@ -41,6 +42,8 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
currentTimestamp = System.currentTimeMillis();
|
currentTimestamp = System.currentTimeMillis();
|
||||||
|
if(last_confighash != plugin.getConfigHashcode())
|
||||||
|
writeConfiguration();
|
||||||
writeUpdates();
|
writeUpdates();
|
||||||
if (allowwebchat) {
|
if (allowwebchat) {
|
||||||
handleWebChat();
|
handleWebChat();
|
||||||
@ -89,6 +92,7 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
|||||||
plugin.events.trigger("buildclientconfiguration", clientConfiguration);
|
plugin.events.trigger("buildclientconfiguration", clientConfiguration);
|
||||||
outputFile = getStandaloneFile("dynmap_config.json");
|
outputFile = getStandaloneFile("dynmap_config.json");
|
||||||
outputTempFile = getStandaloneFile("dynmap_config.json.new");
|
outputTempFile = getStandaloneFile("dynmap_config.json.new");
|
||||||
|
last_confighash = plugin.getConfigHashcode();
|
||||||
|
|
||||||
int retrycnt = 0;
|
int retrycnt = 0;
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user