January 7th, 2005, 07:31 PM
My Last Question
This might not actually be my "last question", but my bot now connects to battle.net, it can send messages, and be online. My only problem is that this only happens if I do not send my dataArrival. And when I do not do that, I can't receive any data from battle.net (messages, users joining, etc.). I'll show the code in VB6, and what I changed it to in Python.
Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
'Battle.net Data Arrival
Dim strTmp As String
Winsock2.GetData strTmp, vbString
My biggest problem is, where does this strTmp come from?
strTemp = ""
January 8th, 2005, 02:54 PM
I've never used VB so Im guessing here but I think your dataArrival() function should probably look more like this:
My assumption is that you want to parse the data received from the socket, so the data is assigned tmpStr and passed to ParseData(). Since in Python s.recv() takes only one argument: the max' number bytes to read from the socket, I'd opted for the default but you can change this if needed .
tmpStr = s.recv()
Anyway, as far as I can see strTmp doesn't in your code so it can't come form anywhere.
Hope this is of some help,