|
@@ -82,7 +82,7 @@ module.exports = class extends coreClass {
|
|
|
if (punishment.type === 'banUserIp' && punishment.value === socket.ip) banishment.banned = true;
|
|
|
});
|
|
|
|
|
|
- socket = { ...socket, ...banishment }
|
|
|
+ socket.banishment = banishment;
|
|
|
|
|
|
next();
|
|
|
});
|
|
@@ -103,9 +103,9 @@ module.exports = class extends coreClass {
|
|
|
if (socket.session.sessionId) sessionInfo = ` UserID: ${socket.session.userId}.`;
|
|
|
|
|
|
// if session is banned
|
|
|
- if (socket.banned) {
|
|
|
+ if (socket.banishment.banned) {
|
|
|
logger.info('IO_BANNED_CONNECTION', `A user tried to connect, but is currently banned. IP: ${socket.ip}.${sessionInfo}`);
|
|
|
- socket.emit('keep.event:banned', socket.ban);
|
|
|
+ socket.emit('keep.event:banned', socket.banishment.ban);
|
|
|
socket.disconnect(true);
|
|
|
} else {
|
|
|
logger.info('IO_CONNECTION', `User connected. IP: ${socket.ip}.${sessionInfo}`);
|