Valhalla Legends Forums Archive | Battle.net Bot Development | Regarding BNet Chat Bots..

AuthorMessageTime
CMallette
After opening a connection to Battle.net and successfully logging in using CHAT, if I try to open a second connection in CHAT, it will disconnect the first connection from Battle.net, but will not close the socket or return any error.

My question is, how could the program know if it was disconnected due to this, if Battle.net doesn't close the socket?
April 12, 2004, 5:41 PM
iago
Don't connect a second? :P
April 12, 2004, 5:47 PM
AC_Drkan
yeah thats right because you connect using 1 because of the winsock connection. it connects using 1 of 2 things:
1) hostname
2) ip address
April 12, 2004, 7:05 PM
LoRd
You can only have one chat connection per IP; trying to connect a second chat bot would result in Battle.net closing one of the two connections.
If you wish to know what event is triggered when this occurs, we need to know what language you're using.
April 12, 2004, 7:12 PM
CMallette
Visual Basics..

It ain't triggering _Error or _Close on the Winsock.

In addition, the state of the winsock of the bot that got disconnected from Battle.net is still sckConnected. It's like if Battle.net disconnects the bot but doesn't close the connection with the person.
April 12, 2004, 9:10 PM
iago
it's like unplugging your NIC - there's no notification. Try sending SID_NULL (or some equivolant, like /time) every minute or so to check.
April 12, 2004, 9:15 PM
CMallette
Would you happen to know the amount of data you must send to Battle.net before getting disconnected with "Flooded" error and is it different for CHAT and SEXP?

Basically I could do something like:

[code]public function GotUnplugged() as boolean
on error goto hell
socket.sendData chr(0)
GotUnplugged = false
exit function
hell:
GotUnplugged = true
end function[/code]

Would that chr(0) be counted in the amount of data I sent for the anti-flood thing over at Battle.net?
April 12, 2004, 10:44 PM
iago
[quote author=CMallette link=board=17;threadid=6272;start=0#msg54847 date=1081809854]
Would you happen to know the amount of data you must send to Battle.net before getting disconnected with "Flooded" error and is it different for CHAT and SEXP?

Basically I could do something like:

[code]public function GotUnplugged() as boolean
on error goto hell
socket.sendData chr(0)
GotUnplugged = false
exit function
hell:
GotUnplugged = true
end function[/code]

Would that chr(0) be counted in the amount of data I sent for the anti-flood thing over at Battle.net?
[/quote]

Look it up, it's been discussed many times.

And yes, the char(0) is part of the packet, so I would imagine it counts.
April 12, 2004, 11:04 PM
Myndfyr
[quote author=CMallette link=board=17;threadid=6272;start=0#msg54834 date=1081804215]
Visual Basics..
[/quote]

Oooh -- be careful when saying "Visual Basic[u]s[/u]" around here -- there are some extremely zealous people who will eat you if you don't remember that it's only singular, not plural.

Try it out a few times...

"Visual Basic"
"Visual Basic"
"Visual Basic"
"I am a newb", er... "Visual Basic"
April 13, 2004, 1:38 AM
iago
[quote author=Myndfyre link=board=17;threadid=6272;start=0#msg54878 date=1081820319]
[quote author=CMallette link=board=17;threadid=6272;start=0#msg54834 date=1081804215]
Visual Basics..
[/quote]

Oooh -- be careful when saying "Visual Basic[u]s[/u]" around here -- there are some extremely zealous people who will eat you if you don't remember that it's only singular, not plural.

Try it out a few times...

"Visual Basic"
"Visual Basic"
"Visual Basic"
"I am a newb", er... "Visual Basic"
[/quote]

That was cuphead, but he is now otherwise disposed so that's the end of it.
April 13, 2004, 3:12 AM
Stealth
[quote author=CMallette link=board=17;threadid=6272;start=0#msg54847 date=1081809854]
Would you happen to know the amount of data you must send to Battle.net before getting disconnected with "Flooded" error and is it different for CHAT and SEXP?

Basically I could do something like:

[code]public function GotUnplugged() as boolean
on error goto hell
socket.sendData chr(0)
GotUnplugged = false
exit function
hell:
GotUnplugged = true
end function[/code]

Would that chr(0) be counted in the amount of data I sent for the anti-flood thing over at Battle.net?
[/quote]

Yes, it would; under CHAT the only messages you can send are, well, chat messages. There is no binary protocol layer as exists with the game clients, so all messages count against your flood protection limit. Sending chr(0), however, will most likely get you disconnected immediately -- sending something more friendly, like /whoami or /time, is a better way to check the connection status.

Nice line label, by the way. :)
April 13, 2004, 5:20 AM
tA-Kane
[quote author=Stealth link=board=17;threadid=6272;start=0#msg54908 date=1081833651]Nice line label, by the way. :)[/quote]

This is such a good word, coming from someone new to programming.
[quote author=CMallette link=board=17;threadid=6272;start=0#msg54847 date=1081809854][code]on error goto hell[/code][/quote]
April 13, 2004, 9:49 PM

Search