Skip to content

Commit

Permalink
Add unlock time column to Manager. Fixes #412
Browse files Browse the repository at this point in the history
  • Loading branch information
gibbed committed Sep 15, 2024
1 parent e68deac commit 506364e
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 92 deletions.
23 changes: 21 additions & 2 deletions SAM.API/Wrappers/SteamUserStats013.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private delegate bool NativeGetAchievement(
IntPtr name,
[MarshalAs(UnmanagedType.I1)] out bool isAchieved);

public bool GetAchievementState(string name, out bool isAchieved)
public bool GetAchievement(string name, out bool isAchieved)
{
using (var nativeName = NativeStrings.StringToStringHandle(name))
{
Expand All @@ -112,7 +112,7 @@ public bool GetAchievementState(string name, out bool isAchieved)
}
#endregion

#region SetAchievementState
#region SetAchievement
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
[return: MarshalAs(UnmanagedType.I1)]
private delegate bool NativeSetAchievement(IntPtr self, IntPtr name);
Expand Down Expand Up @@ -141,6 +141,25 @@ public bool SetAchievement(string name, bool state)
}
#endregion

#region GetAchievementAndUnlockTime
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
[return: MarshalAs(UnmanagedType.I1)]
private delegate bool NativeGetAchievementAndUnlockTime(
IntPtr self,
IntPtr name,
[MarshalAs(UnmanagedType.I1)] out bool isAchieved,
out uint unlockTime);

public bool GetAchievementAndUnlockTime(string name, out bool isAchieved, out uint unlockTime)
{
using (var nativeName = NativeStrings.StringToStringHandle(name))
{
var call = this.GetFunction<NativeGetAchievementAndUnlockTime>(this.Functions.GetAchievementAndUnlockTime);
return call(this.ObjectAddress, nativeName.Handle, out isAchieved, out unlockTime);
}
}
#endregion

#region StoreStats
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
[return: MarshalAs(UnmanagedType.I1)]
Expand Down
Loading

0 comments on commit 506364e

Please sign in to comment.