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 - Map of Newhaven has extra Carriage Returns #206

Closed tuday2 closed 3 years ago

tuday2 commented 3 years ago

Module Information

Describe the bug Map of Newhaven has extra Carriage Returns

To Reproduce Steps to reproduce the behavior:

  1. Enter MajorMud module
  2. Create character if none exists, enter game
  3. Execute "MAP" command
  4. See Error

Expected behavior Map displays correctly

Screenshots

No Console Error

MM Map

Software Information:

enusbaum commented 3 years ago

The problem here is that the information is coming from a .ANS file, which already has properly formatted \r\n newline escapes.

When we outprf(), the helper method FormatNewLineCarriageReturn is called, which replaces any \r\ with \r\n and any \n with \r\n. I'm adding code to verify that the sequence being replaced isn't already \r\n (or reverse order) to ensure we don't DOUBLE the new lines.

enusbaum commented 3 years ago

image

paladine commented 3 years ago

The fix has broken TA's st\r\n output

TA outputs a \r\n when in actuality this should be expanded to \r\n\r\n. TA works when any \r or \n is expanded to \r\n, though obviously MMUD works differently

paladine commented 3 years ago

Maybe we want to continue the prior behavior during a prfmsg call but do not do the expansion in a normal prf write?