SDK code question

Options
archmaegus
edited February 2012 in DotNet
In the Unity SDK code for th demo-litelobby-chatroom, there is the below code:
if (Environment.TickCount > this.NextSendTickCount)

        {

            this.Peer.Service();

            this.NextSendTickCount = Environment.TickCount + this.SendIntervalMs;

        }

I see the description on the function, but it makes no sense to me. What does this code do?

Comments

  • Ok I guess I just needed to stare at the code longer, this basically sends update messages every 100ms.
  • Tobias
    Options
    Hehe. Yes.
    Using TickCount is a very cheap but not totally exact timing method. Service() is called in intervals in those simple demos. A game could also call it when it produced updates to speed up their delivery.
    Don't use it from multiple threads though.