Rename connect event to term_detected, add connected and disconnected events

This commit is contained in:
Josh M. McKee 2017-06-10 18:46:28 -07:00
parent 5572ca5d24
commit c45824b3ad
3 changed files with 17 additions and 12 deletions

View File

@ -3,6 +3,7 @@
// ENiGMA½
const logger = require('./logger.js');
const events = require('./events.js');
// deps
const _ = require('lodash');
@ -76,6 +77,8 @@ function addNewClient(client, clientSock) {
client.log.info(connInfo, 'Client connected');
events.emit('codes.l33t.enigma.system.connected', {'client': client});
return id;
}
@ -93,6 +96,8 @@ function removeClient(client) {
},
'Client disconnected'
);
events.emit('codes.l33t.enigma.system.disconnected', {'client': client});
}
}

View File

@ -177,7 +177,7 @@ function connectEntry(client, nextMenu) {
displayBanner(term);
// fire event
events.emit('codes.l33t.enigma.system.connect', {'client': client});
events.emit('codes.l33t.enigma.system.term_detected', {'client': client});
setTimeout( () => {
return client.menuStack.goto(nextMenu);