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

Add stats & achievements API #8

Merged
merged 1 commit into from May 16, 2019

Conversation

Projects
None yet
2 participants
@alexheretic
Copy link
Contributor

commented May 16, 2019

This pr adds wrappers for the achievements flow:

  • RequestCurrentStats
  • {Get,Set,Clear}Achievement
  • StoreStats

Plus associated callback types. I also fixed some c_char binding issues as a new callback includes a c_char array.

I'll be using this API in Robo Instructus.

let user_stats = client.user_stats();
user_stats.request_current_stats();

// run callbacks

user_stats.achievement("WIN_THE_GAME").set()?;
user_stats.store_stats()?;
/// client.user_stats().achievement("WIN_THE_GAME").set()?;
/// # Err(())
/// ```
pub struct AchievementHelper<'parent, M> {

This comment has been minimized.

Copy link
@Thinkofname

Thinkofname May 16, 2019

Owner

Unless something else is going to be called Achievement (I don't know, I haven't really looked into the achievement side of steamworks yet) this might as well be called Achievement instead.

This comment has been minimized.

Copy link
@alexheretic

alexheretic May 16, 2019

Author Contributor

That would work too. I guess I called it helper as it doesn't directly map to the steam API interfaces, instead these are still in ISteamUserStats, it also is a reference based helper rather than an Arc one as the usage should be short-lived, builder style.

In any case I don't think it's a big deal either way, so let me know how you'd prefer it.

This comment has been minimized.

Copy link
@Thinkofname

Thinkofname May 16, 2019

Owner

Fair enough.

@Thinkofname Thinkofname merged commit 7d2ed5e into Thinkofname:master May 16, 2019

@Thinkofname

This comment has been minimized.

Copy link
Owner

commented May 16, 2019

Thanks!

@alexheretic alexheretic deleted the alexheretic:achievements branch May 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.