PlayerScript.ServerUpdateConnectionQuality C# (CSharp) Méthode

ServerUpdateConnectionQuality() private méthode

private ServerUpdateConnectionQuality ( ) : IEnumerator
Résultat IEnumerator
    private IEnumerator ServerUpdateConnectionQuality()
    {
        for (;;)
        {
            if (Possessor != null)
            {
                // Amount of average time when compared to desired to be considered bad
                float bad = 0.8f;
                float q = Relay.DesiredTimeBetweenNetworkSends / SlowAverageTimeBetweenNetworkFrames;
                // Set the quality on the possessor (we're measuring it based on
				// the packets arriving for this networkView, that's why we do
				// this stuff here instead of on the PlayerPresence, which is
				// 'reliable delta compressed' type of networkview, and not as
				// useful for measurements.
                Possessor.ConnectionQuality = MathExts.Unlerp(bad, 1.0f, q);
            }
            yield return new WaitForSeconds(0.4f);
        }
    }