push changes

This commit is contained in:
Mikhail
2024-09-25 20:03:27 -04:00
parent 1e5c124033
commit 899a56eac5
6 changed files with 87 additions and 3 deletions

View File

@@ -18,9 +18,13 @@ namespace EpinelPS.Controllers
st.Stop(); st.Stop();
var fg = Console.ForegroundColor; var fg = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WriteLine("POST " + HttpContext.Request.Path.Value + " completed in " + st.Elapsed); if (HttpContext.Response.StatusCode == 200)
Console.ForegroundColor = ConsoleColor.DarkGreen;
else
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("POST " + HttpContext.Request.Path.Value + " completed in " + st.Elapsed + "with result " + HttpContext.Response.StatusCode);
Console.ForegroundColor = fg; Console.ForegroundColor = fg;
} }

View File

@@ -0,0 +1,20 @@
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Msgs.Archive
{
[PacketPath("/archive/minigame/getdata")]
public class GetMinigameData : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqGetArchiveMiniGameData>();
var response = new ResGetArchiveMiniGameData();
response.Json = "{}";
// TODO
await WriteDataAsync(response);
}
}
}

View File

@@ -0,0 +1,21 @@
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Msgs.Minigame.nksv2
{
[PacketPath("/minigame/nksv2/scenario/complete")]
public class CompleteScenario : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqCompleteNKSV2Scenario>();
var user = GetUser();
var response = new ResCompleteNKSV2Scenario();
user.MogInfo.CompletedScenarios.Add(req.ScenarioId);
JsonDb.Save();
await WriteDataAsync(response);
}
}
}

View File

@@ -0,0 +1,19 @@
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Msgs.Minigame.nksv2
{
[PacketPath("/minigame/nksv2/scenario/get")]
public class GetScenario : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqGetNKSV2Scenario>();
var user = GetUser();
var response = new ResGetNKSV2Scenario();
response.ScenarioIdList.Add(user.MogInfo.CompletedScenarios);
await WriteDataAsync(response);
}
}
}

View File

@@ -0,0 +1,20 @@
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Msgs.Outpost
{
[PacketPath("/outpost/buildingisdone")]
public class SetBuildingDone : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqBuildingIsDone>();
var user = GetUser();
var response = new ResBuildingIsDone();
await WriteDataAsync(response);
}
}
}

View File

@@ -68,7 +68,7 @@ namespace EpinelPS.Utils
string msg = formatter(state, exception).Replace("Request reached the end of the middleware pipeline without being handled by application code. Request path: ", ""); string msg = formatter(state, exception).Replace("Request reached the end of the middleware pipeline without being handled by application code. Request path: ", "");
if (msg.StartsWith("Executing ObjectResult") || msg.StartsWith("Executed endpoint") || msg.StartsWith("Route matched with ") || msg.Contains("CatchAll") || msg.Contains("$batch")) if (msg.StartsWith("Executing ObjectResult") || msg.StartsWith("Executed endpoint") || msg.StartsWith("Route matched with ") || msg.Contains("CatchAll") || msg.Contains("$batch") || msg.Contains("/dr/getsid"))
return; return;
Console.ForegroundColor = config.LogLevelToColorMap[logLevel]; Console.ForegroundColor = config.LogLevelToColorMap[logLevel];