Skip to content
Snippets Groups Projects
  1. Mar 12, 2023
    • Rob Swindell's avatar
      Better to just break this loop than to call exit() · 1c5404fd
      Rob Swindell authored
      exit()ing from a load()ed script can cause the parent script to terminate and
      we don't want that.
      1c5404fd
    • Rob Swindell's avatar
      Remove extraneous ulong typedef · 15c2d974
      Rob Swindell authored
      15c2d974
    • Rob Swindell's avatar
      Fix a couple of potential NULL-pointer deferences in js_initcx() failure cases · 600cdaf4
      Rob Swindell authored
      service_client->client is NULL in these failure/error cases, so get the
      protocol string from the service_client->service (which is not NULL) instead.
      600cdaf4
    • Rob Swindell's avatar
      New file transfer configuration sub menu script · a0333f66
      Rob Swindell authored
      To replace some copy/pasta in *.src (and later *.js shells)
      a0333f66
    • Rob Swindell's avatar
      Fix mysterious double overflow issue in parse_byte_count() · ab8eca85
      Rob Swindell authored
      It's possible that some values (e.g. "16384P") exceed the storage (count of
      bytes) of a 64-bit integer, and such values were causing floating point
      exceptions when running sbbsctrl.exe, e.g.
      Faulting application name: sbbsctrl.exe, version: 3.20.0.0, time stamp:
      0x00000000
      Faulting module name: gdi32full.dll, version: 10.0.19041.2604, time stamp:
      0x2b5302d5
      Exception code: 0xc0000090
      
      but interesting (and perhaps a clue), not with sbbs.exe.
      
      Anyway, this added range checking, limiting the maximum value to INT64_MAX
      (after division by unit, though there was no division-unit in the problem
      case, the "min_dspace" value parsing in scfglib2.c). Using conditional/ternary
      return statement had the same floating point exception occurrences, so this
      if-statement shouldn't be removed/changed/optimized!
      
      I suspect this has something to do with mix of Borland and MSVC run-time libs
      and perhaps different expectations or setups with regards to floating point
      exceptions. I did notice that when stepping through read_file_cfg(), I would
      get different return values for the same call to iniGetBytes() depending on
      whether it was initiated from sbbsctrl.exe (built with C++Builder) or
      sbbs.dll (built with MSVC).
      
      Thanks to Codefenix for providing the sample file.ini file that demonstrated
      the issue. This problem would've been very hard to root-cause otherwise!
      ab8eca85
  2. Mar 11, 2023
  3. Mar 10, 2023
    • Rob Swindell's avatar
      Add a notice clarify that this script is not actually used by anything · cd4f9cc3
      Rob Swindell authored
      and suggestions how to achieve what the reader/sysop is wanting.
      cd4f9cc3
    • Rob Swindell's avatar
      Re-write to allow options in any order, more control over all behavior · 49053f31
      Rob Swindell authored
      Previously, in order to just specify the terminal-type string, the sysop
      would also have to pass new values for the tg-mode, client-name and
      server-name, which was not very friendly. We still support the old syntax
      where order of arguments matters, but also a new better syntax for options
      (which may now come before or after the required address[:port] argument):
      
      -c <client-name> (default: user alias)
      -s <server-name> (default: user real name)
      -t <terminal-type> (e.g. "xtrn=doorcode" to auto-exec door on server)
      -T <connect-timeout-seconds> (default: 10 seconds)
      -m <telnet-gateway-mode> (Number or TG_* vars OR'd together, default: 0)
      -p send current user alias and password as server and client-name values
      -q don't display banner or pause prompt displayed (quiet)
      -P don't pause for user key-press
      -C don't clear screen after successful session
      
      For arguments that take a value (e.g. -c, -s, -t, -T, -m), the value may
      immediately follow the option letter (e.g. "-cMyName") or be specified
      in the following argument (e.g. "-c MyName"). Multiple options cannot be
      stuck together in the same option (e.g. use '-C -P' instead of '-CP').
      
      If the RLogin server is a Synchronet BBS, you probably want to specify the
      '-p' option which will send the current user's alias and password in the
      RLogin connection parameters that Synchronet expects them.
      
      The sysop now has better control over the output (banner, screen-clearing)
      and the pause prompt that was previously hard-coded.
      49053f31
    • Rob Swindell's avatar
      [telnet|rlogin]_gate now returns bool (false if failed to connect) · 21429128
      Rob Swindell authored
      Previously, there was no real way to tell if the call to telnet_gate() or rlogin_gate() was successful (e.g. to display or an error message to the user), though there were error/warning messages logged for the sysop. Equivalent JS bbs object methods now return Boolean too.
      
      Include ":port" part of address argument to bbs.[telnet|rlogin]_gate methods in JSDOCS.
      
      Removed a bunch of extraneous (copy-pasted?) JS_SET_RVAL() calls from js_bbs.cpp. This just makes the code a little easier to grok.
      21429128
  4. Mar 09, 2023
  5. Mar 06, 2023
  6. Mar 05, 2023
    • Rob Swindell's avatar
      Fix typo in help output · eb398a72
      Rob Swindell authored
      eb398a72
    • Rob Swindell's avatar
      Add support for an optional description character offset (number) arg · 4e1da83c
      Rob Swindell authored
      If all descriptions start a fixed offset and the default parsing
      logic (regex) isn't working for the sysop, they can specify the exact
      error offset to use for the beginning of each file's description. This
      offset is only used for the initial line of the description, not the
      continuation lines, but perhaps that could be done if needed.
      
      This is an attempt to address issue #530
      
      I first attempted to use "Lookbehind Assertions" in the regex, but
      didn't have any success and decided the brute force method that the
      old addfiles utility used might be as simpler solution and provide an
      effective work-around for more potential issues with auto-detecting
      the beginning of the useful file description.
      
      I also added descriptions of the optional arguments to the help output.
      4e1da83c
    • Rob Swindell's avatar
      Add text.dat string: NewUserValEmailSubj · d72eba60
      Rob Swindell authored
      This fixes issue #62
      d72eba60
    • Rob Swindell's avatar
      Use/store the new user.mail_settings property · 52b8f714
      Rob Swindell authored
      to track the user's preference for reverse-ordering when listing/reading
      mail messages. The Un-read mail command still just always uses reverse
      ordering.
      52b8f714
    • Rob Swindell's avatar
      Add user_t.mail (in JS, user.mail_settings) to remember mail preferences · cf0d5714
      Rob Swindell authored
      Right now, the only preference is reverse mail listings (oldest first
      or newest first). These settings are only used when reading "your mail",
      not any other kind of mail reading.
      
      bbs.read_mail() now returns the user-adjusted loadmail_mode value and
      this allows us to determine the user's preferences and save them after
      this function/method is called. A readmail_mod can now return a number
      (other than 0) and that will be used as the return value of this method.
      
      sbbs_t::readmail() now does the adjustment of the passed lm_mode before
      calling any installed readmail_mod, so if for example, deleted message
      viewing is enabled by the sysop, those LM_* flags might be set now in
      the argument to the readmail_mod, wherase they never would before.
      
      There is not yet any way for the sysop to set a new user's default
      mail_settings, they'll just default to 0 for now.
      
      email_sec.js will get some adjustments to use/store the
      user.mail_settings next.
      cf0d5714
  7. Mar 04, 2023
  8. Mar 03, 2023
    • Rob Swindell's avatar
      Introduced user download_cps property · c27b78a9
      Rob Swindell authored
      Will track the user's last succsesful file-download transfer rate
      in characters (bytes) per second.
      
      I'm not calculating or storing this rate yet, but will be soon. This
      will make the file download ETAs more realistic and no longer
      hard-coded to 3000 cps (which now defaults to 10000 cps, to keep up
      with the times).
      
      New field added to user.tab placed adjacent to the other File xfer stats,
      which means the leech attempt counter (likely always 0) was moved to the end
      of the user record.
      c27b78a9
    • Rob Swindell's avatar
      Better access enforcement to files in batch download queues · f2adb547
      Rob Swindell authored
      If a file gets added to a batch download queue that a user doesn't have download-access to (at the time of batch download), deal with that gracefully and consistently.
      
      start_batch_download():
      - Now checks current user access to download the file in both single-file and batch modes
      - Now performs credit-check in single-file mode (wasn't doing so previously)
      - totalsize of multi-file batch download queue is now calculated again (apparently removed/broken in the new filebase conversion of v3.19), so download ETA should be calculated more accurately (?) again
      - Use gettimetodl() to calculate each file's download time for multi-file downloads
      - Using new putnode_download() method to write node downloading "action" and ETA-in-aux fields
      - The node status wasn't being updated at all before start of download in single-file mode - fixed
      
      create_batchdn_lst() :
      - Checks each file still downloadable by the user and if not, removes from the queue (and the generated list file).
      - Performs credit check and removes files that exceed available user credit
      - returns true only when 1 or more files is added to the batch download list file
      
      addtobatdl()
      - Removed redundant 'D' restriction check - this is handled by can_user_download() check already.
      - Use the 'reason' out parameter from can_user_download() to determine which error string to display (not always CantDownloadFromDir).
      f2adb547
    • Rob Swindell's avatar
      Remove defunct files from batch download queue during logon · 9308d1bc
      Rob Swindell authored
      If a user doesn't have access to download a file that's in their batch queue, remove it without saying anything to the user (but log a notice-level message about it) during logon. Files that no longer exist in the filebase are treated the same way.
      9308d1bc
Loading