Skip to content

Commit

Permalink
test cookies implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
imunproductive committed Aug 10, 2024
1 parent 2638042 commit 062201a
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions src/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ async Task<string> GetRiotClientPath()
await Task.WhenAll(tasks);
}

logger.LogInformation("Copying settings and cookies...");
{
async Task DecodeAndWrite(string path, string data)
{
var decoded = Convert.FromBase64String(data);
await File.WriteAllBytesAsync(path, decoded);
}

var basePath = Path.Join(localAppdata, "Riot Games", "Riot Client");
var tasks = new List<Task>() {
DecodeAndWrite(Path.Join(basePath, "Config", "RiotClientSettings.yaml"), core.GetInput("FILE_CLIENT_SETTINGS_CONTENT")),
DecodeAndWrite(Path.Join(basePath, "Data", "RiotGamesPrivateSettings.yaml"), core.GetInput("FILE_PRIVATE_SETTINGS_CONTENT")),
DecodeAndWrite(Path.Join(basePath, "Config", "Cookies", "Cookie"), core.GetInput("FILE_COOKIES_CONTENT")),
};

await Task.WhenAll(tasks);
}

logger.LogInformation("Downloading and running LeagueNoVGK...");

var leagueNoVgkPath = Path.Join(temp, "league-no-vgk.exe");
Expand Down Expand Up @@ -223,15 +241,15 @@ async Task<string> GetLeagueClientPath()
}
}

logger.LogInformation("Logging in...");
{
await rcsAPI.PostAsync("/rso-auth/v1/authorization/gas", new
{
username = username,
password = password,
});
await Task.Delay(TimeSpan.FromSeconds(5));
}
/* logger.LogInformation("Logging in..."); */
/* { */
/* await rcsAPI.PostAsync("/rso-auth/v1/authorization/gas", new */
/* { */
/* username = username, */
/* password = password, */
/* }); */
/* await Task.Delay(TimeSpan.FromSeconds(5)); */
/* } */

logger.LogInformation("Accepting EULA...");
{
Expand Down

0 comments on commit 062201a

Please sign in to comment.