• Welcome to Valhalla Legends Archive.
 

[c++] problem reconnecting

Started by mentalCo., July 26, 2004, 06:05 PM

Previous topic - Next topic

mentalCo.

i can connect to bnet just fine using sc hash.  the problem is if i disconnect and try to reconnect it ip bans me for like 20 minutes.  i even waited like 5 minutes before reconnecting.  when using other bots they can reconnect like instantly.  the way i disconnect is just closing my client.  which ive also tested on other bots...

i get disconnected after receiving 0x50.  and ip banned.

OnlyMeat

#1
Quote from: mentalCo. on July 26, 2004, 06:05 PM
i can connect to bnet just fine using sc hash.  the problem is if i disconnect and try to reconnect it ip bans me for like 20 minutes.  i even waited like 5 minutes before reconnecting.  when using other bots they can reconnect like instantly.  the way i disconnect is just closing my client.  which ive also tested on other bots...

i get disconnected after receiving 0x50.  and ip banned.

Are you sure you are not trying to reconnect using the previous session information?, maybe try and check those values and ensure they are changing accordingly.

Also try and just connect without sending any messages etc, could be you are sending something invalid.

mentalCo.

no i close the bot all together then restart it 5 minutes later.  if i wait long enough i dont get ip banned.  i just want to know why i have to wait that long.

OnlyMeat

#3
Well you should be able to reconnect immediately.

You need to isolate if the problem is caused by the original connect or the reconnect i suggest connecting once with your bot then disconnecting ( without sending messages etc ) and try and connect with a real client.

Btw what client are you emulating? and how are you conneting bnls direct etc?

Did you shutdown your socket properly??

OnlyMeat

So it must be something you are sending on 0x51 post a packet log ^^

MyndFyre

Hrmm......

Are you by any chance not cleaning up all of your memory correctly, and are all of your values initialized at the start of your code?

I doubt a memory leak would be causing the problems, but depending on platform/compiler, you may be running into some issues with invalid pointers or invalid data at pointers due to not initializing them to values appropriately.
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.

mentalCo.

#6

closesocket(bnetfd)

where bnetfd is my socket to bnet obviously.  then connect with real client (starcraft).  wont connect.  i saw in a packet log of the real client it sends a disconnect packet?  does anyone here use that?

edit:
i dont use bnls

mentalCo.

ok i found out whats happening.  i was closing the bot without calling the closesocket function and i was getting a cdkey in use.  i didnt add that support to my bot yet and it went ahead sending the rest of the packets thus getting me ip banned.  lol.

ChR0NiC

Quote from: mentalCo. on July 29, 2004, 02:54 PM
ok i found out whats happening.  i was closing the bot without calling the closesocket function and i was getting a cdkey in use.  i didnt add that support to my bot yet and it went ahead sending the rest of the packets thus getting me ip banned.  lol.

Yep, that will definitely do it.