why send something before command sending ?

Posted by Narci on Tue 29 Dec 2009 08:42 AM — 17 posts, 66,989 views.

#0
I have a puzzle!
before I send a command,something had been sent?like "...mushclient..."
could it not been sent?
How do it?
help!
Amended on Tue 29 Dec 2009 08:44 AM by Narci
Australia Forum Administrator #1
Can you explain in more detail? Something like "...mushclient..."? What exactly? I don't understand the problem. Can you copy and paste output from the screen to explain in more detail?
Netherlands #2
My psychic powers divine that you are talking about the TELOPT 24, also known as TERMINAL-TYPE. This handshake was clearly negotiated when connecting, and the instance you are talking about was likely your client informing the mu* with a

IAC SB TERMINAL-TYPE NULL mushclient IAC SE


sequence. If you do not want to send this information, then you'll need to play a mu* that doesn't ask for it. Usually, they ask with good reason however, to more suitably tailor your playing experience to the capabilities of your client.

If you just wish to hide your clients identity, you can do that through Game->Configure->Output... (Alt+5), and then enter the new telnet terminal type there. Mind you, if the information is being requested, there usually is a good reason for it.
Amended on Tue 29 Dec 2009 12:27 PM by Worstje
#3
Thank you for Worstje!
But it doesn't resolve the problem.
I had done that like Worstje said.But it still send socket.
I had used "Wpe" to see the socket.
when a world connectted,it sent "FF FB 18 "(Binary) first,
then "FF FB 1F",
then "FF FA 1F 00 50 00 14 FF F0 ","50"(binary)="P"(ascii).
because I enter the new telnet terminal type "p".
So the problem is when connecting,three socket been sent.can three socket not been sent?
I had find when the first command sending,two socket been sent also,but another commands is sent it is no.
I look forward to help!
Netherlands #4
I can't really make much sense out of your post, Narci. Sorry. :(

Can you go to Edit and select Debug Packets (Ctrl+Shift+F11) before connecting? That way MUSHclient spits out information about the packets it sends and receives. You can then copy that here or on a pastebin so we can have a better look at what you are referring to.

I'll make an attempt with the info you've given none the less. (You only give me half the information so I need to make a bunch of assumptions.)

Your client sends: IAC WILL NAWS (see RFC1073: http://www.ietf.org/rfc/rfc1073.txt)
It later on sends: IAC SB NAWS 00 50 00 14 IAC SE.
This indicates the handshake must have been succesful.

WIDTH = 00 50 (16-bit hex) = 80 characters.
HEIGHT = 00 14 (16-bit hex) = 20 characters.

This is all according to the specifications and exactly as MUSHclient ought to behave as a telnet client. (Telnet being the protocol pretty much all MUD servers use under the hood.)

If you do not want to send the information in question, you might want to go to Game->Configure->Output (Alt+5), and deselect the 'Negotiate about window size' option, although I am not sure how much that will do as I never used that setting myself.

If you really do not want to send anything, you can likely trick MUSHlient with a plugin that removes any handshake offers you do not like and prevent MUSHclient from acting on them.

But most of all, -WHY- do you want this? I get the feeling you have a problem and are trying to fix it at the wrong place, so please explain more about your situation.
#5
I am chinese.So my english is not well.
I have a game that must be sent a Authentication socket before any socket sent.
I also use zmud.It can send Authentication.because it sent a Authentication then send the socket what I have refered at above.but i want use mushclient.
Netherlands #6
Can you use the Connect Text in the world configuration screen? To my knowledge the stuff there is send immediately after connecting.
Australia Forum Administrator #7
Can you please use Edit menu -> Debug packets?

Turn that on before connecting. When I did that it did not send any FF FB 18.

The sequence FF FB 18 is:


IAC WILL TELOPT_TERMINAL_TYPE


It replies that specifically if the server sends:



FF FD 18

IAC DO TELOPT_TERMINAL_TYPE


So you need to see from the packet debug if the server is sending that first.


Quote:

... then "FF FB 1F" ...


This is IAC WILL TELOPT_NAWS. That is automatically sent if you have "Negotiate about window size" checked in the output window configuration. To stop that, uncheck that box.


Quote:

... then "FF FA 1F 00 50 00 14 FF F0 "


This is the terminal type, because you agreed to send it, the server asked for it, and this is the response.

[EDIT]

This is the window size (0x50 is 80 columns, and 0x14 is 20 lines). Since you had "negotiate about window size" set, it sent the window size.

Quote:

I have a game that must be sent a Authentication socket before any socket sent.


You can make a script file and put in the "on connect" function there (see the scripting window configuration) or make a plugin and use OnPluginConnect callback function. These will send things before anything else, as follows:

  • If you have "auto connect" on, it sends your name and password
  • If you have "Connect Text" (see connecting window) it sends that next
  • If you have "negotiate about window size" checked, it sends FF FB 1F.
  • It then calls the "world script file 'on connect' function", if any
  • It then calls the OnPluginConnect function in all installed plugins, if any.


Amended on Fri 01 Jan 2010 03:33 AM by Nick Gammon
Australia Forum Administrator #8
This isn't a bug, by the way. It is sending what it is supposed to send.
#9

IncomingµÄÊý¾Ý°ü: 1 (39 ×Ö½Ú)

......CONNECTTED   ff fd 18 ff fd 1f 43 4f 4e 4e 45 43 54 54 45 44
..VER 961 963 33   0d 0a 56 45 52 20 39 36 31 20 39 36 33 20 33 33
d37b3..            64 33 37 62 33 0d 0a

Sent µÄÊý¾Ý°ü: 1 (3 ×Ö½Ú)

...                ff fb 18

Sent µÄÊý¾Ý°ü: 2 (3 ×Ö½Ú)

...                ff fb 1f

Sent µÄÊý¾Ý°ü: 3 (9 ×Ö½Ú)

....P....          ff fa 1f 00 50 00 14 ff f0

IncomingµÄÊý¾Ý°ü: 2 (6 ×Ö½Ú)

......             ff fa 18 01 ff f0

Sent µÄÊý¾Ý°ü: 4 (16 ×Ö½Ú)

....mushclient..   ff fa 18 00 6d 75 73 68 63 6c 69 65 6e 74 ff f0

Sent µÄÊý¾Ý°ü: 5 (14 ×Ö½Ú)

	VER 5f4b2b7..     09 56 45 52 20 35 66 34 62 32 62 37 0d 0a

IncomingµÄÊý¾Ý°ü: 3 (37 ×Ö½Ú)

NOTIFY .........   4e 4f 54 49 46 59 20 c4 e3 cb f9 ca b9 d3 c3 b5
................   c4 bf cd bb a7 b6 cb b0 e6 b1 be b2 bb d5 fd c8
.....              b7 a3 a1 0d 0a
Amended on Fri 01 Jan 2010 03:22 AM by Nick Gammon
#10
The bold is the question.
Australia Forum Administrator #11
See near the very start? (incoming packet 1) ...


......CONNECTTED   ff fd 18


The server is asking: IAC DO TERMINAL_TYPE


The client replies (as it should):


IAC WILL TERMINAL_TYPE (ff fb 18)


The server asks if it can query the terminal type, and the client says "yes you can".

The server also sends (incoming packet 1):


IAC DO NAWS (ff fd 1f)


The client replies:


IAC WILL NAWS (ff fb 1f)


The client then sends the window size:


IAC SB NAWS 80 20 IAC SE (ff fa 1f 00 50 00 14 ff f0)


The server then sends (incoming packet 2):


IAC SB TERMINAL_TYPE 01 IAC SE (ff fa 18 01 ff f0)


That is asking for the terminal type since the client has agreed to send it.

The client replies:


IAC SB TERMINAL_TYPE 00 mushclient IAC SE (ff fa 18 00 6d 75 73 68 63 6c 69 65 6e 74 ff f0)


The telnet negotiation is working as it should. However I think you will find that if you do as I suggest and put in any preliminary authentication in the "on connect" it will be done before this negotiation.
Amended on Fri 01 Jan 2010 03:24 AM by Nick Gammon
#12
I understand the question is handshake now.
In fact, do not need to shakehands.
Be able to remove the handshake?
how do it?
Netherlands #13
*gasp* I suggested that too before you jumped in on the topic! ;)

(Although it is always good to have the same thing suggested and thus confirmed by the author of the software as a good solution!)
Australia Forum Administrator #14
Narci said:

In fact, do not need to shakehands.
Be able to remove the handshake?


I don't understand why you want to do this. The server is asking for a terminal type, so it must be able to handle the response. Same with NAWS. You say it works with zMUD ... does zMUD not send any response when queried for the terminal type? That sounds hard to believe.

Did you try my suggestion of doing an OnConnect function? If you did, did it work or not? I am trying to help you and have suggested twice that if you write a script function to be called at connect time, it should send what you want before all this other negotiation. I would appreciate it if you indicate you understood this, and are planning to try it, and if not, why not.
Amended on Fri 01 Jan 2010 03:45 AM by Nick Gammon
Australia Forum Administrator #15
Worstje said:

But most of all, -WHY- do you want this? I get the feeling you have a problem and are trying to fix it at the wrong place, so please explain more about your situation.


I strongly agree with Worstje here, I think you are fixing the wrong problem. Slow down, and carefully analyze what is going wrong with the authentication. So far, what we have seen is what you expect to see.
#16
Thank you for the help! The problem has now been resolved.