Fix use of GrrrLCU

This commit is contained in:
BlossomiShymae
2024-08-22 19:39:27 -05:00
parent 4eae0bd913
commit de6f9f64dd
2 changed files with 7 additions and 5 deletions

View File

@@ -51,10 +51,11 @@ namespace Needlework.Net.ViewModels
_ => throw new Exception("Method is not selected."),
};
var processInfo = Connector.GetProcessInfo();
var processInfo = ProcessFinder.Get();
var requestBody = WeakReferenceMessenger.Default.Send(new ContentRequestMessage(), "ConsoleRequestEditor").Response;
var content = new StringContent(requestBody, new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"));
var response = await Connector.SendAsync(method, RequestPath, content);
var client = Connector.GetLcuHttpClientInstance();
var response = await client.SendAsync(new(method, RequestPath) { Content = content });
var riotAuthentication = new RiotAuthentication(processInfo.RemotingAuthToken);
var responseBody = await response.Content.ReadAsByteArrayAsync();

View File

@@ -50,7 +50,7 @@ namespace Needlework.Net.ViewModels
{
try
{
var processInfo = Connector.GetProcessInfo();
var processInfo = ProcessFinder.Get();
return processInfo;
}
catch (Exception) { }
@@ -77,7 +77,7 @@ namespace Needlework.Net.ViewModels
_ => throw new Exception("Method is missing.")
};
var processInfo = Connector.GetProcessInfo();
var processInfo = ProcessFinder.Get();
var sb = new StringBuilder(Path);
foreach (var pathParameter in Operation.PathParameters)
{
@@ -99,7 +99,8 @@ namespace Needlework.Net.ViewModels
var requestBody = WeakReferenceMessenger.Default.Send(new ContentRequestMessage(), "EndpointRequestEditor").Response;
var content = new StringContent(requestBody, new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"));
var response = await Connector.SendAsync(method, uri, content);
var client = Connector.GetLcuHttpClientInstance();
var response = await client.SendAsync(new(method, uri) { Content = content });
var riotAuthentication = new RiotAuthentication(processInfo.RemotingAuthToken);
var responseBytes = await response.Content.ReadAsByteArrayAsync();