Stuff works

This commit is contained in:
gamer147
2024-09-08 10:27:12 -04:00
parent 7e4bce9ac5
commit ac3b002d74
14 changed files with 157 additions and 87 deletions

View File

@@ -2,11 +2,21 @@ using MessagePack;
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
/// <summary>
/// Wraps responses in the format the official game client expects, with a header section for additional data. Not for manual endpoint use, this wrapping is done automatically in a middleware.
/// </summary>
[MessagePackObject]
public class DataWrapper<T>
public class DataWrapper
{
[Key("data_headers")]
public DataHeaders DataHeaders { get; set; }
[Key("data")]
public T Data { get; set; }
/// <summary>
/// Additional data about the request, response and user.
/// </summary>
[Key("data_headers")]
public DataHeaders DataHeaders { get; set; } = new DataHeaders();
/// <summary>
/// The response data from the endpoint.
/// </summary>
[Key("data")]
public object Data { get; set; } = new();
}