• Welcome to Valhalla Legends Archive.
 

Profile help

Started by OuTLawZGoSu, February 24, 2004, 10:55 PM

Previous topic - Next topic

OuTLawZGoSu


'TCPConnections (Module)

Public Sub Profile(Data As String)
On Error Resume Next
Dim x As Integer
Dim ProfileEnd As String
    Dim SplitProfile As Variant
    Dim splt() As String
    ProfileEnd = Mid(Data, 17, Len(Data))
    SplitProfile = Split(ProfileEnd, Chr(&H0))
    splt() = Split(SplitProfile(3), vbCrLf)
    'SplitProfile (0) 'name
   '' form2.txtSex.text = SplitProfile(1)  'sex
  ''  form2.txtLocation.text = SplitProfile(2)  'location
   '' form2.txtDescription.text = SplitProfile(3)  'description
'     Form1.AddC vbRed, "Sex: " & SplitProfile(1)
'     Form1.AddC vbRed, "Location: " & SplitProfile(2)
'     Form1.AddC vbRed, "Description: " & SplitProfile(3)
''form2.UserToProfile = SplitProfile(0)
    fprofile.txtSex.Text = SplitProfile(1)
    fprofile.txtLocation.Text = SplitProfile(2)
    fprofile.txtDescription.Text = SplitProfile(3)

fprofile.Visible = True
     End Sub

Public Sub RequestProfile(strUser As String)
On Error Resume Next
PBuffer.InsertDWORD 1
PBuffer.InsertDWORD 4
PBuffer.InsertDWORD &H45
PBuffer.InsertNTString strUser
PBuffer.InsertNTString "System\strUser"
PBuffer.InsertNTString "system\Last Logon"
PBuffer.InsertNTString "system\Account Expires"
PBuffer.InsertNTString "system\Time Logged"
PBuffer.InsertNTString "system\Last Logoff"
PBuffer.sendPacket &H26
End Sub

Public Sub setprofile(Info As String, Data As String)

   PBuffer.InsertDWORD 1
   PBuffer.InsertDWORD 1
   PBuffer.InsertBYTE 0
   PBuffer.InsertNTString "profile\age"
   PBuffer.InsertNTString Data
   PBuffer.sendPacket &H27
End Sub

'_____________________________

'This, I put in a manual command, like stealthbot has.

If Left(text1.Text, 8) = "/profile" Then
   Dim whoProfile As String
   whoProfile = Mid(text1.Text, InStr(text1.Text, "e") + 2)
   fprofile.Caption = whoProfile
   fprofile.txtname = whoProfile & "'s Profile"
   PBuffer.InsertDWORD 1
   PBuffer.InsertDWORD 4
   PBuffer.InsertDWORD &H405
   PBuffer.InsertNTString whoProfile
   PBuffer.InsertNTString "Profile\Age"
   PBuffer.InsertNTString "Profile\Sex"
   PBuffer.InsertNTString "Profile\Location"
   PBuffer.InsertNTString "Profile\Description"
   PBuffer.sendPacket &H26
   text1.Text = ""



I cant figure out why this keeps disconnecting me.

Eric

#1
QuotePublic Sub RequestProfile(strUser As String)
On Error Resume Next
PBuffer.InsertDWORD 1
PBuffer.InsertDWORD 4
PBuffer.InsertDWORD &H45
PBuffer.InsertNTString strUser
PBuffer.InsertNTString "System\strUser"
PBuffer.InsertNTString "system\Last Logon"
PBuffer.InsertNTString "system\Account Expires"
PBuffer.InsertNTString "system\Time Logged"
PBuffer.InsertNTString "system\Last Logoff"
PBuffer.sendPacket &H26
End Sub

The second DWORD of 0x26 should contain how many profile keys you are requesting, you said that there were 4 keys being requested, but in reality, there were 5 keys being requested.
Also: System\Account Expires is not a valid profile key, but currently Battle.net does not disconnect and/or IPBan you for sending invalid profile keys.

Zakath

Quote from: LoRd[nK] on February 24, 2004, 11:30 PM
QuotePublic Sub RequestProfile(strUser As String)
On Error Resume Next
PBuffer.InsertDWORD 1
PBuffer.InsertDWORD 4
PBuffer.InsertDWORD &H45
PBuffer.InsertNTString strUser
PBuffer.InsertNTString "System\strUser"
PBuffer.InsertNTString "system\Last Logon"
PBuffer.InsertNTString "system\Account Expires"
PBuffer.InsertNTString "system\Time Logged"
PBuffer.InsertNTString "system\Last Logoff"
PBuffer.sendPacket &H26
End Sub

The second DWORD of 0x26 should contain how many profile keys you are requesting, you said that there were 4 keys being requested, but in reality, there were 5 keys being requested.
Also: System\Account Expires is not a valid profile key, but currently Battle.net does not disconnect and/or IPBan you for sending invalid profile keys.

System\strUser is also not a valid key. The one you're looking for is System\Username.

And incidentally, why are you hardcoding all profile request IDs to be 0x45? Seems to me like that would make it difficult to figure out which person's profile you've got if you had multiple pending profile responses.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

OuTLawZGoSu

#3
My firend put in this code in my project. It worked fine untill I modfied some of the code in my project with out testing it out. ( Didn't have my dsl then.)
I think I edited something that I sholdnt of had.

PS:

Is there a better code you might put up here, or help me wit?
I dont know shit about Editing, Receiving profiles.

Eric

Quote
Packet ID: 0x26
Direction: Client -> Server (Sent)
Format:
Help (DWORD)       Number of Accounts
(DWORD)       Number of Keys
(DWORD)       Request ID
(STRING[])    Requested Accounts
(STRING[])    Requested Keys
Remarks: Requests an extended profile.

Some profile keys - this is not an exhaustive list:

profile\sex
profile\age
profile\location
profile\description
record\GAME\0\wins
record\GAME\0\losses
record\GAME\0\disconnects
record\GAME\0\last GAME
record\GAME\0\last GAME result
record\GAME\1\wins
record\GAME\1\losses
record\GAME\1\disconnects
record\GAME\1\last game
record\GAME\1\last game result
record\GAME\1\rating
record\GAME\1\high rating
record\GAME\1\rank
record\GAME\1\high rank

Packet ID: 0x26
Direction: Server -> Client (Received)
Format:
Help (DWORD)       Number of accounts
(DWORD)       Number of keys
(DWORD)       Request ID
(STRING[])    Requested Key Values
Remarks: Contains profile information as requested in C->S 0x26.

FuzZ

#5
Quote from: OuTLawZGoSu on February 24, 2004, 10:55 PM
PBuffer.InsertDWORD 1
PBuffer.InsertDWORD 4
PBuffer.InsertDWORD &H405
PBuffer.InsertNTString whoProfile
PBuffer.InsertNTString "Profile\Age"
PBuffer.InsertNTString "Profile\Sex"
PBuffer.InsertNTString "Profile\Location"
PBuffer.InsertNTString "Profile\Description"
PBuffer.sendPacket &H26
Notice the "PBuffer.InsertDWORD &H405"

Maybe that's contributing to the problem?

:EDIT: My mistake.

Eric

#6
Quote from: FuzZ on February 26, 2004, 05:20 PM
Quote from: OuTLawZGoSu on February 24, 2004, 10:55 PM
PBuffer.InsertDWORD 1
PBuffer.InsertDWORD 4
PBuffer.InsertDWORD &H405
PBuffer.InsertNTString whoProfile
PBuffer.InsertNTString "Profile\Age"
PBuffer.InsertNTString "Profile\Sex"
PBuffer.InsertNTString "Profile\Location"
PBuffer.InsertNTString "Profile\Description"
PBuffer.sendPacket &H26
Notice the "PBuffer.InsertDWORD &H405"

Maybe that's contributing to the problem?

The token can be anything, Battle.net will just reply with the same token back. The token is used to help identify one profile from another in multiple requests, as Zakath stated.

OuTLawZGoSu

#7
Aight, I found the problem.

Where it shows:

fprofile.Caption = whoProfile
fprofile.txtname = whoProfile & "'s Profile"


It should be fprofile.txtname.Caption = whoProfile & "'s Profile"

Thats why I kept on gettin disonnected

Eric

Quote from: OuTLawZGoSu on February 27, 2004, 08:30 AM
Aight, I found the problem.

Where it shows:

fprofile.Caption = whoProfile
fprofile.txtname = whoProfile & "'s Profile"


It should be fprofile.txtname.Caption = whoProfile & "'s Profile"

Thats why I kept on gettin disonnected

That makes no sense, but ok!

Networks

Where would u add the system keys to:

Packet ID: 0x26
Direction: Client -> Server (Sent)
Format:
Help (DWORD)       Number of Accounts
(DWORD)       Number of Keys
(DWORD)       Request ID
(STRING[])    Requested Accounts
(STRING[])    Requested Keys
Remarks: Requests an extended profile.

Some profile keys - this is not an exhaustive list:

profile\sex
profile\age
profile\location
profile\description
record\GAME\0\wins
record\GAME\0\losses
record\GAME\0\disconnects
record\GAME\0\last GAME
record\GAME\0\last GAME result
record\GAME\1\wins
record\GAME\1\losses
record\GAME\1\disconnects
record\GAME\1\last game
record\GAME\1\last game result
record\GAME\1\rating
record\GAME\1\high rating
record\GAME\1\rank
record\GAME\1\high rank

Packet ID: 0x26
Direction: Server -> Client (Received)
Format:
Help (DWORD)       Number of accounts
(DWORD)       Number of keys
(DWORD)       Request ID
(STRING[])    Requested Key Values
Remarks: Contains profile information as requested in C->S 0x26.


Also I having trouble be able to split the system keys so that I can parse it correctly which I also am having trouble with any help with that?

UserLoser.

Quote from: Networks on March 01, 2004, 10:21 AM
Where would u add the system keys to:

Whereever you want

Eric

Quote from: UserLoser. on March 01, 2004, 08:03 PM
Quote from: Networks on March 01, 2004, 10:21 AM
Where would u add the system keys to:

Whereever you want

Keep in mind that the keys are returned in the order that they are requested in.

UserLoser.

Quote from: LoRd[nK] on March 01, 2004, 08:17 PM
Quote from: UserLoser. on March 01, 2004, 08:03 PM
Quote from: Networks on March 01, 2004, 10:21 AM
Where would u add the system keys to:

Whereever you want

Keep in mind that the keys are returned in the order that they are requested in.

I don't understand what that has to do with putting them in whatever order you want

CrAz3D

#13
I know I'm somewhat reviving a dead topic here, but it is still on topic.
VB6

When I request my keys, whether it be:
   PacketBuf.InsertNTString "System\Username"
   PacketBuf.InsertNTString "System\Account Created"
   PacketBuf.InsertNTString "System\Last Logon"
   PacketBuf.InsertNTString "System\Last Logoff"
   PacketBuf.InsertNTString "System\Time Logged"

or
   PacketBuf.InsertNTString "profile\sex"
   PacketBuf.InsertNTString "profile\age"
   PacketBuf.InsertNTString "profile\location"
   PacketBuf.InsertNTString "profile\description"

They are return in the order that I sent them, but not in the order that they Split().

IE:
Quote'[6:41:54 PM] 2 29608520 1681102539     created
'[6:41:54 PM] 3 29623872 3218976033         logon
'[6:41:54 PM] 4 29623863 3142340068         log off
'[6:41:54 PM] 5 97642                       time logged
Today is being returned as:
Quote
[7:33:35 AM] 4 29622090 1673424946               created
[7:33:35 AM] 5 29623980 2731395027               logon
[7:33:35 AM] 6 29623979 2869513927               logoff
[7:33:35 AM] 7 509            time logged
The index of the order in the string as each is returned is infront of the rest for the string.  Is there a way to display the Profile info with trying to display SplitProfile(4)?


EDIT:Forgot Splitting code

   For i = 1 To UBound(SplitProfile)
       If i = 3 Then
           SPP = Split(SplitProfile(3), " ")
           FT.dwHighDateTime = SPP(0)
           FT.dwLowDateTime = SPP(1)
           Call FileTimeToLocalFileTime(FT, FT)
           Call FileTimeToSystemTime(FT, st)
           TIMEO = st.wHour & ":" & st.wMinute & ":" & st.wSecond
           TIMEO = Format(TIMEO, "hh:mm:ss ampm")
           AddChat vbGreen, "Account Created: ", vbCrLf & &HC0C000, st.wMonth & "/" & st.wDay & "/" & st.wYear, vbCrLf & vbRed, " @ ", vbCrLf & &HC0C000, TIMEO
       ElseIf i = 4 Then
           SPP = Split(SplitProfile(4), " ")
           FT.dwHighDateTime = SPP(0)
           FT.dwLowDateTime = SPP(1)
           Call FileTimeToLocalFileTime(FT, FT)
           Call FileTimeToSystemTime(FT, st)
           TIMEO = st.wHour & ":" & st.wMinute & ":" & st.wSecond
           TIMEO = Format(TIMEO, "hh:mm:ss ampm")
           AddChat vbGreen, "Last Logon: ", vbCrLf & &HC0C000, st.wMonth & "/" & st.wDay & "/" & st.wYear, vbCrLf & vbRed, " @ ", vbCrLf & &HC0C000, TIMEO
       ElseIf i = 5 Then
           SPP = Split(SplitProfile(5), " ")
           FT.dwHighDateTime = SPP(0)
           FT.dwLowDateTime = SPP(1)
           Call FileTimeToLocalFileTime(FT, FT)
           Call FileTimeToSystemTime(FT, st)
           TIMEO = st.wHour & ":" & st.wMinute & ":" & st.wSecond
           TIMEO = Format(TIMEO, "hh:mm:ss ampm")
           AddChat vbGreen, "Last Log Off: ", vbCrLf & &HC0C000, st.wMonth & "/" & st.wDay & "/" & st.wYear, vbCrLf & vbRed, " @ ", vbCrLf & &HC0C000, TIMEO
       ElseIf i = 6 Then
           AddChat vbGreen, "Time Logged: ", vbCrLf & &HC0C000, ConvertTime(SplitProfile(6) * 1000)
       End If
   Next i
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Networks

#14
Crazed how did you parse them so that you were able to use the addchat function. I cant figure that out. I can't even get to that step can anyone show the light?