2016-01-11 20:07:57 +01:00
|
|
|
// BlitzSteam - Steam wrapper for Blitz
|
|
|
|
|
// Copyright (C) 2015 Xaymar (Michael Fabian Dirks)
|
|
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2016-02-06 00:17:29 +01:00
|
|
|
#include "BlitzSteam.h"
|
2016-01-11 20:07:57 +01:00
|
|
|
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(ISteamUserStats*) BS_UserStats() {
|
|
|
|
|
return SteamUserStats();
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_RequestCurrentStats( ISteamUserStats* lpSteamUserStats ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->RequestCurrentStats( );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetStat( ISteamUserStats* lpSteamUserStats, const char* pchName, int32_t* pData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetStat( pchName, pData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetStatF( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t* pData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetStat( pchName, pData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_SetStat( ISteamUserStats* lpSteamUserStats, const char* pchName, int32_t pData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->SetStat( pchName, pData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_SetStatF( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t pData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->SetStat( pchName, pData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_UpdateAvgRateStat( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t flCountThisSession, double_t* dSessionLength ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->UpdateAvgRateStat( pchName, flCountThisSession, *dSessionLength );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName, bool* pbAchieved ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetAchievement( pchName, (bool*)pbAchieved );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_SetAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->SetAchievement( pchName );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_ClearAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->ClearAchievement( pchName );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetAchievementAndUnlockTime( ISteamUserStats* lpSteamUserStats, const char* pchName, bool* pbAchieved, uint32_t* punUnlockTime ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetAchievementAndUnlockTime( pchName, (bool*)pbAchieved, punUnlockTime );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_StoreStats( ISteamUserStats* lpSteamUserStats ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->StoreStats( );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetAchievementIcon( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetAchievementIcon( pchName );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(const char*) BS_UserStats_GetAchievementDisplayAttribute( ISteamUserStats* lpSteamUserStats, const char* pchName, const char* pchKey ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetAchievementDisplayAttribute( pchName, pchKey );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_IndicateAchievementProgress( ISteamUserStats* lpSteamUserStats, const char* pchName, uint32_t nCurProgress, uint32_t nMaxProgress ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->IndicateAchievementProgress( pchName, nCurProgress, nMaxProgress );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetNumAchievements( ISteamUserStats* lpSteamUserStats ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetNumAchievements( );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(const char*) BS_UserStats_GetAchievementName( ISteamUserStats* lpSteamUserStats, uint32_t iAchievement ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetAchievementName( iAchievement );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_RequestUserStats( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->RequestUserStats( *steamIDUser ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetUserStat( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, uint32_t* pData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetUserStat( *steamIDUser, pchName, (int32_t*)pData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetUserStatF( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, float_t* pData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetUserStat( *steamIDUser, pchName, pData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetUserAchievement( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, bool* pbAchieved ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetUserAchievement( *steamIDUser, pchName, (bool*)pbAchieved );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetUserAchievementAndUnlockTime( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, bool* pbAchieved, uint32_t* punUnlockTime ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetUserAchievementAndUnlockTime( *steamIDUser, pchName, (bool*)pbAchieved, punUnlockTime );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_ResetAllStats( ISteamUserStats* lpSteamUserStats, uint32_t bAchievementsToo ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->ResetAllStats( bAchievementsToo != 0 );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_FindOrCreateLeaderboard( ISteamUserStats* lpSteamUserStats, const char* pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->FindOrCreateLeaderboard( pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_FindLeaderboard( ISteamUserStats* lpSteamUserStats, const char *pchLeaderboardName ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->FindLeaderboard( pchLeaderboardName ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(const char*) BS_UserStats_GetLeaderboardName( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetLeaderboardName( *hSteamLeaderboard );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(int) BS_UserStats_GetLeaderboardEntryCount( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetLeaderboardEntryCount( *hSteamLeaderboard );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(ELeaderboardSortMethod) BS_UserStats_GetLeaderboardSortMethod( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetLeaderboardSortMethod( *hSteamLeaderboard );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(ELeaderboardDisplayType) BS_UserStats_GetLeaderboardDisplayType( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetLeaderboardDisplayType( *hSteamLeaderboard );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_DownloadLeaderboardEntries( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->DownloadLeaderboardEntries( *hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_DownloadLeaderboardEntriesForUsers( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, CSteamID* prgUsers, int cUsers ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->DownloadLeaderboardEntriesForUsers( *hSteamLeaderboard, prgUsers, cUsers ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetDownloadedLeaderboardEntry( ISteamUserStats* lpSteamUserStats, SteamLeaderboardEntries_t* hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetDownloadedLeaderboardEntry( *hSteamLeaderboardEntries, index, pLeaderboardEntry, pDetails, cDetailsMax );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_UploadLeaderboardScore( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32_t* pScoreDetails, int cScoreDetailsCount ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t(lpSteamUserStats->UploadLeaderboardScore( *hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount ));
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_AttachLeaderboardUGC( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, UGCHandle_t* hUGC ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->AttachLeaderboardUGC( *hSteamLeaderboard, *hUGC ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_GetNumberOfCurrentPlayers( ISteamUserStats* lpSteamUserStats ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->GetNumberOfCurrentPlayers( ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_RequestGlobalAchievementPercentages( ISteamUserStats* lpSteamUserStats ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->RequestGlobalAchievementPercentages( ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetMostAchievedAchievementInfo( ISteamUserStats* lpSteamUserStats, char *pchName, uint32_t unNameBufLen, float *pflPercent, bool* pbAchieved ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetMostAchievedAchievementInfo( pchName, unNameBufLen, pflPercent, pbAchieved );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetNextMostAchievedAchievementInfo( ISteamUserStats* lpSteamUserStats, int iIteratorPrevious, char *pchName, uint32_t unNameBufLen, float *pflPercent, bool *pbAchieved ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetNextMostAchievedAchievementInfo( iIteratorPrevious, pchName, unNameBufLen, pflPercent, pbAchieved );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetAchievementAchievedPercent( ISteamUserStats* lpSteamUserStats, const char *pchName, float *pflPercent ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetAchievementAchievedPercent( pchName, pflPercent );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_RequestGlobalStats( ISteamUserStats* lpSteamUserStats, int nHistoryDays ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return new uint64_t( lpSteamUserStats->RequestGlobalStats( nHistoryDays ) );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetGlobalStatLL( ISteamUserStats* lpSteamUserStats, const char *pchStatName, int64* pData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetGlobalStat( pchStatName, pData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetGlobalStatD( ISteamUserStats* lpSteamUserStats, const char *pchStatName, double* pData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetGlobalStat( pchStatName, pData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetGlobalStatHistoryLL( ISteamUserStats* lpSteamUserStats, const char *pchStatName, int64 *pData, uint32_t cubData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetGlobalStatHistory( pchStatName, pData, cubData );
|
|
|
|
|
}
|
2016-03-04 03:47:32 +01:00
|
|
|
BS_I
|
2016-02-06 00:17:29 +01:00
|
|
|
DLL_FUNCTION(uint32_t) BS_UserStats_GetGlobalStatHistoryD( ISteamUserStats* lpSteamUserStats, const char *pchStatName, double *pData, uint32_t cubData ) {
|
2016-01-11 20:07:57 +01:00
|
|
|
return lpSteamUserStats->GetGlobalStatHistory( pchStatName, pData, cubData );
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BS_UserStats_GetGlobalStatHistoryD=_BS_UserStats_GetGlobalStatHistoryD@16")
|