コード例 #1
0
        public SessionHandler()
        {
            var procAct = new Action(() =>
            {
                var now = DateTime.UtcNow;
                if (IsGameRunning())
                {
                    if (_startSessionTime <= DateTime.MinValue)
                    {
                        _startSessionTime = now;
                    }
                    _lastSessionTime = now;
                }
            });

            procAct.Invoke();
            TimerEx.Every(1f, procAct);
        }