Compleate DC Protocol Documentation

Technical discussion about the NMDC and <a href="http://dcpp.net/ADC.html">ADC</A> protocol. The NMDC protocol is documented in the <a href="http://dcpp.net/wiki/">Wiki</a>, so feel free to refer to it.

Moderator: Moderators

Locked
Sid
Posts: 56
Joined: 2003-01-07 18:13
Contact:

Compleate DC Protocol Documentation

Post by Sid » 2003-02-02 16:13

I have put together a *near* complete protocol doc from all the other docs on the internet aswell as some of my own research. Check it out and let me know if i missed anything or if there are errors (including spelling :D)

Hope this helps someone!

http://1stleg.com/download/Documents/DC Protocol.rar
Sid

[email protected]
http://www.1stleg.com
[url=dcHub://Greed.1stleg.com]dcHub://Greed.1stleg.com[/url]

Sid
Posts: 56
Joined: 2003-01-07 18:13
Contact:

Correct Link

Post by Sid » 2003-02-02 16:15

Here is the working link for those who are to lazy to copy paste :D

http://1stleg.com/download/Documents/DC%20Protocol.rar
Sid

[email protected]
http://www.1stleg.com
[url=dcHub://Greed.1stleg.com]dcHub://Greed.1stleg.com[/url]

Gumboot
Posts: 22
Joined: 2003-01-15 20:08
Location: New Zealand

Post by Gumboot » 2003-02-02 18:15

Good job!

I hate to sound like I'm complaining, but the docs would be much easier to view if you put them on the web server individually (ie. not zipped or rar'ed) and put up a contents page that linked to each page. Or even better (IMHO) combine it all into one page with links at the top.

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-02-02 21:19

nice :)
looking good!

I took the liberty of correcting some errors and adding a few comments.
also I added formatting through css, now all commands and variables are fixed width (and colorized).

http://wza.digitalbrains.com/DC/doc/
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

ender
Posts: 224
Joined: 2003-01-03 17:47

Post by ender » 2003-02-03 02:45

<nick> is the user's username. This must not contain a space (the NMDC server converts any spaces to underscores and allows the login to proceed using the corrected username). XXX what's the max length of a username? are ascii-z allowed? /sed
The nickname length is limited by individual hubs - in my hub you can set it between 5 and 40 characters. The nickname can contain any character except for space, $ and | AFAIK.
(I'm not sure what the correct series of messages is if the server is full and a nick with a password is sent in the $ValidateNick. Should it be rejected immediately with $ValidateDenide? Or answer with a $BadPass?)
NMDC hub answers with $HubIsFull even beforet the nickname is sent. Other hub implementations usually wait until the nickname is validated and then decide whether to let the user in or to disconnect him.

You could also add $SR - passive search result to the client-server protocol spec. The format (as received by the hub) is:
$SR <nick1> <result><size> <free slots>/<total slots><hub name> (<hub IP>)<nick2>

= ASCII 5

<nick1> is the user who responded to the search
<result> is the search result
<nick2> is the user who searched

The search result should be sent to <nick2>, but without the <nick2> at the end.

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-02-03 20:31

ender wrote:The nickname can contain any character except for space, $ and | AFAIK.
hmm.. I did some testing.. and all characters I tried are fine in both DCH++ and nmdch. but the User Menu Item (custom menu's) did not copy the exact name, so I got "user is not online", both with the +userinfo (dch++) and some standard userinfo vbscript (nmdch). luckily the Kick function worked properly (again in both hubs).

maybe it would be wise to block all characters below 0x20.
ender wrote:You could also add $SR [snip]
will do
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

Dj_Offset
Posts: 48
Joined: 2003-02-22 19:22
Location: Oslo, Norway
Contact:

Post by Dj_Offset » 2003-02-22 20:59

I found some errors in the client-client description:
(ACTIVE FILE DOWNLOAD
----------------------
D = downloader
U = uploader
H = hub

D>H: $ConnectToMe <U's username> <D's IP and port>|
H>U: $ConnectToMe <U's username> <D's IP and port>|
U>D: Connection
U>D: $MyNick <U's nick>|$Lock <new lock with pk>|
D>U: $MyNick <D's nick>|$Lock <new lock with pk>|$Direction Download <anumber>|$Key <key for U's lock>|
U>D: $Key <key for D's lock>|

Should be:
U>D:$Direction Upload <anumber>|$Key <key for D's lock>|
(...)
D>U: $Send|
U>D: Data, in many chunks.
D>U: $Send| <- when 40906 bytes are sent, ask for more
Wtf? I've never seen this?
One single "$Send|" should be it!
I wrote QuickDC - A DC++ compatible client for Linux and FreeBSD.

ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

Post by ivulfusbar » 2003-02-23 02:08

if i remember correctly, ">" is not allowed in nicknames...
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

Phlebas
Posts: 1
Joined: 2003-04-07 11:33
Location: Paris
Contact:

Post by Phlebas » 2003-04-11 19:46

:D
Yeah
Consider Phlebas, who once was tall and handsome like you.

andlju
Posts: 27
Joined: 2003-02-28 12:58
Location: Stockholm, Sweden
Contact:

Post by andlju » 2003-04-13 11:12

First of all, thank you very much for this documentation! It's great!

Second, I wonder whether I can find a similar documentation of all (or some) extensions made to the protocol? I know DC++ has quite a few features that aren't mentioned in the document above, and I suppose there are a few hubs out there that also have their own set of features?

/Anders

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-04-13 13:46

The DC++ source includes an Extensions.txt file that tells about $Supports and the features that DC++ offers there.

andlju
Posts: 27
Joined: 2003-02-28 12:58
Location: Stockholm, Sweden
Contact:

Post by andlju » 2003-04-13 14:09

Well, well.. I knew I would get it someday for not browsing through the source.. thanks! :oops:

Locked