Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: TravelToAiur on October 17, 2003, 05:44 PM

Title: Winsock suggestions?
Post by: TravelToAiur on October 17, 2003, 05:44 PM
I'm making an app with several winsocks in it ( each one should be a separate bot that connects to b.net server ). When the first one connects all work fine, when the second asks for connection he get refused and the first winsock connection is closed as well.
Any suggestion?

PS: vb plz ;)
Title: Re:Winsock suggestions?
Post by: Spht on October 17, 2003, 06:11 PM
Quote from: TravelToAiur on October 17, 2003, 05:44 PM
I'm making an app with several winsocks in it ( each one should be a separate bot that connects to b.net server ). When the first one connects all work fine, when the second asks for connection he get refused and the first winsock connection is closed as well.
Any suggestion?

PS: vb plz ;)

No suggestions. Is this Visual Basic and are you using the Winsock control? You'll have to paste some related code.
Title: Re:Winsock suggestions?
Post by: TravelToAiur on October 17, 2003, 06:37 PM
This is meant to be a really basic bot

Private Sub wskBNet_Connect()
   wskBnet.SendData Chr(3) & Chr(4) & BotAccount & vbCrLf & BotPass & vbCrLf
End Sub

Private Sub wskBNet2_Connect()
   wskBnet2.SendData Chr(3) & Chr(4) & BotAccount2 & vbCrLf & BotPass & vbCrLf
End Sub

Private Sub Form_Load()
   wskBnet.RemoteHost = server
   wskBnet.RemotePort = botPort
   wskBnet.Connect
--> all work fine, data is sent and bot appears online on b.net server
   wskBnet2.RemoteHost = server
   wskBnet2.RemotePort = botPort
   wskBnet2.Connect
--> connection is refused, wskBnet is disconnected as well :(
End Sub


[Edit: added code tags.  In the future, you should use them  yourself.]
Title: Re:Winsock suggestions?
Post by: hismajesty on October 17, 2003, 06:45 PM
Please put (code) and (/code) around your code.

(replace ( and ) with [ and ] )
Title: Re:Winsock suggestions?
Post by: Banana fanna fo fanna on October 17, 2003, 07:50 PM
You can only have 1 connection to CHAT per IP address.
Title: Re:Winsock suggestions?
Post by: TravelToAiur on October 18, 2003, 07:36 AM
Any way to have more than one?
Use proxies on my app?
Or trying to spoof IP every new connection? Is this possibile in vb?
Thank you
Title: Re:Winsock suggestions?
Post by: Bannable on October 18, 2003, 07:55 AM
There is a simiple solution to this.  For each connection you have to increase the Local Port on each winsock so that it does not match any other local port's already in use.  If this is not done, odd things can happen.
Title: Re:Winsock suggestions?
Post by: CupHead on October 18, 2003, 08:36 AM
First of all, Bannable has no idea what he's talking about.

Secondly, yes, you can use a proxied connection to open more than one connection via CHAT.  Spoofing the IP wouldn't do any good because the connection negotiation would be attempted at the IP that you specified, not yours.  Other than that, you're stuck using a "binary" connection if you want more than one custom-client on [each gateway].
Title: Re:Winsock suggestions?
Post by: Lenny on October 18, 2003, 07:40 PM
Wouldnt a control array of winsocks be easier?