Problem with loggin into server
Moderator: Moderators
Problem with loggin into server
Hello im writening a DC client but 1 have one problem with loggin in.
This is how I try to do this:
H-Hub C-Client
1)HUB->Lock
2)C->Key
3)H->HubName.........
4)C->ValidateNick .........
5)H-><Hub-Security> ............
Thats all , hub dont send any more messages.But when i write a small DC Hub and connected to it with DC++ it seems a little diferend:
1)H->Lock
2)H->HubName.........
3)H-><Hub-Security> ............
4)C->Key
5)C->ValidateNick .........
So i tryed to do the same with my client but with no results..
If samone can help me it would be nice , and i have 2 questions :
1)Why everyhub sends <Hub-Security>........... ?
2)Whitch ports uses clients with client-to-client connection ?
My lock->key function works with no problems , so i dont know what should I change.
Sorry for my English
GreetZ
Rave
This is how I try to do this:
H-Hub C-Client
1)HUB->Lock
2)C->Key
3)H->HubName.........
4)C->ValidateNick .........
5)H-><Hub-Security> ............
Thats all , hub dont send any more messages.But when i write a small DC Hub and connected to it with DC++ it seems a little diferend:
1)H->Lock
2)H->HubName.........
3)H-><Hub-Security> ............
4)C->Key
5)C->ValidateNick .........
So i tryed to do the same with my client but with no results..
If samone can help me it would be nice , and i have 2 questions :
1)Why everyhub sends <Hub-Security>........... ?
2)Whitch ports uses clients with client-to-client connection ?
My lock->key function works with no problems , so i dont know what should I change.
Sorry for my English
GreetZ
Rave
Well this works for me
You're including the | and $ right? And your name in ValidateNick right? These are the only things that *should* be messing it up.....
Anyways if that didn't help, here's the rest of the answers to your q's...
The hub sends <Hub-Security>.... just to tell the user what's going on. It's a main chat message (e.x <Hub-Security> Your name is registered, please supply the password.|$GetPass| )
The client to client connection port vaires. NMDC uses 412 by default and DC++ 1412 (used to)...it doesn't matter though...it's the port you're listening for connection requests and search results (active mode only).
Code: Select all
H -> $Lock <something>|
C -> $Key <decodedfromlock>|$ValidateNick <myname>|
Hub may send if registered
H -> $GetPass|
C -> $MyPass <mypass>|
H -> $LogedIn <yourname>|$Hello <yourname>|
^ (maybe $Hello is before $LogedIn but it doesn't matter)
otherwise it should send to everybody (including yourself)
H -> $Hello <yourname>|
Anyways if that didn't help, here's the rest of the answers to your q's...
The hub sends <Hub-Security>.... just to tell the user what's going on. It's a main chat message (e.x <Hub-Security> Your name is registered, please supply the password.|$GetPass| )
The client to client connection port vaires. NMDC uses 412 by default and DC++ 1412 (used to)...it doesn't matter though...it's the port you're listening for connection requests and search results (active mode only).
Re: Problem with loggin into server
in my experience, it doesn't really matter.r4v3 wrote:1)HUB->Lock
2)C->Key
3)H->HubName.........
4)C->ValidateNick .........
5)H-><Hub-Security> ............
as soon as you get the Key, reply with the $Lock+$ValidateNick in one packet. after that, send the $MyINFO when you are logged in (i.e. get the $Hello). if I'm not mistaken, the whole thing is rather state-less. (note that you may get a $ValidateDenide or a $GetPass, after which you'll have to reply appropriately)
afaik this is just a chat message... the neo-modus guys chose to call the sender Hub-Security.r4v3 wrote:1)Why everyhub sends <Hub-Security>........... ?
this depends on the $ConnectToMe's, and may be any one of the 64k ports.r4v3 wrote:2)Whitch ports uses clients with client-to-client connection ?
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)
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)
ehe.. swap the `Key' and `Lock' in my post :-/
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)
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)
Similer Problem
I have had a similer problem to that. Most of the time my client logs in wiht out a problem but every now and again it hangs and the hub tempbans me. best i can come up with is there is a bug in the nmdc hub software.
-Sid
-Sid
Re: Similer Problem
Happens to me aswell.Sid wrote:I have had a similer problem to that. Most of the time my client logs in wiht out a problem but every now and again it hangs and the hub tempbans me. best i can come up with is there is a bug in the nmdc hub software.
-Sid
Indeed I noted too some dysfunctions in the routine of luke-jr. I
preferred the routine of SuxXx which is exact especially in the
calculation of the bits shift.
Protocol by SuxXx coming with opendcd:
http://opendcd.sourceforge.net/
preferred the routine of SuxXx which is exact especially in the
calculation of the bits shift.
Protocol by SuxXx coming with opendcd:
http://opendcd.sourceforge.net/
Its ma again , i have the same problem as 2 they ago
When (H - hub , C - client)
H $Lock ........|
C $Key ..........|
H $HubName........|
C <do nothing>
H <HubSecurity>.................|
C <do nothing>
and this is all , hub dont send mi $Hello ....|
Me lock->key algoritm is ok (checked with DC++)
This problem is only with Neo Modus hub Software ,rest (except few others) login me normally.
Im trying to fix this for 3 days but i doesnt work
Im looking for some help...
Hub doesnt ban mi it just disconnect (exactly i dont know is it disconnecting or just sending still the same value about 6500)
Im writenig in Java (SDK 1.4)
I dont know C++ but i heared that string "abc" in java is
[a][c] but in c++ is [a][c][0] , maybe this is the problem ?
And one more question is this difference with :
send("abc|");
send("def|");
AND
send("abc|def|");
Uff thats all
When (H - hub , C - client)
H $Lock ........|
C $Key ..........|
H $HubName........|
C <do nothing>
H <HubSecurity>.................|
C <do nothing>
and this is all , hub dont send mi $Hello ....|
Me lock->key algoritm is ok (checked with DC++)
This problem is only with Neo Modus hub Software ,rest (except few others) login me normally.
Im trying to fix this for 3 days but i doesnt work
Im looking for some help...
Hub doesnt ban mi it just disconnect (exactly i dont know is it disconnecting or just sending still the same value about 6500)
Im writenig in Java (SDK 1.4)
I dont know C++ but i heared that string "abc" in java is
[a][c] but in c++ is [a][c][0] , maybe this is the problem ?
And one more question is this difference with :
send("abc|");
send("def|");
AND
send("abc|def|");
Uff thats all
you must send $ValidateNick after the $Key, after that, the hub will either answer with $ValidateDenide (the nickname is taken or it contains invalid characters), $GetPass (the nickname is password-protected), or $Hello.
BTW: there are two open-source Java clients out there already, you can learn from them: JavaDC and JavaOpenDC.
BTW: there are two open-source Java clients out there already, you can learn from them: JavaDC and JavaOpenDC.
Read another line from the hub - this is what I get if I connect to a hub with telnet (without sending anything):
As you see, $Lock, $HubName and the chat message are sent immediately (Luke-jr's hub is just a hacked version of the Neo-modus hub - it behaves the same).
Code: Select all
$Lock a?Kl0(@2X\nk(=?\@Lx;k+znDdA)AD,5+zubQnys.cbqO>bvy+r'C1IjE5.J]13gHmFNIV3Jv+ Pk=JIm4@X+I'J%Vuik^|$HubName Test|<Hub-Security> This hub is running version 1.0.25 of Luke-Jr's DC Hub (1500 max) Software.|||||
I do this exactly as u wrote but this f**** neo-modus hubs dont send me $Hello , they are closing connection(only neo - modus hubs) , but they dont ban me
I have next questions :
1)Each command must ends with "|" , but how should end whole message to hub for example
$abc|$def| ?
2)Does it difference between
$abc|
$def|
And
$abc|def| ?
Maybe hubs disconnects me beacouse Java and C++ sockets are different ? (I so DC clients in Java...)
If samone is programming in Java(SDK) please help
PS Did u all have as many problems as I with "stupid" client -> server communication ?
I have next questions :
1)Each command must ends with "|" , but how should end whole message to hub for example
$abc|$def| ?
2)Does it difference between
$abc|
$def|
And
$abc|def| ?
Maybe hubs disconnects me beacouse Java and C++ sockets are different ? (I so DC clients in Java...)
If samone is programming in Java(SDK) please help
PS Did u all have as many problems as I with "stupid" client -> server communication ?
Ive done dc-programming in java, no problems whatsoever. Dont worry abouts sockets being different, they arent.r4v3 wrote:so now i really dont know what shoul i fix...
I written small DC+ hub - it shows everything what clients sends and i connected to it with my DC and DC++ and everything was the same.
I thing that it must be same problem with sockets so i should find someone who knows Java...
One thing to look our for though, mitht be character encoding. Java supports lots of differents ones, so when you are converting to bytes to send onto the network, it might be you are using a default encoding of ascii, which wont work. It should be "iso-8859-1" instead. Default encoding is different depending on locale on your computer I think.
Windows-1252 is the Western Windows codepage. It differs from ISO-8859-1 in chatacters with codes from 128 to 160 (they're used in Win1252 but not in iso). Anyway, I'm only saying that this codepage should be used, since most people using DC use it. The only real difference will be seen with users who use special characters in their nicknames (to make them look stupid)... In theory, any single-byte codepage which has codes 0-127 the same as US-ASCII should work.