mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-26 01:21:29 +01:00
Added WebChat back to web.
This commit is contained in:
parent
c53e6058be
commit
2bd0052aa9
@ -34,6 +34,17 @@ public class Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 static class Tile {
|
||||||
public String type = "tile";
|
public String type = "tile";
|
||||||
public String name;
|
public String name;
|
||||||
|
@ -98,6 +98,7 @@ public class DynmapPlugin extends JavaPlugin {
|
|||||||
messageHandler.onMessageReceived.addListener(new Listener<SendMessageHandler.Message>() {
|
messageHandler.onMessageReceived.addListener(new Listener<SendMessageHandler.Message>() {
|
||||||
@Override
|
@Override
|
||||||
public void triggered(Message t) {
|
public void triggered(Message t) {
|
||||||
|
mapManager.pushUpdate(new Client.WebChatMessage(t.name, t.message));
|
||||||
log.info("[WEB]" + t.name + ": " + t.message);
|
log.info("[WEB]" + t.name + ": " + t.message);
|
||||||
getServer().broadcastMessage("[WEB]" + t.name + ": " + t.message);
|
getServer().broadcastMessage("[WEB]" + t.name + ": " + t.message);
|
||||||
}
|
}
|
||||||
|
@ -296,6 +296,11 @@ DynMap.prototype = {
|
|||||||
if (!me.options.showchat)
|
if (!me.options.showchat)
|
||||||
return;
|
return;
|
||||||
me.onPlayerChat(update.playerName, update.message);
|
me.onPlayerChat(update.playerName, update.message);
|
||||||
|
},
|
||||||
|
webchat: function() {
|
||||||
|
if (!me.options.showchat)
|
||||||
|
return;
|
||||||
|
me.onPlayerChat('[WEB] ' + update.playerName, update.message);
|
||||||
}
|
}
|
||||||
}, function(type) {
|
}, function(type) {
|
||||||
console.log('Unknown type ', value, '!');
|
console.log('Unknown type ', value, '!');
|
||||||
|
Loading…
Reference in New Issue
Block a user