Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Noodlez on March 05, 2003, 01:30 AM

Title: Re: Receiving 127 and 137 Bytes
Post by: Noodlez on March 05, 2003, 01:30 AM
why dont you print the data?
Title: Re: Receiving 127 and 137 Bytes
Post by: tA-Kane on March 05, 2003, 02:13 AM
The data you are receving is most likely something similar to...

2010 NAME kanezor
1007 CHANNEL "Public Chat 1"
1001 USER FearsBot 0010 [CHAT]
1001 USER W3P 0010 [CHAT]
1001 USER Gods_TempleChat 0010 [CHAT]
1001 USER STD-East 0010 [CHAT]
1001 USER dt1969#2 0010 [CHAT]
1001 USER Sage_Master 0000 [D2XP]
1001 USER pr0be_death 0010 [CHAT]
1001 USER AvalonBoA 0010 [CHAT]
1001 USER BF-Franksbot 0010 [CHAT]
1001 USER kiss1212k@Azeroth 0000 [WAR3]
1001 USER kanezor 0010 [CHAT]
1018 INFO "Welcome to Battle.net!"
1018 INFO "This server is hosted by AT&T."
1018 INFO "There are currently 369 users in Chat, and 228452 users playing 91278 games on Battle.net."
1019 ERROR "Chatting with this game is restricted to the channels listed in the channel menu."
1018 INFO "Last logon: Fri Feb 14  2:22 AM"
1019 ERROR "Failed logon attempts since then: 1"
1003 LEAVE kiss1212k@Azeroth 0000
1003 LEAVE AvalonBoA 0010
1003 LEAVE Sage_Master 0000
Title: Re: Receiving 127 and 137 Bytes
Post by: Mesiah / haiseM on March 05, 2003, 10:03 AM
lol on your data arrival sub, make a string, and do SOCKET.getdata STRINGUMADE

and then add the STRINGUMADE to the rtb or in the intermeddiate debug window by using debug.print or debug.assert, but its gotta be what kane said, nothing else in the chatbot connection procedure is that large.
Title: Re: Receiving 127 and 137 Bytes
Post by: haZe on March 05, 2003, 10:45 AM
Nevermind, I used PeekData instead and got my orginal results. But, their requesting my user and pass and I already sent it!! Here is my complete code.
Private Sub connect_Click()
sckBnet.Close
sckBnet.connect "useast.battle.net", 6112
'Debug.Print "Connecting to useast.battle.net..."
AddText vbDarkYellow, "Connecting to useast.battle.net..."
End Sub

Private Sub disconnect_Click()
sckBnet.Close
'Debug.Print "Disconnected."
AddText vbRed, "Disconnected."
End Sub

Private Sub Form_Load()
frmDataWindow.Show
End Sub
Private Sub sckBnet_Connect()
sckBnet.SendData Chr(3) & Chr(4) & USERNAME & vbCrLf & PASSWORD & vbCrLf
AddText vbGreen, "Connected!"
End Sub

Private Sub sckBnet_ConnectionRequest(ByVal requestID As Long)
AddText vbBlue, "Connection Request from to " & requestID
End Sub

Private Sub sckBnet_DataArrival(ByVal bytesTotal As Long)
Dim data As String
AddData vbLavender, "Data Recieved - Bytes Total: " & bytesTotal
sckBnet.PeekData data
AddData &HFFFF00, "" & data
End Sub

Private Sub sckBnet_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Debug.Print "Error: " & Number & ":" & Description & " Scode: " & Scode & " Source: " & Source
AddText vbRed, "Socket Error " & Number & ": " & Description
AddText vbRed, "Socket Error Scode " & Scode
AddText vbRed, "Socket Error Source " & Source
AddData vbRed, "Socket Error " & Number & ": " & Description
AddData vbRed, "Socket Error Scode " & Scode
AddData vbRed, "Socket Error Source " & Source
End Sub
Am I sending my user and password wrong? Because its requesting it...
Title: Re: Receiving 127 and 137 Bytes
Post by: Yoni on March 05, 2003, 10:56 AM
Use GetData, not PeekData.
GetData removes the data from the internal buffer. PeekData doesn't (so you'll see the same data over and over again until you run out of buffer space).
Title: Re: Receiving 127 and 137 Bytes
Post by: haZe on March 05, 2003, 10:59 AM
Not for me..and even with GetData, I get the same message. It requests my user/pass again, even thouhg im pretty sure I already sent it.
Title: Re: Receiving 127 and 137 Bytes
Post by: Mesiah / haiseM on March 05, 2003, 02:43 PM
IIRC, bnet chat protocol doesnt request the name and password again if its invalid, you just get disconnected, so your obviously not doing it right.
Title: Re: Receiving 127 and 137 Bytes
Post by: haZe on March 05, 2003, 02:48 PM
what am i doing wrong..
Title: Re: Receiving 127 and 137 Bytes
Post by: Camel on March 05, 2003, 03:28 PM
QuoteUse GetData, not PeekData.
haze, you're totally wrong if you think peekdata is removing data from "the internal buffer"
Title: Re: Receiving 127 and 137 Bytes
Post by: haZe on March 05, 2003, 03:41 PM
Uh, Buddy, Yoni wrote that Not me.
Title: Re: Receiving 127 and 137 Bytes
Post by: tA-Kane on March 06, 2003, 02:54 AM
QuoteIIRC, bnet chat protocol doesnt request the name and password again if its invalid, you just get disconnected
You do not remember correctly.

Connection from [ip hidden]

Enter your account name and password.
Use 'anonymous' if you only want to issue queries.

Username: badusername
Password: badpassword

Login incorrect
Username: kanezor
Password: (hidden)


2010 NAME kanezor
1007 CHANNEL "Public Chat 1"
...etc
Title: Re: Receiving 127 and 137 Bytes
Post by: Camel on March 06, 2003, 09:15 AM
QuoteUh, Buddy, Yoni wrote that Not me.
yoni wrote it, i emphasized it

[edit] google is the best spell checker ever invented
Title: Re: Receiving 127 and 137 Bytes
Post by: Banana fanna fo fanna on March 06, 2003, 10:24 AM
Quote[edit] google is the best spell checker ever invented

True dat. AbiWord's sucks.