27 Jul, 2009, Kintar wrote in the 1st comment:
Votes: 0
I was just wondering what everyone thought about Telnet support in MUDs, specifically, how many of the additional RFCs a basic mud server should support. It seems to me that Telnet has been bloated beyond reason over the decades that it's been in service, and implementing every feature that could be applicable to a MUD is just pointless. (NAWS, LineMode, TermType, SuppressGoAhead, etc., etc., etc.) I've also noticed that most MUD servers I connect to only support a VERY small subset of the available options, usually not even implementing the LineMode RFC, but instead using the fairly common "poor-man's line mode" option.

Any thoughts? For those of you who have written your own codebase, did you use a pre-built Telnet library, or did you have to implement your own, and how much did that influence your decision?
27 Jul, 2009, David Haley wrote in the 2nd comment:
Votes: 0
When I get around to implementing telnet options in BabbleMUD, I'll either use Elanthis's libtelnet or write something similar of my own (the reason being that I'm not exclusively in C, so it might be easier to do it in Lua or something).

I won't be implementing that many of the extra RFCs, though. ZMP and MCCP will be first on my list.
27 Jul, 2009, Cratylus wrote in the 3rd comment:
Votes: 0
Useful: linemode/charmode, naws, mccp, new-environ, mssp, ttype.

Probably useful but I personally don't use em: mxp, zmp.

My suggestion, if you don't see a good reason for em, and you don't like
coding such stuff, screw it. Mudding's sposed to be a hobby for fun.

-Crat
http://lpmuds.net
28 Jul, 2009, Kintar wrote in the 4th comment:
Votes: 0
Thanks for the input, guys. My preference would certainly be to use a library; I find a lot of odd programming tasks fun, but implementing telnet, I've discovered, isn't one of them. :P My problem comes from the fact that the server is being written in Java, though, and there's a shortage of telnet libraries for Java. All of the ones I've found are specifically targeted at being a client connection, which I find very odd since I've always considered telnet a peer-to-peer protocol, rather than a client/server protocol. :/
28 Jul, 2009, David Haley wrote in the 5th comment:
Votes: 0
You know, a basic telnet library isn't actually that bad, if you implement it as a simple state machine. I've kind of thought of telnet as a client/server protocol as well, incidentally, and not really a peer-to-peer protocol, although really it doesn't make a huge difference.
28 Jul, 2009, Erok wrote in the 6th comment:
Votes: 0
I've asked myself this same question.

I think linemode is a given, but the rest seem subjective and I'll take Cratylus' advice. For now, I recognize and strip out any received telnet sequences, and can incrementally add state machines to process them later as needed.
28 Jul, 2009, Kintar wrote in the 7th comment:
Votes: 0
@David Haley: I guess that disconnect is part of what makes telnet a little tricky for me. At the onset, it never seems very complicated to build a state machine for one of the RFCs, but I always end up getting myself tangled over the terminology when I start trying to keep it peer-to-peer in my head.

@Erok: That's pretty much what I've got at the moment, too. Glad I'm not the only one taking the path of least resistance, at least to begin with. ;)
28 Jul, 2009, kiasyn wrote in the 8th comment:
Votes: 0
I found this very useful when I created the Telnet State machine in the MSSP crawler. It was posted by someone on MUDBytes - sorry, I forget who posted it.

Read from the reader end of the pipe until the writer finishes
STATE : BYTE -> NEW STATE (action)
TEXT : IAC -> IAC (begin telnet command)
TEXT : anything -> TEXT (regular text input from the remote end)
IAC : IAC -> TEXT (escaped IAC byte)
IAC : DO -> DO (start DO negotiation)
IAC : DONT -> DONT (start DONT negotiation)
IAC : WILL -> WILL (start WILL negotiation)
IAC : WONT -> WONT (start WONT negotiation)
IAC : SB -> SB (begin sub-request)
IAC : anything -> TEXT (one of several IAC commands, most are not used in MUDs, safely ignored usually)
DO : anything -> TEXT (DO option code, process)
DONT : anything -> TEXT (DONT option code, process)
WILL : anything -> TEXT (WILL option code, process)
WONT : anything -> TEXT (WONT option code, process)
SB : IAC -> SB_IAC (sub-request end/escape sequence)
SB_IAC : IAC -> SB (escaped IAC byte)
SB_IAC : SE -> TEXT (completed subrequest, process data)
SB_IAC : anything -> TEXT (invalid sub-request, abort)
29 Jul, 2009, flumpy wrote in the 9th comment:
Votes: 0
Kintar said:
Thanks for the input, guys. My preference would certainly be to use a library; I find a lot of odd programming tasks fun, but implementing telnet, I've discovered, isn't one of them. :P My problem comes from the fact that the server is being written in Java, though, and there's a shortage of telnet libraries for Java. All of the ones I've found are specifically targeted at being a client connection, which I find very odd since I've always considered telnet a peer-to-peer protocol, rather than a client/server protocol. :/


I use a telnet daemon library by someone called Dieter Weinberger. His telnet implementation is just good enough for me to have used with GroovyMud. I had to adapt it and fix a IO blocking bug that had been around in 2.0 for a while, but suffice to say its a fairly complete solution.

Here's the link to my fixed version .I also link to his site from mine. I got his permission to copy the codebase and release my own btw. It is also Mavenised.. instructions are on the site on how to use as a maven dependency too, if that sort of thing boats your float.


He has also done an OSGI version, and although I know next to nothing about OSGI I have heard good things about it.

[EDIT]

I also wrote a decorator class you (Kintar) can use if you want, here, as long as you keep my licensing in your code :D You might want to remove the filterchain object tho so it works without it.

[EDIT 2]

I too have been meaning to write an entire Telnet Library of my own, based on Deiters'. However the task seems insurmountable atm with all the other things going on atm. I have heard (mainly from comments on his own site) that his implementation is slightly 'wonky', but thats for another day. It does what I want it to do, and that is enough.
16 Aug, 2009, Barm wrote in the 10th comment:
Votes: 0
FWIW, I am working on the world's slowest progressing MUD in Python and wrote a state-based Telnet class from scratch here:

http://code.google.com/p/bogboa/source/b...

It's not feature complete but does NAWS, get terminal type, and a few more and should filter out what isn't directly supported from the data stream. The project is GPL but I wont lose any sleep if it helps someone write their own Telnet handler. I did add lots of commenting.
11 Sep, 2009, Vassi wrote in the 11th comment:
Votes: 0
flumpy said:
Kintar said:
Thanks for the input, guys. My preference would certainly be to use a library; I find a lot of odd programming tasks fun, but implementing telnet, I've discovered, isn't one of them. :P My problem comes from the fact that the server is being written in Java, though, and there's a shortage of telnet libraries for Java. All of the ones I've found are specifically targeted at being a client connection, which I find very odd since I've always considered telnet a peer-to-peer protocol, rather than a client/server protocol. :/


I use a telnet daemon library by someone called Dieter Weinberger. His telnet implementation is just good enough for me to have used with GroovyMud. I had to adapt it and fix a IO blocking bug that had been around in 2.0 for a while, but suffice to say its a fairly complete solution.

Here's the link to my fixed version .I also link to his site from mine. I got his permission to copy the codebase and release my own btw. It is also Mavenised.. instructions are on the site on how to use as a maven dependency too, if that sort of thing boats your float.


He has also done an OSGI version, and although I know next to nothing about OSGI I have heard good things about it.

[EDIT]

I also wrote a decorator class you (Kintar) can use if you want, here, as long as you keep my licensing in your code :D You might want to remove the filterchain object tho so it works without it.

[EDIT 2]

I too have been meaning to write an entire Telnet Library of my own, based on Deiters'. However the task seems insurmountable atm with all the other things going on atm. I have heard (mainly from comments on his own site) that his implementation is slightly 'wonky', but thats for another day. It does what I want it to do, and that is enough.


Eek, old thread. (sorry)

If you're working in Java you should look for some C# libs or code. I've used Java examples to do C# stuff before, my book on Algorithms is intended for Java actually (there are -none- for C#\.NET) but works mostly the same way with a few exceptions.

I made mine from a python source that Elanthis wrote for SourceMud. Somebody else here said it before, but the only modification I made was to add an event to the subnegotiation end so that support for option handling can be added piecemeal and completely separate from the core telnet switch. God bless events.
11 Sep, 2009, Scandum wrote in the 12th comment:
Votes: 0
Kintar said:
Any thoughts? For those of you who have written your own codebase, did you use a pre-built Telnet library, or did you have to implement your own, and how much did that influence your decision?


You could take a look at my Mud Telopt Handler snippet.
0.0/12