• Welcome to Valhalla Legends Archive.
 

Regarding BNet Chat Bots..

Started by CMallette, April 12, 2004, 12:41 PM

Previous topic - Next topic

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?

iago

This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


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
"The Arguments of Today Result in the Wars of Tomorrow" - Quote By Muah.
<@Logan> I spent a minute looking at my own code by accident.
<@Logan> I was thinking "What the hell is this guy doing?"

<kow`> "There are 10 types of people in the world... those who understand binary and those who don't."
<SpaceRain> That's only 2 types of people, kow.
<SpaceRain> STUPID


<[TN]FBMachine> i got kicked out of barnes and noble once for moving all the bibles into the fiction section

God i love Bash.org.

Eric

#3
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.

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.

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.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


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:

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


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

iago

Quote from: CMallette on April 12, 2004, 05:44 PM
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:

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


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

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.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


MyndFyre

Quote from: CMallette on April 12, 2004, 04:10 PM
Visual Basics..

Oooh -- be careful when saying "Visual Basics" 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"
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

iago

Quote from: Myndfyre on April 12, 2004, 08:38 PM
Quote from: CMallette on April 12, 2004, 04:10 PM
Visual Basics..

Oooh -- be careful when saying "Visual Basics" 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"

That was cuphead, but he is now otherwise disposed so that's the end of it.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Stealth

Quote from: CMallette on April 12, 2004, 05:44 PM
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:

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


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

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. :)
- Stealth
Author of StealthBot

tA-Kane

Quote from: Stealth on April 13, 2004, 12:20 AMNice line label, by the way. :)

This is such a good word, coming from someone new to programming.
Quote from: CMallette on April 12, 2004, 05:44 PMon error goto hell
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com