diff options
-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": |