Fix client side timestamp problem

Added Support for standalone webchat by reading a json file
Fix for jsonfile-interval in code
Added working php script with spam prevention, for webchat
This commit is contained in:
Jason Booth 2011-03-10 00:11:43 -06:00
parent 965686d44c
commit d296724755
5 changed files with 102 additions and 13 deletions

View file

@ -134,9 +134,7 @@ public class DynmapPlugin extends JavaPlugin {
messageHandler.onMessageReceived.addListener(new Listener<SendMessageHandler.Message>() {
@Override
public void triggered(Message t) {
mapManager.pushUpdate(new Client.WebChatMessage(t.name, t.message));
log.info("[WEB]" + t.name + ": " + t.message);
getServer().broadcastMessage("[WEB]" + t.name + ": " + t.message);
webChat(t.name, t.message);
}
});
webServer.handlers.put("/up/sendmessage", messageHandler);
@ -345,7 +343,7 @@ public class DynmapPlugin extends JavaPlugin {
private void jsonConfig() {
File outputFile;
Map<?, ?> clientConfig = (Map<?, ?>) configuration.getProperty("web");
File webpath = new File(configuration.getString("webpath", "web"), "dynmap_config.json");
File webpath = new File(configuration.getString("webpath", "web"), "standalone/dynmap_config.json");
if (webpath.isAbsolute())
outputFile = webpath;
else
@ -361,4 +359,11 @@ public class DynmapPlugin extends JavaPlugin {
log.log(Level.SEVERE, "Exception while writing JSON-configuration-file.", ioe);
}
}
public void webChat(String name, String message)
{
mapManager.pushUpdate(new Client.WebChatMessage(name, message));
log.info("[WEB]" + name + ": " + message);
getServer().broadcastMessage("[WEB]" + name + ": " + message);
}
}