using System.Diagnostics; using Fantasy.Async; using Fantasy.Network; using Fantasy.Network.Interface; using Hotfix; namespace Fantasy; public class G2C_GetGameAccountInfoHandler : MessageRPC { protected override async FTask Run(Session session, C2G_GetGameAccountInfo request, G2C_GetGameAccountInfo response, Action reply) { // var flagCom = session.GetComponent(); // // 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} "); } }