Files
ServerStudy/物品和背包的完整代码/Server/Hotfix/Handler/C2G_GameInitCompleteRequestHandler.cs
2026-03-05 11:39:06 +08:00

26 lines
1.0 KiB
C#
Raw Permalink 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.Async;
using Fantasy.Network;
using Fantasy.Network.Interface;
namespace Fantasy;
public sealed class C2G_GameInitCompleteRequestHandler : MessageRPC<C2G_GameInitCompleteRequest, G2C_GameInitCompleteResponse>
{
protected override async FTask Run(Session session, C2G_GameInitCompleteRequest request, G2C_GameInitCompleteResponse response, Action reply)
{
var account = session.GetComponent<Account>();
var requestPushContainer = request.PushContainer;
var requestPushUnitInfo = request.PushUnitInfo;
var requestAoi = request.Aoi;
// 当调用reply方法的时候就会马上返回G2C_GameInitCompleteResponse消息给客户端了。
// 这时候客户端await等待就会继续执行。
reply();
// 比如这个代码就是推送给客户端的。
if (requestPushContainer)
{
// 推送容器的数据给客户端。
ContainerHelper.SendAllContainerInfo(account);
}
await FTask.CompletedTask;
}
}