handlers folder re-strucutring

This commit is contained in:
rafi1212122
2023-06-05 13:18:07 +07:00
parent f822976f74
commit cb2bc9d56e
74 changed files with 31 additions and 15 deletions

View File

@@ -0,0 +1,32 @@
using Common.Database;
using Common.Resources.Proto;
namespace PemukulPaku.GameServer.Handlers
{
[PacketCmdId(CmdId.GetClientDataReq)]
internal class GetClientDataReqHandler : IPacketHandler
{
public void Handle(Session session, Packet packet)
{
GetClientDataReq Data = packet.GetDecodedBody<GetClientDataReq>();
ClientDataScheme? clientData = Common.Database.ClientData.GetClientData(session.Player.User.Uid, Data.Type, Data.Id);
GetClientDataRsp Rsp = new() { retcode = GetClientDataRsp.Retcode.Succ, Id = Data.Id, Type = Data.Type };
if (clientData is not null)
{
Rsp.ClientDataLists.Add(new()
{
Id = clientData.ClientDataId,
Type = clientData.Type,
Data = clientData.Data
});
}
else
{
Rsp.retcode = GetClientDataRsp.Retcode.NotFound;
}
session.Send(Packet.FromProto(Rsp, CmdId.GetClientDataRsp));
}
}
}