• Welcome to Valhalla Legends Archive.
 

0x71 C => S

Started by vuther.de, March 16, 2005, 05:07 PM

Previous topic - Next topic

vuther.de

For some reason.. it will only let me send a 4 letter length tag, not 2 or 3. Here is my code:

Private Sub cmdInvite_Click()
Dim I As Integer

With PBuffer
    .InsertDWORD 0
    .InsertNTString txtClanName.Text

Select Case Len(txtTag.Text)

Case 2
    .InsertNonNTString vbNullChar & vbNullChar & StrReverse(txtTag.Text)
Case 3
    .InsertNonNTString vbNullChar & StrReverse(txtTag.Text)
Case 4
    .InsertNonNTString StrReverse(txtTag.Text)
End Select

    .InsertBYTE lstMembers.ListItems.Count

For I = 1 To lstMembers.ListItems.Count
    .InsertNonNTString lstMembers.ListItems.Item(I).Text & vbNullChar
Next I

    .sendPacket &H71
End With

End Sub


Here's packetlog:
Quote
[6:06:30 PM] BNET: Packet sent: 0x71
[6:06:30 PM] Output dump: 0000:  00 00 00 00 54 65 73 74 69 6E 67 00 00 00 56 65   ....Testing...Ve
0010:  09 64 73 66 73 66 64 33 64 00 64 72 73 66 67 66   .dsfsfd3d.drsfgf
0020:  34 00 4D 61 6C 69 63 65 31 31 32 00 73 64 66 73   4.Malice112.sdfs
0030:  64 64 73 33 00 64 73 66 64 73 64 33 00 33 64 73   dds3.dsfdsd3.3ds
0040:  66 64 33 64 00 69 6E 6E 65 72 69 73 74 69 67 68   fd3d.inneristigh
0050:  74 00 69 6E 6E 65 72 6C 69 6B 65 73 6D 65 6E 00   t.innerlikesmen.
0060:  69 6E 6E 65 72 69 73 63 6F 6F 6C 00               inneriscool.....
[6:06:30 PM] BNET: Packet received: 0x71
[6:06:30 PM] Output dump: 0000:  FF 71 0A 00 00 00 00 00 02 00                     ÿq.............

Eric

#1
That's because the clan tag is sent as a DWord, not a string.

vuther.de

#2
Something like this:

.InsertDWORD .GetDWORD(StrReverse(txtTag.Text))

Warrior

Why don't you TRY it and if it doesn't work then ask us.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

vuther.de

#4
I have, and for some reason it works but on the invitation it just says "Clan ". There's no name for it. It still only works for 4 length tag's..

I changed around my code alittle, here's how it is now:

Private Sub cmdInvite_Click()
Dim strCandidates As String, strNew() As String
Dim I As Integer, intCount As Integer
    For I = 1 To lstMembers.ListItems.Count
    If lstMembers.ListItems.Item(I).Checked Then strCandidates = strCandidates & lstMembers.ListItems.Item(I).Text & vbNullChar
    Next I
    strNew = Split(strCandidates, vbNullChar)
    strCandidates = vbNullString
    For I = 0 To 8
    strCandidates = strCandidates & strNew(I) & vbNullChar
    intCount = intCount + 1
    Next I
    Erase strNew()
    With PBuffer
        .InsertDWORD 0
        .InsertNTString txtClanName.Text
        .InsertDWORD .GetDWORD(StrReverse(txtTag.Text))
        .InsertBYTE intCount
        .InsertNonNTString strCandidates
        .sendPacket &H71
    End With
End Sub

Eric

Quote.InsertDWORD .GetDWORD(StrReverse(txtTag.Text))
... why are you reversing the clan tag?

Quote.InsertNonNTString strCandidates
The username's are sent as null-terminated strings... why not just replace those few horrible lines of code which is then inserted into the buffer using a function which shouldn't be in it in the first place with:


.InsertSTRING User1
.InsertSTRING User2
.InsertSTRING User3
...

vuther.de

Quote from: LoRd[nK] on March 17, 2005, 04:10 AM
Quote.InsertDWORD .GetDWORD(StrReverse(txtTag.Text))
... why are you reversing the clan tag?

Quote.InsertNonNTString strCandidates
The username's are sent as null-terminated strings... why not just replace those few horrible lines of code which is then inserted into the buffer using a function which shouldn't be in it in the first place with:


.InsertSTRING User1
.InsertSTRING User2
.InsertSTRING User3
...

Because it's easy as a array. And you reverse tha tag because you're supposed to.

QwertyMonster

#7
Inner, this isnt a flame. But...

You post code thinking people are going to fix it up and paste it back. People will only spot out the errors, and then you will have to find it in your code and fix it to what they said.

[ontopic]
Try not to reverse your clan tag? For instance, if it was "Clan vL", it would be "Clan Lv", right?
[/ontopic]

Edit: Blaze fixed my error in lV. Thanks.

Blaze

The caps wouldn't flip it would be Lv not Vl, IIRC you can't have a clan channel of two letters.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Hdx

#9
#1, Clan tangs can be 2-4 chrs.
#2, Eww at what you are doing!
Maby this could work.
    Dim ClanTag As String * 4, ClanName As String, Users(8) As String
    '// Dim the required vareables, #1, ClanTag is atmost 4 chrs long,  so dim it as *4, #2 Clan name can be any length (reasonable), #3, You need 9 users, so dim the array as 8 (0-8 = 9 properties)

    ClanTag = InputBox("Please enter your clan tag, 2-4 charectors.")
    '// Get the wanted clan tag, Will trunce it if it is more then 4 chrs long, and will padd it with spaces if it is less.

    ClanName = InputBox("Please enter your clan name.")
    '// Get the Clan Name, Blah.

    For X = 0 To 8
    '// You need 9 users, 0-8 = 9 units.

        Users(X) = InputBox("Please enter user #" & X & "'s username.")
        '// Gets all 9 users.

    Next X

    ClanTag = StrReverse(Replace(ClanTag, Space(1), vbNull))
    '// The clan tag is a DWORD, so it is 4 in length, hence the *4 at the dimming, We want to replace the Spaces with null chrs as to make the clan name w/o spaces.
    '// Also This is a bad way, but DWORD string (shush peopl) are reserves, Hence RATS not STAR.

    .InsertDWORD &H1 '//Cookie
    .InsertNTString ClanName '//Clan name
    .InsertNonNTString ClanTag '//Clan tag, Dword, but use NonNTString
    .InsertBYTE &H9 '//( is the number of peopl you are inviting.
    For X = 0 To 8
        .InsertNTString Users(X) '// Loop through and get all 9 people.
    Next X
    .SendPacket &H71 '// Send the dammen thing, we are done!

Change the Input boxes to whatever you need, But Get rid of that nasty way of getting the people.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

QwertyMonster

Hdx, very nice way! But be sure to put some comments in, as he will just prob copy / paste it. :-\

UserLoser.

Quote from: Blaze on March 17, 2005, 11:25 AM
The caps wouldn't flip it would be Lv not Vl, IIRC you can't have a clan channel of two letters.

See: Clan BH on USEast

UserLoser.

Quote from: inner. on March 17, 2005, 07:03 AM
Because it's easy as a array. And you reverse tha tag because you're supposed to.

The clan tag isn't reversed...

Hdx

Added comments, I am really bad at that as you can see.
Also waists A LOT of space.

QuoteThe clan tag isn't reversed...
When using it as a dword, the string apears reversed. like RATS insted of STAR.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

UserLoser.

Quote from: HdxBmx27 on March 17, 2005, 01:45 PM
Added comments, I am really bad at that as you can see.
Also waists A LOT of space.

QuoteThe clan tag isn't reversed...
When using it as a dword, the string apears reversed. like RATS insted of STAR.
~-~(HDX)~-~

('S' << 24 | 'T' << 16 | 'A' << 8 | 'R') String?  no.  It's 32-bit integer, not string.