提交示例代码

This commit is contained in:
Bob.Song
2026-03-05 11:39:06 +08:00
commit 25958f58c3
2534 changed files with 209593 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
using Fantasy.Platform.Net;
namespace Fantasy;
public static class ChatHelper
{
/// <summary>
/// 发送一个聊天消息给ChatScene不能在ChatScene中调用
/// </summary>
/// <param name="scene"></param>
/// <param name="chatUnitRouteId"></param>
/// <param name="tree"></param>
public static void SendChatMessage(Scene scene, long chatUnitRouteId, ChatInfoTree tree)
{
if (scene.SceneType == SceneType.Chat)
{
Log.Warning("ChatHelper.SendChatMessage: scene is not a chat scene.");
return;
}
var other2ChatChatMessage = new Other2Chat_ChatMessage()
{
ChatInfoTree = tree
};
scene.NetworkMessagingComponent.SendInnerRoute(chatUnitRouteId, other2ChatChatMessage);
}
}