mirror of
https://github.com/rafi1212122/PemukulPaku
synced 2025-12-14 04:04:34 +01:00
CustomHead and Frame impl, with GetMainDataRsp fix
This commit is contained in:
@@ -9,7 +9,8 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
SendChatMsgNotify Data = packet.GetDecodedBody<SendChatMsgNotify>();
|
||||
WorldChatroom.GetInstance().GetChatroom(session).OnSendChat(session, Data.ChatMsg);
|
||||
if (Data.ChatMsg.Channel == ChatMsg.MsgChannel.World)
|
||||
WorldChatroom.GetInstance().GetChatroom(session).OnSendChat(session, Data.ChatMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
{
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
GetMainDataReq Data = packet.GetDecodedBody<GetMainDataReq>();
|
||||
UserScheme User = session.Player.User;
|
||||
|
||||
PlayerLevelData.LevelData levelData = PlayerLevelData.GetInstance().CalculateLevel(User.Exp);
|
||||
|
||||
GetMainDataRsp Rsp = new()
|
||||
@@ -23,18 +23,18 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
Exp = (uint)levelData.Exp,
|
||||
FreeHcoin = (uint)User.Hcoin,
|
||||
Hcoin = (uint)User.Hcoin,
|
||||
CustomHeadId = 161001,
|
||||
CustomHeadId = (uint)User.CustomHeadId,
|
||||
Scoin = session.Player.Equipment.MaterialList.Where(mat => mat.Id == 100).FirstOrDefault()?.Num ?? 0,
|
||||
IsAll = true,
|
||||
RegisterTime = User.GetCreationTime(),
|
||||
PayHcoin = 0,
|
||||
WarshipAvatar = User.WarshipAvatar,
|
||||
SelfDesc = User.SelfDesc,
|
||||
UseFrameId = 200001,
|
||||
UseFrameId = User.FrameId < 200001 ? 200001 : (uint)User.FrameId,
|
||||
OnPhonePendantId = 350005,
|
||||
Stamina = (uint)User.Stamina,
|
||||
StaminaRecoverConfigTime = 360,
|
||||
StaminaRecoverLeftTime = 0,
|
||||
StaminaRecoverLeftTime = 360,
|
||||
EquipmentSizeLimit = 1000,
|
||||
OpenPanelActivityLists = new uint[] { 2 },
|
||||
ChatworldActivityInfo = new()
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
|
||||
session.Player.User.Nick = Data.Nickname;
|
||||
|
||||
GetMainDataRsp MainDataRsp = new() { retcode = GetMainDataRsp.Retcode.Succ, Nickname = session.Player.User.Nick };
|
||||
GetMainDataRsp MainDataRsp = new() { retcode = GetMainDataRsp.Retcode.Succ, Nickname = session.Player.User.Nick, TypeLists = new uint[] { 2 } };
|
||||
session.Send(Packet.FromProto(MainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(new NicknameModifyRsp() { retcode = NicknameModifyRsp.Retcode.Succ }, CmdId.NicknameModifyRsp));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
GetMainDataRsp mainDataRsp = new()
|
||||
{
|
||||
retcode = GetMainDataRsp.Retcode.Succ,
|
||||
Birthday = Data.Birthday
|
||||
Birthday = Data.Birthday,
|
||||
TypeLists = new uint[] { 21 }
|
||||
};
|
||||
ReportBirthdayRsp Rsp = new() { retcode = ReportBirthdayRsp.Retcode.Succ };
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
GetMainDataRsp mainDataRsp = new()
|
||||
{
|
||||
retcode = GetMainDataRsp.Retcode.Succ,
|
||||
SelfDesc = Data.SelfDesc
|
||||
SelfDesc = Data.SelfDesc,
|
||||
TypeLists = new uint[] { 16 }
|
||||
};
|
||||
SetSelfDescRsp Rsp = new() { retcode = SetSelfDescRsp.Retcode.Succ };
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
session.Player.User.AssistantAvatarId = (int)Data.AvatarId;
|
||||
|
||||
UpdateAssistantAvatarIdRsp Rsp = new() { retcode = UpdateAssistantAvatarIdRsp.Retcode.Succ };
|
||||
GetMainDataRsp MainDataRsp = new() { retcode = GetMainDataRsp.Retcode.Succ, AssistantAvatarId = (uint)session.Player.User.AssistantAvatarId };
|
||||
GetMainDataRsp MainDataRsp = new() { retcode = GetMainDataRsp.Retcode.Succ, AssistantAvatarId = (uint)session.Player.User.AssistantAvatarId, TypeLists = new uint[] { 19 } };
|
||||
|
||||
session.Send(Packet.FromProto(MainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(Rsp, CmdId.UpdateAssistantAvatarIdRsp));
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
GetFrameDataRsp Rsp = new() { retcode = GetFrameDataRsp.Retcode.Succ, IsAll = true };
|
||||
Rsp.FrameLists.Add(new FrameData() { Id = 200001 });
|
||||
Rsp.FrameLists.AddRange(Common.Utils.ExcelReader.FrameData.GetInstance().All.Select(x => new FrameData() { Id = (uint)x.Id }));
|
||||
|
||||
session.Send(Packet.FromProto(Rsp, CmdId.GetFrameDataRsp));
|
||||
}
|
||||
|
||||
49
GameServer/Handlers/Two/GetOtherPlayerCardDataReqHandler.cs
Normal file
49
GameServer/Handlers/Two/GetOtherPlayerCardDataReqHandler.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Common.Database;
|
||||
using Common.Resources.Proto;
|
||||
using Common.Utils.ExcelReader;
|
||||
using PemukulPaku.GameServer.Game;
|
||||
|
||||
namespace PemukulPaku.GameServer.Handlers.Two
|
||||
{
|
||||
[PacketCmdId(CmdId.GetOtherPlayerCardDataReq)]
|
||||
internal class GetOtherPlayerCardDataReqHandler : IPacketHandler
|
||||
{
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
GetOtherPlayerCardDataReq Data = packet.GetDecodedBody<GetOtherPlayerCardDataReq>();
|
||||
UserScheme? user = User.FromUid(Data.TargetUid);
|
||||
GetOtherPlayerCardDataRsp Rsp = new() { retcode = GetOtherPlayerCardDataRsp.Retcode.Succ, TargetUid = Data.TargetUid };
|
||||
|
||||
if(user is not null)
|
||||
{
|
||||
Player player = new(user);
|
||||
Rsp.CardData = new()
|
||||
{
|
||||
Uid = player.User.Uid,
|
||||
MsgData = new()
|
||||
{
|
||||
MsgIndex = 0,
|
||||
MsgConfig = 1
|
||||
},
|
||||
OnPhonePendantId = 350005
|
||||
};
|
||||
Rsp.PlayerData = new()
|
||||
{
|
||||
Uid = player.User.Uid,
|
||||
Nickname = player.User.Nick,
|
||||
Level = (uint)PlayerLevelData.GetInstance().CalculateLevel(player.User.Exp).Level,
|
||||
SelfDesc = player.User.SelfDesc,
|
||||
CustomHeadId = (uint)player.User.CustomHeadId,
|
||||
FrameId = player.User.FrameId < 200001 ? 200001 : (uint)player.User.FrameId,
|
||||
LeaderAvatar = player.AvatarList.FirstOrDefault(x => x.AvatarId == player.User.AvatarTeamList.FirstOrDefault()?.AvatarIdLists[0])?.ToDetailData(player.Equipment) ?? new() { AvatarId = 101 }
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Rsp.retcode = GetOtherPlayerCardDataRsp.Retcode.Fail;
|
||||
}
|
||||
|
||||
session.Send(Packet.FromProto(Rsp, CmdId.GetOtherPlayerCardDataRsp));
|
||||
}
|
||||
}
|
||||
}
|
||||
22
GameServer/Handlers/Two/SetFrameUseReqHandler.cs
Normal file
22
GameServer/Handlers/Two/SetFrameUseReqHandler.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Common.Resources.Proto;
|
||||
|
||||
namespace PemukulPaku.GameServer.Handlers.Two
|
||||
{
|
||||
[PacketCmdId(CmdId.SetFrameUseReq)]
|
||||
internal class SetFrameUseReqHandler : IPacketHandler
|
||||
{
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
SetFrameUseReq Data = packet.GetDecodedBody<SetFrameUseReq>();
|
||||
session.Player.User.FrameId = (int)Data.FrameId;
|
||||
GetMainDataRsp mainDataRsp = new()
|
||||
{
|
||||
retcode = GetMainDataRsp.Retcode.Succ,
|
||||
UseFrameId = Data.FrameId,
|
||||
TypeLists = new uint[] { 26 }
|
||||
};
|
||||
|
||||
session.Send(Packet.FromProto(mainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(new SetFrameUseRsp() { FrameId = Data.FrameId, retcode = SetFrameUseRsp.Retcode.Succ }, CmdId.SetFrameUseRsp));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,8 @@ namespace PemukulPaku.GameServer.Handlers
|
||||
GetMainDataRsp MainDataRsp = new()
|
||||
{
|
||||
retcode = GetMainDataRsp.Retcode.Succ,
|
||||
WarshipTheme = new() { WarshipId = (uint)session.Player.User.WarshipId }
|
||||
WarshipTheme = new() { WarshipId = (uint)session.Player.User.WarshipId },
|
||||
TypeLists = new uint[] { 38 }
|
||||
};
|
||||
SetWarshipRsp Rsp = new() { retcode = SetWarshipRsp.Retcode.Succ };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user