Format Style Fixes

This commit is contained in:
sp-tarkov-bot
2025-10-28 17:03:57 +00:00
parent abb844c9ce
commit 3da3ea1098
3 changed files with 22 additions and 67 deletions
@@ -16,26 +16,17 @@ public class LauncherV2Callbacks(
{ {
public ValueTask<string> Ping() public ValueTask<string> Ping()
{ {
return new ValueTask<string>(httpResponseUtil.NoBody(new LauncherV2PingResponse return new ValueTask<string>(httpResponseUtil.NoBody(new LauncherV2PingResponse { Response = launcherV2Controller.Ping() }));
{
Response = launcherV2Controller.Ping()
}));
} }
public ValueTask<string> Types() public ValueTask<string> Types()
{ {
return new ValueTask<string>(httpResponseUtil.NoBody(new LauncherV2TypesResponse return new ValueTask<string>(httpResponseUtil.NoBody(new LauncherV2TypesResponse { Response = launcherV2Controller.Types() }));
{
Response = launcherV2Controller.Types()
}));
} }
public ValueTask<string> Login(LoginRequestData info) public ValueTask<string> Login(LoginRequestData info)
{ {
return new ValueTask<string>(httpResponseUtil.NoBody(new LauncherV2LoginResponse return new ValueTask<string>(httpResponseUtil.NoBody(new LauncherV2LoginResponse { Response = launcherV2Controller.Login(info) }));
{
Response = launcherV2Controller.Login(info)
}));
} }
public async ValueTask<string> Register(RegisterData info) public async ValueTask<string> Register(RegisterData info)
@@ -65,49 +56,35 @@ public class LauncherV2Callbacks(
public ValueTask<string> CompatibleVersion() public ValueTask<string> CompatibleVersion()
{ {
return new ValueTask<string>( return new ValueTask<string>(
httpResponseUtil.NoBody(new LauncherV2VersionResponse httpResponseUtil.NoBody(new LauncherV2VersionResponse { Response = launcherV2Controller.SptVersion() })
{
Response = launcherV2Controller.SptVersion()
})
); );
} }
public ValueTask<string> Mods() public ValueTask<string> Mods()
{ {
return new ValueTask<string>(httpResponseUtil.NoBody(new LauncherV2ModsResponse return new ValueTask<string>(httpResponseUtil.NoBody(new LauncherV2ModsResponse { Response = launcherV2Controller.LoadedMods() }));
{
Response = launcherV2Controller.LoadedMods()
}));
} }
public ValueTask<string> Profiles() public ValueTask<string> Profiles()
{ {
return new ValueTask<string>( return new ValueTask<string>(
httpResponseUtil.NoBody(new LauncherV2ProfilesResponse httpResponseUtil.NoBody(new LauncherV2ProfilesResponse { Response = profileController.GetMiniProfiles() })
{
Response = profileController.GetMiniProfiles()
})
); );
} }
public ValueTask<string> Profile(LoginRequestData username) public ValueTask<string> Profile(LoginRequestData username)
{ {
return new ValueTask<string>( return new ValueTask<string>(
httpResponseUtil.NoBody(new LauncherV2ProfileResponse httpResponseUtil.NoBody(new LauncherV2ProfileResponse { Response = launcherV2Controller.GetMiniProfileFromUsername(username) })
{
Response = launcherV2Controller.GetMiniProfileFromUsername(username)
})
); );
} }
public ValueTask<string> Wipe(RegisterData info) public ValueTask<string> Wipe(RegisterData info)
{ {
return new ValueTask<string>( return new ValueTask<string>(
httpResponseUtil.NoBody(new LauncherV2WipeResponse httpResponseUtil.NoBody(
{ new LauncherV2WipeResponse { Response = launcherV2Controller.Wipe(info), Profiles = profileController.GetMiniProfiles() }
Response = launcherV2Controller.Wipe(info), )
Profiles = profileController.GetMiniProfiles(),
})
); );
} }
} }
@@ -185,9 +185,10 @@ public class LauncherV2Controller(
if (!sessionId) if (!sessionId)
{ {
var profileInfo = saveServer.GetProfiles().FirstOrDefault(x => var profileInfo = saveServer
x.Value.ProfileInfo?.Username == info.Username .GetProfiles()
).Value.ProfileInfo; .FirstOrDefault(x => x.Value.ProfileInfo?.Username == info.Username)
.Value.ProfileInfo;
profileInfo!.Edition = info.Edition; profileInfo!.Edition = info.Edition;
profileInfo.IsWiped = true; profileInfo.IsWiped = true;
@@ -14,36 +14,13 @@ public class LauncherV2StaticRouter(LauncherV2Callbacks launcherV2Callbacks, Jso
[ [
new RouteAction<EmptyRequestData>("/launcher/v2/ping", async (_, _, _, _) => await launcherV2Callbacks.Ping()), new RouteAction<EmptyRequestData>("/launcher/v2/ping", async (_, _, _, _) => await launcherV2Callbacks.Ping()),
new RouteAction<EmptyRequestData>("/launcher/v2/types", async (_, _, _, _) => await launcherV2Callbacks.Types()), new RouteAction<EmptyRequestData>("/launcher/v2/types", async (_, _, _, _) => await launcherV2Callbacks.Types()),
new RouteAction<LoginRequestData>( new RouteAction<LoginRequestData>("/launcher/v2/login", async (_, info, _, _) => await launcherV2Callbacks.Login(info)),
"/launcher/v2/login", new RouteAction<RegisterData>("/launcher/v2/register", async (_, info, _, _) => await launcherV2Callbacks.Register(info)),
async (_, info, _, _) => await launcherV2Callbacks.Login(info) new RouteAction<LoginRequestData>("/launcher/v2/remove", async (_, info, _, _) => await launcherV2Callbacks.Remove(info)),
), new RouteAction<EmptyRequestData>("/launcher/v2/version", async (_, _, _, _) => await launcherV2Callbacks.CompatibleVersion()),
new RouteAction<RegisterData>(
"/launcher/v2/register",
async (_, info, _, _) => await launcherV2Callbacks.Register(info)
),
new RouteAction<LoginRequestData>(
"/launcher/v2/remove",
async (_, info, _, _) => await launcherV2Callbacks.Remove(info)
),
new RouteAction<EmptyRequestData>(
"/launcher/v2/version",
async (_, _, _, _) => await launcherV2Callbacks.CompatibleVersion()
),
new RouteAction<EmptyRequestData>("/launcher/v2/mods", async (_, _, _, _) => await launcherV2Callbacks.Mods()), new RouteAction<EmptyRequestData>("/launcher/v2/mods", async (_, _, _, _) => await launcherV2Callbacks.Mods()),
new RouteAction<EmptyRequestData>( new RouteAction<EmptyRequestData>("/launcher/v2/profiles", async (_, _, _, _) => await launcherV2Callbacks.Profiles()),
"/launcher/v2/profiles", new RouteAction<LoginRequestData>("/launcher/v2/profile", async (_, info, _, _) => await launcherV2Callbacks.Profile(info)),
async (_, _, _, _) => await launcherV2Callbacks.Profiles() new RouteAction<RegisterData>("/launcher/v2/wipe", async (_, info, _, _) => await launcherV2Callbacks.Wipe(info)),
),
new RouteAction<LoginRequestData>(
"/launcher/v2/profile",
async (_, info, _, _) => await launcherV2Callbacks.Profile(info)
),
new RouteAction<RegisterData>(
"/launcher/v2/wipe",
async (_, info, _, _) => await launcherV2Callbacks.Wipe(info)
)
] ]
) ) { }
{
}