Minor improvements to socket.io chat, including banning and unbanning per room, and spam detection and server bans

This commit is contained in:
knotteye
2019-12-07 21:23:50 -06:00
parent a0be256a64
commit 61deb1afa7
5 changed files with 120 additions and 14 deletions

View File

@ -36,6 +36,24 @@
else if(m.startsWith('/list')){
socket.emit('LIST', {room: room});
}
else if(m.startsWith('/banlist')){
socket.emit('LISTBAN', {
room: room,
});
}
else if(m.startsWith('/ban')){
socket.emit('BAN', {
room: room,
nick: m.split(' ')[1],
time: (1 * m.split(' ')[2])
});
}
else if(m.startsWith('/unban')){
socket.emit('UNBAN', {
room: room,
ip: m.split(' ')[1]
});
}
else socket.emit('MSG', {room: room, msg: m});
document.getElementById('m').value = '';
}