聊天频道相关
This commit is contained in:
@@ -6,17 +6,29 @@ namespace NB.Chat;
|
||||
|
||||
public static class ChatSceneHelper
|
||||
{
|
||||
#region 消息发送
|
||||
|
||||
/// <summary>
|
||||
/// 广播消息
|
||||
/// 广播记录更新
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="record"></param>
|
||||
public static void BroadcastRecord(Scene scene, ChatContentRecord record)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 广播消息给所有人
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="message"></param>
|
||||
public static void Broadcast(Scene scene, string message)
|
||||
public static void Broadcast(Scene scene, ChatMessageInfo message)
|
||||
{
|
||||
Log.Info("广播消息===");
|
||||
//发送给所有Gate服务器,让Gate转发给其他客户端
|
||||
var gateConfigs = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Gate);
|
||||
|
||||
var sendMessage = new Chat2G_ChatMessage()
|
||||
{
|
||||
Message = message
|
||||
@@ -29,7 +41,12 @@ public static class ChatSceneHelper
|
||||
}
|
||||
}
|
||||
|
||||
public static async FTask<long> Online(Scene scene, long accountID, long gateRuntimeId)
|
||||
#endregion
|
||||
|
||||
|
||||
#region 上线下线
|
||||
|
||||
public static async FTask<long> Online(Scene scene, RoleSimpleInfo roleSimple, long gateRuntimeId)
|
||||
{
|
||||
var gameSceneConfig = GetSceneConfig();
|
||||
var gameRouteId = gameSceneConfig.RouteId;
|
||||
@@ -37,7 +54,7 @@ public static class ChatSceneHelper
|
||||
var gameResponse = (Chat2G_EnterResponse)await scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
gameRouteId, new G2Chat_EnterRequest()
|
||||
{
|
||||
AccountId = accountID,
|
||||
Role = roleSimple,
|
||||
GateRouteId = gateRuntimeId
|
||||
});
|
||||
|
||||
@@ -48,14 +65,13 @@ public static class ChatSceneHelper
|
||||
|
||||
return gameResponse.RoleRouteId;
|
||||
}
|
||||
|
||||
|
||||
private static SceneConfig GetSceneConfig()
|
||||
{
|
||||
var gameSceneConfigs = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Chat);
|
||||
|
||||
return gameSceneConfigs.First();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user