diff --git a/README.md b/README.md index f63670e..bd08222 100644 Binary files a/README.md and b/README.md differ diff --git a/server.js b/server.js index 03b7eeb..312eb94 100644 --- a/server.js +++ b/server.js @@ -244,8 +244,10 @@ function Server () { }); this.io.on('connection', socket => { - this.connections++; - this.io.emit('update visitors', this.connections); + if (!settings.hideVisitors) { + this.connections++; + this.io.emit('update visitors', this.connections); + } socket.on('take book', bookId => { const fileLocation = this.takeBook(bookId, socket.id); @@ -258,8 +260,10 @@ function Server () { }); socket.on('disconnect', () => { - this.connections--; - this.io.emit('update visitors', this.connections); + if (!settings.hideVisitors) { + this.connections--; + this.io.emit('update visitors', this.connections); + } this.deleteBooks(socket.id); }); }); diff --git a/settings.json b/settings.json index 913434a..77388d6 100644 --- a/settings.json +++ b/settings.json @@ -8,5 +8,6 @@ "maxFileSize": 0, "maxHistory": 0, "allowedFormats": [".epub", ".mobi", ".pdf"], - "backupPassword": "password" + "backupPassword": "password", + "hideVisitors": false } \ No newline at end of file