Skip to content
Snippets Groups Projects
  1. Feb 06, 2024
    • Rob Swindell's avatar
      Add K_CP437 mode flag for use with inkey() - translates UTF-8 to CP437 · d1a88b5d
      Rob Swindell authored
      If you're writing, say, a message editor and you don't want to deal with
      UTF-8 input at all, specify this mode flag to convert any translatable UTF-8
      chars (that have CP437 equivalents) to CP437 chars. Non-translatable UTF-8
      chars are just ignored (treated the same as a timeout/no-input).
      d1a88b5d
  2. Sep 25, 2023
  3. Jun 09, 2023
    • Rob Swindell's avatar
      Address new GCC (10.2) warnings from previous commit · ee5559e9
      Rob Swindell authored
      Adding and removing typecasts and changing some types (of ints).
      ee5559e9
    • Rob Swindell's avatar
      <Deuce> ... billion-and-one result of comparison of constant 100000 warnings. · 2b087b8b
      Rob Swindell authored
      So Clang-FreeBSD was warning (in compiles of scfg/scfg*.c by Deuce):
      result of comparison of constant 100000 with expression of type 'uint16_t'
      (aka 'unsigned short') is always true
      
      Why? Cause a uint16_t's max value is 65535 (less than 100000). Sure we could
      have just lowered the UIFC max number of config items to 65535, but that would
      have been too easy. And why are these compared-with values of type uint16_t to
      begin with? Because most ctrl/*.cnf lists (of configuration items) were
      limited to 65535 entries cause ... 16-bit DOS, historically. Now that *.cnf
      files aren't used, we could just increase these scfg_t.*_total type sizes from
      16 to 32-bits, yeah? The result is this commit.
      
      I went to (signed) int so we could still keep -1 as the special illegal
      sub/dir num value (e.g. INVALID_SUB, which is sometimes used to indicate the
      email message base). Theoretically, 2 billion configuration items could be
      supported in these lists, but SCFG will limit you to 100000 anyway. So there's
      a whole lot of s/uint/int in this commit.
      
      I'd be very surprised if this doesn't result in some new GCC/Clang warnings,
      but at least the old "comparison of constant 100000" warnings are now gone!
      2b087b8b
  4. May 06, 2023
    • Rob Swindell's avatar
      Perform input translation (e.g. DEL<->BKSPC, PETSCII chars) in input_thread() · 0fba2f87
      Rob Swindell authored
      My first idea was to have a per-external-program setting to enable input
      translation, but Deuce suggested it would be better done in input_thread() and
      after some thought, I agree. Translations are not done in data/file transfer
      mode, so use the CON_RAW_IN console flag to indicate this condition. So even
      JS console.getbyte() will return a translated char unless the console is set
      raw input mode (this could be surprising behavior for some!).
      
      I considered saving/restoring the console mode when performing a file transfer
      but will leave that to a time when obviously needed.
      
      This fixes issue #497 in automatic way (no option needed).
      0fba2f87
  5. Mar 18, 2023
    • Rob Swindell's avatar
      Add terminal-client socket inactivity detection/disconnection · 53b26318
      Rob Swindell authored
      - New keys in [BBS] section of sbbs.ini:
        MaxLoginInactivity (default: 10 minutes)
        MaxNewUserInactivity (default: 60 minutes)
        MaxSessionInactivity (default: none/unlimited)
      - Each configured external program/door in SCFG can have its own maximum inactivity setting (or else the session max inactivity is applied)
      - moved node-specific sec_hangup to system-wide/shared max_getkey_inactivity (configured in SCFG->System->Advanced)
      - moved node-specific sec_warn (seconds of inactivity before sending warning) to inactivity_warn (a percentage of elapsed max inactivity before sending warning), also configured in SCFG->System->Advanced and used for both socket and getkey inactivity detection
      - Renamed JS console.inactivity_hangup to console.max_getkey_inactivity (old name remains as alias)
      - Renamed JS console.timeout to console.last_getkey_activity (old name remains as alias)
      - Removed JS console.inactivity_warning
      - Added JS console.max_socket_inactivity (current input_thread inactivity threshold)
      - New text.dat string: InactivityAlert (just contains 3 ^G/BELLs by default) used for non-visual inactive-user warning
      
      The MaxLoginInactivity setting in particular solves the problem of custom scripts (e.g. animated pause prompts) that just poll indefinitely for user input and never time-out  - these will no longer cause nodes to be tied-up with inactive/bot users at login.
      
      You may ask yourself, how did I get here? No, you may ask yourself: why configure these socket inactivity max values in sbbs.ini? The reason is consistency: sbbs.ini is where the MaxInactivity is configured for all the other TCP servers and services.
      
      This fixes issue #534 for Krueger in #synchronet
      53b26318
  6. Mar 11, 2023
  7. Feb 19, 2023
    • Rob Swindell's avatar
      The great 'long int' purge of 2023 part 2 · 0932bcda
      Rob Swindell authored
      Mostly [s]printf format fixups
      0932bcda
    • Rob Swindell's avatar
      The great 'long int' purge of 2023 part 1 · 59d8974c
      Rob Swindell authored
      At one time, Synchronet was a 16-bit DOS project, plagued by the 16-bit [u]int, so long's were used everywhere > 16-bits were known to be needed/wanted (This is before the days of the standard sized types from stdint.h), and they've persisted.
      
      But '[u]long int' is 64-bits on *nix 64-bit builds, 32-bits everywhere else (even 64-bit Windows builds if/when we ever get around to that), so this could lead to insidious bugs that would only show up on one flavor or the other. Since [u]int is 32-bits on everything we currently support, we'll use that instead of [u]long.
      
      This "part 1" because I'm sure there's going to be warnings and errors from the GCC/Clang builds as a result, which I'll get to next.
      59d8974c
  8. Feb 03, 2023
  9. Jan 30, 2023
  10. Jul 04, 2022
  11. Jul 03, 2022
    • Rob Swindell's avatar
      Use mouse button release rather than press to activate a hotspot · 48b40607
      Rob Swindell authored
      As described in issue #412, when using extended mouse coordinate (SGR) mode, the mouse button release sequence would be received by the BBS after the hotspot-activated menu option was executed and then that button release sequence possibly passed through to the a child script or program that didn't know how to handle or ignore it.
      
      To resolve this, the BBS now ignores ("eats") the mouse button *press* sequence and only acts upon the mouse button *release* sequence. This is more aligned with how button-clicks work in mouse-control/GUI applications anyway.
      48b40607
  12. Jun 26, 2022
  13. Apr 28, 2022
  14. Mar 10, 2022
  15. Dec 14, 2021
  16. May 14, 2021
    • Rob Swindell's avatar
      Fix-ups for the "continuous random tone" sysop chat pager · b03cb43f
      Rob Swindell authored
      I haven't played with this chat pager in *years*! The lowest tones were inaudible (raise the range from 0-800Hz to 400-1200Hz).
      Increase the msgabort() tone from 1 to 10ms, sounds like those computerized voice recognition phone systems now.
      
      Remove the redundant "<user> paged you to chat" notifications (and log message) when turning *off* the chat pager.
      b03cb43f
  17. Jan 22, 2021
    • Rob Swindell's avatar
      Optionally distinguish between timeout and NUL inkey() result · 18bbb277
      Rob Swindell authored
      Some terminals can send NUL (ASCII 0), e.g. hitting Ctrl-Space in Apple iTerm. Allow users of inkey() (in C++ or JS) to optionally detect the difference by specifying the K_NUL mode flag. In JS, console.inkey() will return null upon timeout (rather than "") when the K_NUL mode flag is used and return an empty string ("") upon receipt of NUL (ASCII 0).
      
      The default is the previous behavior where a timeout and the receipt of a NUL character appear the same to the caller of inkey().
      18bbb277
  18. Nov 07, 2020
    • Rob Swindell's avatar
      Store client terminal information in node#/terminal.ini · c1637082
      Rob Swindell authored
      In preparation for node-spy applications that can support multiple terminal sizes/types (none exist yet). The file is updated whenever there is new/updated information about the client's terminal.
      
      Exposed as JS method: console.term_updated().
      c1637082
  19. 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
  20. Nov 02, 2020
    • Rob Swindell's avatar
      Support PETSCII terminals connected to non-PETSCII ports · a1652355
      Rob Swindell authored
      The reported problem (by John "Jay" Crutti) was:
      If autodetection of the terminal is used from the defaults menu I get stuck on the prompt to hit my Delete key because on the BBS, it keeps showing me login statistics every time I hit my delete key. 
      
      Add/use new K_CTRLKEYS mode to stop inkey() from handling/eating control-keys (e.g. Ctrl-T) when asking user to hit backspace during defaults->terminal settings.
      
      Allow PETSCII_DELETE (Ctrl-T) as a valid option when asking for the backspace/delete key and set the PETSCII flag in the autoterm variable if hit by the user.
      a1652355
  21. Oct 25, 2020
    • Rob Swindell's avatar
      Support manual terminal columns setting per user · cb442b53
      Rob Swindell authored
      The default terminal columns (still 0/auto) can be overridden with the 'L' command from the user defaults menu. 
      
      Also increased maximum manual terminal rows setting from 99 to 999 - this involved moving the record in user.dat, though the old record value is auto-migrated.
      cb442b53
  22. Aug 30, 2020
    • 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.
  23. Aug 16, 2020
  24. Aug 04, 2020
  25. May 24, 2020
  26. May 12, 2020
    • rswindell's avatar
      Use the SGR extended mouse coordinate reporting. · 36964b35
      rswindell authored
      Support a "mouse pass-through" console status flag to allow the pass-through of uncaptured mouse reports (e.g. for hot-spots) to other tasks/scripts. When there are no active hot-spots, this is the normal behavior.
      This commit leaves the legacy X10 mouse report handling/pass-through logic in. But I'll likely be removing that soon.
      36964b35
  27. May 11, 2020
  28. May 10, 2020
  29. May 09, 2020
    • rswindell's avatar
      By default, single-char hot-spots do not extend to the end of the row (use the... · ec56c63f
      rswindell authored
      By default, single-char hot-spots do not extend to the end of the row (use the "hungry" attribute to control behavior).
      ec56c63f
    • rswindell's avatar
      Both hungry/liberal hot-spots and strict hot-spots can be defined now, at the... · 6f16fafe
      rswindell authored
      Both hungry/liberal hot-spots and strict hot-spots can be defined now, at the same time. For Nelgin.
      Use ^A` to define a single-char strict hot-spot using Ctrl-A codes. Unfortunately, this usurps the "home" Ctrl-A code which nothing seems to use but has now been changed to ^A'.
      Use ` instead of ~ in mnemonics to define strict single-char hot-spots (also displays the cmd key in [] instead () on non ANSI/PETSCII terms).
      Use @` instead of @~ codes to define strict hot-keys.
      Use HOT:STRICT @-code to declare a strict hot-key color.
      Use HOT:HUNGRY @-code to toggle back to hungry color-defined hot-keys (the default).
      New optional boolean argument to JS console.add_hotkey(), hungry = true by default.
      6f16fafe
  30. May 08, 2020
    • rswindell's avatar
      2 more uses of the "HOT" @-code: · b468feda
      rswindell authored
      - "HOT" by itself will set the hot-spot attribute to the *current* attribute
        (just colorize the @-code in your editor the same as you do your cmd keys
        no need to memorize color-code mnemonics)
      - "HOT:OFF" will turn off the hot-spot attribute through the end of the text or   util re-enabled
      - Use a more greedy/liberal hot-spot matching algoirthm so that hot spots can overlap and the "best" one will be chosen. No way to opt-out of this algorithm (e.g. to use a conservative matching algo) currently.
      - Earlier parse of @~ codes to keep text prestine
      b468feda
    • 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
      Resolve GCC warning: format '%u' expects argument of type 'unsigned int', but... · aca3666f
      rswindell authored
      Resolve GCC warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long int'
      aca3666f
    • 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
  31. May 04, 2020
Loading