Makes weekly leaderboards creatable from app.

Removes dependency on breakhack.net if that site ever goes offline.
This commit is contained in:
Linus Probert 2019-02-20 20:03:06 +01:00
parent 269b25ba86
commit 2775780d5b
3 changed files with 14 additions and 1 deletions

View File

@ -127,7 +127,7 @@ request_data_queue_run(void)
else if (!m_hWarriorHighscore)
c_SteamUserStats_FindLeaderboard(LB_WARRIOR_HIGHSCORE);
else if (!m_hWeeklyHighscore)
c_SteamUserStats_FindLeaderboard(lb_weekly);
c_SteamUserStats_FindOrCreateLeaderboard(lb_weekly);
timer_start(requestDataTimer);
}

View File

@ -121,6 +121,16 @@ c_SteamUserStats_FindLeaderboard(const char * name)
m_CallbackHandler->m_FindLeaderboardCallResult.Set(hSteamAPICall, m_CallbackHandler, &CallbackHandler::OnFindLeaderboard);
}
extern "C" void
c_SteamUserStats_FindOrCreateLeaderboard(const char *name)
{
if (!m_Initiated || !m_CallbackHandler)
return;
SteamAPICall_t hSteamAPICall = SteamUserStats()->FindOrCreateLeaderboard(name, k_ELeaderboardSortMethodAscending, k_ELeaderboardDisplayTypeNumeric);
m_CallbackHandler->m_FindLeaderboardCallResult.Set(hSteamAPICall, m_CallbackHandler, &CallbackHandler::OnFindLeaderboard);
}
extern "C" void c_SteamUserStats_UploadLeaderboardScore(int64_t hLeaderboard, int32_t nScore, const int32_t *details, int32_t nDetails)
{
if (!hLeaderboard || !m_Initiated)

View File

@ -50,6 +50,9 @@ c_SteamUserStats_GetAchievementDisplayAttribute(const char *achId, const char *a
void
c_SteamUserStats_FindLeaderboard(const char *name);
void
c_SteamUserStats_FindOrCreateLeaderboard(const char *name);
void
c_SteamUserStats_UploadLeaderboardScore(int64_t hLeaderboard, int32_t nScore, const int32_t *details, int32_t nDetails);