mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
* Lots of code cleanup
* New standard MCI codes for labels * WIP MaskEditTextView * Extra styles for EditTextView
This commit is contained in:
parent
1a1dd53ca1
commit
a96af34a20
12 changed files with 150 additions and 62 deletions
26
core/bbs.js
26
core/bbs.js
|
@ -169,8 +169,6 @@ function startListening() {
|
|||
});
|
||||
|
||||
client.on('end', function onClientEnd() {
|
||||
logger.log.info({ clientId : client.runtime.id }, 'Client disconnected');
|
||||
|
||||
removeClient(client);
|
||||
});
|
||||
|
||||
|
@ -192,7 +190,20 @@ function startListening() {
|
|||
|
||||
function addNewClient(client) {
|
||||
var id = client.runtime.id = clientConnections.push(client) - 1;
|
||||
logger.log.debug('Connection count is now %d', clientConnections.length);
|
||||
|
||||
var connInfo = {
|
||||
connectionCount : clientConnections.length,
|
||||
clientId : client.runtime.id,
|
||||
};
|
||||
|
||||
if(logger.log.debug()) {
|
||||
connInfo.address = client.address();
|
||||
} else {
|
||||
connInfo.ip = client.address().address;
|
||||
}
|
||||
|
||||
logger.log.info(connInfo, 'Client connected');
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
@ -200,7 +211,14 @@ function removeClient(client) {
|
|||
var i = clientConnections.indexOf(client);
|
||||
if(i > -1) {
|
||||
clientConnections.splice(i, 1);
|
||||
logger.log.debug('Connection count is now %d', clientConnections.length);
|
||||
|
||||
logger.log.info(
|
||||
{
|
||||
connectionCount : clientConnections.length,
|
||||
clientId : client.runtime.id
|
||||
},
|
||||
'Client disconnected'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue