mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-12 02:40:56 +01:00
Added WebChat back to web.
This commit is contained in:
parent
c53e6058be
commit
2bd0052aa9
@ -33,6 +33,17 @@ public class Client {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
public static class WebChatMessage {
|
||||
public String type = "webchat";
|
||||
public String playerName;
|
||||
public String message;
|
||||
|
||||
public WebChatMessage(String playerName, String message) {
|
||||
this.playerName = playerName;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Tile {
|
||||
public String type = "tile";
|
||||
|
@ -98,6 +98,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);
|
||||
}
|
||||
|
@ -296,6 +296,11 @@ DynMap.prototype = {
|
||||
if (!me.options.showchat)
|
||||
return;
|
||||
me.onPlayerChat(update.playerName, update.message);
|
||||
},
|
||||
webchat: function() {
|
||||
if (!me.options.showchat)
|
||||
return;
|
||||
me.onPlayerChat('[WEB] ' + update.playerName, update.message);
|
||||
}
|
||||
}, function(type) {
|
||||
console.log('Unknown type ', value, '!');
|
||||
|
Loading…
Reference in New Issue
Block a user