Actually, this raises another interesting question. Sometimes you get sent data without a newline, such as a prompt. You need to display that verbatim on the screen before you receive a newline, because that newline may not be forthcoming. On the other hand, protocols like MSP and MXP work best when handled a whole line at a time, but that means withholding the display of the line until you get a newline. MSP you can at least spot by the "!!" prefix to the line, but with MXP, I suppose it's guesswork.
Obviously you can get around this by assuming that the MUD sends data in contiguous blocks and having some sort of hacky state that waits for a newline and, if it hasn't received it within a certain length of time, assumes it's a prompt. But that's just plain wrong, really.
Ouch. I wish people had given their extension protocols a bit more thought.
|