mirror of
https://github.com/rafi1212122/PemukulPaku
synced 2025-12-16 12:54:35 +01:00
CustomHead and Frame impl, with GetMainDataRsp fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Common.Resources.Proto;
|
||||
using Common.Utils.ExcelReader;
|
||||
|
||||
namespace PemukulPaku.GameServer.Handlers
|
||||
{
|
||||
@@ -8,7 +9,7 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
GetCustomHeadDataRsp Rsp = new() { retcode = GetCustomHeadDataRsp.Retcode.Succ, IsAll = true };
|
||||
Rsp.CustomHeadLists.Add(new CustomHead() { Id = 161001 });
|
||||
Rsp.CustomHeadLists.AddRange(CustomHeadData.GetInstance().All.Where(x => x.HeadParaInt == 0 || session.Player.AvatarList.Select(x => x.AvatarId).ToList().Contains((uint)x.HeadParaInt) || session.Player.AvatarList.SelectMany(x => x.DressLists).ToList().Contains((uint)x.HeadParaInt)).Select(x => new CustomHead() { Id = (uint)x.HeadId }));
|
||||
|
||||
session.Send(Packet.FromProto(Rsp, CmdId.GetCustomHeadDataRsp));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using Common.Resources.Proto;
|
||||
|
||||
namespace PemukulPaku.GameServer.Handlers.Three
|
||||
{
|
||||
[PacketCmdId(CmdId.GetOtherPlayerClientSettingReq)]
|
||||
internal class GetOtherPlayerClientSettingReqHadler : IPacketHandler
|
||||
{
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
GetOtherPlayerClientSettingReq Data = packet.GetDecodedBody<GetOtherPlayerClientSettingReq>();
|
||||
GetOtherPlayerClientSettingRsp Rsp = new()
|
||||
{
|
||||
retcode = GetOtherPlayerClientSettingRsp.Retcode.Succ,
|
||||
ClientSettingType = Data.ClientSettingType,
|
||||
TargetUid = Data.TargetUid,
|
||||
IsWeeklyGuideSwitchOn = false
|
||||
};
|
||||
|
||||
session.Send(Packet.FromProto(Rsp, CmdId.GetOtherPlayerClientSettingRsp));
|
||||
}
|
||||
}
|
||||
}
|
||||
23
GameServer/Handlers/Three/SetCustomHeadReqHandler.cs
Normal file
23
GameServer/Handlers/Three/SetCustomHeadReqHandler.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Common.Resources.Proto;
|
||||
|
||||
namespace PemukulPaku.GameServer.Handlers.Three
|
||||
{
|
||||
[PacketCmdId(CmdId.SetCustomHeadReq)]
|
||||
internal class SetCustomHeadReqHandler : IPacketHandler
|
||||
{
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
SetCustomHeadReq Data = packet.GetDecodedBody<SetCustomHeadReq>();
|
||||
session.Player.User.CustomHeadId = (int)Data.Id;
|
||||
|
||||
GetMainDataRsp mainDataRsp = new()
|
||||
{
|
||||
retcode = GetMainDataRsp.Retcode.Succ,
|
||||
CustomHeadId = Data.Id,
|
||||
TypeLists = new uint[] { 36 }
|
||||
};
|
||||
|
||||
session.Send(Packet.FromProto(mainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(new SetCustomHeadRsp() { retcode = SetCustomHeadRsp.Retcode.Succ }, CmdId.SetCustomHeadRsp));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,8 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
GetMainDataRsp MainDataRsp = new()
|
||||
{
|
||||
retcode = GetMainDataRsp.Retcode.Succ,
|
||||
WarshipAvatar = session.Player.User.WarshipAvatar
|
||||
WarshipAvatar = session.Player.User.WarshipAvatar,
|
||||
TypeLists = new uint[] { 35 }
|
||||
};
|
||||
|
||||
session.Send(Packet.FromProto(MainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(new SetWarshipAvatarRsp() { retcode = SetWarshipAvatarRsp.Retcode.Succ }, CmdId.SetWarshipAvatarRsp));
|
||||
|
||||
Reference in New Issue
Block a user