Compare commits
No commits in common. "978a1b81e341982c73e625a8b856ba6249f8c8ce" and "1bd90756d1adb62b94ba41d50570c34241b9e16f" have entirely different histories.
978a1b81e3
...
1bd90756d1
|
@ -55,9 +55,6 @@ private:
|
|||
nlohmann::json defined_achievements;
|
||||
nlohmann::json user_achievements;
|
||||
std::vector<std::string> sorted_achievement_names;
|
||||
std::map<std::string, int32> stats_cache_int;
|
||||
std::map<std::string, float> stats_cache_float;
|
||||
|
||||
|
||||
unsigned int find_leaderboard(std::string name)
|
||||
{
|
||||
|
@ -203,17 +200,8 @@ bool SetStat( const char *pchName, int32 nData )
|
|||
PRINT_DEBUG("SetStat int32 %s\n", pchName);
|
||||
if (!pchName) return false;
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
auto cached_stat = stats_cache_int.find(pchName);
|
||||
if (cached_stat != stats_cache_int.end()) {
|
||||
if (cached_stat->second == nData) return true;
|
||||
}
|
||||
|
||||
if (local_storage->store_data(Local_Storage::stats_storage_folder, pchName, (char* )&nData, sizeof(nData)) == sizeof(nData)) {
|
||||
stats_cache_int[pchName] = nData;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return local_storage->store_data(Local_Storage::stats_storage_folder, pchName, (char* )&nData, sizeof(nData)) == sizeof(nData);
|
||||
}
|
||||
|
||||
bool SetStat( const char *pchName, float fData )
|
||||
|
@ -221,17 +209,8 @@ bool SetStat( const char *pchName, float fData )
|
|||
PRINT_DEBUG("SetStat float %s\n", pchName);
|
||||
if (!pchName) return false;
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
auto cached_stat = stats_cache_float.find(pchName);
|
||||
if (cached_stat != stats_cache_float.end()) {
|
||||
if (cached_stat->second == fData) return true;
|
||||
}
|
||||
|
||||
if (local_storage->store_data(Local_Storage::stats_storage_folder, pchName, (char* )&fData, sizeof(fData)) == sizeof(fData)) {
|
||||
stats_cache_float[pchName] = fData;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return local_storage->store_data(Local_Storage::stats_storage_folder, pchName, (char* )&fData, sizeof(fData)) == sizeof(fData);
|
||||
}
|
||||
|
||||
bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength )
|
||||
|
|
|
@ -175,10 +175,10 @@ ESteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall )
|
|||
|
||||
bool GetAPICallResult( SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed )
|
||||
{
|
||||
PRINT_DEBUG("GetAPICallResult %llu %i %i %p\n", hSteamAPICall, cubCallback, iCallbackExpected, pbFailed);
|
||||
PRINT_DEBUG("GetAPICallResult %llu %i %i\n", hSteamAPICall, cubCallback, iCallbackExpected);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
if (callback_results->callback_result(hSteamAPICall, pCallback, cubCallback)) {
|
||||
if (pbFailed) *pbFailed = false;
|
||||
*pbFailed = false;
|
||||
PRINT_DEBUG("GetAPICallResult Succeeded\n");
|
||||
return true;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue