Valhalla Legends Forums Archive | Battle.net Bot Development | Connecting with BNLS

AuthorMessageTime
EviL_MarinE
Hey.

I Decided i want my bot to connect with bnls first of all, now i need some help there.

Its "bnls.valhallalegends" for server yes?
And its port "9367" yes?

Well if they are both correct, then it shud connect:
[code]
Private Sub mnuConnect_Click()
Display ChatRoom, True, True, vbYellow, "Connecting To " & frmLogin.BnlsServer
        frmMain.bnlsSocket.Close
    frmMain.bnlsSocket.Connect frmLogin.BnlsServer, 9367
End Sub
[/code]

"frmMain.bnlsSocket.Connect" Bit makes it connect (duhh)
So here it is:
[code]
Private Sub bnlsSocket_Connect()
Display frmMain.ChatRoom, True, True, vbGreen, "Connected to BNLS!"
    With PBuffer
        .InsertNTString "IllusionBot"
        .SendBNLSPacket &HE
    End With
End Sub
[/code]

But it doesnt start to connect, have i gone somewhere wrong with my bnls?
October 24, 2004, 11:12 AM
UserLoser.
Try using bnls.valhallalegends.com
October 24, 2004, 4:15 PM
shadypalm88
[quote author=EviL_MarinE link=topic=9297.msg85898#msg85898 date=1098616379][quote]
Private Sub mnuConnect_Click()
Display ChatRoom, True, True, vbYellow, "Connecting To " & [u]frmLogin.BnlsServer[/u]
        frmMain.bnlsSocket.Close
    frmMain.bnlsSocket.Connect [u]frmLogin.BnlsServer[/u], 9367
End Sub
[/quote]
[/quote]Can't really see why that's wrong, try stepping through it with the debugger to see if frmLogin.BnlsServer really contains "bnls.valhallalegends.com" when it starts to connect.

And, just a tip, create a public variable in a module somewhere to hold the BNLS server address and other things like the username, password, etc.  I assume frmLogin is your settings form.  If you keep using frmLogin.Blah to access your settings, you force your bot to keep that form in memory, which is just a waste.  Not to mention that using text fields is slower than using variables.
October 24, 2004, 7:10 PM
EviL_MarinE
AH, k thanks.

Well i did just use www.valhallalegends.com in the end and it worked

Thanks for the help in other forum btw :)
October 24, 2004, 7:15 PM
Skywing
Using www.valhallalegends.com as a default is a bad idea, since your program will break if the web server ever gets moved to a different machine.
October 24, 2004, 10:52 PM
EviL_MarinE
Oh, well i did use bnls.valhallalegends.com and it didnt work, hmm

Edit: bnls.valhallalegends.com Does work now, My Apolgies :P
October 25, 2004, 9:02 AM
R.a.B.B.i.T
Not really sure if I should be talking about this here, but:
JBLS is a BNLS clone that can hash all games remotely, and uses the same protocol.  The only differences are that JBLS is a hell of a lot less efficient than BNLS, and it must be run by somebody.  You should always (even before JBLS existed) allow for the user to specify the BNLS server, but default it to bnls.valhallalegends.com.
October 26, 2004, 1:13 AM
KkBlazekK
Stop talking about JBLS... Its not up half the time anyway....
October 26, 2004, 1:24 AM
EviL_MarinE
Heh, as i just said in my other post, i aint using BNLS Now, go to my other post (" A Problem, help plz") To see why ;\
October 26, 2004, 11:05 AM
The-FooL
[quote author=Blaze link=topic=9297.msg86135#msg86135 date=1098753880]
Stop talking about JBLS... Its not up half the time anyway....
[/quote]
It's not up ever, at least not on a public server.
October 27, 2004, 1:03 AM
LivedKrad
You should learn to debug things, Evil Marine.
October 29, 2004, 9:42 PM
bethra
Hi

what is the IP for bnls.valhallalegends.com?

I am currently trying to move away from VB and make a bot in C++.  I can't seem to connect to bnls under the "bnls.valhallalegends.com" address.

I've been looking at other simple C++ bots and how they connect and it shows it connecting to BNET with its IP address instead of "useast.battle.net".

October 30, 2004, 3:00 AM
UserLoser.
[quote author=bethra link=topic=9297.msg86577#msg86577 date=1099105249]
Hi

what is the IP for bnls.valhallalegends.com?
[/quote]

Start->Run->cmd->nslookup bnls.valhallalegends.com
October 30, 2004, 4:06 AM
EviL_MarinE
[quote author=LivedKrad link=topic=9297.msg86549#msg86549 date=1099086178]
You should learn to debug things, Evil Marine.
[/quote]

Thx? :\
October 30, 2004, 9:42 AM
Zakath
[quote author=bethra link=topic=9297.msg86577#msg86577 date=1099105249]
Hi

what is the IP for bnls.valhallalegends.com?

I am currently trying to move away from VB and make a bot in C++.  I can't seem to connect to bnls under the "bnls.valhallalegends.com" address.

I've been looking at other simple C++ bots and how they connect and it shows it connecting to BNET with its IP address instead of "useast.battle.net".


[/quote]

A properly constructed connection sequence can deal equally well with either a name or an IP address. ZakBot, for instance, can connect fine with a name like "useast.battle.net."
October 30, 2004, 7:55 PM
Newby
[quote author=bethra link=topic=9297.msg86577#msg86577 date=1099105249]
Hi

what is the IP for bnls.valhallalegends.com?

I am currently trying to move away from VB and make a bot in C++.  I can't seem to connect to bnls under the "bnls.valhallalegends.com" address.

I've been looking at other simple C++ bots and how they connect and it shows it connecting to BNET with its IP address instead of "useast.battle.net".


[/quote]
Resolve the domain name to an IP. I suggest you look up WSAAsyncGetHostByName().

(GetHostByName() IIRC will work as well, but WSAAsync is a better bet.)
October 30, 2004, 8:51 PM
Myndfyr
As I understand it, WSAAsyncXxx does not actually perform true asynchronous communications.
October 30, 2004, 9:58 PM
Zakath
That is correct. It's only emulated, but it works well enough.

I don't use WSAAsyncGetHostByName(), though...the normal gethostbyname() has always worked for me.
October 31, 2004, 12:15 AM
Minux
[quote author=MyndFyre link=topic=9297.msg86660#msg86660 date=1099173498]
As I understand it, WSAAsyncXxx does not actually perform true asynchronous communications.
[/quote]

[url]http://support.microsoft.com/default.aspx?scid=kb;en-us;156749[/url]

[Edit]
A good way to find the IP of a domain is to open your command console and type
ping www.valhallalegends.com or ping bnls.valhallalegends.com
[/Edit]
October 31, 2004, 12:24 AM
Myndfyr
[quote author=Minus link=topic=9297.msg86685#msg86685 date=1099182276]
[quote author=MyndFyre link=topic=9297.msg86660#msg86660 date=1099173498]
As I understand it, WSAAsyncXxx does not actually perform true asynchronous communications.
[/quote]

[url]http://support.microsoft.com/default.aspx?scid=kb;en-us;156749[/url]
[/quote]

So smart guy...  Do you realize that the KB article you gave here appies to 16-bit Windows?

[quote]
Winsock Applications that issue a WSAAsyncGetHostByName() against MS real mode TCP/IP Winsock.dll receive IP address in reverse order

A Winsock application such as Internet Explorer 2.01 or Netscape 2.02 running on Windows 3.1 with MS real mode TCP/IP stack will fail to connect a remote host when the application issues a WSAAsyncGetHostByName() to resolve the remote host name to IP address. For example, WSAAsyncGetHostByName() will return "99.88.77.66" if the remote host IP address is "66.77.88.99".
[/quote] (emphasis mine).

Since all of our computers nowadays use IE 2.01 on Windows 3.1, and we definitely link to 16-bit Winsock.dll as opposed to ws2_32.dll....
October 31, 2004, 1:44 AM
Zakath
You're the one who posted the link

Minus, I would almost call that a flame: don't do that again
October 31, 2004, 3:06 AM
Minux
[quote author=Zakath link=topic=9297.msg86716#msg86716 date=1099191962]
You're the one who posted the link

Minus, I would almost call that a flame: don't do that again
[/quote]

Why what are you talking about Sir Zakath?
October 31, 2004, 3:06 AM
Zakath
Way to delete your flame before my reply went through. Good thing we've got something called browser caching.

[img]http://www.valhallalegends.com/zakath/deletedpost.png[/img]
October 31, 2004, 3:17 AM
Skywing
You should use getaddrinfo() if it's available.  The best option is to create a dedicated thread to do DNS lookups, with the thread using getaddrinfo if the local Winsock supports it, or gethostbyname if there is no IPv6 support available.
October 31, 2004, 11:03 AM

Search