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:
parent
860e354b77
commit
1111e7d518
@ -129,89 +129,5 @@ namespace Aki.Common.Http
|
|||||||
{
|
{
|
||||||
return Task.Run(() => PutJsonAsync(path, json)).Result;
|
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,6 @@ namespace Aki.PrePatch
|
|||||||
|
|
||||||
private static string _sptPluginFolder = "plugins/spt";
|
private static string _sptPluginFolder = "plugins/spt";
|
||||||
|
|
||||||
private static string _sptPluginFolder = "plugins/spt";
|
|
||||||
|
|
||||||
public static void Patch(ref AssemblyDefinition assembly)
|
public static void Patch(ref AssemblyDefinition assembly)
|
||||||
{
|
{
|
||||||
PerformPreValidation();
|
PerformPreValidation();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user