1
0
mirror of synced 2024-12-24 20:04:53 +01:00
GC-local-server-rewrite/Application/Game/Card/Session/GetSessionCommand.cs

25 lines
856 B
C#
Raw Normal View History

2023-02-16 09:53:02 +01:00
namespace Application.Game.Card.Session;
2023-02-09 16:19:14 +01:00
public record GetSessionCommand(long CardId, string Mac) : IRequestWrapper<string>;
2023-02-16 17:38:01 +01:00
public class GetSessionCommandHandler : RequestHandlerBase<GetSessionCommand, string>
2023-02-09 16:19:14 +01:00
{
private const string SESSION_XPATH = "/root/session";
public GetSessionCommandHandler(ICardDependencyAggregate aggregate) : base(aggregate)
{
}
public override Task<ServiceResult<string>> Handle(GetSessionCommand request, CancellationToken cancellationToken)
{
var session = new SessionDto
{
CardId = request.CardId,
Mac = request.Mac,
PlayerId = 1,
Expires = 9999,
SessionId = "12345678901234567890123456789012"
};
return Task.FromResult(new ServiceResult<string>(session.SerializeCardData(SESSION_XPATH)));
}
}