revert sharing progress with gameserver, pointless

This commit is contained in:
otavepto 2024-06-18 16:47:16 +03:00
parent cd21b54e6b
commit 0e47a2bd73
2 changed files with 0 additions and 34 deletions

View File

@ -236,13 +236,7 @@ message GameServerStats_Messages {
optional AvgStatInfo value_avg = 4; // only set when type != INT optional AvgStatInfo value_avg = 4; // only set when type != INT
} }
message AchievementInfo { message AchievementInfo {
// progress is always sent from user to server, not the opposite
message Progress {
float progress = 1;
float max_progress = 2;
}
bool achieved = 1; bool achieved = 1;
optional Progress progress = 2;
} }
// --- requests & responses objects // --- requests & responses objects

View File

@ -1164,7 +1164,6 @@ bool Steam_User_Stats::IndicateAchievementProgress( const char *pchName, uint32
if (achieved) return false; if (achieved) return false;
// save new progress // save new progress
bool value_updated = false;
try { try {
auto old_progress = user_achievements.value(actual_ach_name, nlohmann::json{}).value("progress", ~nCurProgress); auto old_progress = user_achievements.value(actual_ach_name, nlohmann::json{}).value("progress", ~nCurProgress);
if (old_progress != nCurProgress) { if (old_progress != nCurProgress) {
@ -1173,8 +1172,6 @@ bool Steam_User_Stats::IndicateAchievementProgress( const char *pchName, uint32
save_achievements(); save_achievements();
value_updated = true;
overlay->AddAchievementNotification(actual_ach_name, user_achievements[actual_ach_name], true); overlay->AddAchievementNotification(actual_ach_name, user_achievements[actual_ach_name], true);
} }
} catch (...) {} } catch (...) {}
@ -1197,19 +1194,6 @@ bool Steam_User_Stats::IndicateAchievementProgress( const char *pchName, uint32
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data)); callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
} }
// progress is always sent from user to server, not the opposite
if (value_updated && !settings->disable_sharing_stats_with_gameserver) {
auto &new_ach = (*pending_server_updates.mutable_user_achievements())[actual_ach_name];
new_ach.set_achieved(false);
auto progress_msg = new GameServerStats_Messages::AchievementInfo::Progress();
progress_msg->set_progress((float)nCurProgress);
progress_msg->set_max_progress((float)nMaxProgress);
new_ach.set_allocated_progress(progress_msg);
if (settings->immediate_gameserver_stats) send_updated_stats();
}
return true; return true;
} }
@ -2062,18 +2046,6 @@ void Steam_User_Stats::network_stats_initial(Common_Message *msg)
bool achieved = false; bool achieved = false;
GetAchievement(name.c_str(), &achieved); GetAchievement(name.c_str(), &achieved);
this_ach.set_achieved(achieved); this_ach.set_achieved(achieved);
// progress
if (!achieved) {
float progress = 0;
float max_progress = 0;
if (GetAchievementProgressLimits(name.c_str(), &progress, &max_progress) && max_progress > 0) {
auto progress_msg = new GameServerStats_Messages_AchievementInfo_Progress();
progress_msg->set_progress(progress);
progress_msg->set_max_progress(max_progress);
this_ach.set_allocated_progress(progress_msg);
}
}
} }
auto initial_stats_msg = new GameServerStats_Messages::InitialAllStats(); auto initial_stats_msg = new GameServerStats_Messages::InitialAllStats();