CustomHead and Frame impl, with GetMainDataRsp fix

This commit is contained in:
rafi1212122
2023-06-07 10:21:58 +07:00
parent f95f370a48
commit cd2087f6cb
20 changed files with 324 additions and 16 deletions

View File

@@ -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));
}

View File

@@ -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));
}
}
}

View 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));
}
}
}

View File

@@ -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));