Jump to content


Photo

Renaming items no longer works


  • Please log in to reply
15 replies to this topic

#1 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 16 March 2019 - 07:12 PM

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. 



#2 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 16 March 2019 - 07:24 PM

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.



#3 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,140 posts

Posted 16 March 2019 - 08:57 PM

I'm confused. When does it work and when doesn't it?



#4 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 16 March 2019 - 09:24 PM

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.



#5 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,140 posts

Posted 16 March 2019 - 09:45 PM

Yes, v2 came with many breaking changes. I think probably all you need to do is get rid of the coerceToLong calls.



#6 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 16 March 2019 - 10:00 PM

I'll try that out, thanks! I'll submit a pull request (properly this time, tabs and all) if it works.



#7 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 16 March 2019 - 10:03 PM

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.



#8 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,140 posts

Posted 16 March 2019 - 10:25 PM

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.



#9 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 16 March 2019 - 11:14 PM

I see. 

 

So I see there's a 

k_EMsgGCNameBaseItemResponse

Would 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.



#10 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,140 posts

Posted 16 March 2019 - 11:16 PM

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.



#11 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 16 March 2019 - 11:29 PM

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.



#12 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,140 posts

Posted 16 March 2019 - 11:57 PM

I need the full error, and I need to know what line corresponds to the line number it's triggering on.



#13 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 17 March 2019 - 12:01 AM

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 NameBaseItemResponse

Is there a way to callback NameBaseItemResponse?


Edited by Acorn Eyes, 17 March 2019 - 12:04 AM.


#14 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,140 posts

Posted 17 March 2019 - 02:57 AM

You could handle the NameBaseItemResponse, sure, but you'd have to figure out what the byte stream means.



#15 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 17 March 2019 - 04:06 AM

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. 



#16 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,140 posts

Posted 18 March 2019 - 04:43 PM

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users