NuSkooler / enigma-bbs

ENiGMA½ BBS Software
https://nuskooler.github.io/enigma-bbs/
BSD 2-Clause "Simplified" License
529 stars 104 forks source link

Got an Invalid: "socket" is not a valid io type! for my door. #506

Closed mkrueger closed 9 months ago

mkrueger commented 9 months ago

Fixed that by:

--- a/core/door.js
+++ b/core/door.js
@@ -59,7 +59,7 @@ module.exports = class Door {

         if ('socket' === this.io && !this.sockServer) {
             return cb(Errors.UnexpectedState('Socket server is not running'));
-        } else if ('stdio' !== this.io) {
+        } else if ('stdio' !== this.io && 'socket' !== this.io) {
             return cb(Errors.Invalid(`"${this.io}" is not a valid io type!`));
         }
mkrueger commented 9 months ago

better:



         if ('socket' === this.io) {
            if (!this.sockServer) {
             return cb(Errors.UnexpectedState('Socket server is not running'));
            }
        } else if ('stdio' !== this.io) {
             return cb(Errors.Invalid(`"${this.io}" is not a valid io type!`));
         }
``
cognitivegears commented 9 months ago

Thanks @mkrueger for the report and fix!! I've gone ahead and made a PR for this. @NuSkooler can you or someone try this? I don't have any doors setup to test this with.

cognitivegears commented 9 months ago

@mkrueger it looks like this change has landed! If possible can you please pull the latest and verify that it is working for you?

cognitivegears commented 9 months ago

FYI I'm going to close this issue for now based on the code change, @mkrueger please feel free to re-open if you run into any more issues.