Quick change to have the lobby list refresh upon returning from a lobby, as though entering from the main menu. Since we constantly query while in the lobby, the rate limit could interfere, so there's now logic to wait if needed.
privateRateLimitCooldownm_rateLimitQuery=newRateLimitCooldown(1.5f);// Used for both the lobby list UI and the in-lobby updating. In the latter case, updates can be cached.
// We assume this can only occur when leaving a lobby and returning to the join menu; the refresh button is rate-limited, but we might have recently queried while still in the lobby.
m_pendingOperations.Enqueue(()=>{RetrieveLobbyListAsync(onListRetrieved,onError,limitToColor);});// With that assumption, retry the refresh after the limit, as though entering the join menu from the main menu.
return;
}
publicboolIsInCooldown
{
get=>m_isInCooldown;
set
privateset
{if(m_isInCooldown!=value)
{m_isInCooldown=value;
OnChanged(this);
if(m_timeSinceLastCall>=m_cooldownTime)
{
IsInCooldown=false;
Locator.Get.UpdateSlow.Unsubscribe(OnUpdate);// Note that this is after IsInCooldown is set, to prevent an Observer from kicking off CanCall again immediately.
if(!m_isInCooldown)// It's possible that by setting IsInCooldown, something called CanCall immediately, in which case we want to stay on UpdateSlow.
Locator.Get.UpdateSlow.Unsubscribe(OnUpdate);// Note that this is after IsInCooldown is set, to prevent an Observer from kicking off CanCall again immediately.