不是说realm 和 gate都不对外暴露,是router转发的,这不是直接连上realm 和gate 了吗
Main2NetClient_LoginHandler 中的代码。
R2C_Login r2CLogin;
using (Session session = await netComponent.CreateRouterSession(realmAddress, account, password))
{
C2R_Login c2RLogin = C2R_Login.Create();
c2RLogin.Account = account;
c2RLogin.Password = password;
r2CLogin = (R2C_Login)await session.Call(c2RLogin);
}
// 创建一个gate Session,并且保存到SessionComponent中
Session gateSession = await netComponent.CreateRouterSession(NetworkHelper.ToIPEndPoint(r2CLogin.Address), account, password); gateSession.AddComponent<ClientSessionErrorComponent>();
root.AddComponent<SessionComponent>().Session = gateSession;