Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Lenny on January 02, 2004, 11:09 PM

Title: Anti-idles (Battle.net)
Post by: Lenny on January 02, 2004, 11:09 PM
Will battle.net disconnect a user if nothing is sent from the bot?

If so, is there an actual anti-idle packet for battle.net or can it be any sort of channel packet?

And how often must it be sent?
Title: Re:Anti-idles (Battle.net)
Post by: Gangz on January 02, 2004, 11:10 PM
There is no idle kick for bnet. I have had my bots on for over 2 weeks now with no idles.
Title: Re:Anti-idles (Battle.net)
Post by: Spht on January 02, 2004, 11:35 PM
Quote from: Lenny on January 02, 2004, 11:09 PM
Will battle.net disconnect a user if nothing is sent from the bot?

No. However, if you don't send anything when idle, it's possible for your application to sometimes not detect connection failures. So you should send something to Battle.net (maybe SID_NULL) if the connection has been idle for a couple minutes to enable the TCP layer to detect connection failures and report them to your application, so you can act on it (reconnect or something).
Title: Re:Anti-idles (Battle.net)
Post by: hismajesty on January 03, 2004, 05:43 AM
I beleive 0x00 should be sent every ~2 minutes. I know that if I don't send it within about 4 minutes apart at least, I'll disconnect. However, if you send it too fast (every millisecond even) you'll disconnect too. :P
Title: Re:Anti-idles (Battle.net)
Post by: Gangz on January 03, 2004, 11:40 AM
I guess it depends on how your bot is written. Mine checks for open winsock connections every 5 minutes.
Title: Re:Anti-idles (Battle.net)
Post by: Skywing on January 03, 2004, 12:16 PM
IIRC, battle.snp sends SID_NULL at semiregular intervals.  Some broken battle.net emulation servers (e.g. FSGS) will disconnect client that do not do this.
Title: Re:Anti-idles (Battle.net)
Post by: Kp on January 03, 2004, 12:23 PM
Also, if your connection is idle too long, battle.net will send you a SID_PING.  Failure to answer enough of these will get you dropped.  I haven't tested whether SID_PING can be ignored in preference of sending more meaningful traffic (that is, whether the server wants a pong or just wants you to send anything at all).
Title: Re:Anti-idles (Battle.net)
Post by: Mesiah / haiseM on January 03, 2004, 03:03 PM
you can ignore SID_PING...

Depending on what type of bot you are creating, but i have found my bot to be most stable, by adding support for just about every "connection" packet there is, ad banner requests are also a nice little way to stay alive..
Title: Re:Anti-idles (Battle.net)
Post by: Skywing on January 03, 2004, 03:05 PM
Note that because the ad server tends to die, it's a bad idea to rely on ad banners to detect a dead connection.
Title: Re:Anti-idles (Battle.net)
Post by: UserLoser. on January 03, 2004, 03:06 PM
I try to do almost exactly what the client does, when it does it too - I have never gotten disconnected for being idle
Title: Re:Anti-idles (Battle.net)
Post by: Lenny on January 03, 2004, 09:26 PM
Quote from: Kp on January 03, 2004, 12:23 PM
Also, if your connection is idle too long, battle.net will send you a SID_PING.  Failure to answer enough of these will get you dropped.  I haven't tested whether SID_PING can be ignored in preference of sending more meaningful traffic (that is, whether the server wants a pong or just wants you to send anything at all).

I've tested by ignoring the SID_PING and sending text messages at given intervals, battle.net just seems to want the client to send anything at all...