# 寻找或创建排行榜 ISteamUserStats::FindOrCreateLeaderboard(name, int=2, int=1)
def find_or_create_leaderboard(name)
if initted?
@@dll_SteamAPI_ISteamUserStats_FindOrCreateLeaderboard.call(@i_user_stats, name, 2, 1) #% 256 != 0
else
nil
end
end
def find_leaderboard(name)
if initted?
@@dll_SteamAPI_ISteamUserStats_FindLeaderboard.call(@i_user_stats, name) #% 256 != 0
else
nil
end
end
# 上传用户分数 ISteamUserStats::UploadLeaderboardScore(steamleaderboard_t, int=2, newScore)
def upload_leaderboard_score(name, score)
if initted?
handle = find_or_create_leaderboard(name)
if !handle.nil?
p handle
#handle = handle.unpack('L')
#p handle
#handle = handle[0]
@@dll_SteamAPI_ISteamUserStats_UploadLeaderboardScore.call(@i_user_stats,
@@dll_SteamAPI_ISteamUserStats_FindLeaderboard.call(@i_user_stats, name),
1, score, ' ', 0)
else
nil
end
else
nil
end
end
#
###############################################################
# 2020.12.3 新增 零教授
###############################################################
# 排行榜功能
###############################################################
# 寻找或创建排行榜 ISteamUserStats::FindOrCreateLeaderboard(name, int=2, int=1)
@@dll_SteamAPI_ISteamUserStats_FindOrCreateLeaderboard = Win32API.new(self.steam_dll_name, 'SteamAPI_ISteamUserStats_FindOrCreateLeaderboard', 'PPII', 'L')
@@dll_SteamAPI_ISteamUserStats_FindLeaderboard = Win32API.new(self.steam_dll_name, 'SteamAPI_ISteamUserStats_FindLeaderboard', 'PP', 'L')
# 上传用户分数 ISteamUserStats::UploadLeaderboardScore(name, int=2, newScore)
@@dll_SteamAPI_ISteamUserStats_UploadLeaderboardScore = Win32API.new(self.steam_dll_name, 'SteamAPI_ISteamUserStats_UploadLeaderboardScore', 'PLIIPI', 'L')
###############################################################
#
###############################################################