• Welcome to Valhalla Legends Archive.
 

Re: Receiving 127 and 137 Bytes

Started by Noodlez, March 05, 2003, 01:30 AM

Previous topic - Next topic

Noodlez

why dont you print the data?

tA-Kane

#1
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
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Mesiah / haiseM

#2
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.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

haZe

#3
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...

Yoni

#4
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).

haZe

#5
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.

Mesiah / haiseM

#6
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.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

haZe

#7
what am i doing wrong..

Camel

QuoteUse GetData, not PeekData.
haze, you're totally wrong if you think peekdata is removing data from "the internal buffer"

haZe

#9
Uh, Buddy, Yoni wrote that Not me.

tA-Kane

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
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Camel

QuoteUh, Buddy, Yoni wrote that Not me.
yoni wrote it, i emphasized it

[edit] google is the best spell checker ever invented

Banana fanna fo fanna

#12
Quote[edit] google is the best spell checker ever invented

True dat. AbiWord's sucks.