using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; namespace Facepunch.Steamworks.Data { /// /// Sent for games with enabled anti indulgence / duration control, for enabled users. /// Lets the game know whether persistent rewards or XP should be granted at normal rate, half rate, or zero rate. /// public struct DurationControl { internal DurationControl_t _inner; /// /// appid generating playtime /// public AppId Appid => _inner.Appid; /// /// is duration control applicable to user + game combination /// public bool Applicable => _inner.Applicable; /// /// playtime since most recent 5 hour gap in playtime, only counting up to regulatory limit of playtime, in seconds /// internal TimeSpan PlaytimeInLastFiveHours => TimeSpan.FromSeconds( _inner.CsecsLast5h ); /// /// playtime on current calendar day /// internal TimeSpan PlaytimeToday => TimeSpan.FromSeconds( _inner.CsecsLast5h ); /// /// recommended progress /// internal DurationControlProgress Progress => _inner.Progress; } }