using System; using Base; using Model; namespace Hotfix { public static class HotfixEntry { public static void Start() { Login(); } public static async void Login() { try { Game.Scene.AddComponent(AppType.Client); ClientConfig clientConfig = Game.Scene.AddComponent().Config.GetComponent(); NetOuterComponent networkComponent = Game.Scene.AddComponent(); using (Session session = networkComponent.Create(clientConfig.Address)) { R2C_Login s2CLogin = await session.Call(new C2R_Login { Account = "abcdef", Password = "111111" }); networkComponent.Remove(session.Id); // 连接Gate using (Session gateSession = networkComponent.Create(s2CLogin.Address)) { await gateSession.Call(new C2G_LoginGate(s2CLogin.Key)); } Log.Info("连接Gate验证成功!"); } } catch (Exception e) { Log.Error(e.ToString()); } } } }