add chat command

This commit is contained in:
Naruse
2026-04-27 00:40:08 +08:00
parent 9c67e36ca3
commit 4ee9fd6908
7 changed files with 121 additions and 4 deletions

View File

@@ -0,0 +1,19 @@
using Google.Protobuf;
using MikuSB.Proto;
using MikuSB.Util;
namespace MikuSB.GameServer.Server.Packet.Recv.Friend;
[Opcode(CmdIds.ReqFriendChat)]
public class HandlerReqFriendChat : Handler
{
public override async Task OnHandle(Connection connection, byte[] data, ushort seqNo)
{
var req = ChatMsg.Parser.ParseFrom(data);
var json = JsonFormatter.Default.Format(req);
Logger.GetByClassName().Debug($"{json}");
await connection.Player!.ReceiveMessage((uint)connection.Player!.Uid, (uint)req.Recver, req.Text, (uint)req.Emoji);
await connection.SendPacket(CmdIds.RspFriendChat);
}
}