예제 #1
0
        public bool CheckForLeague()
        {
            var lc = Process.GetProcessesByName("LeagueClient");

            foreach (var p in lc)
            {
                var path = p.MainModule.FileName;

                if (path.Contains("RADS"))
                {
                    path = Regex.Split(path, @"RADS")[0];
                }

                if (!IsValidLeagueClientPath(path))
                {
                    continue;
                }
                _lcBasePath = path;
                CheckForExistingLockfile();
                return(true);
            }

            var lcUx = Process.GetProcessesByName("LeagueClientUx");

            if (lcUx.Length > 0)
            {
                LeagueClientSessionStarted?.Invoke(this, Lockfile.FromProcess(lcUx[0]));
                return(true);
            }

            return(false);
        }
예제 #2
0
 public void CheckForExistingLockfile()
 {
     if (File.Exists(LockfilePath))
     {
         LeagueClientSessionStarted?.Invoke(this, Lockfile.FromPath(LockfilePath));
     }
 }