协议定义

This commit is contained in:
bob
2025-08-12 17:28:22 +08:00
parent 15723850c0
commit f8b876ca2f
19 changed files with 1150 additions and 329 deletions

View File

@@ -0,0 +1,26 @@
using Fantasy;
using Fantasy.Async;
using Fantasy.Network.Interface;
namespace NB.Chat;
/// <summary>
/// 请求创建频道
/// </summary>
public class
C2Chat_CreateChannelRequestHandler : RouteRPC<ChatUnit, C2Chat_CreateChannelRequest, Caht2C_CreateChannelResponse>
{
protected override async FTask Run(ChatUnit entity, C2Chat_CreateChannelRequest request,
Caht2C_CreateChannelResponse response, Action reply)
{
var channelCenter = entity.Scene.GetComponent<ChatChannelCenterComponent>();
if (channelCenter == null)
{
response.ErrorCode = ErrorCode.ErrServer;
return;
}
var channel = await channelCenter.Create(entity);
}
}