mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
Fixed Rich Presence bugs
Refactored the Rich Presence two-minute trigger to clean it up and fix it.
This commit is contained in:
@ -176,6 +176,8 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path,
|
||||
}
|
||||
ActivateDeactivateLeaderboards();
|
||||
ActivateDeactivateRichPresence();
|
||||
// Reset this to zero so that RP immediately triggers on the first frame
|
||||
m_last_ping_time = 0;
|
||||
|
||||
callback(fetch_game_data_response);
|
||||
});
|
||||
@ -255,9 +257,13 @@ void AchievementManager::DoFrame()
|
||||
});
|
||||
if (!m_system)
|
||||
return;
|
||||
u64 current_time = m_system->GetCoreTiming().GetTicks();
|
||||
if (current_time - m_last_ping_time > SystemTimers::GetTicksPerSecond() * 120)
|
||||
m_queue.EmplaceItem([this] { PingRichPresence(GenerateRichPresence()); });
|
||||
time_t current_time = std::time(nullptr);
|
||||
if (difftime(current_time, m_last_ping_time) > 120)
|
||||
{
|
||||
RichPresence rp = GenerateRichPresence();
|
||||
m_queue.EmplaceItem([this, rp] { PingRichPresence(rp); });
|
||||
m_last_ping_time = current_time;
|
||||
}
|
||||
}
|
||||
|
||||
u32 AchievementManager::MemoryPeeker(u32 address, u32 num_bytes, void* ud)
|
||||
|
Reference in New Issue
Block a user