Files
Fishing2Server/Hotfix/Game/Chat/Helper/ChatHelper.cs
2026-03-19 16:14:33 +08:00

30 lines
938 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Fantasy;
using Fantasy.Platform.Net;
namespace NB.Chat;
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.Social)
// {
// Log.Warning("ChatHelper.SendChatMessage: scene is not a chat scene.");
// return;
// }
var other2ChatChatMessage = new Other2Chat_ChatMessage()
{
ChatInfoTree = tree
};
// scene.NetworkMessagingComponent.SendInnerRoute(chatUnitRouteId, other2ChatChatMessage);
scene.NetworkMessagingComponent.Send(chatUnitRouteId, other2ChatChatMessage);
}
}