- Apr 02, 2021
-
-
Deucе authored
This appears to work and the event handler *should* work on other event types already. Note, this is *nix-only due to the use of poll(). select() will need to be used for Windows to keep XP compatability.
-
- Feb 22, 2021
-
-
Rob Swindell authored
-
- Feb 15, 2021
-
-
Rob Swindell authored
Hopefully not introducing any bugs in the process.
-
Rob Swindell authored
Hopefully not introducing any bugs in the process.
-
- Jan 22, 2021
-
-
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().
-
- Nov 07, 2020
-
-
Rob Swindell authored
-
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().
-
- Sep 13, 2020
-
-
Rob Swindell authored
Throw an exception if no filename is specified (rather than just abort the script by returning JS_FALSE). The return value is supposed to be a bool, not an int (JS_TRUE != JSVAL_TRUE).
-
- Aug 16, 2020
-
-
Rob Swindell authored
-
- May 24, 2020
-
-
rswindell authored
Addd console.mouse_mode (bit-field) property for visibility/control of sbbs internal ANSI-mouse-reporting mode flags (should not normally need to set this). console.getxy() now works with non-ANSI terminals and returns false if for some reason the request fails (e.g. ANSI cursor position report timeout).
-
- May 14, 2020
-
-
rswindell authored
SCFG for Win32 is linked against a load_cfg lib that builds withOUT SCFG defined, so these compiled AR elements were allocated and then many SCFG operations (e.g. copy/paste, create new) would copy the allocated ARs to another configuration and then be subjected to double-free upon exit/clean-up (resulting in exception or crash). Just get rid of this cruft and some other related RAM-byte-saving hold-overs from the MS-DOS days.
-
- May 12, 2020
-
-
rswindell authored
As part of the rev 1.147 (add mouse hot sport support) commit, I made what I thought was a harmless change to the JS console.clear() implementation, I changed the call to sbbs->CLS to sbbs->clearscreen(). The sbbs->CLS macro calls outchar(FF) which check the line-counter and does the auto-pause before screen-clear. A direct call to sbbs->clearscreen() does not. Just in case someone actually wants the new (but unexpected behavior), I added an optional boolean parameter to console.clear(), autopause (default to true). Pass false if you want to defeat the autopause functionality. This should be effectively the same as setting the console.line_counter = 0 before calling console.clear(), but it also totally bypasses sbbs_t::outchar, so there could be other differences I'm not thinking of. Anyway, this fixes the lack of auto-screen pauses in JS mods recently introduced.
-
- May 09, 2020
-
-
rswindell authored
-
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.
-
- May 08, 2020
-
-
rswindell authored
and JS console.keyboard_buffer_space() and keyboard_buffer_level() ... for tracking the number of character spaces used and available in the the (unget)keyboard input buffer.
-
rswindell authored
-
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>
-
- Apr 30, 2020
-
-
rswindell authored
the name of a scalar property in either the current scope (by default) or the scope of the object passed to: - bbs.menu() - console.putmsg() - console.printfile() - console.printtail() The 'name' cannot be an array element (e.g. myprop[0]) or a nested object reference (e.g. myobj.myprop): just a single property name that can be converted to a string. Also, bbs.menu() now accepts an optional print-mode argument (default: P_NONE).
-
- Apr 06, 2020
-
-
rswindell authored
yesno() and noyes() methods: We need to check the argument count before using the second (optional) argument or else it has some garbage/left-over value from some previous JS function call. And no, just increasing the argument count in the method table isn't enough. :-( Reported by echicken and DaiTengu, thanks!
-
- Mar 19, 2020
-
-
rswindell authored
- you couldn't specify a maxnum value of 0 (it would get overridden to ~0) - you couldn't specify a mode argument value without also specifying a non-zero maxnum value
-
- Mar 02, 2020
-
-
rswindell authored
-
- Mar 01, 2020
-
-
rswindell authored
now accept an optional print-mode (a.k.a. pmode) argument to provide more control over the printing that happens in these functions/methods. The immediate use is for P_NOCRLF to stop the newline from being printed after a yes or no response (e.g. in a full-screen UI), but there could be other uses.
-
- Oct 08, 2019
-
-
rswindell authored
JS console.gotoxy() and the GOTOXY @-code now work with PETSCII terminals (homes the cursor then moves down and right the appropriate number of rows and columns). Bummer I didn't think of this method sooner.
-
- Sep 21, 2019
-
-
rswindell authored
"width" argument (in columns), defaults the user's current screen column-width but you can now over-ride this value when an additional/optional argument. Also, center() now clears-to-EOL before sending the CRLF to the terminal. Hopefully this doesn't mess up anyone's existing use of center().
-
- Sep 10, 2019
-
-
deuce authored
Hopfully this doesn't break the Borland or Watcom (?!) builds.
-
- Aug 21, 2019
-
-
rswindell authored
use socket I/O (e.g. sexyz, door32.sys doors, sync-xsdk doors) - not just when the client is connected via SSH. This solves a number of problems: - programs that change socket options - programs that don't support non-CP437 charsets (e.g. PETSCII, UTF-8) - programs that don't support Telnet-IAC escaping This greatly simplifies (reduces the need for) input_thread locking. The passthru_thread now handles chunks of up to 4000 bytes per transfer between socket and ringbuf, instead of a char at a time, greatly improving the performance.
-
- Aug 05, 2019
-
-
rswindell authored
- new @-code BPS:x (where x is 0/unlimited, 300, 600, 1200, 2400, ... 115200) - new JS property: console.output_rate So you can have mutliple output rate changes in a single file by using multiple BPS @-codes. Hopefully this doesn't do weird things with non-compliant terminals.
-
rswindell authored
now accept an optional "count" argument (default: 1). JS console.backspace() and carrage_return() methods now accept an optional "count" argumnet (default: 1).
-
- Aug 04, 2019
-
-
rswindell authored
- bstrlen() moved to sbbs_t, accepts an option pmode argument so it can account for UTF-8 encoded strings correctly - JS console.strlen() now accepts an optional pmode argument (e.g. P_UTF8) - Renamed sbbs_t::utf8_to_cp437 to sbbs_t::print_utf8_as_cp437 - Create/use msghdr_hfield() to perform UTF-8->CP437 conversions as needed for printing/copying UTF-8 encoded message header fields. - Defined XTRN_UTF8 misc setting flag. If a message editor does *not* have this flag, it is assumed to *not* support UTF-8. Will likely use this for UTF-8 doors as some point too (none known to exist, yet).
-
- Aug 03, 2019
-
-
rswindell authored
I plan to convert all these to wiki-syntax eventually anyway.
-
- Jul 27, 2019
-
-
rswindell authored
be called as console.print(string, number), the number will be interpretted as the P_* mode flags value. Otherwise, all arguments are converted to strings and printed (as before). If anyone was calling console.print(string, number), they will get different behavior now. I couldn't find any evidence of anyone using this syntax for console.print(), so I think this should be okay. Only a limited set of P_* flags are supported (e.g. P_PETSCII, P_UTF8) - far fewer than console.putmsg(), but console.putmsg() is much more heavy weight and supports a lot more "features" likely to interfere with the expected user output. In general, try to use console.putmsg() only when printing multi-line text strings or when @-code expansion is needed. Otherwise, console.print() is usually better.
-
- Jul 10, 2019
-
-
rswindell authored
terminal "type" string (ANSI, RIP, PETSCII, or DUMB). Expose this value in JS via the new console.type read-only property. The TERM @-code now expands to this string rather than the (often client-supplied) sbbs_t.terminal string value.
-
rswindell authored
Create a sbbs_t method: wide(), which displays a string using "fullwidth" Unicode characters, when possible, otherwise, double-spaced. Exposed in JS via console.wide() and a new @-code: WIDE:<string>
-
- May 09, 2019
-
-
rswindell authored
- for PETSCII, this is automatic and you don't lose blink, but you do lose colored foreground when enabling a bright background ("reverse video") - for ANSI, this mode is typically referred to as "iCE colors" and disables blinking-text support - Ctrl-AE (^AE) is the new attribute code to enable bright-background (will have no effect on ANSI terminals that are not iCE color enabled) "E" is now valid in the ctrl/attr.cfg file and string values for JS console.attributes assignments, as well - Ctrl-AI (^AI) - blink - now does nothing for ANSI/ICE color terminals (blinking is not supported in combination with bright-background) - Using a new/non-standard CGA attribute bit-flag to indicate the selection of bright-background colors (BG_BRIGHT, bit 10), separate from BLINK. This change required all/most char/uchar attribute representations to be converted to int/uint. New text.dat strings: - PetTerminalDetected (renamed from PetTermDetected) - PetTerminalQ - TerminalAutoDetect - TerminalColumns - TerminalRows - TerminalMonochrome - TerminalColor - TerminalIceColor - IceColorTerminalQ This also moved the MsgCarbonCopyList definition to the end of the file for now. PETSCII reverse-video attribute fix: When a CR is sent to the terminal, the reverse-video attibute is auto-disabled so update our "current attribute" (curatr) value to match the remote. Support new printfile/putmsg mode flag: P_WRAP to force an ungraceful line-wrap (splitting) to the specified column width. If no column width is specified (0), then this mode will force an ungraceful wrap before the last terminal column where some terminals *may* auto-wrap. JS console.printfile() and printtail() methods now support an optional "orig_columns" argument, similar to console.putmsg(). Must specify P_WORDWRAP or P_WRAP for this argument to have any effect. Much improved terminal-type selection/configuration in the user defaults menu and abort (^C) at any of the yes/no prompts is now detected/handled much better (to answers to the prompted questions are not saved to the user settings).
-
- May 04, 2019
-
-
rswindell authored
JS's console.getkeys(). If no mode value is specified, K_UPPER is the default behavior (same as before). *.getkeys() currently only recognizes the following mode flags: - K_UPPER - K_NOECHO - K_NOCRLF K_NONE (0) is also a valid value.
-
rswindell authored
declaration
-
rswindell authored
Use this in place of JS_GetPrivate() in native class methods that need the class instance's private data pointer and will do bad things if that pointer points to something other than what is expected. mcmlxxix (matt) discovered that using Object.apply(), you can invoke class methods where the 'this' instance is a different class. This would result in "Internal Error: No Private Data." or a crash. So now, gracefully detect this condition and report a meaningful error: "'<class-name>' instance: No Private Data or Class Mismatch" Also, important to note: if the method uses JS_THIS_OBJECT to get the JSObject* to pass to JS_Get*Private, then it must do this *before* it calls JS_SET_RVAL. From jsapi.h: * NB: there is an anti-dependency between JS_CALLEE and JS_SET_RVAL: native * methods that may inspect their callee must defer setting their return value * until after any such possible inspection. Otherwise the return value will be * inspected instead of the callee function object. The js_crypt*.c files still need this treatment.
-
- May 03, 2019
-
-
rswindell authored
the 'keys' argument is optional. If no keys are specified (or NULL), then any/ all non-numeric keys are considered valid input and may be returned by this function/method.
-
- Apr 11, 2019
-
-
rswindell authored
console.msghdr_top_of_screen): a hack to let scripts know whether the most-recently displayed message header was displayed on the top of the terminal screen (or not). This allows us to show avatars at the top of the screen when the header is up there, rather than relevative to the bottom of the header (the pos can vary, depending on stuff).
-
- Mar 24, 2019
-
-
rswindell authored
- bbs.show_msg() - bbs.show_msg_header() Re-worked the JS bbs.netmail() implementation sbbs::show_msg(), show_msghdr(), msgtotxt() now take an smb_t* argument (don't use the pseudo-global 'smb' in these functions any longer) sbbs_t::putmsg() and JS console.putmsg() now accept an optional orig_columns argument to specify the original column width of a text for intelligent re-word-wrapping (e.g. as taken from a message header field). Previously, the original-column value was hard-coded to 80 columns (technically, 79). sbbs_t::show_msghdr() no longer sends a CRLF if the cursor is already at the top-of-screen (TOS). sbbs_t::show_msg() now uses the stored "columns" msg header fields to pass to putmsg() to intelligently re-word-wrap message bodies for display. sbbs_t::show_msg() and msgtotxt() return bool now instead of void. JS MsgBase.get_all_msg_headers() now supports an optional "expand_fields" argument (defaults to true). I contemplated just getting rid of the (few) expanding header fields (more like default-value-header fields, like 'id'), but decided against it, at least for now. JS MsgBase.put_msg_header(), the "number_or_offset" argument is optional and not needed if a header object argument is provided. Make this clear in this JS docs for this method Note: I sat on this commit for a while because I noticed occasional errors like this: Node 1 <Digital Man> !ERROR 2 (No such file or directory) (WinError 0) in readmsgs.cpp line 217 (sbbs_t::loadposts) locking "path/to/sub" access=-100 info=smb_locksmbhdr msgbase not open started cropping up after introducing these changes and which I never root-caused. But after a clean-build and waiting a week, I haven't seen it again, so hopefully it was just a incomplete rebuild issue and not a new bug.
-