diff options
author | jak1 <jak1@themanaworld.org> | 2023-01-12 22:20:37 +0100 |
---|---|---|
committer | jak1 <jak1@themanaworld.org> | 2023-01-12 22:20:37 +0100 |
commit | 6851946d830728cda28c7eaa74c57f3a423d3790 (patch) | |
tree | 6fd7b21459da406c28cd6c4acfd5534b0a4ed2c4 | |
parent | e2f33cdbf3de6932b5c699d43db8b3f7a9198c0f (diff) | |
download | thepixelworld-6851946d830728cda28c7eaa74c57f3a423d3790.tar.gz thepixelworld-6851946d830728cda28c7eaa74c57f3a423d3790.tar.bz2 thepixelworld-6851946d830728cda28c7eaa74c57f3a423d3790.tar.xz thepixelworld-6851946d830728cda28c7eaa74c57f3a423d3790.zip |
added command: @lbc/@localbroadcast <msg>
-rw-r--r-- | app.js | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -111,11 +111,22 @@ io.sockets.on('connection', function(socket){ switch (command[0]) { // @bc (args: <message>) case "bc": + case "broadcast": res = joinArgs(command, 1, 0); for (var i in SOCKET_LIST){ SOCKET_LIST[i].emit('addToChat', {ctimestamp: getTimeStamp(0), content: "<font color='red' weight='bold'>GlobalAnnounce: " + escapeHTML(res) + "</font>", tab: "world"}); } break; + + // @lbc (args: <message>) + case "lbc": + case "localbroadcast": + res = joinArgs(command, 1, 0); + for (var i in Player.Player.list){ + if (Player.Player.list[i].map == Player.Player.list[socket.id].map) + SOCKET_LIST[i].emit('addToChat', {ctimestamp: getTimeStamp(0), content: "<font color='red' weight='bold'>GlobalAnnounce: " + escapeHTML(res) + "</font>", tab: "world"}); + } + break; // @who (args: none) case "who": |