Skip to content

Update Steamworks API to 1.6.2 #689

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

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

MindsEyeGames
Copy link

Attempted to follow the instructions in CodeGen/README.md, and then updated the dll/so/dylib files and the info in Version.cs.

I might have missed a step, please double-check this all looks good :/ Additionally, this was done on Windows (and thus there are unfortunately line ending changes in this), so I assume it's preferable to just have someone more connected to the project do it directly on Linux :/

But figured I would try to contribute a version update since I was asking for it in #687 - hopefully this is helpful!

(It's worth noting that some parts of the API seem to have been deprecated/removed in this version update - those functions look less common, but still worth calling out)

khyperia and others added 2 commits January 13, 2025 12:11
Attempted to follow the instructions in CodeGen/README.md, and then updated the dll/so/dylib files and the info in Version.cs

This was done on Windows (and thus there are unfortunately line ending changes in this), so I assume it's preferable to just have someone more connected to the project do it directly on Linux :/ But figured I would try to contribute a version update since I was asking for it in rlabrecque#687

Additionally, some parts of the API seem  to have been deprecated/removed - those functions look less common but worth calling out.
@MindsEyeGames MindsEyeGames requested a review from yaakov-h March 20, 2025 02:43
@MindsEyeGames
Copy link
Author

Unfortunately when testing this locally, it looks like the auto code gen made some errors in generating the new files?

I am not sure if I followed the directions incorrectly, or this is a Windows/linux difference thing, or something else went wrong.

Is there a particular timeframe by when the core library can be updated to 1.6.2? If that's relatively soon, I can revert this pull request

@rlabrecque
Copy link
Owner

I'll try to get to it this weekend

FWIW when testing the "GetInput" function, it *is* returning the correct number of input events, but does not seem to actually be storing the values in the passed-in array.

I am unsure what the correct fix is here TBH, I am not familiar enough with c/c# native interop to know if this is a bad way of getting the array changes propagated to C#
@MindsEyeGames
Copy link
Author

I'll try to get to it this weekend

Thank you very much!

FWIW I have been trying to test these changes locally, updated this pull request with a commit that gets things working/functional. (I am still unsure if the typos in question from the code autogen are windows-specific or something)

I would also call out that changing the "out RemotePlayInput_t" native call to "RemotePlayInput_t[]" (which from what I see online should be fine?) does not seem to cause the structs within the array to actually have their data populated (or at least, I'm getting only unknown type events, though the number returned seems accurate). Not sure if I've just changed the type to a wrong thing though :/

This *partially* addresses the struct type union (I believe mouse motion events are being properly serialized) but I can't figure out what's wrong with key press/other events, and it seems to not be handling multi-event responses correctly.

I think someone who knows a lot more about code interop needs to take it from here, honestly :/
@MindsEyeGames
Copy link
Author

Alright, I think I understand the core issue - the union in the RemotePlayInput_t c struct needs to be very explicitly handled in C#. Took my best crack at fixing it, and it seems to handle mouse movement now but other event types are still failing.

@MindsEyeGames
Copy link
Author

As an update, this did actually fix the c#<>c struct issues - have been able to play fully remote mouse + keyboard with it. (An unrelated bug in my integration code was impacting other events 9_9)

@rlabrecque
Copy link
Owner

rlabrecque commented Mar 31, 2025

Could you try this out, and potentially try rebasing this PR onto the wip/v1.62 branch just to see how our changes line up?
cc3402d
EDIT: This change is missing the .meta files!

For the RemotePlayInput_t struct, I ended up going with a Custom Type, and following some of your lead with the explicit Size for the padding. But I also aligned it to be closer to some of our other union based types like SteamNetworkingConfigValue_t. We originally did this just so that it's a little more explicit that they are all one value and you're only supposed to access one; and to be able to grab the whole unions size as a whole for the struct size.

JamesMcGhee and others added 8 commits April 2, 2025 00:02
Attempted to follow the instructions in CodeGen/README.md, and then updated the dll/so/dylib files and the info in Version.cs

This was done on Windows (and thus there are unfortunately line ending changes in this), so I assume it's preferable to just have someone more connected to the project do it directly on Linux :/ But figured I would try to contribute a version update since I was asking for it in rlabrecque#687

Additionally, some parts of the API seem  to have been deprecated/removed - those functions look less common but worth calling out.
FWIW when testing the "GetInput" function, it *is* returning the correct number of input events, but does not seem to actually be storing the values in the passed-in array.

I am unsure what the correct fix is here TBH, I am not familiar enough with c/c# native interop to know if this is a bad way of getting the array changes propagated to C#
This *partially* addresses the struct type union (I believe mouse motion events are being properly serialized) but I can't figure out what's wrong with key press/other events, and it seems to not be handling multi-event responses correctly.

I think someone who knows a lot more about code interop needs to take it from here, honestly :/
@MindsEyeGames
Copy link
Author

MindsEyeGames commented Apr 29, 2025

Updated! I had to remove a duplicate struct declaration but other than that it appears to work fine!

Sorry for the delay, was dealing with a number of things on my end :/

@Withaust
Copy link

Withaust commented May 3, 2025

@MindsEyeGames How production-ready is your PR in its current state? I was hopping of using your branch as a substitute to the official merge/update till it will come on later

@MindsEyeGames
Copy link
Author

@MindsEyeGames How production-ready is your PR in its current state? I was hopping of using your branch as a substitute to the official merge/update till it will come on later

So I believe it is fully functional (and am using it in the current multiplayer playtest I'm running for INTO EVIL https://store.steampowered.com/app/1893440/INTO_EVIL/) - so far no issues in testing.

You should obviously test for yourself tho

Withaust added a commit to UnarySoftware/Steamworks.NET that referenced this pull request May 3, 2025
@Withaust
Copy link

Withaust commented May 3, 2025

@MindsEyeGames It seems that if you were to use your PR as a package with a GIT URL, you are going to be getting these errors since there is a .meta file missing for one of the new scripts added
{056B1F59-12DE-40D2-BFFF-E2EB42DF2695}

Withaust added a commit to UnarySoftware/Steamworks.NET that referenced this pull request May 4, 2025
Withaust added a commit to UnarySoftware/Steamworks.NET that referenced this pull request May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants