mbbsemu / MBBSEmu

The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
https://www.mbbsemu.com
MIT License
132 stars 14 forks source link

[WCCMMUD] Majormud - Character FSD editor Exit options behave strangely #569

Open fletcherm opened 1 year ago

fletcherm commented 1 year ago

Module Information

Describe the bug

While in the character FSD editor screen, when you toggle Exit options, the rendering can be a bit funny, especially when compared with stock Worldgroup.

To Reproduce Steps to reproduce the behavior:

  1. Create a new Majormud character, or train stats on an existing character, and see the FSD character editor pop up.
  2. Scroll down to the bottom Exit options.
  3. Start typing "save" "edit" or "quit" fairly quickly.

As you type the different options, you'll see SAVE EDIT or QUIT being auto-filled by the game. But if you type too fast, you'll see both the auto-filled characters, as well as additional letters that you were typing.

Expected behavior

There should not be extra characters showing up, and transitions between the choices should be smooth.

Screen recording

Here is a screen recording comparing MBBSEmu on the left to stock WG on the right.

First, see how on the right, we can scroll around the FSD, change options, etc and all the transitions are smooth.

Then, see how on the left, on MBBSEmu when we scroll to the bottom, and start changing options, extra characters show up.

In this video I am using a combination of pressing the space bar to change options, as well as typing the word. Sadly it's hard to see exactly what I'm doing, but when you see extra characters show up, that is definitely me typing.

Software Information:

enusbaum commented 1 year ago

I'll need to investigate this further, but I believe this issue is being caused by characters being echoed back via the Session controller before they're processed by the FsdRoutine.

We decouple the Sessions (Telnet, Rlogin, Console, etc.) from the HostProcess, with the Session handling communication on the channel. While there is an option to disable echo (BTUECH, I believe), Echo is still enabled via normal operation of the session while in the FSD. Since there are routines that have to execute while in the FSD (validation, auto-complete, etc.), these routines might take longer to execute than characters coming through the session.

Because of this, if you quickly enter SSS while on the last field, it'll begin processing the first S to auto-complete to SAVE, the session will continue to echo out the two extra S characters and then the host process will prf to the channel the SAVE auto-complete value, resulting in SSSAVE being printed.

We'll need to investigate potentially turning off echo while in the FSD and have the FSD itself handle output to the channel of the entered characters.