Valhalla Legends Forums Archive | Battle.net Bot Development | I think I'm doing something wrong for WC3

AuthorMessageTime
Myndfyr
Unfortunately, I can't get WC3 to run on my laptop, and that is the only machine I can packetlog on (as crappy as it is, I still only use dialup).

I'm using the same connection algorithm (I'm using the NLS) for Starcraft, BW, WC2, and Diablo 2 Classic as I am for WC3. However, I'm getting two errors when trying to connect with WC3: the BNLS VerifyServer message returns negatory, and the 0x3A message to Battle.net is returning 0x203 (invalid password).

Are the servers for Warcraft III separate? I've just been connecting to useast.battle.net.

Thanks in advance!

--Rob
November 5, 2003, 11:12 PM
Skywing
[quote author=Myndfyre link=board=17;threadid=3435;start=0#msg27597 date=1068073943]
Unfortunately, I can't get WC3 to run on my laptop, and that is the only machine I can packetlog on (as crappy as it is, I still only use dialup).

I'm using the same connection algorithm (I'm using the NLS) for Starcraft, BW, WC2, and Diablo 2 Classic as I am for WC3. However, I'm getting two errors when trying to connect with WC3: the BNLS VerifyServer message returns negatory, and the 0x3A message to Battle.net is returning 0x203 (invalid password).

Are the servers for Warcraft III separate? I've just been connecting to useast.battle.net.

Thanks in advance!

--Rob
[/quote]
As UserLoser pointed out, you must use SID_AUTH_ACCOUNT* with NLS 1 and above.

BNLS's implementation of the server signature checker is correct, so it's likely that you're giving it an invalid parameter.

Note that you should provide the server IPv4 address in network byte order.
November 5, 2003, 11:38 PM
Myndfyr
So then, this is the order I'm getting through the BNLS specs and what you told me. Is this right?

(some other BNLS commands like 0x0e and 0x0f, I can't remember what else)
BNCS 0x50
BNCS 0x25 (on request)
BNCS 0x51
BNLS 0x02
BNCS 0x53
BNLS 0x03
BNCS 0x54
BNCS *possibly* 0x57

Is that right? I don't believe I'm using *any* of those packets right now, except 0x50, 0x25, and 0x51.

Thanks for the help!

--Rob
November 6, 2003, 12:33 AM
Freeware
Verifying a Server signature is OPTIONAL btw
If you need some source help, I believe Craz3d posted some working BNLS Warcraft III source code, search.
November 6, 2003, 3:14 AM
CrAz3D
You beleive right. It also has my Username//Password//CDKey.
http://crazedmind.net/vb/bnls.zip
November 6, 2003, 4:16 AM
Skywing
[quote author=Freeware link=board=17;threadid=3435;start=0#msg27649 date=1068088458]
Verifying a Server signature is OPTIONAL btw
If you need some source help, I believe Craz3d posted some working BNLS Warcraft III source code, search.
[/quote]
Note that it's best to verify the signature to ensure that the Battle.net server you're connecting to is really what it claims to be, even though it's "optional".
November 6, 2003, 4:41 AM
Maddox
[quote author=Skywing link=board=17;threadid=3435;start=0#msg27675 date=1068093719]
[quote author=Freeware link=board=17;threadid=3435;start=0#msg27649 date=1068088458]
Verifying a Server signature is OPTIONAL btw
If you need some source help, I believe Craz3d posted some working BNLS Warcraft III source code, search.
[/quote]
Note that it's best to verify the signature to ensure that the Battle.net server you're connecting to is really what it claims to be, even though it's "optional".
[/quote]

I used to verify it but it BNLS would sometimes return false even if the server was valid. I believe you said this was a battle.net bug, Skywing.
November 6, 2003, 6:51 AM
Kp
[quote author=Maddox link=board=17;threadid=3435;start=0#msg27683 date=1068101501]
[quote author=Skywing link=board=17;threadid=3435;start=0#msg27675 date=1068093719]
Note that it's best to verify the signature to ensure that the Battle.net server you're connecting to is really what it claims to be, even though it's "optional".
[/quote]I used to verify it but it BNLS would sometimes return false even if the server was valid. I believe you said this was a battle.net bug, Skywing.[/quote]Although it is presently optional, making it mandatory would be a great and cheap way to trip up clients like yours, Maddox. Just make the server fail 1/(large number) attempts, and if anyone proceeds after the signature is wrong, ban them. War3 and strict emulations of it will have given up when the signature was bad, so only clients which ignored it proceed.
November 6, 2003, 3:50 PM
Skywing
[quote author=Maddox link=board=17;threadid=3435;start=0#msg27683 date=1068101501]
[quote author=Skywing link=board=17;threadid=3435;start=0#msg27675 date=1068093719]
[quote author=Freeware link=board=17;threadid=3435;start=0#msg27649 date=1068088458]
Verifying a Server signature is OPTIONAL btw
If you need some source help, I believe Craz3d posted some working BNLS Warcraft III source code, search.
[/quote]
Note that it's best to verify the signature to ensure that the Battle.net server you're connecting to is really what it claims to be, even though it's "optional".
[/quote]

I used to verify it but it BNLS would sometimes return false even if the server was valid. I believe you said this was a battle.net bug, Skywing.
[/quote]
I've seen this happen with a frequency of far less than once 100 events (and I've not seen it happen for the past few months, now, come to think of it). Given that the official client also gives up under these conditions, it would be a good idea for yours to do so as well.
November 6, 2003, 4:52 PM
Freeware
I never said you should not verify the server, I just said thats probably not your reason for the failure to login. Let me restate it: Verification of the server signature is optional, but you should do it anyway.
November 6, 2003, 11:39 PM
Myndfyr
Thanks for the help fellas. Now here's my next problem - when I resolve the server (useast.battle.net), I get back a list of about 10 IP addresses. I don't need to worry about it when connecting (because .NET uses the IPEndPoint class), but if I want to verify the server, which IP address do I pick?
November 7, 2003, 12:21 AM
K
The one you connected to? If you're using a TcpClient to connect, don't use the Connect() method that accepts a string as the hostname, resolve the hostname first, and then use the Connect() method that accepts an IPEndPoint. Now you know which one you've connected to.
November 7, 2003, 12:49 AM
Myndfyr
I'm not using a TcpClient, I'm using the Socket straight-up. I use an IPEndPoint pointing to useast.battle.net:6112.

I'll modify this post when I get home later with the code in front of me.
November 7, 2003, 3:20 AM
Adron
You should be able to somehow query which remote address you are currently connected to.

Using the regular socket APIs, the function is called "getpeername". Look for something similar in what you use.

TcpClient.Client.RemoteEndPoint seems to be it.
November 9, 2003, 1:26 PM

Search