Update README.md

This commit is contained in:
Asval
2019-06-16 14:25:33 +02:00
parent fe9171adb2
commit 4cb1d5eab3
7 changed files with 33 additions and 21 deletions

View File

@@ -39,7 +39,6 @@ namespace FModel
}
AESEntries = outputList;
}
else { throw new Exception("Fail to locate AESManager.xml"); }
}
}
}

View File

@@ -1,7 +1,6 @@
using FModel.Methods.BackupPAKs.Parser.AccessCodeParser;
using FModel.Methods.BackupPAKs.Parser.TokenParser;
using RestSharp;
using System;
using Newtonsoft.Json.Linq;
using System.Globalization;
using System.Collections.Generic;
@@ -20,24 +19,17 @@ namespace FModel
/// <returns> url content </returns>
public static string GetEndpoint(string url, bool auth)
{
string content = string.Empty;
try
{
RestClient EndpointClient = new RestClient(url);
RestRequest EndpointRequest = new RestRequest(Method.GET);
RestClient EndpointClient = new RestClient(url);
RestRequest EndpointRequest = new RestRequest(Method.GET);
if (auth)
{
EndpointRequest.AddHeader("Authorization", "bearer " + getExchangeToken(getAccessCode(getAccessToken(Properties.Settings.Default.eEmail, Properties.Settings.Default.ePassword))));
}
var response = EndpointClient.Execute(EndpointRequest);
content = JToken.Parse(response.Content).ToString(Newtonsoft.Json.Formatting.Indented);
}
catch (Exception ex)
if (auth)
{
throw new Exception(ex.Message);
EndpointRequest.AddHeader("Authorization", "bearer " + getExchangeToken(getAccessCode(getAccessToken(Properties.Settings.Default.eEmail, Properties.Settings.Default.ePassword))));
}
var response = EndpointClient.Execute(EndpointRequest);
string content = JToken.Parse(response.Content).ToString(Newtonsoft.Json.Formatting.Indented);
return content;
}
private static string getAccessToken(string email, string password)

View File

@@ -64,9 +64,9 @@ namespace FModel
}
}
}
else { throw new Exception("Unsupported LocRes version."); }
else { throw new ArgumentException("Unsupported LocRes version."); }
}
else { throw new Exception("Wrong LocResMagic number."); }
else { throw new ArgumentException("Wrong LocResMagic number."); }
}
return JsonConvert.SerializeObject(LocResDict, Formatting.Indented);

View File

@@ -73,7 +73,7 @@ namespace FModel
}
/// <summary>
/// Once upon a time, it was used for shitty stuff
///
/// </summary>
public static void JohnWickCheck()
{