|
talonnb |
Posted: Thu Sep 09, 2010 4:57 am
Honestly can't explain it easily, blank space issue? |
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Sep 10, 2010 9:42 pm |
I got it to happen when there were no packet breaks. That just made it a bit easier to occur.
I think I tracked it down. The GMCP code is setting the #TAG value on the *next* line from the MUD. So it does something like this:
Code: |
SetTag( CurLine+1, TagStr) |
Now, when the scrollback buffer is full, the "CurLine" is always the last line in the buffer (line 999 if the scrollback size is set to 1000). So the above line is trying to set the tag for line 1000, which doesn't exist (lines are 0 to 999).
This doesn't cause any memory overflow or anything. When the SetTag routine tries to set the tag for line 1000, CMUD scrolls the buffer by one line and readjusts the value to 999.
The GMCP code is setting the Tag for 4 values: Name, Exits, vNum, and Prompt. This causes 4 extra lines of scrolling because each of these attempts to set the tag for line 1000. And because the scrolling is happening where CMUD doesn't expect it, the text on the screen also can get screwed up requiring you to click on the window to refresh it.
The reason using my debugger was preventing the problem from occurring is because it was allowing CMUD to re-paint itself when the debugger halted at a breakpoint, and the act of repainting was fixing the line buffer so that it was setting the tag for line 999 instead of line 1000.
The only way I discovered all of this was by commenting out the GMCP code and then un-commenting it line by line. As soon as I uncommented the first Tag (for Room Name), it was adding a single blank line. As soon as I uncommented the Tag for Exits, it was adding a second blank line, and so on.
So, I think I will have this fixed for the next version. Hopefully I'll get it out later tonight. This was definitely a head-ache inducing bug. Thanks for your patience in trying to track it down. |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Fri Sep 10, 2010 9:52 pm |
Very nice. I'm glad you found it!
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|