using System; using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Chat; /// /// 请求创建频道 /// public class C2S_CreateChannelRequestHandler : AddressRPC { protected override async FTask Run(SocialUnit entity, C2S_CreateChannelRequest request, S2C_CreateChannelResponse response, Action reply) { var channelCenter = entity.Scene.GetComponent(); if (channelCenter == null) { response.ErrorCode = ErrorCode.ErrServer; return; } var channel = await channelCenter.Create(entity); response.ChannelId = channel.Id; } }