Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dropfile improvements #521

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed handling of unknown door types
  • Loading branch information
cognitivegears committed Nov 5, 2023
commit 04392e387dbe70a3654df0ae843dce906665346c
5 changes: 5 additions & 0 deletions core/abracadabra.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ exports.getModule = class AbracadabraModule extends MenuModule {
fileType: self.config.dropFileType,
});

if(!(self.dropFile.isSupported())) {
// Return error so complete will log and return
return callback(Errors.AccessDenied('Dropfile format not supported'));
}

return self.dropFile.createFile(callback);
},
],
Expand Down
16 changes: 9 additions & 7 deletions core/dropfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,21 @@ module.exports = class DropFile {
return undefined;
}
const filePath = paths.join(this.dropFileFormatDirectory, fileName);
fs.access(filePath, fs.constants.R_OK, err => {
if (err) {
Log.info({filename: fileName}, 'Dropfile format not found.');
return undefined;
}
});
if(!fs.existsSync(filePath)) {
Log.info({filename: fileName}, 'Dropfile format not found or readable.');
return undefined;
}

// Return the handler to get the dropfile, because in the future we may have additional handlers
return this.getDropfile;
}

getContents() {
const handler = this.getHandler().bind(this);
const handlerRef = this.getHandler();
if(!handlerRef) {
return undefined;
}
const handler = handlerRef.bind(this);
const contents = handler();
return contents;
}
Expand Down
8 changes: 4 additions & 4 deletions dropfile_formats/CALLINFO.BBS
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ NOTPROVIDED
{UI}
0
{CT}
{CT} {DT}
{CT} {getCurrentDateMMDDYY}
{MC}
{DN}
999
0
999999
555-555-5555
{DT} {CT}
{getCurrentDateMMDDYY} {CT}
NOVICE
All
{DT}
{getCurrentDateMMDDYY}
{UC}
{SH}
0
Expand All @@ -31,6 +31,6 @@ REMOTE
38400
FALSE
Normal Connection
{DT} {CT}
{getCurrentDateMMDDYY} {CT}
{ND}
0