Eintoo/GameServer/Server/Hotfix/Outter/Gate/Handler/G2C_GetGameAccountInfoHandler.cs

41 lines
1.4 KiB
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 System.Diagnostics;
using Fantasy.Async;
using Fantasy.Network;
using Fantasy.Network.Interface;
using Hotfix;
namespace Fantasy;
public class G2C_GetGameAccountInfoHandler : MessageRPC<C2G_GetGameAccountInfo,G2C_GetGameAccountInfo>
{
protected override async FTask Run(Session session, C2G_GetGameAccountInfo request, G2C_GetGameAccountInfo response, Action reply)
{
// var flagCom = session.GetComponent<GameAccountFlagComponent>();
//
// if (flagCom == null)
// {
// Log.Debug("Gate 请先登录在访问这个接口");
// session.Dispose();
// return;
// }
// GameAccount gameAccount = flagCom.Account;
//
// if (gameAccount == null)
// {
// Log.Debug("Gate gameaccount 已经被销毁掉了 并不是我们 想要的");
// return;
// }
var scene = session.Scene;
var gameAccount = await GateComponentHelper.GetGameAccount(scene,session,request.AccountId);
if (gameAccount == null)
{
Log.Debug("Gate gameaccount 并不存在 并不是我们 想要的");
return;
}
response.AccountInfo = gameAccount.GetGameAccountInfo();
Log.Debug($"Gate: 获取账号信息 AccountId {response.AccountInfo.GameName} ");
}
}