What's needed for MSN Messenger to go online

I previously discussed getting MSN Messenger to connect locally... Now that we have it connecting to a local server, it's time to make it connect.

<- VER 139 MSNP2 CVR0
-> VER 139 MSNP2
<- INF 140
-> INF 140 MD5
<- USR 141 MD5 I jd@hotmail.com
-> USR 141 MD5 S <Challenge>
<- USR 142 MD5 S 8f03d9aaca85a468f1625c10652c3c91
-> USR 142 OK jd@hotmail.com JD
<- SYN 143 0
-> SYN 143 0
<- CHG 144 NLN
-> CHG 144 NLN
<- CVR 145 0x0409 win 4.0 i386 MSMSGS 1.0.0863
-> CVR 145 1.0.0864 1.0.0864 1.0.0863 http://messenger.hotmail.com/mmsetup.exe http://messenger.hotmail.com
<- OUT

The messages are split by a carriage-return/line-feed combination (\r\n) and every command (except OUT) requires a transaction ID, which the server will return with a reply.

VER - Negotiates common protocol dialect between client and Server.

In MSN Messenger 1.0 it sends MSNP2 and CVR0. I'm unsure if CVR0 is an actual protocol, or if it's just relaying what Client Version it is. I replied back with MSNP2, That's the protocol I'm going to be implementing.

INF - Request set of supported authentication protocols from the server.

Here we are replying with MD5, indicating that we only support MD5 authentication.

USR - Authenticates client with server, possibly in multiple passes.

The client selects an authentication package found in the INF reply, followed by I (Initial), and then the username of the user attempting to authenticate. In MSN Chat v1.0, only *@hotmail.com email addresses may connect.

All of the next USR commands should use the same authentication package, and S (Subsequent) before sending any parameters. The parameters are implementation dependent, and may involve many messages from both the client, and the server.

The final USR message should be OK, followed by the username specified in the INF, and a friendly name that the user has previously set.

SYN - Initiates client-server property synchronization.

Here the client is telling the server it has contact list 0 (empty) and the server responds with a 0 indicating that the client contact list 0 is up to date. This avoids us having to re-download the list.

CHG - Sends a client state change to the server.

The client sends NLN (Online) to the server indicating it wants to show other users it's state is online. The server responds with NLN showing the new state of the client.

CVR - Client Version

This one doesn't appear to be documented in the Draft, however it indicates to the server which client is being used. The server replies with client Minimum/Recommended versions of the software, a download link, and an informational link.

OUT - Ends a client-server Session.

This simple command is telling the server that the client is going to log off. The server does not reply, but simply closes the active connection.

MSN Messenger 1.0 is now online.





Comments

Popular posts from this blog