Acorn Eyes Posted March 17, 2019 Report Posted March 17, 2019 I revisted the whole function you helped me make a while ago, GlobalOffensive.prototype.nameItem = function(nameTagID, itemID, customName) { let buffer = new ByteBuffer(16 + Buffer.byteLength(customName) + 1); buffer.writeUint64(coerceToLong(nameTagID)); buffer.writeUint64(coerceToLong(itemID)); buffer.writeUint8(0); buffer.writeCString(customName); this._send(Language.NameItem, null, buffer); }; And it no longer seems to work. I'd also like to apologize for not submitting the pull request, I never got notified you responded so I wasn't aware that I submitted it against my own fork. Too late for that now since like I said, it no longer seems to work. Quote
Acorn Eyes Posted March 17, 2019 Author Report Posted March 17, 2019 I just cloned the forked repository after merging my own pull request to see if it was the module or CSGO itself that broke the function, it still works with version 1.3.2 I don't wish to take up your time, but I'm at a complete loss as to why that is. Quote
Dr. McKay Posted March 17, 2019 Report Posted March 17, 2019 I'm confused. When does it work and when doesn't it? Quote
Acorn Eyes Posted March 17, 2019 Author Report Posted March 17, 2019 I'm confused. When does it work and when doesn't it?It does not work in the latest version, version 2.0.1 It does still work in version 1.3.2, the one from where you originally helped create the function Which leads me to believe that there was a change in module, not the game coordinator, that prevents it from working. Quote
Dr. McKay Posted March 17, 2019 Report Posted March 17, 2019 Yes, v2 came with many breaking changes. I think probably all you need to do is get rid of the coerceToLong calls. Quote
Acorn Eyes Posted March 17, 2019 Author Report Posted March 17, 2019 I'll try that out, thanks! I'll submit a pull request (properly this time, tabs and all) if it works. Quote
Acorn Eyes Posted March 17, 2019 Author Report Posted March 17, 2019 Slightly unrelated question, is there a way to list all itemIDs, including items that are of base qualities? Since it's possible to rename base grade items through the client, I'm assuming the itemIDs for those items are already there. Quote
Dr. McKay Posted March 17, 2019 Report Posted March 17, 2019 Base quality ("stock") items do not have IDs. In TF2, there's a separate GC message used to rename a stock item (NameBaseItem). The value exists in CS:GO's GC message enum, but that doesn't necessarily mean anything as it was just copied and pasted from TF2 and the message may not do anything on the backend. I believe the buffer you should send with that message is a 32- or 64-bit (dunno which, exactly) defindex, followed by the C string. Quote
Acorn Eyes Posted March 17, 2019 Author Report Posted March 17, 2019 I see. So I see there's a k_EMsgGCNameBaseItemResponseWould this help me in any way understand what it expects? So if I for example send this._send(Language.NameBaseItem, null, nameTagID+WEAPON_TASER+0+customName); I'd like to know why it doesn't like that. There's only so many nametags I can get, I don't want to burn through them blindly guessing. Quote
Dr. McKay Posted March 17, 2019 Report Posted March 17, 2019 You need to do it like the other message, with a ByteBuffer. Replace the second writeUint64 with writeUint32 and put the item's defindex in there. But it probably won't work. Quote
Acorn Eyes Posted March 17, 2019 Author Report Posted March 17, 2019 Yeah I just opted to not include writing all those variables into a buffer for readability I'm getting an error Illegal value: "+value+" (not an integer) However its setup nearly identically to the last function: GlobalOffensive.prototype.nameBaseItem = function(nameTagID, defIndex, customName) { let buffer = new ByteBuffer(12 + Buffer.byteLength(customName) + 1); buffer.writeUint64(nameTagID); buffer.writeUint32(defIndex); buffer.writeUint8(0); buffer.writeCString(customName); this._send(Language.NameBaseItem, null, buffer); }; So I'm not sure why it wouldn't accept Buffer.byteLength(customName) Despite being unchanged. Quote
Dr. McKay Posted March 17, 2019 Report Posted March 17, 2019 I need the full error, and I need to know what line corresponds to the line number it's triggering on. Quote
Acorn Eyes Posted March 17, 2019 Author Report Posted March 17, 2019 (edited) It turns out I was confusing myself with all the files open. I was changing values in a config for the forked older version when I thought I was editing v2 Long story short, the error is irrelevant and I already fixed it. However with both nameBaseItem and nameItem, the request goes through but nothing happens. Sending GC message NameBaseItem Got unhandled GC message NameBaseItemResponseIs there a way to callback NameBaseItemResponse? Edited March 17, 2019 by Acorn Eyes Quote
Dr. McKay Posted March 17, 2019 Report Posted March 17, 2019 You could handle the NameBaseItemResponse, sure, but you'd have to figure out what the byte stream means. Quote
Acorn Eyes Posted March 17, 2019 Author Report Posted March 17, 2019 That's a good point. So it's probably a lost cause to try and decipher that? Regardless, I'm still not entirely sure what is causing both functions (specifically NameItem which I know works in previous versions) to go through but not do anything. Does it have something to do with protobuf v6? As a sidenote: I really appreciate all the help you've given. I don't know how much people donate to you, but I doubt it's enough. Quote
Dr. McKay Posted March 18, 2019 Report Posted March 18, 2019 I wouldn't expend the effort, no. It could just be an EResult, or it could be something really complex. Protobuf v6 shouldn't have anything to do with it as these aren't protobuf messages. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.