Subj : Some help with login/logon and shell javascript
To : Digital Man
From : alterego
Date : Tue May 26 2020 05:14 pm
Howdy,
Can somebody (DM?) give me some guidance here - something is not working as I expect.
I've writing my own "shell" for SBBS, which is to handle the user before login, and after. So I'm using the same javascript to handle login.js and the users shell "ansitex". (It is aware if the user is "logged in" or not - and I'm using it to leverage a consistent experience.)
During login, things work well - notice the "INIT: [undefined]" is the first line of my javascript:
log(LOG_DEBUG,'INIT: ['+ansitex+']');
var ansitex;
if (! ansitex) {
// Load many SBBS definitions
load('sbbsdefs.js');
// Load text.dat definitions
load('text.js');
// Key definitions
load('key_defs.js');
// Enable to manipulate the ANSI terminal
ansi = load({},'ansiterm_lib.js');
login = load({},'ansitex/control/login.js');
// Ansitex specific includes
load('ansitex/load/defs.js');
load('ansitex/load/funcs.js');
ansitex = true;
}
(I didnt have the test for ansitex originally, I thought it might be able to bypass the load statements when ansitex.js runs - but it appears that ansitex value is not retained (which I didnt expect that it would be actually))
5/26 16:50:25 term Node 1 auto-detected terminal type: 80x25 ANSI
5/26 16:50:26 term Node 1 terminal type: 80x25 syncterm
5/26 16:50:26 term Node 1 INIT: [undefined]
5/26 16:50:26 term Node 1 Loaded control/login.js
5/26 16:50:26 term Node 1 ansiterm.sending: [?25l
When the user supplies their login details, it calls:
to which logon.js takes over (this is the stock SBBS logon.js) logon.js complains about:
5/26 16:56:00 term Node 1 <Test> !JavaScript /opt/sbbs/exec/logon.js line 12: TypeError: load is not a function
then after logon.js has completed, login.js exits and the user shell takes over - which is ansitex.js (the same file as login.js) - you can see the EXIT: debug statement, shortly after starting again with the INIT debug line.
5/26 16:50:37 term Node 1 <Test> - User:undefined
5/26 16:50:37 term Node 1 <Test> (0003) Test Logon 98 - 7
5/26 16:50:38 term Node 1 <Test> - EXIT:
5/26 16:50:38 term Node 1 <Test> Executing external: ?ansitex
5/26 16:50:38 term Node 1 <Test> INIT: [undefined]
5/26 16:50:38 term Node 1 <Test> !JavaScript /opt/sbbs/mods/ansitex.js line 7: TypeError: load is not a function
5/26 16:50:38 term Node 1 <Test> disconnecting client
So why the errors about "load is not a function"? If I use the standard synchronet login.js, then ansitex.js loads fine as the users shell.
If I dont call bbs.logon(), then I get an error after bbs.login()
5/26 17:00:33 term Node 1 <Test> - EXIT:
5/26 17:00:33 term Node 1 <Test> !ERROR 0 (Success) in answer.cpp line 488 (answer) checking "User not logged on" access=0
Does logon.js need to do something specific?
Thanks...
...����
... BEWARE - Tagline Thief is in the area...
---
� Synchronet � Alterant | an SBBS in Docker on Pi!