-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client Start Finally Works but needs a whole rewrite to add more feat…
…ures and qol features + error codes handling is being developed ok ok ok
- Loading branch information
1 parent
7365e67
commit a576411
Showing
6 changed files
with
209 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,17 @@ public class ClientManager | |
|
||
private static string versionsdata = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\XybLauncher/versions.json"; | ||
|
||
private const string FORTNITE_EXECUTABLE = "D:\\Builds\\7.40\\7.40\\FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe"; | ||
private const string FORTNITE_EXECUTABLE = "D:\\Builds\\Fortnite 8.51\\FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe"; | ||
|
||
|
||
|
||
private static Process _fnProcess; | ||
private static Patcher _fnPatcher; | ||
|
||
public static void Test(string[] args) | ||
{ | ||
string joinedArgs = string.Join(" ", args); | ||
string appdata = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\XybLauncher"; | ||
|
||
// Check if -FORCECONSOLE exists in args (regardless of case) to force console (due to Epic Games Launcher by default hiding it) | ||
if (joinedArgs.ToUpper().Contains("-FORCECONSOLE")) | ||
|
@@ -58,20 +61,27 @@ public static void Test(string[] args) | |
// Setup a process exit event handler | ||
AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit); | ||
|
||
var accountParser = new AccountParser(); | ||
string email = accountParser.GetAccountInfo("email"); | ||
string password = accountParser.GetAccountInfo("password"); | ||
|
||
|
||
// Initialize Fortnite process with start info | ||
_fnProcess = new Process | ||
{ | ||
StartInfo = | ||
{ | ||
FileName = FORTNITE_EXECUTABLE, | ||
Arguments = $"{joinedArgs} -NOSSLPINNING -epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -skippatchcheck -nobe -fromfl=eac -fltoken=3db3ba5dcbd2e16703f3978d -caldera=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiYmU5ZGE1YzJmYmVhNDQwN2IyZjQwZWJhYWQ4NTlhZDQiLCJnZW5lcmF0ZWQiOjE2Mzg3MTcyNzgsImNhbGRlcmFHdWlkIjoiMzgxMGI4NjMtMmE2NS00NDU3LTliNTgtNGRhYjNiNDgyYTg2IiwiYWNQcm92aWRlciI6IkVhc3lBbnRpQ2hlYXQiLCJub3RlcyI6IiIsImZhbGxiYWNrIjpmYWxzZX0.VAWQB67RTxhiWOxx7DBjnzDnXyyEnX7OljJm-j2d88G_WgwQ9wrE6lwMEHZHjBd1ISJdUO1UVUqkfLdU5nofBQ -AUTH_LOGIN=[email protected] -AUTH_PASSWORD=12345678 -AUTH_TYPE=epic", | ||
Arguments = $"{joinedArgs} -NOSSLPINNING -epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -skippatchcheck -nobe -fromfl=eac -fltoken=3db3ba5dcbd2e16703f3978d -caldera=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiYmU5ZGE1YzJmYmVhNDQwN2IyZjQwZWJhYWQ4NTlhZDQiLCJnZW5lcmF0ZWQiOjE2Mzg3MTcyNzgsImNhbGRlcmFHdWlkIjoiMzgxMGI4NjMtMmE2NS00NDU3LTliNTgtNGRhYjNiNDgyYTg2IiwiYWNQcm92aWRlciI6IkVhc3lBbnRpQ2hlYXQiLCJub3RlcyI6IiIsImZhbGxiYWNrIjpmYWxzZX0.VAWQB67RTxhiWOxx7DBjnzDnXyyEnX7OljJm-j2d88G_WgwQ9wrE6lwMEHZHjBd1ISJdUO1UVUqkfLdU5nofBQ -AUTH_LOGIN={email} -AUTH_PASSWORD={password} -AUTH_TYPE=epic", | ||
RedirectStandardOutput = true, | ||
RedirectStandardError = true, | ||
UseShellExecute = false | ||
} | ||
}; | ||
|
||
_fnProcess.Start(); // Start Fortnite client process | ||
XybLauncher.Injector.Inject(_fnProcess.Id, appdata + "\\Cobalt.dll"); | ||
|
||
|
||
// Set up our async readers | ||
AsyncStreamReader asyncOutputReader = new AsyncStreamReader(_fnProcess.StandardOutput); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,4 +300,7 @@ public class ChoiceContainer | |
|
||
|
||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.IO; | ||
using System.Text.Json; | ||
|
||
namespace XybLauncher | ||
{ | ||
public class AccountParser | ||
{ | ||
|
||
public class Account | ||
{ | ||
public int Index { get; set; } | ||
public string DisplayName { get; set; } | ||
public string Email { get; set; } | ||
public string Password { get; set; } | ||
} | ||
|
||
public class LauncherData | ||
{ | ||
public int Selected { get; set; } | ||
public Account[] Accounts { get; set; } | ||
} | ||
|
||
private LauncherData _data; | ||
|
||
// Constructor with hardcoded file path | ||
public AccountParser() | ||
{ | ||
string filePath = Path.Combine( | ||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), | ||
"XybLauncher", // Hardcoded folder name | ||
"accounts.json" // Hardcoded file name | ||
); | ||
|
||
if (!File.Exists(filePath)) | ||
throw new FileNotFoundException($"The file {filePath} was not found."); | ||
|
||
string json = File.ReadAllText(filePath); | ||
_data = JsonSerializer.Deserialize<LauncherData>(json) | ||
?? throw new InvalidOperationException("Failed to parse JSON data."); | ||
} | ||
|
||
// Method to get account information based on the argument ('email' or 'password') | ||
public string GetAccountInfo(string argument) | ||
{ | ||
var selectedAccount = _data.Accounts.FirstOrDefault(a => a.Index == _data.Selected); | ||
if (selectedAccount == null) | ||
throw new InvalidOperationException("No account found with the selected index."); | ||
|
||
return argument.ToLower() switch | ||
{ | ||
"email" => selectedAccount.Email, | ||
"password" => selectedAccount.Password, | ||
_ => throw new ArgumentException("Invalid argument. Use 'email' or 'password'.") | ||
}; | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters