-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help converting RichPresence data to byte[] #108
Comments
I believe this is binary VDF. Here are decoder implementations: https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Types/KeyValue.cs https://github.com/seishun/node-steam/blob/master/lib/VDF.js |
SteamKit already has a method for reading them. However, I don't think that On Mon, Apr 20, 2015 at 1:10 PM, Rossen Georgiev notifications@github.com
|
I've also tried copying the incoming rich presence from a second client, but no callback-manager seems to catch an incoming ClientRichPresenceInfo message. Nethook catches it without a problem. Am I missing a callback or is there a way to see all incoming messages? |
SteamKit doesn't provide a built-in callback for rich presence, you'd need to implement your own handler for it. And as @psychonic previously mentioned, we also don't have an implementation for writing out binary KV, only reading. |
Thanks for the help. I've gotten a callback working and copied the key value into my CMsgClientRichPresentUpload, but unfortunately it doesn't seem to be enough. No clients are receiving the update. I'm still trying to convert the key values into string or byte[], but there are always some bytes wrong. If I convert "RP�status#DOTA_RP_SPECTATING�num_params0�watching_server[A:1:2280182793:5413]�watching_from_server[A:1:2840994821:5413]��" to hex and back, the text becomes broken. The hex seems to miss only 0's (2 at the start for example). Edit: even when copying the key value, the bytes seem wrong. Here's the part my code:
If i compare the hex values of both messages, one start with "0525001" (wrong) and the other one starts with "0052500001". |
If you're just copying the byte[] directly from another client's rich presence to the upload message's byte[], that should just work. You shouldn't have to convert to string or anything. That said, I personally don't know how RP uploading works, or whether it needs to be in a specific/different format than what friends of the uploading client receive. I'd go with using nethook, launching dota, and seeing what the client uploads and how it's doing it. |
I'd been meaning to implement binary serialisation for now, and that's done simply in 1f1a183. As far as I know, each game has it's own Rich Presence definition, so you'll need to NetHook it out of that game. Note that if your Rich Presence object requires data types beyond just KeyValues Object and String, you won't be able to use |
Binary saving is great, but there doesn't appear to get it back without saving to a file? There should be a |
The Body of CMsgClientRichPresenceUpload contains RichPresence data, which seems to be a byte array. If I change the view on the analyzer to Binary Key Values, it looks like a serialized class. I've tried multiple ways to convert my own data into that byte array, but I always get different values.
Example:
bytes: 00525000017374617475730023444F54415F52505F424F54505241435449434500016E756D5F706172616D73003000017761746368696E675F736572766572005B413A313A323130383933353136393A353431325D00017761746368696E675F66726F6D5F736572766572005B413A313A3836343436383939343A353431325D000808
utf8 string: \0RP\0�status\0#DOTA_RP_BOTPRACTICE\0�num_params\00\0�watching_server\0[A:1:2108935169:5412]\0�watching_from_server\0[A:1:864468994:5412]\0��
Neither creating a RP class and serializing nor converting a string to byte array seems to get an identical result.
The RichPresense is used to show friends what you're currently doing (playing/watching etc) inside a game.
The text was updated successfully, but these errors were encountered: