// using Fantasy; // using Fantasy.Async; // using Fantasy.Entitas; // using Fantasy.Network.Interface; // // namespace NB.Chat; // // public sealed class G2Chat_LoginRequestHandler : AddressRPC // { // protected override async FTask Run(Scene scene, G2Chat_LoginRequest request, Chat2G_LoginResponse response, Action reply) // { // var chatUnit = scene.GetComponent().Add(request.UnitId, request.UserName, request.GateRouteId); // response.ChatRouteId = chatUnit.RunTimeId; // // 这里模拟创建一个频道用于测试用 // var chatChannelCenterComponent = scene.GetComponent(); // var chatChannelComponent = chatChannelCenterComponent.Apply(1); // // 加入到聊天频道 // chatChannelComponent.JoinChannel(request.UnitId); // await FTask.CompletedTask; // } // }