set dress, set bio & set birthday

This commit is contained in:
rafi1212122
2023-06-05 12:12:00 +07:00
parent 934e7475d7
commit f822976f74
4 changed files with 80 additions and 0 deletions

View File

@@ -104,6 +104,8 @@ namespace Common.Database
public void AddFragment(uint num) { Fragment += num; }
public void SetDress(uint dressId) { DressId = dressId; }
public void LevelUpSkill(uint subSkillId, bool isLevelUpAll = false)
{
AvatarSubSkillDataExcel? subSkillData = AvatarSubSkillData.GetInstance().FromId((int)subSkillId);

View File

@@ -0,0 +1,22 @@
using Common.Resources.Proto;
namespace PemukulPaku.GameServer.Handlers
{
[PacketCmdId(CmdId.ReportBirthdayReq)]
internal class ReportBirthdayReqHandler : IPacketHandler
{
public void Handle(Session session, Packet packet)
{
ReportBirthdayReq Data = packet.GetDecodedBody<ReportBirthdayReq>();
session.Player.User.BirthDate = (int)Data.Birthday;
GetMainDataRsp mainDataRsp = new()
{
retcode = GetMainDataRsp.Retcode.Succ,
Birthday = Data.Birthday
};
ReportBirthdayRsp Rsp = new() { retcode = ReportBirthdayRsp.Retcode.Succ };
session.Send(Packet.FromProto(mainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(Rsp, CmdId.ReportBirthdayRsp));
}
}
}

View File

@@ -0,0 +1,34 @@
using Common.Database;
using Common.Resources.Proto;
namespace PemukulPaku.GameServer.Handlers
{
[PacketCmdId(CmdId.SetDressReq)]
internal class SetDressReqHandler : IPacketHandler
{
public void Handle(Session session, Packet packet)
{
SetDressReq Data = packet.GetDecodedBody<SetDressReq>();
SetDressRsp Rsp = new() { retcode = SetDressRsp.Retcode.Succ };
AvatarScheme? avatar = session.Player.AvatarList.Where(x => x.AvatarId == Data.AvatarId).FirstOrDefault();
if (avatar is not null)
{
if (avatar.DressLists.Contains(Data.DressId))
{
avatar.SetDress(Data.DressId);
session.ProcessPacket(Packet.FromProto(new GetAvatarDataReq() { AvatarIdLists = new uint[] { avatar.AvatarId } }, CmdId.GetAvatarDataReq));
}
else
{
Rsp.retcode = SetDressRsp.Retcode.DressNotExist;
}
}
else
{
Rsp.retcode = SetDressRsp.Retcode.AvatarNotExist;
}
session.Send(Packet.FromProto(Rsp, CmdId.SetDressRsp));
}
}
}

View File

@@ -0,0 +1,22 @@
using Common.Resources.Proto;
namespace PemukulPaku.GameServer.Handlers
{
[PacketCmdId(CmdId.SetSelfDescReq)]
internal class SetSelfDescReqHandler : IPacketHandler
{
public void Handle(Session session, Packet packet)
{
SetSelfDescReq Data = packet.GetDecodedBody<SetSelfDescReq>();
session.Player.User.SelfDesc = Data.SelfDesc;
GetMainDataRsp mainDataRsp = new()
{
retcode = GetMainDataRsp.Retcode.Succ,
SelfDesc = Data.SelfDesc
};
SetSelfDescRsp Rsp = new() { retcode = SetSelfDescRsp.Retcode.Succ };
session.Send(Packet.FromProto(mainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(Rsp, CmdId.SetSelfDescRsp));
}
}
}