1
0
mirror of synced 2024-11-27 23:50:49 +01:00

Test temp fix for cond

This commit is contained in:
asesidaa 2023-10-12 02:20:43 +08:00
parent dbc776ddda
commit 7edcd07723
3 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,14 @@
namespace Application.Game.Card.Write;
public record WriteCondCommand(long CardId, string Data) : IRequestWrapper<string>;
public class WriteCondCommandHandler : RequestHandlerBase<WriteCondCommand, string>
{
public WriteCondCommandHandler(ICardDependencyAggregate aggregate) : base(aggregate) {}
public override Task<ServiceResult<string>> Handle(WriteCondCommand request, CancellationToken cancellationToken)
{
// TODO: Add proper implementation
return Task.FromResult(new ServiceResult<string>(request.Data));
}
}

View File

@ -53,6 +53,7 @@ public enum CardRequestType
WriteCoin = 980, WriteCoin = 980,
WriteUnlockKeynum = 1020, WriteUnlockKeynum = 1020,
WriteSoundEffect = 8969, WriteSoundEffect = 8969,
WriteCond = 8976,
#endregion #endregion

View File

@ -25,7 +25,7 @@ public class CardController : BaseController<CardController>
cardCommandType.Throw().IfOutOfRange(); cardCommandType.Throw().IfOutOfRange();
if (cardCommandType is CardCommandType.CardReadRequest or CardCommandType.CardWriteRequest) if (cardCommandType is CardCommandType.CardReadRequest or CardCommandType.CardWriteRequest)
{ {
cardRequestType.Throw().IfOutOfRange(); cardRequestType.Throw($"Failed to process {cardCommandType.ToString()}").IfOutOfRange();
} }
request.Data = WebUtility.UrlDecode(request.Data); request.Data = WebUtility.UrlDecode(request.Data);
@ -84,6 +84,8 @@ public class CardController : BaseController<CardController>
new WriteUnlockKeynumCommand(request.CardId, request.Data)), new WriteUnlockKeynumCommand(request.CardId, request.Data)),
CardRequestType.WriteSoundEffect => await Mediator.Send( CardRequestType.WriteSoundEffect => await Mediator.Send(
new WriteSoundEffectCommand(request.CardId, request.Data)), new WriteSoundEffectCommand(request.CardId, request.Data)),
CardRequestType.WriteCond => await Mediator.Send(
new WriteCondCommand(request.CardId, request.Data)),
CardRequestType.StartOnlineMatching => await Mediator.Send( CardRequestType.StartOnlineMatching => await Mediator.Send(
new StartOnlineMatchingCommand(request.CardId, request.Data)), new StartOnlineMatchingCommand(request.CardId, request.Data)),
CardRequestType.UpdateOnlineMatching => await Mediator.Send( CardRequestType.UpdateOnlineMatching => await Mediator.Send(