Skip to content
Snippets Groups Projects
  1. Nov 06, 2020
    • Rob Swindell's avatar
      Replace ctype.h function calls with new MSVC-safe XPDEV macros · ec20d959
      Rob Swindell authored
      I'm fed-up with MSVC assertions in ctype functions (e.g. isdigit, isprint, isspace, etc.) when called with out-of-range (e.g. negative) values.
      
      This problem only affects MSVC debug builds, but if you run them (like I do), these things are like little time bombs that can drive you crazy (knocking your board out of service).
      
      The new macros names are bit more descriptive as well.
      ec20d959
  2. Nov 04, 2020
    • Rob Swindell's avatar
      Always evaluate js.on_exit() installed expressions. · 48f244e7
      Rob Swindell authored
      I noticed that when executing an external JS with the new "Use Shell / New Context" option set to "Yes", that any expressions (strings) installed via js.on_exit() were not being executed upon exit from the script. These on-exit strings are important for restoring global state information (e.g. control key pass-through, console mode) to the original state before the JS mod made any changes.
      
      I'm not sure why the special treatment of "scope == NULL" is through-out this function. Going back to v3.16, it appears this was special treatment for JS mods invoked via global hot key event (when scope != NULL). When invoking an xtrn JS mod with the new Context option, the scope argument is not NULL, so this check was defeating the parsing of the "exit_code" and the evaluation of any js.on_exit() installed expressions for no apparent reason. I can't think why global hot key events should be excluded from this logic either.
      48f244e7
  3. Aug 30, 2020
    • Rob Swindell's avatar
      External program "use shell" option can be used to use a new JS context · 1decdc69
      Rob Swindell authored
      Rather than introduce yet-another-external-program/config flag to enable
      the "new JS run-time/context" per invocation of any particular JS command,
      I'm using the XTRN/EX_SH ("Use Shell") option as it had no function for
      JavaScript command-lines and the concept is similar.
      
      So if you want to invoke a JS external program/timed-event in its own
      "sandbox", enable the "Use Shell / New Context" option for that
      program/command in SCFG. There may be performance penalties when running
      JS mods in this way, but you get the benefit of isolating one JS module
      from all others, if/when necessary.
      1decdc69
    • Rob Swindell's avatar
      Previous commit fixed issue with JS_GC before JS_ENDREQUEST · 25625186
      Rob Swindell authored
      So revert the order back to the way it was in aa2bcd61
      (don't you love these git references?).
      
      Also, the previous fix for js_execfile() calls for global hot-key events also
      fixed the EX_JS_CX feature I was working on (js_execmodule)!
      25625186
    • Rob Swindell's avatar
      Fix JS global object corruption when invoking JS global hotkey handlers · cb5188bd
      Rob Swindell authored
      As reported by Ragnarok and The Lizard Master, invoking a JS global
      hot-key handler (e.g. hitting Ctrl-U or Ctrl-P with the privatemsg
      or nodelist modules installed as handlers) would lead to the global
      object being cleared/corrupted so other scripts would then fail to
      run correctly (e.g. Error: can't open sbbsdefs.js: No such file or directory)
      
      This probably explains the JS_GC/JS_ENDREQUEST change needed when
      the hotkey-specific JS runtime/context/scope was introduced last year.
      Should revisit that too.
  4. Aug 16, 2020
  5. Aug 01, 2020
    • rswindell's avatar
      An experimental external() mode flag that runs JS modules in their own... · b898eb73
      rswindell authored
      An experimental external() mode flag that runs JS modules in their own separate runtime and context - currently does not work (appears to corrupt the shared JS context). Not actually used currently.
      The reason I wanted to run a JS module (actually JS doorgame) in its own context was to get useful error messages (filenames and line numbers) when the module throws an exception. Currently, the error is just reported as occuring in xtrn_sec.js, which isn't helpful or correct.
      b898eb73
  6. May 08, 2020
    • rswindell's avatar
      More mouse hot spot stuff: · e821783a
      rswindell authored
      - User Defaults menu mousified
      - When all hot spots have scrolled off the screen, clear the hot spot list
      - Insert new hot spots in the front of the list so they will take precedence
        over any previously defined duplicate hot spots
      - Numeric hot spot commands end in a carriage-return
      - No auto-acceptence of numbers when there are keys in the keyboard buffer
      - Baja UNGETKEY function now inserts keys into the "front" of the keyboard
        buffer (next to be consumed)
      - Hot key @-code command text supports C-style escape sequences
        (allows encoding of ctrl chars, spaces, etc.)
      e821783a
    • rswindell's avatar
      Add mouse hot spot support: · 87c9982c
      rswindell authored
      - hot spots are clickable screen areas (e.g. in menus and prompts) that   generate key-strokes
      - commands may be from 1 to 127 ASCII-characters in length
      - currently using the X10 mouse reporting mode, may change
      - all mnemonics strings (~Example) are automatically hot-spots
      - The new ~ @-code defines a hot spot
      - Any screen-clear operation clears all hot spots
      - sbbs now tracks the current screen (cursor position) row
      - eliminated the old "tos" (top-of-screen) boolean (row == 0 indicates "tos")
      - created an sbbs_t::ungetstr() method
      - keep track if in pause (hit a key) prompt, for special mouse behavior
      
      new JS console object:
      - row property
      - tos property is now read-only (and deprecated)
      - new methods:
        add_hotspot()
        clear_hotspots()
        scroll_hotspots()
      
      redrwstr() gets some UTF8 touch-ups as part of this commit. <shrug>
      87c9982c
  7. Apr 11, 2020
    • rswindell's avatar
      Two unrelated changes, but since they touched sbbs.h, I'm committing them · 0d73dbc4
      rswindell authored
      together to keep things atomic:
      1. Eliminate eprintf() as sbbs_t::lputs() and sbbs_t::lprintf() do the
         "right thing" (e.g. log to the event log when called from the event_thread).
      2. Moved upload_stats() and download_stats() from ftpsrvr.c to getstats.c where
          I plan to make use of them for JS-based upload/download file support.
      0d73dbc4
  8. Oct 24, 2019
    • rswindell's avatar
      Invoking a JavaScripot global hot key event handler (e.g. nodelist.js) *while* · c912ee30
      rswindell authored
      running a JavaScript module would crash (e.g. segfault) sbbs:
      Create and use a separate JS runtime, context, and global object/scope for
      global hotkey events. This means that the hotkey won't benefit from any
      previously loaded/required scripts, possibly effecting the performance of the
      first invocation of the hotkey handler. Subsequent JS hotkey events will reuse
      the same runtime/context/global, so they'll execute fast(er).
      
      One questionalbe change to js_execfile():
      With the JS_GC (garbage collection) call *before* the JS_ENDREQUEST() call, the
      process would crash in libmozjs. Moving the JS_GC() call to *after* the
      JS_ENDREQUEST() resolved this issue and I'm not clear why. This 'js_cx'
      parameter here is not always sbbs_t::js_cx. When called to handle a JS hotkey
      event, it's sbbs_t::js_hotkey_cx, so it shouldn't interfere with the
      sbs_t::js_cx being used by the currently executing JS module (shell or door).
      <scratches chin>
      c912ee30
  9. Sep 10, 2019
  10. May 28, 2019
  11. May 09, 2019
  12. Feb 21, 2019
  13. Nov 03, 2018
    • deuce's avatar
      Fix new error with Clang 6.x: · cb1d932f
      deuce authored
      exec.cpp:438:8: error: case value evaluates to 2684500526, which cannot be narrowed to type 'int32_t' (aka 'int')
            [-Wc++11-narrowing]
                      case 0xA0023A2E:
                           ^
      
      The switch cases were unsigned, but the passed value was an int32.
      cb1d932f
  14. Oct 05, 2018
  15. Nov 16, 2016
    • rswindell's avatar
      Leave the console-abort status intact when returning from executing a Baja · 932fae30
      rswindell authored
      module. This is a reversal of the revision 1.102 commit (Jan-2-2016), but only
      for Baja (JS is left with the new behavior). As the commit message said
      "We'll see", and what we saw was that the yesnobar.bin and noyesbar.bin
      long-standing Baja modules no longer returned "No" when the user hit Ctrl-C.
      So at least for now, we have different behavior with regards to the console
      abort (ctrl-C) flag between JS and Baja. :-/
      932fae30
  16. Apr 23, 2016
  17. Jan 02, 2016
    • rswindell's avatar
      Clear the console-abort flag upon return from executing a JS or Baja module. · c22063f9
      rswindell authored
      This solves the problem of a JS-external program (e.g. SyncWX) being aborted
      at a pause prompt with Ctrl-C or Q and that abort status propagating back to
      the external program's menu. If there is a module which needs to propagate
      the console-abort status up to the parent(s), then this could introduce a
      problem. We'll see.
      c22063f9
  18. Dec 04, 2015
    • rswindell's avatar
      Resolve FAQ: · 7a96e2b3
      rswindell authored
      Don't report a JavaScript warning ("Disconnected") until the OperationCallback
      has been executed 10 times with the user offline. This gives the executing
      script ample time to recognize the disconnected state and exit gracefully.
      Script that do not check/notice that the user has disconnected will still be
      auto-terminated (by default) and this warning will still be logged in those
      cases. The value 10 was picked at random and appears to work fine.
      7a96e2b3
  19. Aug 20, 2015
    • deuce's avatar
      Update to 3.17a · dbbfabf1
      deuce authored
      New Features:
      - Multiple bindings for each service
        Use comma-separated interfaces on Interface= lines in the ini file.
        Default is now "0.0.0.0,::"
      - IPv6 support
      - TLS support for the webserver and (non-static) services
        New TLS option in services.ini (ie: Options=TLS)
      - Decrease LEN_SCAN_CMD to 35 chars, increase the CID field to 45 chars,
        and rename the MAIL_CMD string to IPADDR.  I think this frees up the
        note field for SysOp use.
      dbbfabf1
  20. Apr 25, 2015
    • deuce's avatar
      Fix exit() behaviour by introducing the new js.scope value which is the · f3256d81
      deuce authored
      scripts global scope (as opposed to js.global which is the instance global
      scope), and having exit() define exit_code in js.scope instead of js.global.
      
      This also sets exit_code in js.scope to null when preparing to execute a new
      script.  If a new script starts in the same scope as an old one, the old
      exit_code value will be destroyed.
      
      This should only impact scripts where js.global != js.scope (bbs.exec()ed,
      and mailsrvr)
      f3256d81
  21. Nov 03, 2011
  22. Oct 28, 2011
  23. Oct 09, 2011
  24. Oct 08, 2011
  25. Sep 10, 2011
  26. Jul 02, 2011
  27. Mar 01, 2011
  28. Apr 02, 2010
  29. Mar 15, 2010
  30. Mar 13, 2010
  31. Mar 12, 2010
  32. Mar 06, 2010
  33. Dec 17, 2009
Loading