PaulCombal / SamRewritten

Steam Achievement Manager For Linux. Rewritten in C++.
GNU General Public License v3.0
353 stars 34 forks source link

Completed X of Y is not yet implemented #125

Open 5HT2 opened 2 years ago

5HT2 commented 2 years ago

image image

5HT2 commented 2 years ago

Update: I've now spent three hours trying to get anywhere with this issue and I can't get anywhere useful.

What I've figured out

@PaulCombal where did you get GET_ACHIEVEMENT_STATS from? That would be the next step for implementing this

PaulCombal commented 2 years ago

Hello,

This feature was just never implemented, it's not broken.

On another note, I'm very glad you're looking into the code and willing to contribute! Have you read the few documentation I've left in the doc folder? As a reminder, it can be found online here and will answer most of your questions.

You have found the documentation for the web developer API, which SamRewritten does NEVER use. It uses the steamworks C++ API, as described in the documentation. EDIT: my bad this is the right one, but just the overview

As for GET_ACHIEVEMENT_STATS, can you please link a Github file/line reference?

Thank you, and let me know whether you missed the doc or if it is just unclear

5HT2 commented 2 years ago

As for GET_ACHIEVEMENT_STATS, can you please link a Github file/line reference?

Sorry, I typed the issue from memory, I meant to say GET_ACHIEVEMENTS.

I was referring to https://github.com/PaulCombal/SamRewritten/blob/be64ba67b36fab121e717ca55b8b1f37c87d10af/src/controller/MySteam.cpp#L190

Specifically the make_get_achievements_request_string() bit.

5HT2 commented 2 years ago

Thank you, and let me know whether you missed the doc or if it is just unclear

Your documentation is just fine, I'm struggling to find Steam's own documentation for it's available IPC requests / responses.

PaulCombal commented 2 years ago

Don't you have your IDE set up to get to declarations to have something similar to this:

image

You can follow everything to its declaration this way. I'm not sure what you don't understand here so I'll give a little context. This line is the client asking the "server" to send back the achievements and stats. make_get_achievements_request_string() will produce a string, just like a plain HTTP request in traditional web. request_response sends this string over to the server, which returns a response, also as a string. Both the request and response are JSON formatted strings.

If you want to fix the issue, I think you should better focus on "server" code. I do not think Steamworks provides a way to figure if an achievement is linked to a stat (I've only reread ISteamUserStats), so my best bet would be to dig around the file parser to see if there is any extra info in the "cache" files.

Also, if you do not have a clear understanding of the steamworks API, remember that there is a full app example included in the SDK zip, doc here.

EDIT: Apparently I also left comments in Actions.h detailing the format of the JSON ipc

5HT2 commented 2 years ago

I do understand what it's doing. By "where did you get it from" I was wondering how you figured out that that's the string you need to use in the request. You're manually declaring GET_ACHIEVEMENTS in the headers, so it isn't being pulled from steamworks.

I do not think Steamworks provides a way to figure if an achievement is linked to a stat (I've only reread ISteamUserStats), so my best bet would be to dig around the file parser to see if there is any extra info in the "cache" files.

That's where I was at before, I was looking through the Steamworks sdk for any hint to that. Which file parser and which cache files are you talking about?

PaulCombal commented 2 years ago

Is this what you're talking about? https://github.com/PaulCombal/SamRewritten/blob/master/src/types/Actions.h#L5 https://github.com/PaulCombal/SamRewritten/blob/master/src/types/Actions.h#L37

This is me manually defining a string and an enum.. All the IPC between the client process and server process has been written by me and another contributor. That means I wrote the instructions to send it, and how to react when it is received, this is all custom. Doing a simple Ctrl+shift+f on GET_ACHIEVEMENTS_STR gives you a great idea where it is encoded and decoded on both sides.

As for the parser, I mention it in the doc.

5HT2 commented 2 years ago

Oh, I see. The entire parser and IPC wrapper you wrote flew over my head, that makes significantly more sense.

I'll take a look through more of the steamworks lib, what was the "cache" files you mentioned before?

PaulCombal commented 2 years ago

This is explained in the same paragraph I linked in my previous message. Maybe it needs more explanation: as far as I know, when Steamapi_init is called, steam caches a file about stats and achievements somewhere in your Steam folder. SamRewritten reads this file to extract some extra info.

I added a link to the parser implementation in the documentation.

5HT2 commented 2 years ago

Ahh, thank you.