From 29f426baf093836748e6a054d7d3a39c38895704 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Mon, 24 Feb 2020 12:00:57 +0000 Subject: [PATCH] Added Friend.GetAchievementUnlockTime --- Facepunch.Steamworks/Structs/Friend.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Facepunch.Steamworks/Structs/Friend.cs b/Facepunch.Steamworks/Structs/Friend.cs index 9110212..79b5f64 100644 --- a/Facepunch.Steamworks/Structs/Friend.cs +++ b/Facepunch.Steamworks/Structs/Friend.cs @@ -243,5 +243,21 @@ namespace Steamworks return val; } + /// + /// Gets a the time this achievement was unlocked. + /// + /// The name of the achievement you want to get + /// The time unlocked. If it wasn't unlocked, or you haven't downloaded the stats yet - will return DateTime.MinValue + public DateTime GetAchievementUnlockTime( string statName ) + { + bool val = false; + uint time = 0; + + if ( !SteamUserStats.Internal.GetUserAchievementAndUnlockTime( Id, statName, ref val, ref time ) || !val ) + return DateTime.MinValue; + + return Epoch.ToDateTime( time ); + } + } } \ No newline at end of file