daveappserver 0.5.40 → 0.5.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/appserver.js +14 -1
  2. package/package.json +1 -1
package/appserver.js CHANGED
@@ -1,4 +1,4 @@
1
- var myVersion = "0.5.40", myProductName = "daveAppServer";
1
+ var myVersion = "0.5.41", myProductName = "daveAppServer";
2
2
 
3
3
  exports.start = startup;
4
4
  exports.notifySocketSubscribers = notifySocketSubscribers;
@@ -282,6 +282,18 @@ function cleanFileStats (stats) { //4/19/21 by DW
282
282
  });
283
283
  }
284
284
 
285
+ function kissOtherLogonsGoodnight (screenname, theNewConnection) { //12/14/21 by DW
286
+ theWsServer.connections.forEach (function (conn, ix) {
287
+ if (conn.appData !== undefined) { //it's one of ours
288
+ if (conn != theNewConnection) { //it's not the new one
289
+ if (conn.appData.screenname == screenname) {
290
+ conn.sendText ("goodnight");
291
+ }
292
+ }
293
+ }
294
+ });
295
+ }
296
+
285
297
  conn.on ("text", function (s) {
286
298
  var words = s.split (" ");
287
299
  if (words.length > 1) { //new protocol as of 11/29/15 by DW
@@ -300,6 +312,7 @@ function cleanFileStats (stats) { //4/19/21 by DW
300
312
  conn.appData.urlToWatch = "";
301
313
  davetwitter.getScreenName (token, secret, function (screenname) {
302
314
  conn.appData.screenname = screenname;
315
+ kissOtherLogonsGoodnight (screenname, conn); //12/14/21 by DW
303
316
  logToConsole (conn, conn.appData.lastVerb, conn.appData.screenname);
304
317
  });
305
318
  break;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "daveappserver",
3
3
  "description": "Factored code that was appearing in all my servers.",
4
- "version": "0.5.40",
4
+ "version": "0.5.41",
5
5
  "main": "appserver.js",
6
6
  "repository": {
7
7
  "type" : "git",