unstable whisper, now you can dm your friend(if you have any lol)

This commit is contained in:
rafi1212122
2023-06-08 09:37:50 +07:00
parent cd2087f6cb
commit 115fc0951b
8 changed files with 181 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
using Common.Database;
using Common.Resources.Proto;
namespace PemukulPaku.GameServer.Handlers.Chat
{
[PacketCmdId(CmdId.GetPrivateHistoryChatMsgReq)]
internal class GetPrivateHistoryChatMsgReqHandler : IPacketHandler
{
public void Handle(Session session, Packet packet)
{
GetPrivateHistoryChatMsgReq Data = packet.GetDecodedBody<GetPrivateHistoryChatMsgReq>();
GetPrivateHistoryChatMsgRsp Rsp = new() { retcode = GetPrivateHistoryChatMsgRsp.Retcode.Succ };
if (Data.UidLists.Length > 0)
{
foreach (uint targetUid in Data.UidLists)
{
Rsp.ChatLists.AddRange(PrivateMessage.GetMessages(session.Player.User.Uid, targetUid));
}
}
else
{
Rsp.ChatLists.AddRange(PrivateMessage.GetMessages(session.Player.User.Uid));
}
session.Send(Packet.FromProto(Rsp, CmdId.GetPrivateHistoryChatMsgRsp));
}
}
}