31 lines
880 B
C#

using Fantasy;
using Fantasy.Async;
using Fantasy.Platform.Net;
namespace Hotfix;
public static class GateLoginHelper
{
public static async FTask Login(Scene scene, GameAccount account,long gateRouted)
{
await LoginChat(scene, account, gateRouted);
}
public static async FTask LoginChat(Scene scene, GameAccount account,long gateRouteId)
{
var chat = SceneConfigData.Instance.GetSceneBySceneType(scene.World.Id, SceneType.Chat)[0];
var response = (Chat2G_LoginResponse)await scene.NetworkMessagingComponent.CallInnerRoute(chat.RouteId, new G2Chat_LoginRequest()
{
GameName = account.GameName,
AccountId = account.Id,
GateRoutedId = gateRouteId,
});
if (response.ErrorCode != 0)
{
}
Log.Debug("聊天服务器登录成功");
}
}