From 3895fd33aa8e462ca4550555c77b65a9904f81a8 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:43:07 +0000 Subject: [PATCH] Added servers stats ClearAchievement, GetAchievement --- Facepunch.Steamworks/Server/Stats.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Facepunch.Steamworks/Server/Stats.cs b/Facepunch.Steamworks/Server/Stats.cs index 0a28aa4..2238205 100644 --- a/Facepunch.Steamworks/Server/Stats.cs +++ b/Facepunch.Steamworks/Server/Stats.cs @@ -111,5 +111,26 @@ namespace Facepunch.Steamworks return data; } + + /// + /// Resets the unlock status of an achievement for the specified user. Must have called Refresh on a steamid first. + /// + public bool ClearAchievement( ulong steamid, string name ) + { + return server.native.gameServerStats.ClearUserAchievement( steamid, name ); + } + + /// + /// Return true if available, exists and unlocked + /// + public bool GetAchievement( ulong steamid, string name ) + { + bool achieved = false; + + if ( !server.native.gameServerStats.GetUserAchievement( steamid, name, ref achieved ) ) + return false; + + return achieved; + } } }