Lobby package now requires a heartbeat, so this adds that in. Note that I've identified a bug with the UpdateSlow where the wrong delta time was being passed, and I'm not *technically* fixing that, but it's close enough and just a one-line fix.
/// Some objects might need to be on a slower update loop than the usual MonoBehaviour Update, e.g. to refresh data from services.
/// Some objects might need to be on a slower update loop than the usual MonoBehaviour Update and without precise timing, e.g. to refresh data from services.
/// Some might also not want to be coupled to a Unity object at all but still need an update loop.
/// </summary>
publicclassUpdateSlow:MonoBehaviour,IUpdateSlow
while(m_updateTimer>effectivePeriod)
{
m_updateTimer-=effectivePeriod;
OnUpdate(effectivePeriod);
OnUpdate(m_updatePeriod);// Using m_updatePeriod will be incorrect on the first update for a new subscriber, due to the staggering. However, we don't expect UpdateSlow subscribers to require precision, and this is less verbose than tracking per-subscriber.
privateconstfloatk_heartbeatPeriod=8;// The heartbeat must be rate-limited to 5 calls per 30 seconds. We'll aim for longer in case periods don't align.
/// <summary>
/// Lobby requires a periodic ping to detect rooms that are still active, in order to mitigate "zombie" lobbies.