SDK code question
Options
In the Unity SDK code for th demo-litelobby-chatroom, there is the below code:
I see the description on the function, but it makes no sense to me. What does this code do?
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?
0
Comments
-
Ok I guess I just needed to stare at the code longer, this basically sends update messages every 100ms.0
-
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.0