Exemplo n.º 1
0
 public static Config Get()
 {
     if (File.Exists(AuroraConfig._path))
     {
         return((Config)JsonConvert.DeserializeObject <Config>(AuroraConfig.Decompress(File.ReadAllBytes(AuroraConfig._path))));
     }
     AuroraConfig.Create();
     return(AuroraConfig.Get());
 }
Exemplo n.º 2
0
        public async Task StartGame(
            string arguments,
            bool injectNative = true,
            string antiCheat  = null,
            string path       = null)
        {
            FortniteLauncher fortniteLauncher       = this;
            string           tempDirPath            = Path.Combine(Path.GetTempPath(), "FortniteClient-Win64-Shipping_" + (antiCheat ?? "BE") + ".exe");
            Stream           manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Aurora.Launcher.Resources.FortniteClient-Win64-Shipping_" + (antiCheat ?? "BE") + ".exe");
            FileStream       file       = new FileStream(tempDirPath, FileMode.Create, FileAccess.ReadWrite);
            FileStream       fileStream = file;
            await manifestResourceStream.CopyToAsync((Stream)fileStream);

            file.Close();
            fortniteLauncher._antiCheatProcess = new Process()
            {
                StartInfo = new ProcessStartInfo(tempDirPath, arguments)
                {
                    UseShellExecute = false,
                    CreateNoWindow  = true
                }
            };
            fortniteLauncher._antiCheatProcess.Start();
            fortniteLauncher._clientProcess = new Process()
            {
                StartInfo = new ProcessStartInfo(path ?? Path.Combine(AuroraConfig.Get()?.Path, "FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe"), arguments)
                {
                    UseShellExecute = false,
                    CreateNoWindow  = true
                }
            };
            fortniteLauncher._clientProcess.Start();
            if (injectNative)
            {
                Injector.Inject(fortniteLauncher._clientProcess.Id, Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Aurora.Runtime.dll"));
            }
            await fortniteLauncher._clientProcess.WaitForExitAsync();

            fortniteLauncher._antiCheatProcess.Kill();
            Thread.Sleep(200);
            File.Delete(tempDirPath);
            tempDirPath = (string)null;
            file        = (FileStream)null;
        }
Exemplo n.º 3
0
 public static void SavePath(string path) => AuroraConfig.Save(new Config()
 {
     DeviceAuth = AuroraConfig.Get()?.DeviceAuth,
     Path       = path
 });
Exemplo n.º 4
0
 public static void SaveDeviceAuth(DeviceAuth deviceAuth) => AuroraConfig.Save(new Config()
 {
     DeviceAuth = deviceAuth,
     Path       = AuroraConfig.Get()?.Path
 });