0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00

Fix 390 modules compilation (!126)

Removes some issues that were added during the 3.8.2 merge
- Remove re-added deprecated 3.8.0 ReqestHandler code
- Remove duplicate `_sptPluginFolder` variable in AkiBotsPrePatcher

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#126
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
This commit is contained in:
DrakiaXYZ 2024-05-14 07:29:59 +00:00 committed by chomp
parent 860e354b77
commit 1111e7d518
2 changed files with 0 additions and 86 deletions

View File

@ -129,89 +129,5 @@ namespace Aki.Common.Http
{
return Task.Run(() => PutJsonAsync(path, json)).Result;
}
#region DEPRECATED, REMOVE IN 3.8.1
[Obsolete("GetData(path, isHost) is deprecated, please use GetData(path) instead.")]
public static byte[] GetData(string path, bool hasHost)
{
var url = (hasHost) ? path : Host + path;
_logger.LogInfo($"Request GET data: {SessionId}:{url}");
var headers = new Dictionary<string, string>()
{
{ "Cookie", $"PHPSESSID={SessionId}" },
{ "SessionId", SessionId }
};
var request = new Request();
var data = request.Send(url, "GET", null, headers: headers);
ValidateData(url, data);
return data;
}
[Obsolete("GetJson(path, isHost) is deprecated, please use GetJson(path) instead.")]
public static string GetJson(string path, bool hasHost)
{
var url = (hasHost) ? path : Host + path;
_logger.LogInfo($"Request GET json: {SessionId}:{url}");
var headers = new Dictionary<string, string>()
{
{ "Cookie", $"PHPSESSID={SessionId}" },
{ "SessionId", SessionId }
};
var request = new Request();
var data = request.Send(url, "GET", headers: headers);
var body = Encoding.UTF8.GetString(data);
ValidateJson(url, body);
return body;
}
[Obsolete("PostJson(path, json, isHost) is deprecated, please use PostJson(path, json) instead.")]
public static string PostJson(string path, string json, bool hasHost)
{
var url = (hasHost) ? path : Host + path;
_logger.LogInfo($"Request POST json: {SessionId}:{url}");
var payload = Encoding.UTF8.GetBytes(json);
var mime = WebConstants.Mime[".json"];
var headers = new Dictionary<string, string>()
{
{ "Cookie", $"PHPSESSID={SessionId}" },
{ "SessionId", SessionId }
};
var request = new Request();
var data = request.Send(url, "POST", payload, true, mime, headers);
var body = Encoding.UTF8.GetString(data);
ValidateJson(url, body);
return body;
}
[Obsolete("PutJson(path, json, isHost) is deprecated, please use PutJson(path, json) instead.")]
public static void PutJson(string path, string json, bool hasHost)
{
var url = (hasHost) ? path : Host + path;
_logger.LogInfo($"Request PUT json: {SessionId}:{url}");
var payload = Encoding.UTF8.GetBytes(json);
var mime = WebConstants.Mime[".json"];
var headers = new Dictionary<string, string>()
{
{ "Cookie", $"PHPSESSID={SessionId}" },
{ "SessionId", SessionId }
};
var request = new Request();
request.Send(url, "PUT", payload, true, mime, headers);
}
#endregion
}
}

View File

@ -16,8 +16,6 @@ namespace Aki.PrePatch
private static string _sptPluginFolder = "plugins/spt";
private static string _sptPluginFolder = "plugins/spt";
public static void Patch(ref AssemblyDefinition assembly)
{
PerformPreValidation();