tanghai před 2 roky
rodič
revize
a970eab85e
24 změnil soubory, kde provedl 165 přidání a 91 odebrání
  1. 2 1
      ET.sln.DotSettings
  2. 3 2
      Unity/Assets/Config/Proto/ClientMessage_C_1000.proto
  3. 4 2
      Unity/Assets/Scripts/Core/World/Module/Fiber/FiberManager.cs
  4. 18 5
      Unity/Assets/Scripts/Hotfix/Client/Demo/Main/ClientSenderCompnentSystem.cs
  5. 1 1
      Unity/Assets/Scripts/Hotfix/Client/Demo/NetClient/Main2NetClient_LoginHandler.cs
  6. 22 21
      Unity/Assets/Scripts/Hotfix/Client/Module/Message/NetClientComponentSystem.cs
  7. 1 1
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkClient.cs
  8. 2 2
      Unity/Assets/Scripts/Hotfix/Server/Demo/Realm/RealmGateAddressHelper.cs
  9. 15 0
      Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/Console/CreateRobotConsoleHandler.cs
  10. 28 0
      Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/FiberInit_Robot.cs
  11. 1 1
      Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/FiberInit_Robot.cs.meta
  12. 32 0
      Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/RobotManagerComponentSystem.cs
  13. 11 0
      Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/RobotManagerComponentSystem.cs.meta
  14. 0 35
      Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/Scene/RobotSceneFactory.cs
  15. 2 1
      Unity/Assets/Scripts/Hotfix/Share/Demo/EntryEvent1_InitShare.cs
  16. 1 0
      Unity/Assets/Scripts/Hotfix/Share/FiberInit_Main.cs
  17. 0 3
      Unity/Assets/Scripts/HotfixView/Client/Demo/EntryEvent3_InitClient.cs
  18. 3 1
      Unity/Assets/Scripts/Model/Client/Module/Message/NetClientComponent.cs
  19. 5 1
      Unity/Assets/Scripts/Model/Generate/Client/Message/ClientMessage_C_1000.cs
  20. 0 5
      Unity/Assets/Scripts/Model/Generate/ClientServer/ConfigPartial/StartSceneConfig.cs
  21. 5 1
      Unity/Assets/Scripts/Model/Generate/ClientServer/Message/ClientMessage_C_1000.cs
  22. 0 5
      Unity/Assets/Scripts/Model/Generate/Server/ConfigPartial/StartSceneConfig.cs
  23. 5 1
      Unity/Assets/Scripts/Model/Generate/Server/Message/ClientMessage_C_1000.cs
  24. 4 2
      Unity/Assets/Scripts/Model/Server/Demo/Robot/RobotManagerComponent.cs

+ 2 - 1
ET.sln.DotSettings

@@ -404,6 +404,7 @@ II.2.12 <HandlesEvent />
 	<s:Boolean x:Key="/Default/Environment/SearchAndNavigation/AutoExpandResults/@EntryValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/Environment/SearchAndNavigation/MergeOccurences/@EntryValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/Environment/SearchAndNavigation/OpenPreviewTabForSelectedItemInFindResults/@EntryValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EApplication_002EExceptionReport_002EUserLoginInformationMigrateSettings/@EntryIndexedValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EdotCover_002EInteractive_002ECore_002EFilterManagement_002EMigration_002EGlobalFilterSettingsManagerMigrateSettings/@EntryIndexedValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002EDaemon_002EInlayHints_002EParameterHints_002ECppParameterNameHintsOptionsOptionsMigration/@EntryIndexedValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECSharp_002EParameterNameHints_002ECSharpParameterNameHintsOptionsMigration/@EntryIndexedValue">True</s:Boolean>
@@ -432,7 +433,7 @@ II.2.12 &lt;HandlesEvent /&gt;&#xD;
 	<s:String x:Key="/Default/GlobalFilterSettingsManager/AttributeFilterXml/@EntryValue">&lt;data&gt;&lt;AttributeFilter ClassMask="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" IsEnabled="True" /&gt;&lt;AttributeFilter ClassMask="System.CodeDom.Compiler.GeneratedCodeAttribute" IsEnabled="True" /&gt;&lt;/data&gt;</s:String>
 	<s:Boolean x:Key="/Default/Housekeeping/FeatureSuggestion/FeatureSuggestionManager/DisabledSuggesters/=SwitchToGoToActionSuggester/@EntryIndexedValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/Housekeeping/FeatureSuggestion/FeatureSuggestionManager/DisabledSuggesters/=TabNavigationExplainer/@EntryIndexedValue">True</s:Boolean>
-	<s:String x:Key="/Default/Housekeeping/FeedbackReport/SelectedUserIdentificator/@EntryValue">anonymous</s:String>
+	
 	<s:Boolean x:Key="/Default/Housekeeping/GlobalSettingsUpgraded/IsUpgraded/@EntryValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/Housekeeping/IntellisenseHousekeeping/HintUsed/@EntryValue">True</s:Boolean>
 	<s:String x:Key="/Default/Housekeeping/Layout/DialogWindows/OptionsDialog/SelectedPageId/@EntryValue">CSharpBracesLayoutPage</s:String>

+ 3 - 2
Unity/Assets/Config/Proto/ClientMessage_C_1000.proto

@@ -7,8 +7,9 @@ package ET;
 message Main2NetClient_Login // IRequest
 {
 	int32 RpcId = 1;
-	string Account = 2;
-	string Password = 3;
+	int32 OwnerFiberId = 2;
+	string Account = 3;
+	string Password = 4;
 }
 
 message NetClient2Main_Login // IResponse

+ 4 - 2
Unity/Assets/Scripts/Core/World/Module/Fiber/FiberManager.cs

@@ -101,10 +101,10 @@ namespace ET
             return await this.Create(schedulerType, fiberId, zone, sceneType, name);
         }
         
-        public void Remove(int id)
+        public async Task Remove(int id)
         {
             Fiber fiber = this.Get(id);
-            
+            TaskCompletionSource<bool> tcs = new();
             // 要扔到fiber线程执行,否则会出现线程竞争
             fiber.ThreadSynchronizationContext.Post(() =>
             {
@@ -112,7 +112,9 @@ namespace ET
                 {
                     f.Dispose();
                 }
+                tcs.SetResult(true);
             });
+            await tcs.Task;
         }
 
         // 不允许外部调用,容易出现多线程问题, 只能通过消息通信,不允许直接获取其它Fiber引用

+ 18 - 5
Unity/Assets/Scripts/Hotfix/Client/Demo/Main/ClientSenderCompnentSystem.cs

@@ -1,4 +1,6 @@
-namespace ET.Client
+using System.Threading.Tasks;
+
+namespace ET.Client
 {
     [EntitySystemOf(typeof(ClientSenderCompnent))]
     [FriendOf(typeof(ClientSenderCompnent))]
@@ -13,19 +15,30 @@
         [EntitySystem]
         private static void Destroy(this ClientSenderCompnent self)
         {
-            if (self.fiberId != 0)
+            self.RemoveFiberAsync().Coroutine();
+        }
+
+        private static async ETTask RemoveFiberAsync(this ClientSenderCompnent self)
+        {
+            if (self.fiberId == 0)
             {
-                FiberManager.Instance.Remove(self.fiberId);
+                return;
             }
+
+            int fiberId = self.fiberId;
+            self.fiberId = 0;
+            await FiberManager.Instance.Remove(fiberId);
         }
 
         public static async ETTask<long> LoginAsync(this ClientSenderCompnent self, string account, string password)
         {
-            
             self.fiberId = await FiberManager.Instance.Create(SchedulerType.ThreadPool, 0, SceneType.NetClient, "");
             self.netClientActorId = new ActorId(self.Fiber().Process, self.fiberId);
 
-            NetClient2Main_Login response = await self.Fiber().MessageInnerSender.Call(self.netClientActorId, new Main2NetClient_Login() { Account = account, Password = password }) as NetClient2Main_Login;
+            NetClient2Main_Login response = await self.Fiber().MessageInnerSender.Call(self.netClientActorId, new Main2NetClient_Login()
+            {
+                OwnerFiberId = self.Fiber().Id, Account = account, Password = password
+            }) as NetClient2Main_Login;
             return response.PlayerId;
         }
 

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Client/Demo/NetClient/Main2NetClient_LoginHandler.cs

@@ -19,7 +19,7 @@ namespace ET.Client
                 routerAddressComponent =
                         root.AddComponent<RouterAddressComponent, string, int>(ConstValue.RouterHttpHost, ConstValue.RouterHttpPort);
                 await routerAddressComponent.Init();
-                root.AddComponent<NetClientComponent, AddressFamily>(routerAddressComponent.RouterManagerIPAddress.AddressFamily);
+                root.AddComponent<NetClientComponent, AddressFamily, int>(routerAddressComponent.RouterManagerIPAddress.AddressFamily, request.OwnerFiberId);
             }
             IPEndPoint realmAddress = routerAddressComponent.GetRealmAddress(account);
 

+ 22 - 21
Unity/Assets/Scripts/Hotfix/Client/Module/Message/NetClientComponentSystem.cs

@@ -10,19 +10,20 @@ namespace ET.Client
     public static partial class NetClientComponentSystem
     {
         [EntitySystem]
-        private static void Awake(this NetClientComponent self, AddressFamily addressFamily)
+        private static void Awake(this NetClientComponent self, AddressFamily addressFamily, int ownerFiberId)
         {
             self.AService = new KService(addressFamily, ServiceType.Outer, self.Fiber().Log);
             self.AService.ReadCallback = self.OnRead;
             self.AService.ErrorCallback = self.OnError;
+            self.OwnerFiberId = ownerFiberId;
         }
-        
+
         [EntitySystem]
         private static void Destroy(this NetClientComponent self)
         {
             self.AService.Dispose();
         }
-        
+
         [EntitySystem]
         private static void Update(this NetClientComponent self)
         {
@@ -38,29 +39,29 @@ namespace ET.Client
             }
 
             session.LastRecvTime = TimeInfo.Instance.ClientNow();
-            
+
             switch (message)
             {
                 case IResponse response:
-                {
-                    session.OnResponse(response);
-                    break;
-                }
+                    {
+                        session.OnResponse(response);
+                        break;
+                    }
                 case ISessionMessage:
-                {
-                    MessageSessionDispatcher.Instance.Handle(session, message);
-                    break;
-                }
+                    {
+                        MessageSessionDispatcher.Instance.Handle(session, message);
+                        break;
+                    }
                 case IMessage iActorMessage:
-                {
-                    // 扔到Main纤程队列中
-                    self.Fiber().MessageInnerSender.Send(new ActorId(self.Fiber().Process, ConstFiberId.Main), iActorMessage);
-                    break;
-                }
+                    {
+                        // 扔到Main纤程队列中
+                        self.Fiber().MessageInnerSender.Send(new ActorId(self.Fiber().Process, self.OwnerFiberId), iActorMessage);
+                        break;
+                    }
                 default:
-                {
-                    throw new Exception($"not found handler: {message}");
-                }
+                    {
+                        throw new Exception($"not found handler: {message}");
+                    }
             }
         }
 
@@ -89,7 +90,7 @@ namespace ET.Client
 
             return session;
         }
-        
+
         public static Session Create(this NetClientComponent self, IPEndPoint routerIPEndPoint, IPEndPoint realIPEndPoint, uint localConn)
         {
             long channelId = localConn;

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkClient.cs

@@ -19,7 +19,7 @@ namespace ET.Server
             //root.AddComponent<GateSessionKeyComponent>();
             //root.AddComponent<LocationProxyComponent>();
             //root.AddComponent<ActorLocationSenderComponent>();
-            root.AddComponent<NetClientComponent, AddressFamily>(AddressFamily.InterNetwork);
+            root.AddComponent<NetClientComponent, AddressFamily, int>(AddressFamily.InterNetwork, ConstFiberId.Main);
             root.AddComponent<BenchmarkClientComponent>();
             await ETTask.CompletedTask;
         }

+ 2 - 2
Unity/Assets/Scripts/Hotfix/Server/Demo/Realm/RealmGateAddressHelper.cs

@@ -7,11 +7,11 @@ namespace ET.Server
 	{
 		public static StartSceneConfig GetGate(int zone, string account)
 		{
-			long hash = account.GetLongHashCode();
+			ulong hash = (ulong)account.GetLongHashCode();
 			
 			List<StartSceneConfig> zoneGates = StartSceneConfigCategory.Instance.Gates[zone];
 			
-			return zoneGates[(int)(hash % zoneGates.Count)];
+			return zoneGates[(int)(hash % (ulong)zoneGates.Count)];
 		}
 	}
 }

+ 15 - 0
Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/Console/CreateRobotConsoleHandler.cs

@@ -12,15 +12,30 @@ namespace ET.Server
             switch (content)
             {
                 case ConsoleMode.CreateRobot:
+                {
                     fiber.Console("CreateRobot args error!");
                     break;
+                }
                 default:
+                {
                     CreateRobotArgs options = null;
                     Parser.Default.ParseArguments<CreateRobotArgs>(content.Split(' '))
                             .WithNotParsed(error => throw new Exception($"CreateRobotArgs error!"))
                             .WithParsed(o => { options = o; });
 
+                    RobotManagerComponent robotManagerComponent =
+                            fiber.Root.GetComponent<RobotManagerComponent>() ?? fiber.Root.AddComponent<RobotManagerComponent>();
+
+                    // 创建机器人
+                    TimerComponent timerComponent = fiber.TimerComponent;
+                    for (int i = 0; i < options.Num; ++i)
+                    {
+                        await robotManagerComponent.NewRobot($"Robot_{i}");
+                        Log.Console($"create robot {i}");
+                        await timerComponent.WaitAsync(2000);
+                    }
                     break;
+                }
             }
             contex.Parent.RemoveComponent<ModeContex>();
             await ETTask.CompletedTask;

+ 28 - 0
Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/FiberInit_Robot.cs

@@ -0,0 +1,28 @@
+namespace ET.Client
+{
+    [Invoke((long)SceneType.Robot)]
+    public class FiberInit_Robot: AInvokeHandler<FiberInit, ETTask>
+    {
+        public override async ETTask Handle(FiberInit fiberInit)
+        {
+            Scene root = fiberInit.Fiber.Root;
+            root.AddComponent<MailBoxComponent, MailBoxType>(MailBoxType.UnOrderedMessage);
+            root.AddComponent<TimerComponent>();
+            root.AddComponent<CoroutineLockComponent>();
+            root.AddComponent<MessageInnerSender>();
+            root.AddComponent<PlayerComponent>();
+            root.AddComponent<CurrentScenesComponent>();
+            root.AddComponent<ObjectWait>();
+            
+            root.SceneType = SceneType.Demo;
+
+            await EventSystem.Instance.PublishAsync(root, new EventType.AppStartInitFinish());
+            
+            await LoginHelper.Login(root, root.Name, "");
+            
+            await EnterMapHelper.EnterMapAsync(root);
+            
+            root.AddComponent<AIComponent, int>(1);
+        }
+    }
+}

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/Scene/RobotSceneFactory.cs.meta → Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/FiberInit_Robot.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 8fc5dfc338ad5a34298bedfecf3e902f
+guid: 0cf060b8428d67d409b3883ca382f806
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 32 - 0
Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/RobotManagerComponentSystem.cs

@@ -0,0 +1,32 @@
+namespace ET.Server
+{
+    [EntitySystemOf(typeof(RobotManagerComponent))]
+    [FriendOf(typeof(RobotManagerComponent))]
+    public static partial class RobotManagerComponentSystem
+    {
+        [EntitySystem]
+        private static void Awake(this RobotManagerComponent self)
+        {
+        }
+        
+        [EntitySystem]
+        private static void Destroy(this RobotManagerComponent self)
+        {
+            async ETTask Remove(int f)
+            {
+                await FiberManager.Instance.Remove(f);
+            }
+            
+            foreach (int fiberId in self.robots)
+            {
+                Remove(fiberId).Coroutine();
+            }
+        }
+
+        public static async ETTask NewRobot(this RobotManagerComponent self, string account)
+        {
+            int robot = await FiberManager.Instance.Create(SchedulerType.ThreadPool, self.Zone(), SceneType.Robot, account);
+            self.robots.Add(robot);
+        }
+    }
+}

+ 11 - 0
Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/RobotManagerComponentSystem.cs.meta

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

+ 0 - 35
Unity/Assets/Scripts/Hotfix/Server/Demo/Robot/Scene/RobotSceneFactory.cs

@@ -1,35 +0,0 @@
-namespace ET.Server
-{
-    public static partial class RobotSceneFactory
-    {
-        public static async ETTask<Scene> Create(
-            Entity parent,
-            long id,
-            long instanceId,
-            int zone,
-            string name,
-            SceneType sceneType,
-            StartSceneConfig startSceneConfig = null
-        )
-        {
-            /*
-            await ETTask.CompletedTask;
-            Log.Info($"create scene: {sceneType} {name} {zone}");
-            Scene scene = EntitySceneFactory.CreateScene(id, instanceId, zone, sceneType, name, parent);
-
-            scene.AddComponent<MailBoxComponent, MailBoxType>(MailBoxType.UnOrderedMessage);
-
-            switch (scene.SceneType)
-            {
-                case SceneType.Robot:
-                    scene.AddComponent<RobotManagerComponent>();
-                    break;
-            }
-
-            return scene;
-            */
-            await ETTask.CompletedTask;
-            return null;
-        }
-    }
-}

+ 2 - 1
Unity/Assets/Scripts/Hotfix/Share/Demo/EntryEvent1_InitShare.cs

@@ -6,7 +6,8 @@ namespace ET
         protected override async ETTask Run(Scene root, EventType.EntryEvent1 args)
         {
             await World.Instance.AddSingleton<ConfigLoader>().LoadAsync();
-            
+            root.AddComponent<TimerComponent>();
+            root.AddComponent<CoroutineLockComponent>();
             root.AddComponent<ObjectWait>();
             root.AddComponent<MailBoxComponent, MailBoxType>(MailBoxType.UnOrderedMessage);
             root.AddComponent<MessageInnerSender>();

+ 1 - 0
Unity/Assets/Scripts/Hotfix/Share/FiberInit_Main.cs

@@ -6,6 +6,7 @@
         public override async ETTask Handle(FiberInit fiberInit)
         {
             Scene root = fiberInit.Fiber.Root;
+           
             await EventSystem.Instance.PublishAsync(root, new EventType.EntryEvent1());
             await EventSystem.Instance.PublishAsync(root, new EventType.EntryEvent2());
             await EventSystem.Instance.PublishAsync(root, new EventType.EntryEvent3());

+ 0 - 3
Unity/Assets/Scripts/HotfixView/Client/Demo/EntryEvent3_InitClient.cs

@@ -8,9 +8,6 @@ namespace ET.Client
     {
         protected override async ETTask Run(Scene root, EventType.EntryEvent3 args)
         {
-            root.AddComponent<TimerComponent>();
-            root.AddComponent<CoroutineLockComponent>();
-            
             GlobalComponent globalComponent = root.AddComponent<GlobalComponent>();
             root.AddComponent<UIGlobalComponent>();
             root.AddComponent<UIComponent>();

+ 3 - 1
Unity/Assets/Scripts/Model/Client/Module/Message/NetClientComponent.cs

@@ -3,8 +3,10 @@
 namespace ET.Client
 {
     [ComponentOf(typeof(Scene))]
-    public class NetClientComponent: Entity, IAwake<AddressFamily>, IDestroy, IUpdate
+    public class NetClientComponent: Entity, IAwake<AddressFamily, int>, IDestroy, IUpdate
     {
         public AService AService;
+
+        public int OwnerFiberId;
     }
 }

+ 5 - 1
Unity/Assets/Scripts/Model/Generate/Client/Message/ClientMessage_C_1000.cs

@@ -18,15 +18,19 @@ namespace ET
 		public int RpcId { get; set; }
 
 		[MemoryPackOrder(1)]
-		public string Account { get; set; }
+		public int OwnerFiberId { get; set; }
 
 		[MemoryPackOrder(2)]
+		public string Account { get; set; }
+
+		[MemoryPackOrder(3)]
 		public string Password { get; set; }
 
 		public override void Dispose() 
 		{
 			if (!this.IsFromPool) return;
 			this.RpcId = default;
+			this.OwnerFiberId = default;
 			this.Account = default;
 			this.Password = default;
 			

+ 0 - 5
Unity/Assets/Scripts/Model/Generate/ClientServer/ConfigPartial/StartSceneConfig.cs

@@ -20,8 +20,6 @@ namespace ET
         
         public List<StartSceneConfig> Routers = new();
         
-        public List<StartSceneConfig> Robots = new();
-        
         public List<StartSceneConfig> Maps = new();
 
         public StartSceneConfig Match;
@@ -64,9 +62,6 @@ namespace ET
                     case SceneType.Location:
                         this.LocationConfig = startSceneConfig;
                         break;
-                    case SceneType.Robot:
-                        this.Robots.Add(startSceneConfig);
-                        break;
                     case SceneType.Router:
                         this.Routers.Add(startSceneConfig);
                         break;

+ 5 - 1
Unity/Assets/Scripts/Model/Generate/ClientServer/Message/ClientMessage_C_1000.cs

@@ -18,15 +18,19 @@ namespace ET
 		public int RpcId { get; set; }
 
 		[MemoryPackOrder(1)]
-		public string Account { get; set; }
+		public int OwnerFiberId { get; set; }
 
 		[MemoryPackOrder(2)]
+		public string Account { get; set; }
+
+		[MemoryPackOrder(3)]
 		public string Password { get; set; }
 
 		public override void Dispose() 
 		{
 			if (!this.IsFromPool) return;
 			this.RpcId = default;
+			this.OwnerFiberId = default;
 			this.Account = default;
 			this.Password = default;
 			

+ 0 - 5
Unity/Assets/Scripts/Model/Generate/Server/ConfigPartial/StartSceneConfig.cs

@@ -20,8 +20,6 @@ namespace ET
         
         public List<StartSceneConfig> Routers = new();
         
-        public List<StartSceneConfig> Robots = new();
-        
         public List<StartSceneConfig> Maps = new();
 
         public StartSceneConfig Match;
@@ -64,9 +62,6 @@ namespace ET
                     case SceneType.Location:
                         this.LocationConfig = startSceneConfig;
                         break;
-                    case SceneType.Robot:
-                        this.Robots.Add(startSceneConfig);
-                        break;
                     case SceneType.Router:
                         this.Routers.Add(startSceneConfig);
                         break;

+ 5 - 1
Unity/Assets/Scripts/Model/Generate/Server/Message/ClientMessage_C_1000.cs

@@ -18,15 +18,19 @@ namespace ET
 		public int RpcId { get; set; }
 
 		[MemoryPackOrder(1)]
-		public string Account { get; set; }
+		public int OwnerFiberId { get; set; }
 
 		[MemoryPackOrder(2)]
+		public string Account { get; set; }
+
+		[MemoryPackOrder(3)]
 		public string Password { get; set; }
 
 		public override void Dispose() 
 		{
 			if (!this.IsFromPool) return;
 			this.RpcId = default;
+			this.OwnerFiberId = default;
 			this.Account = default;
 			this.Password = default;
 			

+ 4 - 2
Unity/Assets/Scripts/Model/Server/Demo/Robot/RobotManagerComponent.cs

@@ -1,8 +1,10 @@
+using System.Collections.Generic;
+
 namespace ET.Server
 {
     [ComponentOf(typeof(Scene))]
-    public class RobotManagerComponent: Entity, IAwake
+    public class RobotManagerComponent: Entity, IAwake, IDestroy
     {
-        
+        public HashSet<int> robots = new();
     }
 }