Ejemplo n.º 1
0
        private void timeStampRecieved(long clientTime, long serverTime)
        {
            if (!timeStampRequests.ContainsKey(clientTime))
            {
                Log.LogErrorFormatted(this, "Ignoring unexpected time sync event {0}", clientTime);
                return;
            }
            TimeStampRequest timeStampRequest = timeStampRequests[clientTime];

            timeStampRequests.Remove(clientTime);
            long elapsedMilliseconds = timeStampRequest.Timer.ElapsedMilliseconds;

            timeStampRequest.Timer.Stop();
            mt.SetServerTimeUpdate(serverTime + elapsedMilliseconds / 2);
            if (timeStampRequest.FetchEncryptionKey)
            {
                fetchEncryptionKey();
            }
        }