mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 20:13:57 +00:00
add chat command
This commit is contained in:
19
GameServer/Server/Packet/Recv/Friend/HandlerReqFriendChat.cs
Normal file
19
GameServer/Server/Packet/Recv/Friend/HandlerReqFriendChat.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user