InitSceneStart_CreateLobbyUI.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Model;
  2. namespace Hotfix
  3. {
  4. [Event(EventIdType.InitSceneStart)]
  5. public class InitSceneStart_CreateLobbyUI
  6. {
  7. public void Run()
  8. {
  9. UI ui = Game.Scene.GetComponent<UIComponent>().Create(UIType.Lobby);
  10. //Login();
  11. }
  12. public static async void Login()
  13. { //
  14. //try
  15. //{
  16. // Game.Scene.AddComponent<MessageDispatherComponent, AppType>(AppType.Client);
  17. // ClientConfig clientConfig = Game.Scene.AddComponent<ClientConfigComponent>().Config.GetComponent<ClientConfig>();
  18. // NetOuterComponent networkComponent = Game.Scene.AddComponent<NetOuterComponent>();
  19. // using (Session session = networkComponent.Create(clientConfig.Address))
  20. // {
  21. // R2C_Login s2CLogin = await session.Call<C2R_Login, R2C_Login>(new C2R_Login { Account = "abcdef", Password = "111111" });
  22. // networkComponent.Remove(session.Id);
  23. //
  24. // // 连接Gate
  25. // using (Session gateSession = networkComponent.Create(s2CLogin.Address))
  26. // {
  27. // await gateSession.Call<C2G_LoginGate, G2C_LoginGate>(new C2G_LoginGate(s2CLogin.Key));
  28. // }
  29. //
  30. // Log.Info("连接Gate验证成功!");
  31. // }
  32. //}
  33. //catch (Exception e)
  34. //{
  35. // Log.Error(e.ToString());
  36. //}
  37. }
  38. }
  39. }