mirror of
https://gitea.tendokyu.moe/Kayori/MedusaPluginChargeMachine.git
synced 2026-10-07 14:37:57 +03:00
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using System.Xml.Linq;
|
|
using Abstractions.Handlers;
|
|
using Abstractions.SerializationTypes;
|
|
using Abstractions.Services;
|
|
using MedusaPluginChargeMachine.Models.Request;
|
|
using MedusaPluginChargeMachine.Models.Response;
|
|
using MedusaPluginChargeMachine.Services;
|
|
|
|
namespace MedusaPluginChargeMachine.Handlers.LA9
|
|
{
|
|
public class CheckinEaChargeHandler(ISessionService sessionService, ICardService cardService): Handler<CheckinRequest, CheckinResponse>
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Module("eacharge");
|
|
Method("checkin");
|
|
}
|
|
public override async Task<CheckinResponse> HandleAsync(CheckinRequest req, GameModel model)
|
|
{
|
|
var sessionId = sessionService.AddSession(req.CardId);
|
|
|
|
var card = await cardService.FindByCardId(req.CardId);
|
|
|
|
var userPaseli = card!.User.PaseliAmount;
|
|
|
|
var checkinResponse = new CheckinResponse()
|
|
{
|
|
Status = 0,
|
|
Sessseq = new XrpcInt(0),
|
|
AccountName = new XrpcString("DUMMY_NAME"),
|
|
Balance = new XrpcInt(userPaseli),
|
|
BuyablePaseli = new XrpcInt(100000),
|
|
SessionId = new XrpcString(sessionId)
|
|
};
|
|
|
|
return checkinResponse;
|
|
}
|
|
}
|
|
}
|