[MUD-Dev] Clients

Katrina McClelan kitkat at directcheck.aries.net
Mon Feb 23 21:58:00 CET 1998


On Sun, 22 Feb 1998 coder at ibm.net wrote:

> >Particularly if you use ncurses and expect (partually
> >dangerous) the the receiving client supports colors in some way or
> >another (doesn't have to be vt100 with ncurses).  
> 
> Nope, the core problem with implementing curses support in the MUD server
> is terminal definition.  In the classical case this was not a problem as
> the terminal type was defined by the application's environment ($TERM,
> terminfo, termcap and company).  These resources and that definition
> ability are not available for a client connecting directly to a port on a
> server.
> 

They are as much as it is connecting to port 23 is on a UNIX box.  The 
telnet protocol is supposed to be able to pass term type (TELOPT_TTYPE == 
24).  I agree that some telnet programs are quite stupid about this.  
However it's not too hard to find a client that works sanely in this regard.

> How does the server know what terminal type the remote client is
> emulating?  

see above.  You query it.

> Many telnet clients very poorly or partially implement even
> the VT-* terminal types.  

See above.

> Additionally it is often quite difficult (and
> few know how) to set the desired terminal type in quite a many telnet
> clients.
> 

Aye, I suppose you'll always have people that don't have a clue.  These 
same people will be the ones that have trouble downloading a client too  
*shrug*

> The next problem is simultaneously supporting multiple terminal types from
> a single executing binary.  Many curses implementations handle that
> extremely poorly, almost forcing you to require all clients to use a
> single terminal definition.
> 

Freely availible, ncurses does a fairly good job of doing this.  It is 
distributed with a terminfo database, can read from this database in a 
user defined directory (if you lack root access to just install it), and 
takes arguments to newterm to define which term type to use:

     SCREEN *newterm(char *type, FILE *outfd, FILE *infd);

     .....The routine newterm() should
     be called once for each terminal.  It returns a variable  of
     type  SCREEN  * which should be saved as a reference to that
     terminal.  The arguments are the type of the terminal to  be
     used  in  place  of  $TERM, a file pointer for output to the
     terminal, and another file pointer for input from the termi-
     nal (if type is NULL, $TERM will be used).  The program must
     also call endwin() for each terminal being used before exit-
     ing  from curses.  If newterm() is called more than once for
     the same terminal, the first terminal referred  to  must  be
     the last one for which endwin() is called.

> That given, curses works very nicely.

Yeah, the only real problem is a client telnet that does not support 
negotiation of term type (which it is SUPPOSED to).

-Kat



More information about the mud-dev-archive mailing list