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
128 stars 14 forks source link

[WCCMMUD] MajorMud - Does not allow you to exit #200

Closed tuday2 closed 3 years ago

tuday2 commented 3 years ago

Module Information

Describe the bug Does not allow you to exit

To Reproduce Steps to reproduce the behavior:

  1. Enter MajorMud module
  2. (create character if none exists)
  3. Enter the Realm
  4. Attempt to Exit ("X")
  5. See Error

Expected behavior Ability to exit to menu

Screenshots

No Console errors

Exit game: MM1

No ability to exit or move around or execute commands -- can hangup and reenter MM2

You start game with 9 lives, when you hangup and reenter you still have 9 lives so you were never really dead MM3

Software Information:

enusbaum commented 3 years ago

Submitted a PR to fix this issue.

The Ordinal CURUSR was only setting the ChannelNumber variable locally to the specified channel. What needs to happen is the active pointers for things like usaprt, usrptr, etc. need to be updated to specify the new channel as well.

Additionally, we need to call UpdateSession() before switching to the new session in order to save items that might have been changed on those structs (substt, etc.)

This is why things got weird... because MajorMUD essentially thought the user was no longer logged in and cleaned up the user data. But because we weren't saving the updated substt, it didn't know that the user was now back at the menu.