@@TITLE Telnet Protocol@@

Implementing Extended Telnet Protocol in DGD

DGD has 'telnet ports', which implement the basic telnet protocol. However, they do so in a very limited and rigid way, and Dworkin has no intention of extending them, or even modifying their behavior. The network patch for DGD makes no change in this, and the ANSI color patch, while it allows certain outgoing high-ASCII characters, still requires patching DGD. What should you do to fix this?

The best answer is to implement your own telnet server in LPC and connect it to a DGD binary port. This allows you to configure the result in LPC rather than patching DGD, and lets you send things like international high-ASCII characters and ANSI color codes when and how you like. It also lets you handle parts of the telnet protocol that DGD does not, such as changes in the screen size, and default terminal settings.

If you want to implement the telnet protocol, you may find this page highly useful. You'll also want to use some RFCs. Here are some potentially useful ones:

  RFC 854 - Telnet protocol specification.
  RFC 855 - Telnet option specifications.
  RFC 1091 - Telnet terminal-type option.
  

There are bugs in how older MUD servers treat newlines, and the same is true of older clients. However, the bugs seem to be all different and highly platform-dependent, so you'll need to work this one out for yourself. Whether a telnet linefeed is newline-then-CR or CR-then-newline or just one or just the other seems to be highly platform dependent. When in doubt, be tolerant.

Be sure to test with a variety of telnet clients. Even recent clients seem to have a variety of odd bugs in the protocol. When testing, remember that some clients will even do odd things like detect the string "password" and turn off character echo afterward rather than relying on the server to turn off echo at the appropriate times.

@@INCLUDE mexican_characters@@
  

@@INCLUDE telnet_echo_cr@@

@@INCLUDE telnet_protocol@@

@@INCLUDE ansi_colors_1@@

@@INCLUDE ansi_colors_2@@

@@INCLUDE ansi_colors_3@@

@@INCLUDE ansi_patch@@

@@INCLUDE ansi_colors_4@@

@@INCLUDE implementing_ansi@@