Please check out The Fairy Garden MUSH !

Member Discussions

terms



[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]


1. \r\n in C Tue Jan 27, 2004 [3:27 PM]
DaShiVa
DaShiVa.LunATiC@verizon.net
member since: Aug 10, 2001
Reply
I know this topic has been done to death several times over, but I cant seem to locate the discussion, and try searching for \ in google and you'll have no luck, as it seems to discard the \'s.
Anycase, I've finally gotten around to sorting out the \r\n's in the code, for sending to chatacters.
From memory, the \n\r's should be changed to \r\n's, however:
I have heard that some clients? telnets? (not sure) prefer "\n\r" to "\r\n", and, for the sakes of economising the code a little, as all text is already parsed on teh way out, I've decided to change it all to simply "\n", and when text is sent to a player, to insert/add the "\r" on the fly.
I can make it a config option for players to choose which wat it comes, but for logins i'll need a default, and I was mainly wondering if "\r\n" was the most compatable...
All datafiles can be written with a "\n", on the linux filesystem, I don't need the "\r", and, while on the topic, I think I'm still using the fread functions supplied with stock godwars, do they read a newline "as is" (ie '\n') or do they add a "\r" or anything?

I know I could find this out with a little internal code to print out the details, but it won't tell me what is best for what client, and perhaps posting here will help a few others too...




2. RE: \r\n in C Tue Jan 27, 2004 [4:32 PM]
muir
Email not supplied
member since: Sep 14, 2003
In Reply To
Reply
Here's the RFC: http://www.faqs.org/rfcs/rfc854.html

As an aside, since the arcane times of the invention of the Telnet protocol, it would make things easier if \n was treated as a CR LF sequence, positioning the cursor to the left margin of the next line (for formatting purposes) and an actual \r\n was used as a command/sequence terminator. Possibly :)

.


3. RE: \r\n in C Wed Jan 28, 2004 [5:20 AM]
Genghis
Email not supplied
member since: Mar 24, 2000
In Reply To
Reply
Command sequence terminator? Isn't that what the Telnet GA (go ahead) signal is supposed to be used for?

Keyboard missing. Think F1 to continue.


4. RE: \r\n in C Wed Jan 28, 2004 [6:35 AM]
rameti
Email not supplied
member since: Aug 4, 2001
In Reply To
Reply
No. Actually the telnet GA was designed for communication over a serial link in which only one direction could use the line at a time. It is simular to XON/XOFF and other handshaking methods used over serial links. Because it is generally useless to your common mud, it has been reused as a nice way to tell the mud client where the prompt ends, so if it supports it, it can swallow up the prompt instead of leaving it on the screen after each command/message.


5. RE: \r\n in C Wed Jan 28, 2004 [2:47 PM]
valnir
valnir@lotn.dyndns.org
member since: Jan 20, 2004
In Reply To
Reply
I have to honostly say that we use '\n\r' on our mud. We do it in that order because '\n' does a newline, but for some reason doesn't always force the return to begining of line. The '\r' is used to return to the begining. So we do the '\n' first to ensure that nothing on the current line is overwritten after the '\r' is passed.


6. RE: \r\n in C Wed Jan 28, 2004 [5:48 PM]
Tyche
Email not supplied
member since: Apr 4, 2000
In Reply To
Reply
rants
bitches
moans

For more rants, bitches and moans just ask. :-)



The Sourcery - http://sourcery.dyndns.org
TeensyMud - http://teensymud.kicks-ass.org
"A man can receive nothing, except it be given him from heaven."


7. RE: \r\n in C Fri Jan 30, 2004 [2:39 AM]
Kastagaar
Email not supplied
member since: Jul 29, 1999
In Reply To
Reply
More! More!

I wholeheartedly agree.

When writing my personal Telnet server, I scoured the RFCs for extensions that just might be implemented somewhere.

Most aren't. In fact, today's Telnet is a shadow of what it once was. For an example of the power that Telnet should command, just take a peek at RFC732, a complete data entry application. There's also support for authentication, encryption, screen sizing, automatic reconnection, and so on. That Telnet is extensible has also been shown, with the likes of MXP, MCP, MSP and MCCP. Although, for some bizarre reason, Telnet is used only as an enabling layer for these protocols, rather than as part of the actual protocol. That is a shame.

The other shame is that in clients that I have looked at, the most that is supported is STATUS, NAWS and TERMINAL_TYPE.

Oh yeah, and some half-hack of the VT100 protocol. Oh to be able to display windowed text in something other than xterm.
There are two ways of constructing software: to make it so simple that there are obviously no errors, and to make it so complex that there are no obvious errors.


8. RE: \r\n in C Sun Feb 1, 2004 [12:50 AM]
Tyche
Email not supplied
member since: Apr 4, 2000
In Reply To
Reply
Just noticed this and went to check it out. Plays well with puTTy too. It's a start at least.

Once client authors have crawled up slopes of Telnet and VT100, the power of curses becomes suddenly available as well.

A good test for a mud client is to check if they can log into a shell and run midnight commander. We're not asking for much here at all. *points accusing finger at mud client authors*

I know... go write it yourself. ;-)







The Sourcery - http://sourcery.dyndns.org
TeensyMud - http://teensymud.kicks-ass.org
"A man can receive nothing, except it be given him from heaven."


9. RE: \r\n in C Sun Feb 1, 2004 [3:13 AM]
scandum
Email not supplied
member since: Aug 30, 2002
In Reply To
Reply
I've seen better implementations :)
http://tintin.sf.net - Kickin It Old Skool since 1992


10. RE: \r\n in C Sun Feb 1, 2004 [3:25 AM]
Tyche
Email not supplied
member since: Apr 4, 2000
In Reply To
Reply
I think you might have and I certainly won't flame you if you post the addie to provide an additional example. :-)
The Sourcery - http://sourcery.dyndns.org
TeensyMud - http://teensymud.kicks-ass.org
"A man can receive nothing, except it be given him from heaven."


11. RE: \r\n in C Sun Feb 1, 2004 [12:49 PM]
muir
Email not supplied
member since: Sep 14, 2003
In Reply To
Reply
Ahm.. I just thought of something. I've been under the happy delusion that all clients *send* a \r\n sequence, even if they don't quite know how to properly display the information the server sends back. Does anyone know of any client that sends one of the variations as its endline (command-terminating) sequence instead of the proper one?

.


12. RE: \r\n in C Mon Feb 2, 2004 [12:26 AM]
Tyche
Email not supplied
member since: Apr 4, 2000
In Reply To
Reply
Does anyone know of any client that sends one of the variations as its endline (command-terminating) sequence instead of the proper one?

There are two the proper EOL sequences, CRLF and CRNUL.

c3270 and tn3270 send the CRNUL sequence as probably do most telnet applications written to support 3270 (its descendents) and SNA devices. Which probably encompasses everything written for IBM's operating systems, clones and competitors excepting AIX and OS/2. It would be my best guess that one might also find some Apple MacIntosh telnet clients sending the CRNUL sequence.

The Sourcery - http://sourcery.dyndns.org
TeensyMud - http://teensymud.kicks-ass.org
"A man can receive nothing, except it be given him from heaven."




[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]