From df477667b08013a6dbeede8efa8c8144d4fe7fa8 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 25 Sep 2015 23:10:18 -0600 Subject: [PATCH] * client.runtime.* renamed to client.session.* * some work on area names - need to fix login issue & rest shoudl work --- core/bbs.js | 8 ++++---- core/client.js | 2 +- core/client_connections.js | 4 ++-- core/fse.js | 2 +- core/message_area.js | 1 + core/system_menu_method.js | 2 +- mods/menu.hjson | 3 +++ mods/msg_area_post_fse.js | 2 +- mods/themes/NU-MAYA/MSGVFTR1.ANS | Bin 213 -> 227 bytes 9 files changed, 14 insertions(+), 10 deletions(-) diff --git a/core/bbs.js b/core/bbs.js index 578a6295..0991d914 100644 --- a/core/bbs.js +++ b/core/bbs.js @@ -186,8 +186,8 @@ function startListening() { // Start tracking the client. We'll assign it an ID which is // just the index in our connections array. // - if(_.isUndefined(client.runtime)) { - client.runtime = {}; + if(_.isUndefined(client.session)) { + client.session = {}; } clientConns.addNewClient(client); @@ -205,12 +205,12 @@ function startListening() { }); client.on('error', function onClientError(err) { - logger.log.info({ clientId : client.runtime.id }, 'Connection error: %s' % err.message); + logger.log.info({ clientId : client.session.id }, 'Connection error: %s' % err.message); }); client.on('close', function onClientClose(hadError) { var l = hadError ? logger.log.info : logger.log.debug; - l( { clientId : client.runtime.id }, 'Connection closed'); + l( { clientId : client.session.id }, 'Connection closed'); clientConns.removeClient(client); }); diff --git a/core/client.js b/core/client.js index f5873825..70695b95 100644 --- a/core/client.js +++ b/core/client.js @@ -106,7 +106,7 @@ function Client(input, output) { Object.defineProperty(this, 'node', { get : function() { - return self.runtime.id + 1; + return self.session.id + 1; } }); diff --git a/core/client_connections.js b/core/client_connections.js index bf6b9698..ec066d40 100644 --- a/core/client_connections.js +++ b/core/client_connections.js @@ -10,7 +10,7 @@ var clientConnections = []; exports.clientConnections = clientConnections; function addNewClient(client) { - var id = client.runtime.id = clientConnections.push(client) - 1; + var id = client.session.id = clientConnections.push(client) - 1; // Create a client specific logger client.log = logger.log.child( { clientId : id } ); @@ -37,7 +37,7 @@ function removeClient(client) { logger.log.info( { connectionCount : clientConnections.length, - clientId : client.runtime.id + clientId : client.session.id }, 'Client disconnected' ); diff --git a/core/fse.js b/core/fse.js index a7901be2..7ba5d5f8 100644 --- a/core/fse.js +++ b/core/fse.js @@ -104,7 +104,7 @@ function FullScreenEditorModule(options) { this.editorMode = config.editorMode; if(_.isObject(options.extraArgs)) { - console.log(options.extraArgs) + //console.log(options.extraArgs) this.messageAreaName = options.extraArgs.messageAreaName || Message.WellKnownAreaNames.Private; console.log(this.messageAreaName) this.messageIndex = options.extraArgs.messageIndex || 0; diff --git a/core/message_area.js b/core/message_area.js index 4ccd19e1..bfc93250 100644 --- a/core/message_area.js +++ b/core/message_area.js @@ -24,6 +24,7 @@ function getMessageAreaByName(areaName) { areaName = areaName.toLowerCase(); var availAreas = getAvailableMessageAreas(); + console.log(availAreas) var index = _.findIndex(availAreas, function pred(an) { return an.name == areaName; }); diff --git a/core/system_menu_method.js b/core/system_menu_method.js index 31ddd896..9bbaf9e4 100644 --- a/core/system_menu_method.js +++ b/core/system_menu_method.js @@ -41,7 +41,7 @@ function login(callingMenu, formData, extraArgs) { if(existingClientConnection) { client.log.info( { - existingClientId : existingClientConnection.runtime.id, + existingClientId : existingClientConnection.session.id, username : user.username, userId : user.userId }, 'Already logged in' diff --git a/mods/menu.hjson b/mods/menu.hjson index dabf0203..be583e36 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -246,6 +246,9 @@ art: NUAFDBK options: { pause: true } next: newUserFeedbackToSysOp + extraArgs: { + messageAreaName: private_mail + } } newUserFeedbackToSysOp: { diff --git a/mods/msg_area_post_fse.js b/mods/msg_area_post_fse.js index d8a876f0..24455701 100644 --- a/mods/msg_area_post_fse.js +++ b/mods/msg_area_post_fse.js @@ -61,7 +61,7 @@ require('util').inherits(AreaPostFSEModule, FullScreenEditorModule); AreaPostFSEModule.prototype.enter = function(client) { - if(_.isString(client.user.properties.message_area_name)) { + if(_.isString(client.user.properties.message_area_name) && !_.isString(this.messageAreaName)) { this.messageAreaName = client.user.properties.message_area_name; } diff --git a/mods/themes/NU-MAYA/MSGVFTR1.ANS b/mods/themes/NU-MAYA/MSGVFTR1.ANS index a3087bead6ff061822932694bd87399856c54a51..3b1c40943274770f0951124b751daec804608573 100644 GIT binary patch delta 46 zcmcc0_?S^fI@-Y6#K79vEH_#~I@-|M*f3W@QcfPoHn5(^C&OqsQM-jPY2pS|01_z+ AzyJUM delta 32 ncmaFNc$JY)I@-Y6#K79vEH_#~I(njv45QgZ%NE9viThLmlNSjm