Archived

This topic is now archived and is closed to further replies.

DycewareInd

Telnet With C++ Help

Recommended Posts

I''m wanting to make a MUD to run via Telnet and I''m having difficulty getting started. I realize there are plenty of MUD code bases out there, but this is more a learning experience than anything else, so I''d like to do it all my own. I''ve already constructed a complete "single player mud" if you will, meaning the only (hehe, yeah) thing I need to learn is how to get it up and operating with Telnet. I''m using Dev-C++ 4.0 (mingw compiler, right?) so there might be special circumstances (there have been before). Basically I could use beginners tutorials for someone with working knowledge of C++. No DirectX or any windows stuff, just console apps. I really just need a place to get started. Thanks!

Share this post


Link to post
Share on other sites
Telnet is simple, basically anything you type in the telnet window is transmitted to the server. So, instead of reading input from stdin, you read it from a socket.

There''s a few complexities with telnet, but for a MUD, you can probably ignore them. Mostly they relate to non-printf type displays (where you draw the whole screen rather print out lines of text) or colour displays.


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
though using ascii control codes, are pretty easy as long as you expierment a bit. i highly suggest creating a wrapper class if you plan on using any of the telnet control codes (ie move cursor). since they are sent as ascii chars (check any ascii char sheet). colors are a bit more complex, and you will have to view the telnet standard to see how to handle it.

Share this post


Link to post
Share on other sites
Socket- implying which headers/libs? Winsock? If so, ok- but after reading some of the stuff on G''Dev''s resources page Winsock didn''t seem to deal so much w/ Telnet. I can pick up concepts fine, I just have trouble w/ using the right files, initializing properly, etc. Especially with DevC++ 4.0.

Share this post


Link to post
Share on other sites
Ok, first point - there is nothing ''dealing with telnet'' really. You just use sockets/Winsock. Telnet is just plain 7-bit ascii sent through a socket, with occasional telnet commands embedded in them. Most MUDS (wrongly) ignore all these commands. It would be beneficial to at least be able to respond to the client that you don''t support whichever feature they are asking for. Do a search for telnet option negotiation and so on. Warning - to do it properly requires writing a very awkward state machine. I asked about it on here a month or two back and no-one had any suggestions on the best way to approach it.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

Share this post


Link to post
Share on other sites
Bummer- Dev-C++ 4.0 is so difficult. Here is an even dumber question though (eventually I''m just gonna take this to the beginners forum, ;-) Ok- I understand that in order to use wsock.h I need to also have the library wsock.lib or something like that. Well with Dev, I can''t find any .lib files. Only .a files. Are they the same thing? When I Add the .a files to my project I get linking errors. Totally lost and stuck.

Share this post


Link to post
Share on other sites