Author | Message | Time |
---|---|---|
inner. | For some reason.. it will only let me send a 4 letter length tag, not 2 or 3. Here is my code: [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 [/code] 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............. [/quote] | March 16, 2005, 11:07 PM |
LoRd | That's because the clan tag is sent as a DWord, not a string. | March 16, 2005, 11:46 PM |
inner. | Something like this: [code] .InsertDWORD .GetDWORD(StrReverse(txtTag.Text)) [/code] | March 17, 2005, 12:00 AM |
Quarantine | Why don't you TRY it and if it doesn't work then ask us. | March 17, 2005, 12:26 AM |
inner. | 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: [code] 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 [/code] | March 17, 2005, 12:27 AM |
LoRd | [quote].InsertDWORD .GetDWORD(StrReverse(txtTag.Text))[/quote] ... why are you reversing the clan tag? [quote].InsertNonNTString strCandidates[/quote] 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: [code] .InsertSTRING User1 .InsertSTRING User2 .InsertSTRING User3 ... [/code] | March 17, 2005, 10:10 AM |
inner. | [quote author=LoRd[nK] link=topic=10941.msg104226#msg104226 date=1111054223] [quote].InsertDWORD .GetDWORD(StrReverse(txtTag.Text))[/quote] ... why are you reversing the clan tag? [quote].InsertNonNTString strCandidates[/quote] 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: [code] .InsertSTRING User1 .InsertSTRING User2 .InsertSTRING User3 ... [/code] [/quote] Because it's easy as a array. And you reverse tha tag because you're supposed to. | March 17, 2005, 1:03 PM |
QwertyMonster | 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. | March 17, 2005, 3:51 PM |
KkBlazekK | The caps wouldn't flip it would be Lv not Vl, IIRC you can't have a clan channel of two letters. | March 17, 2005, 5:25 PM |
HdxBmx27 | #1, Clan tangs can be 2-4 chrs. #2, Eww at what you are doing! Maby this could work. [code] 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![/code] Change the Input boxes to whatever you need, But Get rid of that nasty way of getting the people. ~-~(HDX)~-~ | March 17, 2005, 6:44 PM |
QwertyMonster | Hdx, very nice way! But be sure to put some comments in, as he will just prob copy / paste it. :-\ | March 17, 2005, 7:13 PM |
UserLoser. | [quote author=Blaze link=topic=10941.msg104244#msg104244 date=1111080325] The caps wouldn't flip it would be Lv not Vl, IIRC you can't have a clan channel of two letters. [/quote] See: Clan BH on USEast | March 17, 2005, 7:34 PM |
UserLoser. | [quote author=inner. link=topic=10941.msg104232#msg104232 date=1111064639] Because it's easy as a array. And you reverse tha tag because you're supposed to. [/quote] The clan tag isn't reversed... | March 17, 2005, 7:37 PM |
HdxBmx27 | Added comments, I am really bad at that as you can see. Also waists A LOT of space. [quote]The clan tag isn't reversed... [/quote] When using it as a dword, the string apears reversed. like RATS insted of STAR. ~-~(HDX)~-~ | March 17, 2005, 7:45 PM |
UserLoser. | [quote author=HdxBmx27 link=topic=10941.msg104269#msg104269 date=1111088701] Added comments, I am really bad at that as you can see. Also waists A LOT of space. [quote]The clan tag isn't reversed... [/quote] When using it as a dword, the string apears reversed. like RATS insted of STAR. ~-~(HDX)~-~ [/quote] ('S' << 24 | 'T' << 16 | 'A' << 8 | 'R') String? no. It's 32-bit integer, not string. | March 17, 2005, 7:50 PM |
QwertyMonster | You think its bad commenting? That is extremely good. And since i wasnt 100% sure on it first round, and now with comments i understand it. Good job Hdx! :-* | March 17, 2005, 7:50 PM |
HdxBmx27 | You are CORRECT. Please dont make this into a bag ass argument, its been descussed to dammen much. The reason I call it a string is that it is the standard charectors fo the americal alphabet. MOST users recongnize that it is readable text. Anyway, YOU ARE CORRECT, it is a 32-bit integer. Sop off that topic please. As for my commenting, I hate comments :P ~-~(HDX)~-~ | March 17, 2005, 7:54 PM |
QwertyMonster | Hdx, you think your a bad commenter, but at start i didnt understand some code, but after reading the comments i understand it more. Hdx, Nice commenting! And dont say you cant, cos u can! :P | March 17, 2005, 8:03 PM |
Networks | hm I told him it was odd for the string to be reversed! bnetdocs is always RIGHT! | March 17, 2005, 8:36 PM |
LoRd | [quote author=HdxBmx27 link=topic=10941.msg104269#msg104269 date=1111088701] Added comments, I am really bad at that as you can see. Also waists A LOT of space. [quote]The clan tag isn't reversed... [/quote] When using it as a dword, the string apears reversed. like RATS insted of STAR. ~-~(HDX)~-~ [/quote] The .GetDWORD() function converts a string into a DWord. You should not reverse the string before calling this function. .InsertNonNTString() has infected you. | March 17, 2005, 8:38 PM |
inner. | [quote author=QwertyMonster link=topic=10941.msg104258#msg104258 date=1111086835] Hdx, very nice way! But be sure to put some comments in, as he will just prob copy / paste it. :-\ [/quote] No, I would learn from it first. | March 17, 2005, 11:05 PM |
inner. | [quote author=inner. link=topic=10941.msg104292#msg104292 date=1111100717] [quote author=QwertyMonster link=topic=10941.msg104258#msg104258 date=1111086835] Hdx, very nice way! But be sure to put some comments in, as he will just prob copy / paste it. :-\ [/quote] No, I would learn from it first. [/quote] Edit: I tested it and it adds 1 to each blank spot there is in the tag. Here's my code: [code] Private Sub cmdInvite_Click() Dim ClanTag As String * 4, ClanName As String, strCandidates As String, strNew() As String Dim I As Integer, intCount As Integer ClanTag = txtTag.Text ClanName = txtClanName.Text 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 &H1 .InsertNTString ClanName .InsertNonNTString StrReverse(Replace(ClanTag, Space(1), vbNull)) .InsertBYTE intCount .InsertNonNTString strCandidates .sendPacket &H71 End With End Sub [/code] | March 17, 2005, 11:32 PM |
HdxBmx27 | [quote author=LoRd[nK] link=topic=10941.msg104279#msg104279 date=1111091913] The .GetDWORD() function converts a string into a DWord. You should not reverse the string before calling this function. .InsertNonNTString() has infected you. [/quote] Yes yes it has, I am trying to work on my coding habbits. But I am failing in a few areas, I am sorry. ~-~(HDX)~-~ | March 17, 2005, 11:58 PM |
inner. | Hrm, I cannot get it from adding the 1's when there's a null character in the tag. :( | March 18, 2005, 12:05 AM |
HdxBmx27 | [quote author=inner. link=topic=10941.msg104303#msg104303 date=1111104347] Hrm, I cannot get it from adding the 1's when there's a null character in the tag. :( [/quote]What? Post some packetlogs of what you are doing, or the contects of vareables after stepping through sertian parts of the code. ~-~(HDX)~-~ | March 18, 2005, 12:54 AM |
inner. | Ok. [quote] [8:20:53 PM] BNET: Packet sent: 0x71 [8:20:53 PM] Output dump: 0000: 00 00 00 00 6F 68 68 69 00 31 31 76 65 09 4D 61 ....ohhi.11ve.Ma 0010: 6C 69 63 65 31 31 32 00 64 73 66 73 66 64 33 64 lice112.dsfsfd3d 0020: 00 73 64 66 73 64 64 73 33 00 64 73 66 64 73 64 .sdfsdds3.dsfdsd 0030: 33 00 33 64 73 66 64 33 64 00 64 72 73 66 67 66 3.3dsfd3d.drsfgf 0040: 34 00 43 50 72 6F 67 72 61 6D 69 6E 67 00 43 70 4.CPrograming.Cp 0050: 72 6F 67 72 61 6D 65 72 00 51 75 65 6C 6F 73 77 rogramer.Quelosw 0060: 79 65 00 ye.............. [/quote] Didn't LoRd[nK] say to send as DWord? | March 18, 2005, 1:21 AM |
UserLoser. | [quote author=inner. link=topic=10941.msg104303#msg104303 date=1111104347] Hrm, I cannot get it from adding the 1's when there's a null character in the tag. :( [/quote] You are telling it to replace spaces with ones... so why are you asking here...? | March 18, 2005, 1:26 AM |
inner. | If I try to do Chr(0) or anything else, it gives me back some gay response. [quote] [8:33:45 PM] BNET: Packet received: 0x71 [8:33:45 PM] Output dump: 0000: FF 71 0A 00 00 00 00 00 02 00 ÿq............. [/quote] It gives me that directly after I go to create the clan. When i use: [code] .InsertDWORD .GetDWORD(Replace(ClanTag, Space(1), Chr(0))) [/code] It works, but on the invitation it just says Clan, no tag. Here's the packetlog of it: [quote] [9:09:29 PM] BNET: Packet sent: 0x71 [9:09:29 PM] Output dump: 0000: 00 00 00 00 6F 68 68 69 00 63 65 00 00 09 4D 61 ....ohhi.ec...Ma 0010: 6C 69 63 65 31 31 32 00 64 73 66 73 66 64 33 64 lice112.dsfsfd3d 0020: 00 73 64 66 73 64 64 73 33 00 64 73 66 64 73 64 .sdfsdds3.dsfdsd 0030: 33 00 33 64 73 66 64 33 64 00 43 50 72 6F 67 72 3.3dsfd3d.CProgr 0040: 61 6D 69 6E 67 00 43 70 72 6F 67 72 61 6D 65 72 aming.Cprogramer 0050: 00 51 75 65 6C 6F 73 77 79 65 00 64 72 73 66 67 .Queloswye.drsfg 0060: 66 34 00 f4.............. [/quote] Any suggestions? | March 18, 2005, 1:33 AM |
KkBlazekK | Why are you replacing spaces with nulls? I thought you were supposed to add spaces at the end so it equaled 4 characters. | March 18, 2005, 2:45 AM |
inner. | I also tried that, and it didn't work. | March 18, 2005, 3:03 AM |
UserLoser. | Looks like a valid response to me.. | March 18, 2005, 3:27 AM |
inner. | It is, but it's not sending a invitation. It's pissing the living fuck out of me. Anyone have any suggestions? I fixed up my code alitte: [code] Private Function FormatTag(ByVal strTag As String) As String Select Case Len(strTag) Case 2 FormatTag = vbNullChar & vbNullChar & StrReverse(strTag) Case 3 FormatTag = vbNullChar & StrReverse(strTag) Case 4 FormatTag = StrReverse(strTag) End Select End Function [/code] -- [code] Private Sub cmdInvite_click() Dim ClanName As String, strCandidates As String Dim I As Integer, intCount As Integer ClanName = txtClanName.Text For I = 1 To lstMembers.ListItems.Count If lstMembers.ListItems.Item(I).Checked Then: s trCandidates = strCandidates & lstMembers.ListItems.Item(I).Text & Chr$(0) If lstMembers.ListItems.Item(I).Checked Then: intCount = intCount + 1 Next I With PBuffer .InsertDWORD GetTickCount() .InsertNTString ClanName .InsertNonNTString FormatTag(txtTag.Text) .InsertBYTE intCount .InsertNonNTString strCandidates .sendPacket &H71 End With End Sub [/code] Here's the packetlog with it: [quote] [11:11:40 PM] BNET: Packet sent: 0x71 [11:11:40 PM] Output dump: 0000: F3 37 A7 14 6F 68 68 69 00 00 00 76 65 09 4D 61 ó7§ohhi...ve.Ma 0010: 6C 69 63 65 31 31 32 00 64 73 66 73 66 64 33 64 lice112.dsfsfd3d 0020: 00 73 64 66 73 64 64 73 33 00 64 73 66 64 73 64 .sdfsdds3.dsfdsd 0030: 33 00 33 64 73 66 64 33 64 00 43 50 72 6F 67 72 3.3dsfd3d.CProgr 0040: 61 6D 69 6E 67 00 43 70 72 6F 67 72 61 6D 65 72 aming.Cprogramer 0050: 00 51 75 65 6C 6F 73 77 79 65 00 64 72 73 66 67 .Queloswye.drsfg 0060: 66 34 00 f4.............. [11:11:40 PM] BNET: Packet received: 0x71 [11:11:40 PM] Output dump: 0000: FF 71 0A 00 F3 37 A7 14 02 00 ÿq..ó7§....... [/quote] | March 18, 2005, 3:34 AM |
HdxBmx27 | [quote author=inner. link=topic=10941.msg104334#msg104334 date=1111116845] [11:11:40 PM] BNET: Packet received: 0x71 [11:11:40 PM] Output dump: 0000: FF 71 0A 00 F3 37 A7 14 02 00 ÿq..ó7§....... [/quote] Wtf? A deformed response from Bnet?It should be a cookie, (F3 37 A7 14), then the response as a dword. But your reciving the response as a Word. Being the response of 02, it could safily be concived as failure. ~-~(HDX)~-~ | March 18, 2005, 5:49 AM |
inner. | That's what happenes when I use 2/3 lengths for tag. | March 18, 2005, 6:07 AM |
LoRd | Here's a suggestion: Learn what are and how to use binary datatypes (bytes, words, double-words and strings). Then you'll need to learn how to impliment such datatypes using Visual Basic and finally, you'll need to learn how to use your packetbuffer properly. When you have learned all of these things, sending this packet will be a walk in the park. | March 18, 2005, 9:04 AM |
Soul Taker | I don't know why you go to such lengths to make the tag. Just do something like String(4 - Len(Tag), vbNullChar), and then append or prepend the tag, depending on whatever you're doing with your weird non-DWORD handling of it. | March 18, 2005, 3:27 PM |
inner. | [quote author=Soul Taker link=topic=10941.msg104361#msg104361 date=1111159641] I don't know why you go to such lengths to make the tag. Just do something like String(4 - Len(Tag), vbNullChar), and then append or prepend the tag, depending on whatever you're doing with your weird non-DWORD handling of it. [/quote] I have. Here's what I tried before using that: ClanTag = String(4, vbNullChar) & StrReverse(txtTag.Text) ClanTag = Right$(ClanTag, 4) | March 18, 2005, 9:24 PM |
UserLoser. | [quote author=inner. link=topic=10941.msg104422#msg104422 date=1111181057] [quote author=Soul Taker link=topic=10941.msg104361#msg104361 date=1111159641] I don't know why you go to such lengths to make the tag. Just do something like String(4 - Len(Tag), vbNullChar), and then append or prepend the tag, depending on whatever you're doing with your weird non-DWORD handling of it. [/quote] I have. Here's what I tried before using that: ClanTag = String(4, vbNullChar) & StrReverse(txtTag.Text) ClanTag = Right$(ClanTag, 4) [/quote] Why don't you just use CopyMemory()...? | March 19, 2005, 2:44 AM |
inner. | I'll try it. Edit: [code] Private Sub cmdInvite_Click() Dim ClanTag As String, ClanName As String, strCandidates As String Dim I As Integer, intCount As Integer ClanTag = PBuffer.GetDWORD(StrReverse(txtTag.Text)) ClanName = txtClanName.Text For I = 1 To lstMembers.ListItems.Count If lstMembers.ListItems.Item(I).Checked Then: strCandidates = strCandidates & lstMembers.ListItems.Item(I).Text & Chr$(0) If lstMembers.ListItems.Item(I).Checked Then: intCount = intCount + 1 Next I With PBuffer .InsertDWORD GetTickCount() .InsertNTString ClanName .InsertDWORD StrReverse(ClanTag) .InsertBYTE intCount .InsertNonNTString strCandidates .sendPacket &H71 End With End Sub [/code] | March 19, 2005, 3:50 AM |
QwertyMonster | [quote author=inner. link=topic=10941.msg104482#msg104482 date=1111204202] I'll try it. Edit: [code] Private Sub cmdInvite_Click() Dim ClanTag As String, ClanName As String, strCandidates As String Dim I As Integer, intCount As Integer ClanTag = PBuffer.GetDWORD(StrReverse(txtTag.Text)) ClanName = txtClanName.Text For I = 1 To lstMembers.ListItems.Count If lstMembers.ListItems.Item(I).Checked Then: strCandidates = strCandidates & lstMembers.ListItems.Item(I).Text & Chr$(0) If lstMembers.ListItems.Item(I).Checked Then: intCount = intCount + 1 Next I With PBuffer .InsertDWORD GetTickCount() .InsertNTString ClanName .InsertDWORD StrReverse(ClanTag) .InsertBYTE intCount .InsertNonNTString strCandidates .sendPacket &H71 End With End Sub [/code] [/quote] Why did u just post some code? Without saying wether its working or something wrong? What do u want us to do with that code? :-\ | March 19, 2005, 10:34 AM |
UserLoser. | [quote author=QwertyMonster link=topic=10941.msg104499#msg104499 date=1111228445] Why did u just post some code? Without saying wether its working or something wrong? What do u want us to do with that code? :-\ [/quote] His problem has already been solved, yet he's coming back for more help on nothing. I don't think he should be posting any code | March 19, 2005, 6:13 PM |
inner. | [quote author=UserLoser link=topic=10941.msg104539#msg104539 date=1111255980] [quote author=QwertyMonster link=topic=10941.msg104499#msg104499 date=1111228445] Why did u just post some code? Without saying wether its working or something wrong? What do u want us to do with that code? :-\ [/quote] His problem has already been solved, yet he's coming back for more help on nothing. I don't think he should be posting any code [/quote] No, on the invitation it only say's Clan, no name in it. | March 19, 2005, 9:07 PM |
Quarantine | Then thats and error on your side. | March 19, 2005, 9:18 PM |
inner. | This has been working all along.. My god. I sent it and on the invitation it said "Clan". But I told people to accept it and everyone did and it made the clan I wanted it to. Would anyone know why it only says Clan? | March 19, 2005, 11:37 PM |
KkBlazekK | Because your not including the variable that shows the actual clans name on the display message? | March 20, 2005, 12:54 AM |