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

108 lines
3.0 KiB
C#
Raw Normal View History

2023-03-03 19:25:33 +00:00
/* RequestHandler.cs
* License: NCSA Open Source License
*
2024-05-21 20:15:19 +01:00
* Copyright: SPT
2023-03-03 19:25:33 +00:00
* AUTHORS:
*/
2024-05-21 20:15:19 +01:00
using SPT.Launcher.MiniCommon;
2023-03-03 19:25:33 +00:00
2024-05-21 20:15:19 +01:00
namespace SPT.Launcher
2023-03-03 19:25:33 +00:00
{
public static class RequestHandler
{
private static Request request = new Request(null, "");
public static string GetBackendUrl()
{
return request.RemoteEndPoint;
}
public static void ChangeBackendUrl(string remoteEndPoint)
{
request.RemoteEndPoint = remoteEndPoint;
}
public static void ChangeSession(string session)
{
request.Session = session;
}
public static string RequestConnect()
{
return request.GetJson("/launcher/server/connect");
}
public static string RequestLogin(LoginRequestData data)
{
return request.PostJson("/launcher/profile/login", Json.Serialize(data));
}
public static string RequestRegister(RegisterRequestData data)
{
return request.PostJson("/launcher/profile/register", Json.Serialize(data));
}
public static string RequestRemove(LoginRequestData data)
{
return request.PostJson("/launcher/profile/remove", Json.Serialize(data));
}
public static string RequestAccount(LoginRequestData data)
{
return request.PostJson("/launcher/profile/get", Json.Serialize(data));
}
public static string RequestProfileInfo(LoginRequestData data)
{
return request.PostJson("/launcher/profile/info", Json.Serialize(data));
}
public static string RequestExistingProfiles()
{
return request.GetJson("/launcher/profiles");
}
public static string RequestChangeUsername(ChangeRequestData data)
{
return request.PostJson("/launcher/profile/change/username", Json.Serialize(data));
}
public static string RequestChangePassword(ChangeRequestData data)
{
return request.PostJson("/launcher/profile/change/password", Json.Serialize(data));
}
public static string RequestWipe(RegisterRequestData data)
{
return request.PostJson("/launcher/profile/change/wipe", Json.Serialize(data));
}
public static string SendPing()
{
return request.GetJson("/launcher/ping");
}
public static string RequestServerVersion()
{
return request.GetJson("/launcher/server/version");
}
public static string RequestCompatibleGameVersion()
{
return request.GetJson("/launcher/profile/compatibleTarkovVersion");
}
2023-08-13 11:00:10 -04:00
public static string RequestLoadedServerMods()
{
return request.GetJson("/launcher/server/loadedServerMods");
}
public static string RequestProfileMods()
{
return request.GetJson("/launcher/server/serverModsUsedByProfile");
}
2023-03-03 19:25:33 +00:00
}
}