Author | Message | Time |
---|---|---|
phvckmeh | Alright, well sometimes on my bot, like every couple hours, my bot will loop forever on this sub, i broke it and i marked where it broke too (while it was in a loop) My CPU goes up to 99% when its like this, and it just stays like that untill it crashes. Any ideas? [code]Private Sub sckBnet_DataArrival(ByVal bytesTotal As Long) On Error Resume Next Dim strBuffer As String, strTemp As String, lngLen As Long sckBNET.GetData strTemp, vbString strBuffer = strBuffer & strTemp While Len(strBuffer) > 4 '//Error If Left(strBuffer, 1) <> Chr(&HFF) Then Exit Sub End If lngLen = Val("&H" & StrToHex(StrReverse(Mid(strBuffer, 3, 2)))) If Len(strBuffer) < lngLen Then Exit Sub If ReadINI("Server", "USEBnls") = "1" Then ParseBNET2 (Left(strBuffer, lngLen)) Else ParseBNET (Left(strBuffer, lngLen)) End If strBuffer = Mid(strBuffer, lngLen + 1) Wend[/code] | November 8, 2004, 11:48 PM |
UserLoser. | Note some BNCS packets have a length of four | November 8, 2004, 11:51 PM |
Yegg | im not sur if this will help but heres my winsock dataarrival code (my bot uses hashes) [code]Private Sub wsBNET_DataArrival(ByVal bytesTotal As Long) On Error Resume Next Static strBuffer As String Dim strTemp As String, lngLen As Long wsBNET.GetData strTemp, vbString strBuffer = strBuffer & strTemp While Len(strBuffer) > 4 lngLen = Val("&H" & StrToHex(StrReverse(Mid(strBuffer, 3, 2)))) If Len(strBuffer) < lngLen Then Exit Sub parsep (Left(strBuffer, lngLen)) strBuffer = Mid(strBuffer, lngLen + 1) Wend End Sub[/code] | November 8, 2004, 11:52 PM |
Myndfyr | [quote author=phvckmeh link=topic=9477.msg87983#msg87983 date=1099958253] [quote author=UserLoser link=topic=9477.msg87980#msg87980 date=1099957891] Note some BNCS packets have a length of four [/quote] so i should make it >= 4? [/quote] Crazy enough to work. | November 8, 2004, 11:58 PM |
Minux | The funny thing about both of the codes provided is they both have [code] Val("&H" & StrToHex(StrReverse(Mid(strBuffer, 3, 2)))) [/code] Which points out they didn't write it themselves. And due to DarkMinion's packetbuffer's popularity, you would figure you would instead see [code] pBuffer.GetWORD(Mid$(strBuffer, 3, 2)) [/code] That is...if they really knew what they were doing :P | November 9, 2004, 1:14 AM |
St0rm.iD | see the answer on www.clancybr.com note: people who read the forum will get my joke :) | November 10, 2004, 1:53 AM |