Skip to content

Commit 0fcf08c

Browse files
committed
feat(DiscoveryCenter): 添加发现中心组件调用方法
新增CallDiscoveryCenter方法用于异步调用发现中心组件并获取响应结果
1 parent b7c17e8 commit 0fcf08c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

GameFrameX.Hotfix/Logic/DiscoveryCenter/DiscoveryCenterComponentAgent.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,23 @@ internal void SetAppStartUp(AppStartUpBase appStartUpBase)
4343
_appStartUpBase = appStartUpBase;
4444
}
4545

46+
/// <summary>
47+
/// 发送消息给发现中心组件
48+
/// </summary>
49+
/// <param name="message">发送的消息</param>
4650
public void SendToDiscoveryCenter(MessageObject message)
4751
{
4852
_appStartUpBase?.Send(message);
4953
}
54+
55+
/// <summary>
56+
/// 调用发现中心组件
57+
/// </summary>
58+
/// <param name="message">调用消息</param>
59+
/// <typeparam name="T">响应消息类型</typeparam>
60+
/// <returns>响应结果</returns>
61+
public Task<IRpcResult> CallDiscoveryCenter<T>(MessageObject message) where T : IResponseMessage, new()
62+
{
63+
return _appStartUpBase?.Call<T>(message);
64+
}
5065
}

0 commit comments

Comments
 (0)