Skip to content
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

ISteamInventory get_all_items, get_result_items, SteamInventoryResultReady, SteamInventoryFullUpdate #205

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

Conversation

jstroh
Copy link

@jstroh jstroh commented Sep 9, 2024

I have tested this with app id 480 and my own app id of 2957110 with a user that had items in their inventory. It works as expected.

@ceifa
Copy link
Collaborator

ceifa commented Sep 14, 2024

The build is failing, can you take a look?

@ceifa
Copy link
Collaborator

ceifa commented Sep 14, 2024

I like the way some methods on UGC handle call_results, to make the API more rusty. I think these callbacks can be unnecessary, if the methods return the results themselves. Also destroy_result could be called inside a drop, to prevent leaking memory on the SDK side.

@jstroh
Copy link
Author

jstroh commented Sep 15, 2024

The build is failing, can you take a look?

rustfmt.toml seems to be the culprit? I don't know what the issue is.
https://github.com/Noxime/steamworks-rs/actions/runs/10783447860/job/30144901658?pr=205

@jstroh
Copy link
Author

jstroh commented Sep 15, 2024

I like the way some methods on UGC handle call_results, to make the API more rusty. I think these callbacks can be unnecessary, if the methods return the results themselves. Also destroy_result could be called inside a drop, to prevent leaking memory on the SDK side.

So get_all_items returns a result handle, the callbacks alert as to when the result handle is ready, and
get_result_items gets the actual items with the result handle.

I had destroy_result in get_result_items but I felt if you were using one of the two callbacks or even polling the result handle that you might want to dispose in a few different ways.

That being said, all of these could be private and then we have a public getItems that uses the private functions and we get rid of the publicly usable callbacks.

@ymo-4
Copy link
Contributor

ymo-4 commented Oct 1, 2024

The build is failing, can you take a look?

rustfmt.toml seems to be the culprit? I don't know what the issue is. https://github.com/Noxime/steamworks-rs/actions/runs/10783447860/job/30144901658?pr=205

Probably, you need to run cargo fmt to fix this

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.

3 participants