From: Barid Bel Medar (
Date: 06/21/96

On Fri, 21 Jun 1996, Sean P. Mountcastle wrote:

> 	Well, maybe I went too far with that subject, but what I need to 
> know are the telnet/iac sequences/strings to send to the player to change 
> their connection from line mode to character mode, and back again.  I'd 
> like to make changes to the editor so that it will be a bit more user 
> friendly (and to save all that retyping with OLC).  I was unable to find 
> the codes in telnet.h

The codes should definitely be there.  But if they aren't, get on to 
Yahoo and search for RFC.  Then get the monster Internet RFC list and 
search for "linemode."  It should have all the useful stuff there.  The 
telnet.h file is present on most UNIX systems in 
/usr/include/arpa/telnet.h; the telnet option commands start out TELOPT_xxx.

i.e., sprintf("%c%c%c", (char) IAC, (char) DO, (char) TELOPT_LINEMODE).  
I don't know if that works or not, I just made it up now, but I think it 

> 	If you could point me in the general direction, post the exact 
> sequences, or even post a small function to take care of this I would 
> greatly appreciate it.  Oh and one more thing:  If I change the player to 
> char mode and they try and type sleep will the command interpreter still 
> work and interpret that as south;look;east;east;pout ?

Yes.  Actually, as soon as the player types 's' the MUD will respond with 
'south', the 'l' for 'look', and so on.  Usually, the player will be able 
to catch on to this pretty fast.  The best way for checking is to only 
consider input done after receiving a \r or \n or either.  Remember that 
this will significantly slow down your connections.

Oh, yes.  Telnet command sequences can come in at any time, so be sure to 
add the code to the interpreter so that it'll interpet and strip the 
sequences whenever they come in, wherever they are.  For example, you may 
see this:


You *MUST* expect this.  Also, since you have to initiate most of the 
options, you also have to be careful with endless loops; i.e., you send 
IAC DO LINEMODE and continue processing; you receive IAC WILL LINEMODE, 
in reply you send IAC DO LINEMODE (which would turn it on if the client 
initiated the negotiation); the client receives that and sends IAC WILL 
LINEMODE, since it sees it as a new request, and the loop restarts (or it 
can, at least).  A sort of telnet global flag variable would be good for 
this (turn on the flag when you send the request and maybe even shut it 
off after a given timeout).

> 	Many thanks in advance,
> 	- Sean

Barid Bel Medar                     
Knights of the Cosmos            Shayol Ghul Resort and Health Spa
"I  am  returning  this otherwise good typing paper to you because
someone has printed gibberish all over it and  put  your  name  at
the top." - English Professor, Ohio University

This archive was generated by hypermail 2b30 : 12/18/00 PST