Exemplo n.º 1
0
 public static string GetCookies(EVEAccount eveAccount)
 {
     try
     {
         string filePath = GetCookiesFilename(eveAccount);
         return(System.IO.File.ReadAllText(filePath, Encoding.ASCII));
     }
     catch
     {
         return(string.Empty);
     }
 }
Exemplo n.º 2
0
        public static void ProcessCommandLine(IEnumerable <string> Args)
        {
            if (Args == null || Args.Count() == 0)
            {
                return;
            }

            List <string> LaunchAccountNames = new List <string>();

            bool useInnerSpace = false;

            foreach (string s in Args)
            {
                switch (s.ToLowerInvariant())
                {
                case "-dx9":
                    Settings.UseDirectXVersion = DirectXVersion.dx9;
                    break;

                case "-dx11":
                    Settings.UseDirectXVersion = DirectXVersion.dx11;
                    break;

                case "-singularity":
                    Settings.UseSingularity = true;
                    break;

                case "-tranquility":
                    Settings.UseSingularity = false;
                    break;

                case "-innerspace":
                    useInnerSpace = true;
                    break;

                case "-eve":
                    useInnerSpace = false;
                    break;

                case "-multiinstance":
                    break;

                case "-exit":
                    ExitAfterLaunch = true;
                    break;

                case "null":
                    // ignore
                    break;

                default:
                    LaunchAccountNames.Add(s);
                    break;
                }
            }

            if (LaunchAccountNames.Count == 0)
            {
                return;
            }

            List <Launchers.ILaunchTarget> LaunchAccounts = new List <Launchers.ILaunchTarget>();

            foreach (string name in LaunchAccountNames)
            {
                EVEAccount acct = Settings.Accounts.FirstOrDefault(q => q.Username.Equals(name, StringComparison.InvariantCultureIgnoreCase));
                if (acct != null)
                {
                    LaunchAccounts.Add(acct);
                    continue;
                }

                EVECharacter ec = Settings.Characters.FirstOrDefault(q => q.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
                if (ec != null)
                {
                    LaunchAccounts.Add(ec);
                    continue;
                }

                MessageBox.Show("Unrecognized EVE Account or Character name '" + name + "' -- if this is correct, please use Add Account/Character to enable it before launching.");
                return;
            }

            Launchers.ILauncher launcher;
            if (useInnerSpace)
            {
                InnerSpaceGameProfile gp;
                if (Settings.UseSingularity)
                {
                    gp = Settings.SingularityGameProfile;
                }
                else
                {
                    gp = Settings.TranquilityGameProfile;
                }

                if (gp == null || string.IsNullOrEmpty(gp.Game) || string.IsNullOrEmpty(gp.GameProfile))
                {
                    MessageBox.Show("Please select a Game Profile first!");
                    return;
                }

                launcher = new Launchers.InnerSpaceLauncher(gp, Settings.UseDirectXVersion, Settings.UseSingularity);
            }
            else
            {
                launcher = new Launchers.DirectLauncher(Settings.EVESharedCachePath, Settings.UseDirectXVersion, Settings.UseSingularity);
            }
            Windows.LaunchProgressWindow lpw = new Windows.LaunchProgressWindow(LaunchAccounts, launcher);
            lpw.ShowDialog();

            if (ExitAfterLaunch)
            {
                App.Current.Shutdown();
            }
        }
Exemplo n.º 3
0
        public static void SetCookies(EVEAccount eveAccount, string cookies)
        {
            string filePath = GetCookiesFilename(eveAccount);

            WriteAllTextSafe(filePath, cookies, Encoding.ASCII);
        }
Exemplo n.º 4
0
        public static string GetCookiesFilename(EVEAccount eveAccount)
        {
            string filename = eveAccount.Username.ToLowerInvariant().SHA256();

            return(System.IO.Path.Combine(GetCookieStoragePath(), filename));
        }