Making ListPlus switchable in WWIV part 3

In a previous post, I modified the Main Defaults screen to display the ListPlus Enabled switch status. This status simply reads the variable lp_options and shows whether the cfl_enable bit is on or off, which we had defined in an earlier post. I’ll write about what I did to give the WWIV BBS user the ability to toggle that bit.

Since I want ListPlus to be available to users who have ANSI enabled, it makes sense to make the toggle as well as the switch visible to users who have okansi() = True. In defaults(), a section of code adds keys that the BBS tests for input. I simply add L to our allowable keys.

    737     bout.outstr("|#9Defaults: ");
    738     std::string allowable = "Q?1234567BCDIKMNTUW";
    739     if (okansi()) {
    740       allowable.append("89AS");
    741       if (a()->fullscreen_read_prompt()) {
    742         allowable.push_back('G');
    743       }
    744     }
    745     switch (const auto ch = onek(allowable, true); ch) {

I modify line 740 to:

    740       allowable.append("89ALS");

This makes the onek() function call in line 745, to accept L as input, aside from the other keys in the string allowable.

Now that onek() will accept L, I need to define a switch case, to handle what to do if the BBS receives an L. To make it easier to find the code, I insert the case definition for ‘L’ right after that for ‘K’.

    802     case 'K':
    803       wwiv::bbs::menus::ConfigUserMenuSet("");
    804       need_menu_reload = true;
    805       break;
       +    case 'L':
       +      a()->user()->data.lp_options ^= cfl_enable;
       +      break;
    806     case 'M':
    807       a()->user()->toggle_flag(User::noMsgs);
    808       break;

I used XOR assignment to toggle the cfl_enable bit of lp_options of the user. If it is currently on, XOR will set it off. If it is currently off, XOR will set it on.

That’s it. I’ve made the user’s cfl_enable bit (ListPlus) toggleable from the Main Defaults menu of WWIV.

Next time, I’ll describe the rest of the code modifications needed to make the switch actually turn ListPlus on or off in WWIV.

Making ListPlus switchable in WWIV part 2

Having decided on a variable to hold the ListPlus toggle ( cfl_enable bit in lp_options of the user record in sdk/user.h ), I figured out where in the BBS this can be switched on or off. I decided on adding the switch to the Main D)efaults menu, and in the T)ransfer section defaults menu.

In the Main D)efaults menu, we take a look at the current menu layout.

I can add a ListPlus Enable status line and switch right beside the K) Configure Menus item. It’ll be switchable on or off with the L key! Isn’t that just right?

This screen is controlled in the bbs/defaults.cpp file, and I can modify the output in line 167.

    167   bout.pl("|#1K|#9) Configure Menus");

ListPlus itself relies on the user having ANSI enabled, so I’ll make it switchable only if the user has ANSI enabled. I’ll also make the current value of the switch visible as Yes or No. This is the code after we’ve modified it.

    167   bout.print("|#1K|#9) Configure Menus                      ");
    168   if (okansi()) {
    169     bout.print("|#1L|#9) ListPlus Enabled   : |#2{}",
            YesNoString(a()->user()->data.lp_options & cfl_enable));
    170   }
    171   bout.nl();

The resulting screen looks like this.

So far, I’ve added a bit in the user record where I can select to enable or disable ListPlus, and prepared the defaults screen to display the status of the ListPlus switch.

(to be continued)

c/c++ implementation of wwiv5lastcallers

I started work on a C/C++ implementation of my Python 3 scripts for InterBBS LastCallers[1]. The original scripts were inspired by xqtr’s InterBBS LastCallers script for MysticBBS[2], which were written in MysticBBS Pascal and MysticBBS Python.

Using apam’s InterBBS OneLiners for WWIV[3] as base, I modified the routine for reading in posts on a WWIV SUB for InterBBS Data to call a rot47() function to code/decode text, which then writes a nicely formatted “laston.txt” file that gets displayed as part of WWIV’s bbs/lilo (logon-logoff) routine.

I was struggling a bit because the OpenDoors library that reads in the BBS Door Dropfile did not appear to output the user’s handle and the user’s location simultaneously using the different available dropfile formats that it supported. I resorted to simply using WWIV’s default CHAIN.TXT dropfile, reading the usernum from it, then reading in WWIV data files to get the user’s name/handle and location from the BBS itself.

The repository for this is at https://github.com/ericpareja/wwiv5lastcaller.

-wwivutils https://github.com/ericpareja/xenos-wwiv-utils

-ilc https://github.com/BBSRoot/Scripts-and-Mods/Mystic/xqtr/xq-ilc123.zip

-ibol https://github.com/apamment/ibol

https://wwivbbs.org

Getting back in the saddle…

After a long drought, I am back to writing stuff for WWIV.

I did a little bit of Python coding here and there, with some updates to my old scripts written in Python 2 so that they will now work nicely in Python 3.

I finished my wwiv5ibbslastcall package, which consists of two Python scripts. The first one, which originally was named wwivibbslastcaller, is now xwibbslastcaller.py. The second, originally just ibbs-extract, is now ibbs-extract3. Both of these are now written in Python 3.

xwibbslastcaller.py is responsible for getting the user’s info from the BBS drop files, then posting to the appropriate SUB or ECHO with the caller’s info in rot47. This script is usually part of the LOGON command and can be added to WWIV.INI in the LOGON_CMD setting like this:

LOGON_CMD = xwibbslastcaller.py %R

The other script, ibbs-extract3, reads in configuration settings from WWIV.INI, then proceeds to read message posts from the SUB or ECHO where IBBSLASTCALLER data is posted. It reads in data from the posts and writes out a laston.txt file for each network that it reads data from.

Here’s sample output of the package.

wwiv5ibbslastcall output showing InterBBS Last Callers for WWIVnet and fsxNet.

You can get the scripts from https://github.com/ericpareja/xenos-wwiv-utils/.

WWIV net38b3 on aliens

I updated WWIV networking software from NET37 to NET38b3. Rushfan is maintaining the official networking stack. I have some ideas for doing a complete rewrite for Linux, but am not sure if I can manage to write a portable rewrite.

The network stack of WWIV consists of several components. I’m planning to rewrite one component at a time, so that we can actually run the entire WWIV BBS + WWIV Network + WWIVToss (FTN<->WWIV) on Linux without resorting to dosemu.

Currently, the WWIV BBS software itself already runs on Linux. See WWIV BBS v5.0 Project.

The NET37/NET38 WWIV networking stuff runs mostly under DOS, so requires Linux WWIV sysops to use dosemu and some creative scripting to get it to work.

There is already a stub NETWORK.EXE replacement in the WWIV BBS project tree, which in turn calls NETWORK0.EXE, NETWORKB (Rushfan’s Binkp WWIV transport replacement) or NETWORKP.

NETWORKP (or the WWIV PPP Project component) has some parts of it that have already been replaced with a bunch of scripts which require Python to handle the transport of network files from the WWIV BBS to the hub via SMTP, and fetchmail to retrieve from the hub to the WWIV BBS via POP3. I’m currently working on replacing NETWORKP completely with a Python script to do the conversion of files from their Sx.NET format to their UUencoded format along with their mail headers. Once this is done,  NETWORKP.exe can be replaced on Linux.

NETWORKB is an option, of course. But I’m all for flexibility and having alternatives. Besides, it’s something I like working on while learning in the process.