mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-27 05:04:01 +08:00
revert sharing progress with gameserver, pointless
This commit is contained in:
parent
cd21b54e6b
commit
0e47a2bd73
@ -236,13 +236,7 @@ message GameServerStats_Messages {
|
||||
optional AvgStatInfo value_avg = 4; // only set when type != INT
|
||||
}
|
||||
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;
|
||||
optional Progress progress = 2;
|
||||
}
|
||||
|
||||
// --- requests & responses objects
|
||||
|
@ -1164,7 +1164,6 @@ bool Steam_User_Stats::IndicateAchievementProgress( const char *pchName, uint32
|
||||
if (achieved) return false;
|
||||
|
||||
// save new progress
|
||||
bool value_updated = false;
|
||||
try {
|
||||
auto old_progress = user_achievements.value(actual_ach_name, nlohmann::json{}).value("progress", ~nCurProgress);
|
||||
if (old_progress != nCurProgress) {
|
||||
@ -1173,8 +1172,6 @@ bool Steam_User_Stats::IndicateAchievementProgress( const char *pchName, uint32
|
||||
|
||||
save_achievements();
|
||||
|
||||
value_updated = true;
|
||||
|
||||
overlay->AddAchievementNotification(actual_ach_name, user_achievements[actual_ach_name], true);
|
||||
}
|
||||
} catch (...) {}
|
||||
@ -1197,19 +1194,6 @@ bool Steam_User_Stats::IndicateAchievementProgress( const char *pchName, uint32
|
||||
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;
|
||||
}
|
||||
|
||||
@ -2062,18 +2046,6 @@ void Steam_User_Stats::network_stats_initial(Common_Message *msg)
|
||||
bool achieved = false;
|
||||
GetAchievement(name.c_str(), &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();
|
||||
|
Loading…
Reference in New Issue
Block a user