mirror of
https://github.com/rafi1212122/PemukulPaku
synced 2025-12-12 21:04:43 +01:00
set dress, set bio & set birthday
This commit is contained in:
@@ -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);
|
||||
|
||||
22
GameServer/Handlers/ReportBirthdayReqHandler.cs
Normal file
22
GameServer/Handlers/ReportBirthdayReqHandler.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
34
GameServer/Handlers/SetDressReqHandler.cs
Normal file
34
GameServer/Handlers/SetDressReqHandler.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
22
GameServer/Handlers/SetSelfDescReqHandler.cs
Normal file
22
GameServer/Handlers/SetSelfDescReqHandler.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user