otavepto / gbe_fork

Fork of https://gitlab.com/Mr_Goldberg/goldberg_emulator
https://gitlab.com/Mr_Goldberg/goldberg_emulator
GNU Lesser General Public License v3.0
185 stars 54 forks source link

missing inheritance from interface `ISteamUser022` + refactor #159

Closed otavepto closed 1 month ago

otavepto commented 1 month ago

Motivation

Benefits

Test

Tested on appid 108500, it won't launch without proper steam_interface.txt, proving that these new C++ casts are working exactly as the old C-Style casts.

Info

Search regex pattern

return\s*\((.+?)\)\s*\(\s*void\s*\*\s*\)\s*\((.+?)\)(\w+);

Replace pattern

return reinterpret_cast<$1>(static_cast<$2>($3));

Around ~216 changes (C-Style casts)

Detanup01 commented 1 month ago

In interface getter there is SteamGameServer006 and 007 which returns 008 is that intentional?

otavepto commented 1 month ago

I didn't really change the interface versions except for Steam_User.
Looking at the class, it's indeed missing these 2 interfaces https://github.com/otavepto/gbe_fork/blob/2eb964617dfe3b40e0234a3e4755dddcf75dbc9d/dll/dll/steam_gameserver.h#L41-L51

Looking at the original code on gitlab it is also the same, either this was missed, or the SDK never actually provided them https://gitlab.com/Mr_Goldberg/goldberg_emulator/-/blob/master/dll/steam_gameserver.h?ref_type=heads#L31-41

And the .h file doesn't exist in the sdk/steam folder

I just applied the regex, moved the interface getters, and solved the new compilation error. There are actually some other missing ones for different classes, should we open a separate issue for them so we can look into it later ?

otavepto commented 1 month ago

I've changed all the remaining ones, this regex didn't match any (void *) casts any longer

\(\s*?void\s*?\*\s*?\)

Please check my comment above regarding missing interfaces and feel free to merge if all look good.

Detanup01 commented 1 month ago

looks good, I would request as a "feature" that if interface couldnt exist we save what is the errored interface and quit.

otavepto commented 1 month ago

create new #160 and #161

Detanup01 commented 1 month ago

Looks good. You can merge (currently cant approve or anything since on mobile)

otavepto commented 1 month ago

@Detanup01 Check if you can create a release without any permission problems. Create a tag locally, should match the pattern release-*, replace the asterisk with anything, for lack of creativity for example, I put the date in this format yyyy_m_d

git tag release-2024_1_1

Then push this tag to the origin

git push origin tag release-2024_1_1

Successful output will look like this

Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:otavepto/gbe_fork.git
 * [new tag]           release-2024_1_1 -> release-2024_1_1

The workflow scripts will take of building, packaging, and creating the release, but the changelog is done manually.
Do it whenever you like really 👍