Minor door updates
This commit is contained in:
parent
0e2593bd1c
commit
ecb0cd8941
|
@ -9,9 +9,11 @@ const ansi = require('./ansi_term.js');
|
||||||
const Events = require('./events.js');
|
const Events = require('./events.js');
|
||||||
const { Errors } = require('./enig_error.js');
|
const { Errors } = require('./enig_error.js');
|
||||||
|
|
||||||
|
// deps
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
|
const paths = require('path');
|
||||||
|
|
||||||
const activeDoorNodeInstances = {};
|
const activeDoorNodeInstances = {};
|
||||||
|
|
||||||
|
@ -153,7 +155,7 @@ exports.getModule = class AbracadabraModule extends MenuModule {
|
||||||
|
|
||||||
const exeInfo = {
|
const exeInfo = {
|
||||||
cmd : this.config.cmd,
|
cmd : this.config.cmd,
|
||||||
cwd : this.config.cwd, // null/undefined = parent_of(cmd)
|
cwd : this.config.cwd || paths.dirname(this.config.cmd),
|
||||||
args : this.config.args,
|
args : this.config.args,
|
||||||
io : this.config.io || 'stdio',
|
io : this.config.io || 'stdio',
|
||||||
encoding : this.config.encoding || 'cp437',
|
encoding : this.config.encoding || 'cp437',
|
||||||
|
|
24
core/door.js
24
core/door.js
|
@ -71,13 +71,23 @@ module.exports = class Door {
|
||||||
|
|
||||||
const args = exeInfo.args.map( arg => stringFormat(arg, formatObj) );
|
const args = exeInfo.args.map( arg => stringFormat(arg, formatObj) );
|
||||||
|
|
||||||
const door = pty.spawn(exeInfo.cmd, args, {
|
this.client.log.debug(
|
||||||
cols : this.client.term.termWidth,
|
{ cmd : exeInfo.cmd, args, io : this.io },
|
||||||
rows : this.client.term.termHeight,
|
'Executing door'
|
||||||
cwd : cwd,
|
);
|
||||||
env : exeInfo.env,
|
|
||||||
encoding : null, // we want to handle all encoding ourself
|
let door;
|
||||||
});
|
try {
|
||||||
|
door = pty.spawn(exeInfo.cmd, args, {
|
||||||
|
cols : this.client.term.termWidth,
|
||||||
|
rows : this.client.term.termHeight,
|
||||||
|
cwd : cwd,
|
||||||
|
env : exeInfo.env,
|
||||||
|
encoding : null, // we want to handle all encoding ourself
|
||||||
|
});
|
||||||
|
} catch(e) {
|
||||||
|
return cb(e);
|
||||||
|
}
|
||||||
|
|
||||||
if('stdio' === this.io) {
|
if('stdio' === this.io) {
|
||||||
this.client.log.debug('Using stdio for door I/O');
|
this.client.log.debug('Using stdio for door I/O');
|
||||||
|
|
|
@ -16,6 +16,7 @@ const { mkdirs } = require('fs-extra');
|
||||||
|
|
||||||
//
|
//
|
||||||
// Resources
|
// Resources
|
||||||
|
// * https://github.com/NuSkooler/ansi-bbs/tree/master/docs/dropfile_formats
|
||||||
// * http://goldfndr.home.mindspring.com/dropfile/
|
// * http://goldfndr.home.mindspring.com/dropfile/
|
||||||
// * https://en.wikipedia.org/wiki/Talk%3ADropfile
|
// * https://en.wikipedia.org/wiki/Talk%3ADropfile
|
||||||
// * http://thoughtproject.com/libraries/bbs/Sysop/Doors/DropFiles/index.htm
|
// * http://thoughtproject.com/libraries/bbs/Sysop/Doors/DropFiles/index.htm
|
||||||
|
@ -36,7 +37,7 @@ module.exports = class DropFile {
|
||||||
get fileName() {
|
get fileName() {
|
||||||
return {
|
return {
|
||||||
DOOR : 'DOOR.SYS', // GAP BBS, many others
|
DOOR : 'DOOR.SYS', // GAP BBS, many others
|
||||||
DOOR32 : 'DOOR32.SYS', // EleBBS / Mystic, Syncronet, Maximus, Telegard, AdeptXBBS, ...
|
DOOR32 : 'door32.sys', // Mystic, EleBBS, Syncronet, Maximus, Telegard, AdeptXBBS (lowercase name as per spec)
|
||||||
CALLINFO : 'CALLINFO.BBS', // Citadel?
|
CALLINFO : 'CALLINFO.BBS', // Citadel?
|
||||||
DORINFO : this.getDoorInfoFileName(), // RBBS, RemoteAccess, QBBS, ...
|
DORINFO : this.getDoorInfoFileName(), // RBBS, RemoteAccess, QBBS, ...
|
||||||
CHAIN : 'CHAIN.TXT', // WWIV
|
CHAIN : 'CHAIN.TXT', // WWIV
|
||||||
|
@ -155,6 +156,7 @@ module.exports = class DropFile {
|
||||||
//
|
//
|
||||||
// Resources:
|
// Resources:
|
||||||
// * http://wiki.bbses.info/index.php/DOOR32.SYS
|
// * http://wiki.bbses.info/index.php/DOOR32.SYS
|
||||||
|
// * https://github.com/NuSkooler/ansi-bbs/blob/master/docs/dropfile_formats/door32_sys.txt
|
||||||
//
|
//
|
||||||
// :TODO: local/serial/telnet need to be configurable -- which also changes socket handle!
|
// :TODO: local/serial/telnet need to be configurable -- which also changes socket handle!
|
||||||
const Door32CommTypes = {
|
const Door32CommTypes = {
|
||||||
|
|
Loading…
Reference in New Issue