private void StartBeating() { if (_timer != null) { // already started return; } AssemblySettings settings = new AssemblySettings(); _offlineTimeoutSeconds = StringToInt(settings.GetValue("ServerOnlineTimeoutSeconds", "30"), 30); int dllProcessId = System.Diagnostics.Process.GetCurrentProcess().Id; _gameToLauncherFilepath = FileLocations.GetGameHeartbeatFilepath(dllProcessId); int intervalMilliseconds = 1000 * TIMER_SECONDS; _timer = new System.Timers.Timer(); _timer.Interval = intervalMilliseconds; _timer.Elapsed += _timer_Elapsed; _timer.Enabled = true; _timer.Start(); StartChannelFileWatcher(); AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; }
private void StartBeating() { int dllProcessId = System.Diagnostics.Process.GetCurrentProcess().Id; _gameToLauncherFilepath = FileLocations.GetGameHeartbeatFilepath(dllProcessId); int intervalMilliseconds = 1000 * TIMER_SECONDS; _timer = new System.Timers.Timer(); _timer.Interval = intervalMilliseconds; _timer.Elapsed += _timer_Elapsed; _timer.Enabled = true; _timer.Start(); StartChannelFileWatcher(); AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; }