Skip to content

Upgrade to steamworks-rs v0.12.1 #196

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 4 commits into
base: main
Choose a base branch
from

Conversation

jespertheend
Copy link

No description provided.

@@ -24,8 +24,6 @@ pub fn init(app_id: Option<u32>) -> Result<(), Error> {
| SteamAPIInitError::VersionMismatch(msg) => Error::from_reason(msg),
})?;

steam_client.user_stats().request_current_stats();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was deprecated in version 1.61 of the steamworks sdk:

ISteamUserStats:

  • RequestCurrentStats is no longer necessary and has been removed. The Steam Client will synchronize this data before your game launches.

@jespertheend jespertheend marked this pull request as draft July 18, 2025 12:03
@jespertheend
Copy link
Author

Seems like I'm running into an error with these changes:

Error: The specified procedure could not be found.
\\?\C:\Users\Jesper\Documents\repositories\steamworks.js\dist\win64\steamworksjs.win32-x64-msvc.node
    at process.func [as dlopen] (node:electron/js2c/node_init:2:2559)
    at Module._extensions..node (node:internal/modules/cjs/loader:1602:18)
    at Object.func [as .node] (node:electron/js2c/node_init:2:2559)
    at Module.load (node:internal/modules/cjs/loader:1295:32)
    at Module._load (node:internal/modules/cjs/loader:1111:12)
    at c._load (node:electron/js2c/node_init:2:16955)
    at Module.require (node:internal/modules/cjs/loader:1318:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (C:\Users\Jesper\Documents\repositories\steamworks.js\index.js:8:21)
    at Module._compile (node:internal/modules/cjs/loader:1484:14)

Still investigating what's going on here so I'll leave this as draft for now

if let Some(handle) = self.handle.take() {
handle.disconnect();
}
get_registry().lock().unwrap().remove(&self.id);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these changes are basically here to re-fix #77.
Noxime/steamworks-rs#128 was reverted in Noxime/steamworks-rs#241, and it seems like the fix on steamworks-rs's side is not coming back. So instead I tried to fix this on the rust side of things in steamworks.js. Basically a reference to each handle is kept in the CALLBACK_REGISTRY, which is removed from the registry when the user calls disconnect()

I'll have to admit I used a fair bit of AI to get this part to work as I'm not too familiar with rust. So feel free to make changes if this is absolute garbage.

@jespertheend jespertheend marked this pull request as ready for review July 18, 2025 17:54
@jespertheend
Copy link
Author

Seems like the error was just a result of outdated redistributable files, this should be ready now!

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.

1 participant