Ver Fonte

清理共享库

guodong há 3 anos atrás
pai
commit
e96f55fbd4
81 ficheiros alterados com 1434 adições e 4 exclusões
  1. 1 1
      GameClient/Assets/Game/CSShare
  2. 3 3
      GameClient/Assets/Game/HotUpdate/Controller/GMController.cs
  3. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account.meta
  4. 17 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/A2C_DisconnectHandler.cs
  5. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/A2C_DisconnectHandler.cs.meta
  6. 16 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/AccountInfoComponentSystem.cs
  7. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/AccountInfoComponentSystem.cs.meta
  8. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ConstValue.cs
  9. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ConstValue.cs.meta
  10. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item.meta
  11. 29 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/ItemHelper.cs
  12. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/ItemHelper.cs.meta
  13. 12 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/M2C_NoticeUnitItemAttributeHandler.cs
  14. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/M2C_NoticeUnitItemAttributeHandler.cs.meta
  15. 26 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/M2C_NoticeUnitItemHandler.cs
  16. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/M2C_NoticeUnitItemHandler.cs.meta
  17. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login.meta
  18. 356 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs
  19. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs.meta
  20. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Numeric.meta
  21. 49 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Numeric/NumericHelper.cs
  22. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Numeric/NumericHelper.cs.meta
  23. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Role.meta
  24. 30 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Role/RoleInfosComponentSystem.cs
  25. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Role/RoleInfosComponentSystem.cs.meta
  26. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene.meta
  27. 20 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/CurrentScenesComponentSystem.cs
  28. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/CurrentScenesComponentSystem.cs.meta
  29. 12 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/M2C_StartSceneChangeHandler.cs
  30. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/M2C_StartSceneChangeHandler.cs.meta
  31. 31 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/SceneChangeHelper.cs
  32. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/SceneChangeHelper.cs.meta
  33. 29 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/SceneFactory.cs
  34. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/SceneFactory.cs.meta
  35. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ServerInfo.meta
  36. 22 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ServerInfo/ServerInfosComponentSystem.cs
  37. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ServerInfo/ServerInfosComponentSystem.cs.meta
  38. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session.meta
  39. 10 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session/SessionComponentSystem.cs
  40. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session/SessionComponentSystem.cs.meta
  41. 26 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session/SessionStreamDispatcherClientOuter.cs
  42. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session/SessionStreamDispatcherClientOuter.cs.meta
  43. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit.meta
  44. 13 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/M2C_CreateMyUnitHandler.cs
  45. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/M2C_CreateMyUnitHandler.cs.meta
  46. 38 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitComponentSystem.cs
  47. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitComponentSystem.cs.meta
  48. 35 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitFactory.cs
  49. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitFactory.cs.meta
  50. 18 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitHelper.cs
  51. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitHelper.cs.meta
  52. 15 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitSystem.cs
  53. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitSystem.cs.meta
  54. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Account.meta
  55. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Account/AccountInfoComponent.cs
  56. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Account/AccountInfoComponent.cs.meta
  57. 12 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/EventType.cs
  58. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/EventType.cs.meta
  59. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Role.meta
  60. 10 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Role/RoleInfosComponent.cs
  61. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Role/RoleInfosComponent.cs.meta
  62. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Scene.meta
  63. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Scene/CurrentScenesComponent.cs
  64. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Scene/CurrentScenesComponent.cs.meta
  65. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/ServerInfo.meta
  66. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/ServerInfo/ServerInfosComponent.cs
  67. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/ServerInfo/ServerInfosComponent.cs.meta
  68. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Session.meta
  69. 7 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Session/SessionComponent.cs
  70. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Session/SessionComponent.cs.meta
  71. 8 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit.meta
  72. 7 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/PlayerComponent.cs
  73. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/PlayerComponent.cs.meta
  74. 12 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/Unit.cs
  75. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/Unit.cs.meta
  76. 6 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/UnitComponent.cs
  77. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/UnitComponent.cs.meta
  78. 34 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/WaitType.cs
  79. 11 0
      GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/WaitType.cs.meta
  80. 28 0
      GameClient/Assets/Game/HotUpdate/ServerProxy/GMSProxy.cs
  81. 11 0
      GameClient/Assets/Game/HotUpdate/ServerProxy/GMSProxy.cs.meta

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit f51e6328d799724344d3e756b714b07b548b2e93
+Subproject commit c479f848b91c4949d2bc9137a81aaaa8556d0f07

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Controller/GMController.cs

@@ -9,7 +9,7 @@ namespace GFGGame
         {
             GetSuitItemController.enable = false;
             //获得所有换装部件
-            var errorCode = await GMHelper.SendGMToServer("get all dressup");
+            var errorCode = await GMSProxy.SendGMToServer("get all dressup");
             GetSuitItemController.enable = true;
             if (errorCode != ET.ErrorCode.ERR_Success)
             {
@@ -23,7 +23,7 @@ namespace GFGGame
         public static async ETTask GetAllCardItem()
         {
             //获得所有卡牌部件
-            var errorCode = await GMHelper.SendGMToServer("get all card");
+            var errorCode = await GMSProxy.SendGMToServer("get all card");
             if (errorCode != ET.ErrorCode.ERR_Success)
             {
                 ErrorCodeController.Handler(errorCode);
@@ -34,7 +34,7 @@ namespace GFGGame
 
         public static async ETTask<bool> SendGMCommand(string messageGM, string messageSuc)
         {
-            var errorCode = await GMHelper.SendGMToServer(messageGM);
+            var errorCode = await GMSProxy.SendGMToServer(messageGM);
             if (errorCode != ET.ErrorCode.ERR_Success)
             {
                 ErrorCodeController.Handler(errorCode);

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cf1684410a1be93488aa69fb1d60894c
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 17 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/A2C_DisconnectHandler.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using GFGGame;
+
+namespace ET
+{
+    public class A2C_DisconnectHandler : AMHandler<A2C_Disconnect>
+    {
+        protected override async ETTask Run(Session session, A2C_Disconnect message)
+        {
+            Alert.Show("你已被迫下线!");
+            await ETTask.CompletedTask;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/A2C_DisconnectHandler.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 99d5c666d7a28e144abb60ac40430b5c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 16 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/AccountInfoComponentSystem.cs

@@ -0,0 +1,16 @@
+namespace ET
+{
+    public class AccountInfoComponentDestroySystem : DestroySystem<AccountInfoComponent>
+    {
+        public override void Destroy(AccountInfoComponent self)
+        {
+            self.Token = string.Empty;
+            self.AccountId = 0;
+        }
+    }
+
+    public class AccountInfoComponentSystem
+    {
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/AccountInfoComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9992fcfc216653b42be7ff7ed4a8a13e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ConstValue.cs

@@ -0,0 +1,8 @@
+namespace ET
+{
+    public static class ConstValue
+    {
+        public const string LoginAddress = "10.108.64.190:10005";
+        //  public const string LoginAddress = "127.0.0.1:10005";
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ConstValue.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: eaec1cdcafdd7a247af11d0e26ff2033
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3da71ed85cdf6f54cb91daf6cbfc3903
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 29 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/ItemHelper.cs

@@ -0,0 +1,29 @@
+using System;
+using GFGGame;
+
+namespace ET
+{
+    public static class ItemHelper
+    {
+        public static async ETTask<int> GetItemAttributeInfos()
+        {
+            M2C_GetItemAttributeInfos m2C_GetItemAttributeInfos = null;
+            Session session = null;
+            try
+            {
+                session = GameGlobal.zoneScene.GetComponent<SessionComponent>().Session;
+                m2C_GetItemAttributeInfos = (M2C_GetItemAttributeInfos)await session.Call(new C2M_GetItemAttributeInfos());
+            }
+            catch(Exception e)
+            {
+                return ErrorCode.ERR_NetWorkError;
+            }
+            if(m2C_GetItemAttributeInfos.Error != ErrorCode.ERR_Success)
+            {
+                return m2C_GetItemAttributeInfos.Error;
+            }
+            ItemDataManager.InitServerDataItemAttribute(m2C_GetItemAttributeInfos.ItemAtrributes);
+            return ErrorCode.ERR_Success;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/ItemHelper.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 44e2e90e17a11854bbd2334f320a8cfb
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/M2C_NoticeUnitItemAttributeHandler.cs

@@ -0,0 +1,12 @@
+using GFGGame;
+namespace ET
+{
+    public class M2C_NoticeUnitItemAttributeHandler : AMHandler<M2C_NoticeUnitItemAttribute>
+    {
+        protected override async ETTask Run(Session session, M2C_NoticeUnitItemAttribute message)
+        {
+            ItemDataManager.SetAttribute(message.ConfigId, message.Key, message.NewValue);
+            await ETTask.CompletedTask;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/M2C_NoticeUnitItemAttributeHandler.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 61f18cf6388932e4fa09fabfbc90cb21
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 26 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/M2C_NoticeUnitItemHandler.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using GFGGame;
+
+namespace ET
+{
+    public class M2C_NoticeUnitItemHandler : AMHandler<M2C_NoticeUnitItem>
+    {
+        protected override async ETTask Run(Session session, M2C_NoticeUnitItem message)
+        {
+            var count = ItemDataManager.GetItemNum(message.ConfigId);
+            if(count > message.NewValue)
+            {
+                ItemDataManager.Remove(message.ConfigId, count - message.NewValue);
+            }
+            else if(count < message.NewValue)
+            {
+                ItemDataManager.Add(message.ConfigId, message.NewValue - count);
+            }
+            await ETTask.CompletedTask;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Item/M2C_NoticeUnitItemHandler.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 491677ac5d5db8447b438f36921ba761
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a0cc004b28451a441b7bde3bfba83c1f
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 356 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs

@@ -0,0 +1,356 @@
+using System;
+
+
+namespace ET
+{
+    public static class LoginHelper
+    {
+        public static async ETTask<int> CheckVersion(Scene zoneScene, string address, string version)
+        {
+            A2C_CheckVersion a2C_GetVersion = null;
+            Session session = null;
+            try
+            {
+                session = zoneScene.GetComponent<NetKcpComponent>().Create(NetworkHelper.ToIPEndPoint(address));
+                a2C_GetVersion = (A2C_CheckVersion)await session.Call(new C2A_CheckVersion() { Version = version});
+            }
+            catch(Exception e)
+            {
+                session?.Dispose();
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+            if(a2C_GetVersion.Error != ErrorCode.ERR_Success)
+            {
+                session?.Dispose();
+                return a2C_GetVersion.Error;
+            }
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> Login(Scene zoneScene, string address, string account, string password, bool isMD5)
+        {
+            A2C_LoginAccount a2CLoginAccount = null;
+            Session accountSession = null;
+            try
+            {
+                accountSession = zoneScene.GetComponent<NetKcpComponent>().Create(NetworkHelper.ToIPEndPoint(address));
+                var passwordMD5 = password;
+                //密码禁止明文传输
+                if (!isMD5)
+                {
+                    passwordMD5 = MD5Helper.stringMD5(password);
+                }
+                a2CLoginAccount = (A2C_LoginAccount)await accountSession.Call(new C2A_LoginAccount() { Account = account, Password = passwordMD5 });
+            }
+            catch (Exception e)
+            {
+                accountSession?.Dispose();
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if(a2CLoginAccount.Error != ErrorCode.ERR_Success)
+            {
+                accountSession?.Dispose();
+                return a2CLoginAccount.Error;
+            }
+            if(zoneScene.GetComponent<SessionComponent>() == null)
+            {
+                zoneScene.AddComponent<SessionComponent>();
+            }
+            zoneScene.GetComponent<SessionComponent>().Session = accountSession;
+            zoneScene.GetComponent<SessionComponent>().Session.AddComponent<PingComponent>();
+            AccountInfoComponent accountInfoComponent = zoneScene.GetComponent<AccountInfoComponent>();
+            accountInfoComponent.Token = a2CLoginAccount.Token;
+            accountInfoComponent.AccountId = a2CLoginAccount.AccountId;
+            accountInfoComponent.Age = a2CLoginAccount.Age;
+
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> Register(Scene zoneScene, string address, string account, string password, string name, string identityNum, string code)
+        {
+            A2C_Register r2C_Register = null;
+            Session session = null;
+            try
+            {
+                session = zoneScene.GetComponent<NetKcpComponent>().Create(NetworkHelper.ToIPEndPoint(address));
+                {
+                    //密码禁止明文传输
+                    var passwordMD5 = MD5Helper.stringMD5(password);
+                    r2C_Register = (A2C_Register)await session.Call(new C2A_Register()
+                    { Account = account, Password = passwordMD5, Name = name, IdentityNum = identityNum, Code = code });
+                    if (r2C_Register.Error != ErrorCode.ERR_Success)
+                    {
+                        return r2C_Register.Error;
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                session?.Dispose();
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> GetServerInfos(Scene zoneScene)
+        {
+            A2C_GetServerInfos a2C_GetServerInfos = null;
+
+            try
+            {
+                a2C_GetServerInfos = (A2C_GetServerInfos)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2A_GetServerInfos() 
+                {
+                    AccountId = zoneScene.GetComponent<AccountInfoComponent>().AccountId,
+                    Token = zoneScene.GetComponent<AccountInfoComponent>().Token
+                });
+            }
+            catch(Exception e)
+            {
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if(a2C_GetServerInfos.Error != ErrorCode.ERR_Success)
+            {
+                return a2C_GetServerInfos.Error;
+            }
+
+            foreach(var serverInfoProto in a2C_GetServerInfos.ServerInfosList)
+            {
+                ServerInfo serverInfo = zoneScene.GetComponent<ServerInfosComponent>().AddChild<ServerInfo>();
+                serverInfo.FromMessage(serverInfoProto);
+                zoneScene.GetComponent<ServerInfosComponent>().Add(serverInfo);
+            }
+
+            await ETTask.CompletedTask;
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> GetRoles(Scene zoneScene)
+        {
+            A2C_GetRoles a2C_GetRoles = null;
+
+            try
+            {
+                a2C_GetRoles = (A2C_GetRoles)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2A_GetRoles()
+                {
+                    AccountId = zoneScene.GetComponent<AccountInfoComponent>().AccountId,
+                    Token = zoneScene.GetComponent<AccountInfoComponent>().Token,
+                    ServerId = zoneScene.GetComponent<ServerInfosComponent>().CurrentServerId,
+                });
+            }
+            catch(Exception e)
+            {
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if(a2C_GetRoles.Error != ErrorCode.ERR_Success)
+            {
+                Log.Error(a2C_GetRoles.Error.ToString());
+                return a2C_GetRoles.Error;
+            }
+
+            zoneScene.GetComponent<RoleInfosComponent>().RoleInfos.Clear();
+            foreach(var roleInfoProto in a2C_GetRoles.RoleInfos)
+            {
+                RoleInfo roleInfo = zoneScene.GetComponent<RoleInfosComponent>().AddChild<RoleInfo>();
+                roleInfo.FromMessage(roleInfoProto);
+                zoneScene.GetComponent<RoleInfosComponent>().RoleInfos.Add(roleInfo);
+            }
+
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> CreateRole(Scene zoneScene, string name)
+        {
+            A2C_CreateRole a2C_CreateRole = null;
+            try
+            {
+                a2C_CreateRole = (A2C_CreateRole)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2A_CreateRole
+                {
+                    AccountId = zoneScene.GetComponent<AccountInfoComponent>().AccountId,
+                    Token = zoneScene.GetComponent<AccountInfoComponent>().Token,
+                    Name = name,
+                    ServerId = zoneScene.GetComponent<ServerInfosComponent>().CurrentServerId,
+                });
+            }
+            catch (Exception e)
+            {
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if (a2C_CreateRole.Error != ErrorCode.ERR_Success)
+            {
+                Log.Error(a2C_CreateRole.Error.ToString());
+                return a2C_CreateRole.Error;
+            }
+
+            RoleInfo newRoleInfo = zoneScene.GetComponent<RoleInfosComponent>().AddChild<RoleInfo>();
+            newRoleInfo.FromMessage(a2C_CreateRole.RoleInfo);
+            zoneScene.GetComponent<RoleInfosComponent>().RoleInfos.Add(newRoleInfo);
+
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> DeleteRole(Scene zoneScene, long roleId)
+        {
+            A2C_DeleteRole a2C_DeleteRole = null;
+
+            try
+            {
+                a2C_DeleteRole = (A2C_DeleteRole) await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2A_DeleteRole()
+                {
+                    AccountId = zoneScene.GetComponent<AccountInfoComponent>().AccountId,
+                    Token = zoneScene.GetComponent<AccountInfoComponent>().Token,
+                    RoleInfoId = roleId,
+                    ServerId = zoneScene.GetComponent<ServerInfosComponent>().CurrentServerId,
+                });
+            }
+            catch (Exception e)
+            {
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if(a2C_DeleteRole.Error != ErrorCode.ERR_Success)
+            {
+                Log.Error(a2C_DeleteRole.Error.ToString());
+                return a2C_DeleteRole.Error;
+            }
+
+            int index = zoneScene.GetComponent<RoleInfosComponent>().RoleInfos.FindIndex((info) => { return info.Id == a2C_DeleteRole.DeleteRoleInfoId; });
+            zoneScene.GetComponent<RoleInfosComponent>().RoleInfos.RemoveAt(index);
+
+            await ETTask.CompletedTask;
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> GetRealmKey(Scene zoneScene)
+        {
+            A2C_GetRealmKey a2C_GetRealmKey = null;
+
+            try
+            {
+                a2C_GetRealmKey = (A2C_GetRealmKey)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2A_GetRealmKey()
+                {
+                    AccountId = zoneScene.GetComponent<AccountInfoComponent>().AccountId,
+                    Token = zoneScene.GetComponent<AccountInfoComponent>().Token,
+                    ServerId = zoneScene.GetComponent<ServerInfosComponent>().CurrentServerId,
+                });
+            }
+            catch(Exception e)
+            {
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if(a2C_GetRealmKey.Error != ErrorCode.ERR_Success)
+            {
+                Log.Error(a2C_GetRealmKey.Error.ToString());
+                return a2C_GetRealmKey.Error;
+            }
+
+            zoneScene.GetComponent<AccountInfoComponent>().RealmKey = a2C_GetRealmKey.RealmKey;
+            zoneScene.GetComponent<AccountInfoComponent>().RealmAddress = a2C_GetRealmKey.RealmAddress;
+            zoneScene.GetComponent<SessionComponent>().Session.Dispose();
+
+            await ETTask.CompletedTask;
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> EnterGame(Scene zoneScene)
+        {
+            string realmAddress = zoneScene.GetComponent<AccountInfoComponent>().RealmAddress;
+            //1.连接Realm,获取分配的Gate
+            R2C_LoginRealm r2C_LoginRealm = null;
+
+            Session session = zoneScene.GetComponent<NetKcpComponent>().Create(NetworkHelper.ToIPEndPoint(realmAddress));
+            try
+            {
+                r2C_LoginRealm = (R2C_LoginRealm)await session.Call(new C2R_LoginRealm()
+                {
+                    AccountId = zoneScene.GetComponent<AccountInfoComponent>().AccountId,
+                    RealmTokenKey = zoneScene.GetComponent<AccountInfoComponent>().RealmKey
+                });
+            }
+            catch(Exception e)
+            {
+                Log.Error(e);
+                session?.Dispose();
+                return ErrorCode.ERR_NetWorkError;
+            }
+            session?.Dispose();
+
+            if(r2C_LoginRealm.Error != ErrorCode.ERR_Success)
+            {
+                return r2C_LoginRealm.Error;
+            }
+
+            Log.Warning($"GateAddress : {r2C_LoginRealm.GateAddress}");
+            Session gateSession = zoneScene.GetComponent<NetKcpComponent>().Create(NetworkHelper.ToIPEndPoint(r2C_LoginRealm.GateAddress));
+            gateSession.AddComponent<PingComponent>();
+            gateSession.AddComponent<DisConnectedCompnent>();
+            zoneScene.GetComponent<SessionComponent>().Session = gateSession;
+
+            //2.开始连接Gate
+            long currentRoleId = zoneScene.GetComponent<RoleInfosComponent>().CurrentRoleId;
+            G2C_LoginGate g2C_LoginGate = null;
+            try
+            {
+                long accountId = zoneScene.GetComponent<AccountInfoComponent>().AccountId;
+                g2C_LoginGate = (G2C_LoginGate)await gateSession.Call(new C2G_LoginGate()
+                {
+                    Key = r2C_LoginRealm.GateSessionKey, 
+                    AccountId = accountId, 
+                    RoleId = currentRoleId
+                });
+            }
+            catch(Exception e)
+            {
+                Log.Error(e);
+                zoneScene.GetComponent<SessionComponent>().Session?.Dispose();
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if(g2C_LoginGate.Error != ErrorCode.ERR_Success)
+            {
+                zoneScene.GetComponent<SessionComponent>().Session?.Dispose();
+                return g2C_LoginGate.Error;
+            }
+
+            Log.Debug("登陆gate成功!");
+
+            //3.角色正式请求进入游戏逻辑服
+            G2C_EnterGame g2C_EnterGame = null;
+            try
+            {
+                g2C_EnterGame = (G2C_EnterGame)await gateSession.Call(new C2G_EnterGame() { });
+            }
+            catch(Exception e)
+            {
+                Log.Error(e);
+                zoneScene.GetComponent<SessionComponent>().Session.Dispose();
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if(g2C_EnterGame.Error != ErrorCode.ERR_Success)
+            {
+                Log.Error(g2C_EnterGame.Error.ToString());
+                return g2C_EnterGame.Error;
+            }
+
+            Log.Debug("角色进入游戏成功!");
+            zoneScene.GetComponent<PlayerComponent>().MyId = g2C_EnterGame.MyId;
+            await zoneScene.GetComponent<ObjectWait>().Wait<WaitType.Wait_SceneChangeFinish>();
+
+            await ETTask.CompletedTask;
+            return ErrorCode.ERR_Success;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c2b80185f932b7941ac1ec110b81c33e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Numeric.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 722188fb4d2126a4c9da5b895ba64955
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 49 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Numeric/NumericHelper.cs

@@ -0,0 +1,49 @@
+using System;
+
+namespace ET
+{
+    public static class NumericHelper
+    {
+        public static async ETTask<int> TestUpdateNumeric(Scene zoneScene)
+        {
+            M2C_TestUnitNumric m2C_TestUnitNumric = null;
+            try
+            {
+                m2C_TestUnitNumric = (M2C_TestUnitNumric)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_TestUnitNumric() { });
+            }
+            catch(System.Exception e)
+            {
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+
+            if(m2C_TestUnitNumric.Error != ErrorCode.ERR_Success)
+            {
+                Log.Error(m2C_TestUnitNumric.Error.ToString());
+                return m2C_TestUnitNumric.Error;
+            }
+
+            return ErrorCode.ERR_Success;
+        }
+
+        public static async ETTask<int> RequestAddAttributePoint(Scene zoneScene, int numericType)
+        {
+            M2C_AddAttributePoint m2C_AddAttributePoint = null;
+            try
+            {
+                m2C_AddAttributePoint = (M2C_AddAttributePoint)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_AddAtributePoint() { NumericType = numericType });
+            }
+            catch(Exception e)
+            {
+                Log.Error(e.ToString());
+                return ErrorCode.ERR_NetWorkError;
+            }
+            if(m2C_AddAttributePoint.Error != ErrorCode.ERR_Success)
+            {
+                Log.Error(m2C_AddAttributePoint.Error.ToString());
+                return m2C_AddAttributePoint.Error;
+            }
+            return ErrorCode.ERR_Success;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Numeric/NumericHelper.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ad70f613d5981a542a115552b5f47b5b
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Role.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5bda2a63d6588b446ad4ae53b406caca
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 30 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Role/RoleInfosComponentSystem.cs

@@ -0,0 +1,30 @@
+namespace ET
+{
+    public class RoleInfosComponentDestroySystem : DestroySystem<RoleInfosComponent>
+    {
+        public override void Destroy(RoleInfosComponent self)
+        {
+            foreach(var roleInfo in self.RoleInfos)
+            {
+                roleInfo?.Dispose();
+            }
+            self.RoleInfos.Clear();
+            self.CurrentRoleId = 0;
+        }
+    }
+
+    public static class RoleInfosComponentSystem
+    {
+        public static string GetCurrentRoleName(this RoleInfosComponent self)
+        {
+            foreach(var i in self.RoleInfos)
+            {
+                if(i.Id == self.CurrentRoleId)
+                {
+                    return i.Name;
+                }
+            }
+            return "";
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Role/RoleInfosComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d41ea6e06dbb50045b9bee9c692c815e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5cae1ce1aae7a114796a8bf6f9ddd5a2
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/CurrentScenesComponentSystem.cs

@@ -0,0 +1,20 @@
+using System;
+
+namespace ET
+{
+    public static class CurrentScenesComponentSystem
+    {
+        [ObjectSystem]
+        public class CurrentScenesComponentAwakeSystem : AwakeSystem<CurrentScenesComponent>
+        {
+            public override void Awake(CurrentScenesComponent self)
+            {
+            }
+        }
+
+        public static Scene CurrentScene(this Scene zoneScene)
+        {
+            return zoneScene.GetComponent<CurrentScenesComponent>()?.Scene;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/CurrentScenesComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 301752b941d34a94db78ed9c0f2e73d3
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/M2C_StartSceneChangeHandler.cs

@@ -0,0 +1,12 @@
+using System;
+
+namespace ET
+{
+    public class M2C_StartSceneChangeHandler : AMHandler<M2C_StartSceneChange>
+    {
+        protected override async ETTask Run(Session session, M2C_StartSceneChange message)
+        {
+            await SceneChangeHelper.SceneChangeTo(GFGGame.GameGlobal.zoneScene, message.SceneName, message.SceneInstanceId);
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/M2C_StartSceneChangeHandler.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c799ab31f5b652040ad99b76a6af4e7e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 31 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/SceneChangeHelper.cs

@@ -0,0 +1,31 @@
+using GFGGame;
+using static UnityEngine.UI.CanvasScaler;
+
+namespace ET
+{
+    public static class SceneChangeHelper
+    {
+        // 场景切换协程
+        public static async ETTask SceneChangeTo(Scene zoneScene, string sceneName, long sceneInstanceId)
+        {
+            CurrentScenesComponent currentScenesComponent = zoneScene.GetComponent<CurrentScenesComponent>();
+            currentScenesComponent.Scene?.Dispose(); // 删除之前的CurrentScene,创建新的
+            Scene currentScene = SceneFactory.CreateCurrentScene(sceneInstanceId, zoneScene.Zone, sceneName, currentScenesComponent);
+            UnitComponent unitComponent = currentScene.AddComponent<UnitComponent>();
+
+            // 可以订阅这个事件中创建Loading界面
+            //Game.EventSystem.Publish(new EventType.SceneChangeStart() { ZoneScene = zoneScene });
+
+            // 等待CreateMyUnit的消息
+            WaitType.Wait_CreateMyUnit waitCreateMyUnit = await zoneScene.GetComponent<ObjectWait>().Wait<WaitType.Wait_CreateMyUnit>();
+            M2C_CreateMyUnit m2CCreateMyUnit = waitCreateMyUnit.Message;
+            Unit unit = UnitFactory.Create(currentScene, m2CCreateMyUnit.Unit);
+            unitComponent.Add(unit);
+            GameGlobal.myUnit = unit;
+            GameGlobal.myNumericComponent = unit.GetComponent<NumericComponent>();
+
+            // 通知等待场景切换的协程
+            zoneScene.GetComponent<ObjectWait>().Notify(new WaitType.Wait_SceneChangeFinish());
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/SceneChangeHelper.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 979d8a25f84f51a4ab07e3001b61fdff
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 29 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/SceneFactory.cs

@@ -0,0 +1,29 @@
+using System.Collections;
+using UnityEngine;
+
+namespace ET
+{
+    public class SceneFactory
+    {
+        public static Scene CreateZoneScene(int zone, string name, Entity parent)
+        {
+            Scene zoneScene = EntitySceneFactory.CreateScene(Game.IdGenerater.GenerateInstanceId(), zone, SceneType.Zone, name, parent);
+            zoneScene.AddComponent<ZoneSceneFlagComponent>();
+            zoneScene.AddComponent<NetKcpComponent, int>(SessionStreamDispatcherType.SessionStreamDispatcherClientOuter);
+            zoneScene.AddComponent<CurrentScenesComponent>();
+            zoneScene.AddComponent<ObjectWait>();
+            zoneScene.AddComponent<PlayerComponent>();
+            zoneScene.AddComponent<AccountInfoComponent>();
+            zoneScene.AddComponent<ServerInfosComponent>();
+            zoneScene.AddComponent<RoleInfosComponent>();
+            return zoneScene;
+        }
+
+        public static Scene CreateCurrentScene(long id, int zone, string name, CurrentScenesComponent currentScenesComponent)
+        {
+            Scene currentScene = EntitySceneFactory.CreateScene(id, zone, SceneType.Current, name, currentScenesComponent);
+            currentScenesComponent.Scene = currentScene;
+            return currentScene;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Scene/SceneFactory.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 64c8907b8aac5bd419cafb5c93c5be17
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ServerInfo.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ba695778c51d5f94590571b12c000e68
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 22 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ServerInfo/ServerInfosComponentSystem.cs

@@ -0,0 +1,22 @@
+namespace ET
+{
+    public class ServerInfosComponentDestroySystem : DestroySystem<ServerInfosComponent>
+    {
+        public override void Destroy(ServerInfosComponent self)
+        {
+            foreach(var serverInfo in self.ServerInfoList)
+            {
+                serverInfo?.Dispose();
+            }
+            self.ServerInfoList.Clear();
+        }
+    }
+
+    public static class ServerInfosComponentSystem
+    {
+        public static void Add(this ServerInfosComponent self, ServerInfo serverInfo)
+        {
+            self.ServerInfoList.Add(serverInfo);
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ServerInfo/ServerInfosComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c9a26ba7e938f684795df843d4d4038f
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8d26b825fe6959f4386d17deedc4507d
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 10 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session/SessionComponentSystem.cs

@@ -0,0 +1,10 @@
+namespace ET
+{
+	public class SessionComponentDestroySystem: DestroySystem<SessionComponent>
+	{
+		public override void Destroy(SessionComponent self)
+		{
+			self.Session.Dispose();
+		}
+	}
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session/SessionComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 34425fb2fdbd98a488aa155b3cd12623
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 26 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session/SessionStreamDispatcherClientOuter.cs

@@ -0,0 +1,26 @@
+using System;
+using System.IO;
+
+namespace ET
+{
+    [SessionStreamDispatcher(SessionStreamDispatcherType.SessionStreamDispatcherClientOuter)]
+    public class SessionStreamDispatcherClientOuter: ISessionStreamDispatcher
+    {
+        public void Dispatch(Session session, MemoryStream memoryStream)
+        {
+            ushort opcode = BitConverter.ToUInt16(memoryStream.GetBuffer(), Packet.KcpOpcodeIndex);
+            Type type = OpcodeTypeComponent.Instance.GetType(opcode);
+            object message = MessageSerializeHelper.DeserializeFrom(opcode, type, memoryStream);
+            
+            if (message is IResponse response)
+            {
+                session.OnRead(opcode, response);
+                return;
+            }
+
+            OpcodeHelper.LogMsg(session.DomainZone(), opcode, message);
+            // 普通消息或者是Rpc请求消息
+            MessageDispatcherComponent.Instance.Handle(session, opcode, message);
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Session/SessionStreamDispatcherClientOuter.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 751562b230e08c34c85b7f9c524356c6
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2f93bbbeb5f3a0e48a479ebfadf5c6ae
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 13 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/M2C_CreateMyUnitHandler.cs

@@ -0,0 +1,13 @@
+namespace ET
+{
+	[MessageHandler]
+	public class M2C_CreateMyUnitHandler : AMHandler<M2C_CreateMyUnit>
+	{
+		protected override async ETTask Run(Session session, M2C_CreateMyUnit message)
+		{
+			// 通知场景切换协程继续往下走
+			session.DomainScene().GetComponent<ObjectWait>().Notify(new WaitType.Wait_CreateMyUnit() { Message = message });
+			await ETTask.CompletedTask;
+		}
+	}
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/M2C_CreateMyUnitHandler.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d848bf6693b39944db0af72eeadff5d7
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 38 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitComponentSystem.cs

@@ -0,0 +1,38 @@
+namespace ET
+{
+	[ObjectSystem]
+	public class UnitComponentAwakeSystem : AwakeSystem<UnitComponent>
+	{
+		public override void Awake(UnitComponent self)
+		{
+		}
+	}
+
+	[ObjectSystem]
+	public class UnitComponentDestroySystem : DestroySystem<UnitComponent>
+	{
+		public override void Destroy(UnitComponent self)
+		{
+		}
+	}
+
+	public static class UnitComponentSystem
+	{
+		public static void Add(this UnitComponent self, Unit unit)
+		{
+			
+		}
+
+		public static Unit Get(this UnitComponent self, long id)
+		{
+			Unit unit = self.GetChild<Unit>(id);
+			return unit;
+		}
+
+		public static void Remove(this UnitComponent self, long id)
+		{
+			Unit unit = self.GetChild<Unit>(id);
+			unit?.Dispose();
+		}
+	}
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6c69c03ee837fe349a5a88c2ab195427
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 35 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitFactory.cs

@@ -0,0 +1,35 @@
+
+using GFGGame;
+
+namespace ET
+{
+    public static class UnitFactory
+    {
+        public static Unit Create(Scene currentScene, UnitInfo unitInfo)
+        {
+            UnitComponent unitComponent = currentScene.GetComponent<UnitComponent>();
+            Unit unit = unitComponent.AddChildWithId<Unit>(unitInfo.UnitId);
+            unitComponent.Add(unit);
+            //数值组件
+            NumericComponent numericComponent = unit.AddComponent<NumericComponent>();
+            for (int i = 0; i < unitInfo.Ks.Count; ++i)
+            {
+                numericComponent.Set(unitInfo.Ks[i], unitInfo.Vs[i]);
+            }
+            //物品兑换
+            for (int i = 0; i < unitInfo.KsItemExchange.Count; i++)
+            {
+                ItemDataManager.InitItemExchange(unitInfo.KsItemExchange[i], unitInfo.VsItemExchange[i]);
+            }
+            unit.AddComponent<ObjectWait>();
+            //服装数据与物品通步
+            DressUpMenuSuitDataManager.InitData();
+            DressUpMenuItemDataManager.InitData();
+            //初始化物品
+            ItemDataManager.InitServerData(unitInfo.Items);
+            //自定义套装
+            CustomSuitDataManager.InitServerData(unitInfo.CustomSuits);
+            return unit;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitFactory.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 02dbb23ea38994644bb0a3e44849fd31
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 18 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitHelper.cs

@@ -0,0 +1,18 @@
+namespace ET
+{
+    public static class UnitHelper
+    {
+        public static Unit GetMyUnitFromZoneScene(Scene zoneScene)
+        {
+            PlayerComponent playerComponent = zoneScene.GetComponent<PlayerComponent>();
+            Scene currentScene = zoneScene.GetComponent<CurrentScenesComponent>().Scene;
+            return currentScene.GetComponent<UnitComponent>().Get(playerComponent.MyId);
+        }
+
+        public static Unit GetMyUnitFromCurrentScene(Scene currentScene)
+        {
+            PlayerComponent playerComponent = currentScene.Parent.Parent.GetComponent<PlayerComponent>();
+            return currentScene.GetComponent<UnitComponent>().Get(playerComponent.MyId);
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitHelper.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 645c6eda57389104596ffd607491e6a6
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 15 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitSystem.cs

@@ -0,0 +1,15 @@
+namespace ET
+{
+    [ObjectSystem]
+    public class UnitAwakeSystem : AwakeSystem<Unit>
+    {
+        public override void Awake(Unit self)
+        {
+            
+        }
+    }
+
+    public static class UnitSystem
+    {
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Unit/UnitSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6b8faef24fe90a7439671b700022913e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Account.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1680b1394cf4ed64f816b2c121ddb4bc
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Account/AccountInfoComponent.cs

@@ -0,0 +1,11 @@
+namespace ET
+{
+    public class AccountInfoComponent : Entity, IAwake, IDestroy
+    {
+        public string Token;
+        public long AccountId;
+        public string RealmKey;
+        public string RealmAddress;
+        public int Age;
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Account/AccountInfoComponent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b3766c1f492111c44a4b9155d003efb5
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/EventType.cs

@@ -0,0 +1,12 @@
+using UnityEngine;
+
+namespace ET
+{
+    namespace EventType
+    {
+        public struct AppStart
+        {
+        }
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/EventType.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9cc189a20991b0c40bbeb18289cec932
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Role.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d4a05ac21067fb54080b8b462fcbfd02
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 10 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Role/RoleInfosComponent.cs

@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+
+namespace ET
+{
+    public class RoleInfosComponent : Entity, IAwake, IDestroy
+    {
+        public List<RoleInfo> RoleInfos = new List<RoleInfo>();
+        public long CurrentRoleId = 0;
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Role/RoleInfosComponent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0ceedbaa6c7329e40bbab0fd347e6e13
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Scene.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 14bc9f2442080c8458bfc4649319c6d3
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Scene/CurrentScenesComponent.cs

@@ -0,0 +1,8 @@
+namespace ET
+{
+    //可以用来管理多个客户端场景,比如大世界会加载多块场景
+    public class CurrentScenesComponent : Entity, IAwake
+    {
+        public Scene Scene;
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Scene/CurrentScenesComponent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7cd372a5c2b4aae419454e6a659b728c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/ServerInfo.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 545101ef54014a2469583428b5516de8
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/ServerInfo/ServerInfosComponent.cs

@@ -0,0 +1,11 @@
+using System.Collections.Generic;
+
+namespace ET
+{
+    public class ServerInfosComponent : Entity, IAwake, IDestroy
+    {
+        public List<ServerInfo> ServerInfoList = new List<ServerInfo>();
+
+        public int CurrentServerId = 1;
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/ServerInfo/ServerInfosComponent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c7055fa3938731546a69e0664d91ecb8
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Session.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c610dbc87479edd479fc5568463c83f8
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 7 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Session/SessionComponent.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+	public class SessionComponent: Entity, IAwake, IDestroy
+	{
+		public Session Session;
+	}
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Session/SessionComponent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a99ef93ef7fa23b47a539ed9917a2715
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 940ca5ba763f1964a8c6fb46af037a04
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 7 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/PlayerComponent.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public class PlayerComponent : Entity, IAwake
+    {
+        public long MyId;
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/PlayerComponent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4214a314794253c4caaa16bf86bd1e37
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/Unit.cs

@@ -0,0 +1,12 @@
+using System;
+using FairyGUI;
+using MongoDB.Bson.Serialization.Attributes;
+using UnityEngine;
+
+namespace ET
+{
+    public class Unit : Entity, IAwake
+    {
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/Unit.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4c27da4d9dde1784781162e5f10fd557
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 6 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/UnitComponent.cs

@@ -0,0 +1,6 @@
+namespace ET
+{
+	public class UnitComponent : Entity, IAwake, IDestroy
+	{
+	}
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/Unit/UnitComponent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 01222947ee607734aaa7a4c8841df983
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 34 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/WaitType.cs

@@ -0,0 +1,34 @@
+namespace ET
+{
+    namespace WaitType
+    {
+        public struct Wait_UnitStop: IWaitType
+        {
+            public int Error
+            {
+                get;
+                set;
+            }
+        }
+        
+        public struct Wait_CreateMyUnit: IWaitType
+        {
+            public int Error
+            {
+                get;
+                set;
+            }
+
+            public M2C_CreateMyUnit Message;
+        }
+        
+        public struct Wait_SceneChangeFinish: IWaitType
+        {
+            public int Error
+            {
+                get;
+                set;
+            }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Model/App/WaitType.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7f6f55262e061e74ba23d43caff3bf3b
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 28 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/GMSProxy.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using GFGGame;
+using UnityEngine.Rendering;
+
+namespace ET
+{
+    public static class GMSProxy
+    {
+        public static async ETTask<int> SendGMToServer(string message)
+        {
+            M2C_GM response = (M2C_GM)await MessageHelper.SendToServer(new C2M_GM() { message = message });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    return ErrorCode.ERR_Success;
+                }
+                return response.Error;
+            }
+            return ErrorCode.ERR_NetWorkError;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/GMSProxy.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9602bca623189934d8fec24ef97f7df4
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: