SteamUserStats

Swift
public struct SteamUserStats: Sendable

Steamworks ISteamUserStats

Access via userStats.


Topics

func attachLeaderboardUGC(steamLeaderboard: SteamLeaderboard, ugc: UGCHandle, completion: (LeaderboardUGCSet?) -> Void)

Steamworks ISteamUserStats::AttachLeaderboardUGC(), callback

Declaration
Swift
public func attachLeaderboardUGC(
    steamLeaderboard: SteamLeaderboard, ugc: UGCHandle,
    completion: @escaping (LeaderboardUGCSet?) -> Void)

func attachLeaderboardUGC(steamLeaderboard: SteamLeaderboard, ugc: UGCHandle) async -> LeaderboardUGCSet?

Steamworks ISteamUserStats::AttachLeaderboardUGC(), async

Declaration
Swift
public func attachLeaderboardUGC(
    steamLeaderboard: SteamLeaderboard, ugc: UGCHandle
) async -> LeaderboardUGCSet?

func clearAchievement(name: String) -> Bool

Steamworks ISteamUserStats::ClearAchievement()

Declaration
Swift
public func clearAchievement(name: String) -> Bool

func downloadLeaderboardEntries(steamLeaderboard: SteamLeaderboard, leaderboardDataRequest: LeaderboardDataRequest, rangeStart: Int, rangeEnd: Int, completion: (LeaderboardScoresDownloaded?) -> Void)

Steamworks ISteamUserStats::DownloadLeaderboardEntries(), callback

Declaration
Swift
public func downloadLeaderboardEntries(
    steamLeaderboard: SteamLeaderboard,
    leaderboardDataRequest: LeaderboardDataRequest, rangeStart: Int,
    rangeEnd: Int, completion: @escaping (LeaderboardScoresDownloaded?) -> Void)

func downloadLeaderboardEntries(steamLeaderboard: SteamLeaderboard, leaderboardDataRequest: LeaderboardDataRequest, rangeStart: Int, rangeEnd: Int) async -> LeaderboardScoresDownloaded?

Steamworks ISteamUserStats::DownloadLeaderboardEntries(), async

Declaration
Swift
public func downloadLeaderboardEntries(
    steamLeaderboard: SteamLeaderboard,
    leaderboardDataRequest: LeaderboardDataRequest, rangeStart: Int,
    rangeEnd: Int
) async -> LeaderboardScoresDownloaded?

func downloadLeaderboardEntriesForUsers(steamLeaderboard: SteamLeaderboard, users: [SteamID], completion: (LeaderboardScoresDownloaded?) -> Void)

Steamworks ISteamUserStats::DownloadLeaderboardEntriesForUsers(), callback

Declaration
Swift
public func downloadLeaderboardEntriesForUsers(
    steamLeaderboard: SteamLeaderboard, users: [SteamID],
    completion: @escaping (LeaderboardScoresDownloaded?) -> Void)

func downloadLeaderboardEntriesForUsers(steamLeaderboard: SteamLeaderboard, users: [SteamID]) async -> LeaderboardScoresDownloaded?

Steamworks ISteamUserStats::DownloadLeaderboardEntriesForUsers(), async

Declaration
Swift
public func downloadLeaderboardEntriesForUsers(
    steamLeaderboard: SteamLeaderboard, users: [SteamID]
) async -> LeaderboardScoresDownloaded?

func findLeaderboard(leaderboardName: String, completion: (LeaderboardFindResult?) -> Void)

Steamworks ISteamUserStats::FindLeaderboard(), callback

Declaration
Swift
public func findLeaderboard(
    leaderboardName: String,
    completion: @escaping (LeaderboardFindResult?) -> Void)

func findLeaderboard(leaderboardName: String) async -> LeaderboardFindResult?

Steamworks ISteamUserStats::FindLeaderboard(), async

Declaration
Swift
public func findLeaderboard(leaderboardName: String) async
    -> LeaderboardFindResult?

func findOrCreateLeaderboard(leaderboardName: String, leaderboardSortMethod: LeaderboardSortMethod, leaderboardDisplayType: LeaderboardDisplayType, completion: (LeaderboardFindResult?) -> Void)

Steamworks ISteamUserStats::FindOrCreateLeaderboard(), callback

Declaration
Swift
public func findOrCreateLeaderboard(
    leaderboardName: String, leaderboardSortMethod: LeaderboardSortMethod,
    leaderboardDisplayType: LeaderboardDisplayType,
    completion: @escaping (LeaderboardFindResult?) -> Void)

func findOrCreateLeaderboard(leaderboardName: String, leaderboardSortMethod: LeaderboardSortMethod, leaderboardDisplayType: LeaderboardDisplayType) async -> LeaderboardFindResult?

Steamworks ISteamUserStats::FindOrCreateLeaderboard(), async

Declaration
Swift
public func findOrCreateLeaderboard(
    leaderboardName: String, leaderboardSortMethod: LeaderboardSortMethod,
    leaderboardDisplayType: LeaderboardDisplayType
) async -> LeaderboardFindResult?

func getAchievement(name: String) -> (rc: Bool, achieved: Bool)

Steamworks ISteamUserStats::GetAchievement()

Declaration
Swift
public func getAchievement(name: String) -> (rc: Bool, achieved: Bool)

func getAchievementAchievedPercent(name: String) -> (rc: Bool, percent: Float)

Steamworks ISteamUserStats::GetAchievementAchievedPercent()

Declaration
Swift
public func getAchievementAchievedPercent(name: String) -> (
    rc: Bool, percent: Float
)

func getAchievementAndUnlockTime(name: String) -> (rc: Bool, achieved: Bool, unlockTime: RTime32)

Steamworks ISteamUserStats::GetAchievementAndUnlockTime()

Declaration
Swift
public func getAchievementAndUnlockTime(name: String) -> (
    rc: Bool, achieved: Bool, unlockTime: RTime32
)

func getAchievementDisplayAttribute(name: String, key: String) -> String

Steamworks ISteamUserStats::GetAchievementDisplayAttribute()

Declaration
Swift
public func getAchievementDisplayAttribute(name: String, key: String) -> String

func getAchievementIcon(name: String) -> Int

Steamworks ISteamUserStats::GetAchievementIcon()

Declaration
Swift
public func getAchievementIcon(name: String) -> Int

func getAchievementName(achievementIndex: Int) -> String

Steamworks ISteamUserStats::GetAchievementName()

Declaration
Swift
public func getAchievementName(achievementIndex: Int) -> String

func getAchievementProgressLimitsFloat(name: String) -> (rc: Bool, minProgress: Float, maxProgress: Float)

Steamworks ISteamUserStats::GetAchievementProgressLimits()

Declaration
Swift
public func getAchievementProgressLimitsFloat(name: String) -> (
    rc: Bool, minProgress: Float, maxProgress: Float
)

func getAchievementProgressLimitsInt(name: String) -> (rc: Bool, minProgress: Int, maxProgress: Int)

Steamworks ISteamUserStats::GetAchievementProgressLimits()

Declaration
Swift
public func getAchievementProgressLimitsInt(name: String) -> (
    rc: Bool, minProgress: Int, maxProgress: Int
)

func getDownloadedLeaderboardEntry(steamLeaderboardEntries: SteamLeaderboardEntries, index: Int, detailsMax: Int) -> (rc: Bool, leaderboardEntry: LeaderboardEntry, details: [Int])

Steamworks ISteamUserStats::GetDownloadedLeaderboardEntry()

Declaration
Swift
public func getDownloadedLeaderboardEntry(
    steamLeaderboardEntries: SteamLeaderboardEntries, index: Int,
    detailsMax: Int
) -> (rc: Bool, leaderboardEntry: LeaderboardEntry, details: [Int])

func getGlobalStatDouble(statName: String) -> (rc: Bool, data: Double)

Steamworks ISteamUserStats::GetGlobalStat()

Declaration
Swift
public func getGlobalStatDouble(statName: String) -> (rc: Bool, data: Double)

func getGlobalStatHistoryDouble(statName: String, dataSize: Int) -> (rc: Int, data: [Double])

Steamworks ISteamUserStats::GetGlobalStatHistory()

Declaration
Swift
public func getGlobalStatHistoryDouble(statName: String, dataSize: Int) -> (
    rc: Int, data: [Double]
)

func getGlobalStatHistoryInt(statName: String, dataSize: Int) -> (rc: Int, data: [Int])

Steamworks ISteamUserStats::GetGlobalStatHistory()

Declaration
Swift
public func getGlobalStatHistoryInt(statName: String, dataSize: Int) -> (
    rc: Int, data: [Int]
)

func getGlobalStatInt(statName: String) -> (rc: Bool, data: Int)

Steamworks ISteamUserStats::GetGlobalStat()

Declaration
Swift
public func getGlobalStatInt(statName: String) -> (rc: Bool, data: Int)

func getLeaderboardDisplayType(steamLeaderboard: SteamLeaderboard) -> LeaderboardDisplayType

Steamworks ISteamUserStats::GetLeaderboardDisplayType()

Declaration
Swift
public func getLeaderboardDisplayType(steamLeaderboard: SteamLeaderboard)
    -> LeaderboardDisplayType

func getLeaderboardEntryCount(steamLeaderboard: SteamLeaderboard) -> Int

Steamworks ISteamUserStats::GetLeaderboardEntryCount()

Declaration
Swift
public func getLeaderboardEntryCount(steamLeaderboard: SteamLeaderboard) -> Int

func getLeaderboardName(steamLeaderboard: SteamLeaderboard) -> String

Steamworks ISteamUserStats::GetLeaderboardName()

Declaration
Swift
public func getLeaderboardName(steamLeaderboard: SteamLeaderboard) -> String

func getLeaderboardSortMethod(steamLeaderboard: SteamLeaderboard) -> LeaderboardSortMethod

Steamworks ISteamUserStats::GetLeaderboardSortMethod()

Declaration
Swift
public func getLeaderboardSortMethod(steamLeaderboard: SteamLeaderboard)
    -> LeaderboardSortMethod

func getMostAchievedAchievementInfo(nameBufLen: Int) -> (rc: Int, name: String, percent: Float, achieved: Bool)

Steamworks ISteamUserStats::GetMostAchievedAchievementInfo()

Declaration
Swift
public func getMostAchievedAchievementInfo(
    nameBufLen: Int = SteamConstants.statNameMaxSize + 1
) -> (rc: Int, name: String, percent: Float, achieved: Bool)

func getNextMostAchievedAchievementInfo(iteratorPreviousIndex: Int, nameBufLen: Int) -> (rc: Int, name: String, percent: Float, achieved: Bool)

Steamworks ISteamUserStats::GetNextMostAchievedAchievementInfo()

Declaration
Swift
public func getNextMostAchievedAchievementInfo(
    iteratorPreviousIndex: Int,
    nameBufLen: Int = SteamConstants.statNameMaxSize + 1
) -> (rc: Int, name: String, percent: Float, achieved: Bool)

func getNumAchievements() -> Int

Steamworks ISteamUserStats::GetNumAchievements()

Declaration
Swift
public func getNumAchievements() -> Int

func getNumberOfCurrentPlayers(completion: (NumberOfCurrentPlayers?) -> Void)

Steamworks ISteamUserStats::GetNumberOfCurrentPlayers(), callback

Declaration
Swift
public func getNumberOfCurrentPlayers(
    completion: @escaping (NumberOfCurrentPlayers?) -> Void)

func getNumberOfCurrentPlayers() async -> NumberOfCurrentPlayers?

Steamworks ISteamUserStats::GetNumberOfCurrentPlayers(), async

Declaration
Swift
public func getNumberOfCurrentPlayers() async -> NumberOfCurrentPlayers?

func getStatFloat(name: String) -> (rc: Bool, data: Float)

Steamworks ISteamUserStats::GetStat()

Declaration
Swift
public func getStatFloat(name: String) -> (rc: Bool, data: Float)

func getStatInt(name: String) -> (rc: Bool, data: Int)

Steamworks ISteamUserStats::GetStat()

Declaration
Swift
public func getStatInt(name: String) -> (rc: Bool, data: Int)

func getUserAchievement(user: SteamID, name: String) -> (rc: Bool, achieved: Bool)

Steamworks ISteamUserStats::GetUserAchievement()

Declaration
Swift
public func getUserAchievement(user: SteamID, name: String) -> (
    rc: Bool, achieved: Bool
)

func getUserAchievementAndUnlockTime(user: SteamID, name: String) -> (rc: Bool, achieved: Bool, unlockTime: RTime32)

Steamworks ISteamUserStats::GetUserAchievementAndUnlockTime()

Declaration
Swift
public func getUserAchievementAndUnlockTime(user: SteamID, name: String) -> (
    rc: Bool, achieved: Bool, unlockTime: RTime32
)

func getUserStatFloat(user: SteamID, name: String) -> (rc: Bool, data: Float)

Steamworks ISteamUserStats::GetUserStat()

Declaration
Swift
public func getUserStatFloat(user: SteamID, name: String) -> (
    rc: Bool, data: Float
)

func getUserStatInt(user: SteamID, name: String) -> (rc: Bool, data: Int)

Steamworks ISteamUserStats::GetUserStat()

Declaration
Swift
public func getUserStatInt(user: SteamID, name: String) -> (rc: Bool, data: Int)

func indicateAchievementProgress(name: String, curProgress: Int, maxProgress: Int) -> Bool

Steamworks ISteamUserStats::IndicateAchievementProgress()

Declaration
Swift
public func indicateAchievementProgress(
    name: String, curProgress: Int, maxProgress: Int
) -> Bool

func requestCurrentStats() -> Bool

Steamworks ISteamUserStats::RequestCurrentStats()

Declaration
Swift
public func requestCurrentStats() -> Bool

func requestGlobalAchievementPercentages(completion: (GlobalAchievementPercentagesReady?) -> Void)

Steamworks ISteamUserStats::RequestGlobalAchievementPercentages(), callback

Declaration
Swift
public func requestGlobalAchievementPercentages(
    completion: @escaping (GlobalAchievementPercentagesReady?) -> Void)

func requestGlobalAchievementPercentages() async -> GlobalAchievementPercentagesReady?

Steamworks ISteamUserStats::RequestGlobalAchievementPercentages(), async

Declaration
Swift
public func requestGlobalAchievementPercentages() async
    -> GlobalAchievementPercentagesReady?

func requestGlobalStats(historyDays: Int, completion: (GlobalStatsReceived?) -> Void)

Steamworks ISteamUserStats::RequestGlobalStats(), callback

Declaration
Swift
public func requestGlobalStats(
    historyDays: Int, completion: @escaping (GlobalStatsReceived?) -> Void)

func requestGlobalStats(historyDays: Int) async -> GlobalStatsReceived?

Steamworks ISteamUserStats::RequestGlobalStats(), async

Declaration
Swift
public func requestGlobalStats(historyDays: Int) async -> GlobalStatsReceived?

func requestUserStats(user: SteamID, completion: (UserStatsReceived?) -> Void)

Steamworks ISteamUserStats::RequestUserStats(), callback

Declaration
Swift
public func requestUserStats(
    user: SteamID, completion: @escaping (UserStatsReceived?) -> Void)

func requestUserStats(user: SteamID) async -> UserStatsReceived?

Steamworks ISteamUserStats::RequestUserStats(), async

Declaration
Swift
public func requestUserStats(user: SteamID) async -> UserStatsReceived?

func resetAllStats(achievementsToo: Bool) -> Bool

Steamworks ISteamUserStats::ResetAllStats()

Declaration
Swift
public func resetAllStats(achievementsToo: Bool) -> Bool

func setAchievement(name: String) -> Bool

Steamworks ISteamUserStats::SetAchievement()

Declaration
Swift
public func setAchievement(name: String) -> Bool

func setStat(name: String, data: Float) -> Bool

Steamworks ISteamUserStats::SetStat()

Declaration
Swift
public func setStat(name: String, data: Float) -> Bool

func setStat(name: String, data: Int) -> Bool

Steamworks ISteamUserStats::SetStat()

Declaration
Swift
public func setStat(name: String, data: Int) -> Bool

func storeStats() -> Bool

Steamworks ISteamUserStats::StoreStats()

Declaration
Swift
public func storeStats() -> Bool

func updateAvgRateStat(name: String, countThisSession: Float, sessionLength: Double) -> Bool

Steamworks ISteamUserStats::UpdateAvgRateStat()

Declaration
Swift
public func updateAvgRateStat(
    name: String, countThisSession: Float, sessionLength: Double
) -> Bool

func uploadLeaderboardScore(steamLeaderboard: SteamLeaderboard, leaderboardUploadScoreMethod: LeaderboardUploadScoreMethod, score: Int, scoreDetails: [Int], completion: (LeaderboardScoreUploaded?) -> Void)

Steamworks ISteamUserStats::UploadLeaderboardScore(), callback

Declaration
Swift
public func uploadLeaderboardScore(
    steamLeaderboard: SteamLeaderboard,
    leaderboardUploadScoreMethod: LeaderboardUploadScoreMethod, score: Int,
    scoreDetails: [Int],
    completion: @escaping (LeaderboardScoreUploaded?) -> Void)

func uploadLeaderboardScore(steamLeaderboard: SteamLeaderboard, leaderboardUploadScoreMethod: LeaderboardUploadScoreMethod, score: Int, scoreDetails: [Int]) async -> LeaderboardScoreUploaded?

Steamworks ISteamUserStats::UploadLeaderboardScore(), async

Declaration
Swift
public func uploadLeaderboardScore(
    steamLeaderboard: SteamLeaderboard,
    leaderboardUploadScoreMethod: LeaderboardUploadScoreMethod, score: Int,
    scoreDetails: [Int]
) async -> LeaderboardScoreUploaded?