大修改
This commit is contained in:
27
Hotfix/Social/Handler/C2S_CreateChannelRequestHandler.cs
Normal file
27
Hotfix/Social/Handler/C2S_CreateChannelRequestHandler.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
/// <summary>
|
||||
/// 请求创建频道
|
||||
/// </summary>
|
||||
public class
|
||||
C2S_CreateChannelRequestHandler : RouteRPC<SocialUnit, C2S_CreateChannelRequest, S2C_CreateChannelResponse>
|
||||
{
|
||||
protected override async FTask Run(SocialUnit entity, C2S_CreateChannelRequest request,
|
||||
S2C_CreateChannelResponse response, Action reply)
|
||||
{
|
||||
var channelCenter = entity.Scene.GetComponent<ChatChannelCenterComponent>();
|
||||
if (channelCenter == null)
|
||||
{
|
||||
response.ErrorCode = ErrorCode.ErrServer;
|
||||
return;
|
||||
}
|
||||
|
||||
var channel = await channelCenter.Create(entity);
|
||||
|
||||
response.ChannelId = channel.Id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user