修改为luban

This commit is contained in:
Bob.Song
2026-03-05 15:03:45 +08:00
parent 13e4315a70
commit 36067705f2
122 changed files with 10497 additions and 2216 deletions

View File

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

View File

@@ -0,0 +1,13 @@
// using Fantasy.Async;
// using Fantasy.Network.Interface;
//
// namespace NB.Chat;
//
// public sealed class G2Chat_OfflineRequestHandler : AddressRPC<ChatUnit, G2Chat_OfflineRequest, Chat2G_OfflineResponse>
// {
// protected override async FTask Run(ChatUnit chatUnit, G2Chat_OfflineRequest request, Chat2G_OfflineResponse response, Action reply)
// {
// await FTask.CompletedTask;
// chatUnit.Scene.GetComponent<ChatUnitManageComponent>().Remove(chatUnit.Id);
// }
// }

View File

@@ -0,0 +1,20 @@
using Fantasy;
using Fantasy.Async;
using Fantasy.Network.Interface;
namespace NB.Chat;
public sealed class Other2Chat_ChatMessageHandler : Address<SocialUnit, Other2Chat_ChatMessage>
{
protected override async FTask Run(SocialUnit chatUnit, Other2Chat_ChatMessage message)
{
var result = ChatSceneHelper.Distribution(chatUnit, message.ChatInfoTree, false);
if (result != 0)
{
Log.Warning($"Other2Chat_ChatMessageHandler: Distribution failed, result: {result}");
}
await FTask.CompletedTask;
}
}