yao Posted May 5, 2023 Report Posted May 5, 2023 Hi I am trying to use Java to connect to Steam GC and obtain CSGO information.This is a part of the CMsgClientWelcome I parsed, where you can see the game_data and object_data is not parsed, I would like to know how to parse this part: version: 0 game_data: "(\337\230\302\362\b0\000P\204\336\273\241\006`\347\216\256\242\006h\274\327\314\327\003" outofdate_subscribed_caches { objects { type_id: 1 object_data: "\b\230\353\207\205n\020\276\250\227\333\005\030\001 \261\t(\0010\0018\004@\000H\002p\000\230\001\001" Quote
yao Posted May 5, 2023 Author Report Posted May 5, 2023 I noticed that the fields of this bytes type have withdrawals in the proto, such as object_data is CSOEconItem. But I still have a question. The fields parsed by CSOEconItem are all numbers. How can I know the meaning represented by numbers, such as inventory, quantity, level, etc.? Is there a dictionary table that can be queried Additionally, CSOEconItem ->attribute ->value_bytes is also a type of bytes, and I couldn't find its corresponding message in the proto file Quote
Dr. McKay Posted May 6, 2023 Report Posted May 6, 2023 Every GC is just a copy of TF2, so check out the documentation on the TF2 wiki. value_bytes is not a serialized protobuf message. You need to either read that value as an integer or a float (little-endian), depending on what the item schema specifies the type of the attribute should be. Quote
yao Posted May 10, 2023 Author Report Posted May 10, 2023 Thanks for your help, I have successfully parsed the CSOEconItem. Now I want to move items into and out of the casket. I noticed that there are two parameters in your code such as addToCasket, which are casketId and itemId. Can these two ids be considered as the id in CSOEconItem, that is, the casketid is the id in the CSOEconItem of the casket? ? (I noticed that you extracted the value_bytes of def_index=272 and 273 as the casketid, but in fact I did not find these two values(def_index=273 & 273) during the test. According to my current understanding, if I want to know which component the item belongs to, I can only get it the item in the casket is obtained.) In addition, I found that you get inventory information update by receiving SO_UpdateMultiple and SO_Create, SO_Update, SO_Destroy. But I didn't find out what message to send to the GC to receive the reply?I hope you can tell me what message to send to gc. And what is the difference between these two replies? If I want to monitor inventory changes, do I only need to implement one?(SO_UpdateMultiple or SO_Create, SO_Update, SO_Destroy) .Do I need to keep sending messages to get the reply, or after I send it once, I will get a callback every time the inventory is updated? Quote
Dr. McKay Posted May 10, 2023 Report Posted May 10, 2023 11 hours ago, yao said: Now I want to move items into and out of the casket. I noticed that there are two parameters in your code such as addToCasket, which are casketId and itemId. Can these two ids be considered as the id in CSOEconItem, that is, the casketid is the id in the CSOEconItem of the casket? Yes. 11 hours ago, yao said: T(I noticed that you extracted the value_bytes of def_index=272 and 273 as the casketid, but in fact I did not find these two values(def_index=273 & 273) during the test. According to my current understanding, if I want to know which component the item belongs to, I can only get it the item in the casket is obtained.) Those attributes indicate which casket an item is contained in. When you fetch a casket's contents, the items inside of it are spat into your inventory as standard CSOEconItem objects, and you need to check attributes 272 and 273 to figure out which items are contained within the casket. 11 hours ago, yao said: In addition, I found that you get inventory information update by receiving SO_UpdateMultiple and SO_Create, SO_Update, SO_Destroy. But I didn't find out what message to send to the GC to receive the reply?I hope you can tell me what message to send to gc. And what is the difference between these two replies? If I want to monitor inventory changes, do I only need to implement one?(SO_UpdateMultiple or SO_Create, SO_Update, SO_Destroy) .Do I need to keep sending messages to get the reply, or after I send it once, I will get a callback every time the inventory is updated? Those messages just get sent automatically. There's nothing you need to send to request them. You need to listen for all of those messages. SO_Create is sent when you receive a new item, SO_Update is sent when an item in your inventory is changed in some way, SO_UpdateMultiple is the equivalent of multiple SO_Update messages. Quote
yao Posted May 13, 2023 Author Report Posted May 13, 2023 Thanks, I have successfully parsed Casket with Item. Now I am trying to get the items in the caskets. I refer to your getCasketContents and send the Language.CasketItemLoadContents(1094) message to the GC. The message content contains two param casketId of CMsgCasketItem. The castketId is the id I got from parsing the CSOEconItem. I received 3 returned messages through the callback, and the msgTypes are 9110, 9194, and 9173. I feel that they are not the information I want, and I have not found a way to read and parse them. Is there any problem with my above operation, how can I parse the message returned by Language.CasketItemLoadContents Quote
skr1pt Posted May 13, 2023 Report Posted May 13, 2023 check this https://github.com/nombersDev/casemove Quote
yao Posted May 14, 2023 Author Report Posted May 14, 2023 17 hours ago, skr1pt said: https://github.com/nombersDev/casemove In fact, I have read the code of casemove, but it is more about importing node-globaloffensive. I'm trying to add some csgo inventory and casket operations to my project implemented in java. I have initially obtained and parsed the inventory. I am currently trying to obtain the items in the casket, and then I need to complete the addToCasket and removeFromCasket. At present, I have encountered problems when testing to obtain the items in the casket, so I raised the above doubts Quote
Dr. McKay Posted May 14, 2023 Report Posted May 14, 2023 CasketItemLoadContents doesn't return anything sane, because it's Valve. When you send it, you get back a bunch of SO_Create messages for the items in the casket. Basically, they get added to your inventory as if they were presently in your inventory, even though they aren't. That's where you need to check those two attributes to determine which items are in the casket. Quote
yao Posted May 14, 2023 Author Report Posted May 14, 2023 Thanks, as you said.I did receive the SO_Create message, which contains the casketId. Does this mean that my getCasketContents does not need to receive any return parameters, but only needs to listen to the SO_Create message? In addition, when I was executing the test (connecting to steam GC, logging in to csgo, getting inventory, and getting items in the casket), and then when I received SO_Create, I also received SO_Destroy messages. I am very sure that the items in my inventory have not changed , which puzzles me. Moreover, SO_Create and So_Destroy seem to be together. Every SO_Create I receive is accompanied by a So_Destroy. It seems that So_Destroy is used to offset a SO_Create In the ClientWelcome message, in addition to the caskets and items in the inventory, I also received two items that I don’t know what they are. Their data is as follows. I think I can ignore them: id: 17293822569102708641 account_id: 1533400126 inventory: 3221225477 def_index: 4001 quantity: 1 level: 1 quality: 4 flags: 24 origin: 8 in_use: false rarity: 1 id: 17293822569110896676 account_id: 1533400126 inventory: 3221225477 def_index: 36 quantity: 1 level: 1 quality: 1 flags: 24 origin: 8 attribute { def_index: 6 value_bytes: "\000\000\372B" } in_use: false rarity: 4 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.