Răsfoiți Sursa

去除Robot工程:
机器人相关逻辑移到server中
Server改成Apps因为里面包含了服务器跟机器人
代码编译通过,还未运行

tanghai 3 ani în urmă
părinte
comite
04deb006b0
100 a modificat fișierele cu 548 adăugiri și 111 ștergeri
  1. 0 0
      Apps/App.sln.DotSettings
  2. 0 0
      Apps/App.sln.DotSettings.user
  3. 4 4
      Apps/App/Apps.App.csproj
  4. 0 0
      Apps/App/NLog.config
  5. 0 0
      Apps/App/NLog.xsd
  6. 0 0
      Apps/App/Program.cs
  7. 23 3
      Apps/Hotfix/AppStart_Init.cs
  8. 12 13
      Apps/Hotfix/Apps.Hotfix.csproj
  9. 1 1
      Apps/Hotfix/Config/ConfigLoader.cs
  10. 0 0
      Apps/Hotfix/Handler/C2G_PingHandler.cs
  11. 0 0
      Apps/Hotfix/Handler/C2M_ReloadHandler.cs
  12. 0 0
      Apps/Hotfix/Module/Actor/ActorHelper.cs
  13. 0 0
      Apps/Hotfix/Module/Actor/ActorMessageDispatcherComponentSystem.cs
  14. 0 0
      Apps/Hotfix/Module/Actor/ActorMessageSenderComponentSystem.cs
  15. 0 0
      Apps/Hotfix/Module/Actor/MailBoxComponentSystem.cs
  16. 0 0
      Apps/Hotfix/Module/ActorLocation/ActorLocationSenderComponentSystem.cs
  17. 0 0
      Apps/Hotfix/Module/ActorLocation/ActorLocationSenderSystem.cs
  18. 5 5
      Apps/Hotfix/Module/ActorLocation/LocationProxyComponentSystem.cs
  19. 0 0
      Apps/Hotfix/Module/ActorLocation/ObjectAddRequestHandler.cs
  20. 0 0
      Apps/Hotfix/Module/ActorLocation/ObjectGetRequestHandler.cs
  21. 0 0
      Apps/Hotfix/Module/ActorLocation/ObjectLockRequestHandler.cs
  22. 0 0
      Apps/Hotfix/Module/ActorLocation/ObjectRemoveRequestHandler.cs
  23. 0 0
      Apps/Hotfix/Module/ActorLocation/ObjectUnLockRequestHandler.cs
  24. 0 0
      Apps/Hotfix/Module/Console/ConsoleComponentSystem.cs
  25. 0 0
      Apps/Hotfix/Module/Console/ReloadConfigConsoleHandler.cs
  26. 0 0
      Apps/Hotfix/Module/Console/ReloadDllConsoleHandler.cs
  27. 0 0
      Apps/Hotfix/Module/DB/DBComponentSystem.cs
  28. 0 0
      Apps/Hotfix/Module/DB/DBManagerComponentSystem.cs
  29. 0 0
      Apps/Hotfix/Module/Http/HttpComponentSystem.cs
  30. 0 0
      Apps/Hotfix/Module/MessageInner/NetInnerComponentSystem.cs
  31. 38 0
      Apps/Hotfix/Module/RobotCase/RobotCaseComponentSystem.cs
  32. 80 0
      Apps/Hotfix/Module/RobotCase/RobotCaseDispatcherComponentSystem.cs
  33. 26 0
      Apps/Hotfix/Robot/Case/RobotCase_FirstCase.cs
  34. 55 0
      Apps/Hotfix/Robot/Console/CreateRobotConsoleHandler.cs
  35. 100 0
      Apps/Hotfix/Robot/RobotCaseSystem.cs
  36. 62 0
      Apps/Hotfix/Robot/RobotConsoleHandler.cs
  37. 47 0
      Apps/Hotfix/Robot/RobotManagerComponentSystem.cs
  38. 31 0
      Apps/Hotfix/Robot/Scene/RobotSceneFactory.cs
  39. 1 1
      Apps/Hotfix/Server/AOI/AOIEntitySystem.cs
  40. 1 1
      Apps/Hotfix/Server/AOI/AOIHelper.cs
  41. 1 1
      Apps/Hotfix/Server/AOI/AOIManagerComponentSystem.cs
  42. 1 1
      Apps/Hotfix/Server/AOI/AOISeeCheckHelper.cs
  43. 1 1
      Apps/Hotfix/Server/AOI/CellSystem.cs
  44. 3 3
      Apps/Hotfix/Server/AOI/ChangePosition_NotifyAOI.cs
  45. 1 1
      Apps/Hotfix/Server/Actor_TransferHandler.cs
  46. 2 2
      Apps/Hotfix/Server/C2G_EnterMapHandler.cs
  47. 1 1
      Apps/Hotfix/Server/C2G_LoginGateHandler.cs
  48. 1 1
      Apps/Hotfix/Server/C2M_PathfindingResultHandler.cs
  49. 1 1
      Apps/Hotfix/Server/C2M_StopHandler.cs
  50. 1 1
      Apps/Hotfix/Server/C2M_TestRobotCaseHandler.cs
  51. 1 1
      Apps/Hotfix/Server/C2R_LoginHandler.cs
  52. 1 1
      Apps/Hotfix/Server/G2M_SessionDisconnectHandler.cs
  53. 2 2
      Apps/Hotfix/Server/M2M_UnitTransferRequestHandler.cs
  54. 1 1
      Apps/Hotfix/Server/MessageHelper.cs
  55. 1 1
      Apps/Hotfix/Server/Move/MoveHelper.cs
  56. 1 1
      Apps/Hotfix/Server/Move/PathFindHelper.cs
  57. 1 1
      Apps/Hotfix/Server/PlayerComponentSystem.cs
  58. 1 1
      Apps/Hotfix/Server/R2G_GetLoginKeyHandler.cs
  59. 1 1
      Apps/Hotfix/Server/RealmGateAddressHelper.cs
  60. 1 1
      Apps/Hotfix/Server/Scene/C2M_TransferMapHandler.cs
  61. 5 3
      Apps/Hotfix/Server/Scene/SceneFactory.cs
  62. 1 1
      Apps/Hotfix/Server/Session/InnerMessageDispatcherHelper.cs
  63. 1 1
      Apps/Hotfix/Server/Session/SessionStreamDispatcherServerInner.cs
  64. 1 1
      Apps/Hotfix/Server/Session/SessionStreamDispatcherServerOuter.cs
  65. 1 1
      Apps/Hotfix/Server/SessionPlayerComponentSystem.cs
  66. 1 1
      Apps/Hotfix/Server/Transfer/TransferHelper.cs
  67. 2 2
      Apps/Hotfix/Server/Unit/UnitEnterSightRange_NotifyClient.cs
  68. 1 1
      Apps/Hotfix/Server/Unit/UnitFactory.cs
  69. 1 1
      Apps/Hotfix/Server/Unit/UnitHelper.cs
  70. 2 2
      Apps/Hotfix/Server/Unit/UnitLeaveSightRange_NotifyClient.cs
  71. 0 0
      Apps/Hotfix/Watcher/WatcherComponentSystem.cs
  72. 0 0
      Apps/Hotfix/Watcher/WatcherHelper.cs
  73. 0 0
      Apps/Model/App.Model.csproj.user
  74. 22 45
      Apps/Model/Apps.Model.csproj
  75. 0 0
      Apps/Model/Base/DllHelper.cs
  76. 0 0
      Apps/Model/Base/MongoHelper.cs
  77. 0 0
      Apps/Model/Base/MongoRegister.cs
  78. 0 0
      Apps/Model/Base/StructBsonSerialize.cs
  79. 0 0
      Apps/Model/Generate/Config/AIConfig.cs
  80. 0 0
      Apps/Model/Generate/Config/StartMachineConfig.cs
  81. 0 0
      Apps/Model/Generate/Config/StartProcessConfig.cs
  82. 0 0
      Apps/Model/Generate/Config/StartSceneConfig.cs
  83. 0 0
      Apps/Model/Generate/Config/StartZoneConfig.cs
  84. 0 0
      Apps/Model/Generate/Config/UnitConfig.cs
  85. 0 0
      Apps/Model/Generate/ConfigPartial/StartProcessConfig.cs
  86. 0 0
      Apps/Model/Generate/ConfigPartial/StartSceneConfig.cs
  87. 0 0
      Apps/Model/Generate/Message/InnerMessage.cs
  88. 0 0
      Apps/Model/Generate/Message/InnerOpcode.cs
  89. 0 0
      Apps/Model/Generate/Message/MongoMessage.cs
  90. 0 0
      Apps/Model/Generate/Message/MongoOpcode.cs
  91. 0 0
      Apps/Model/Generate/Message/OuterMessage.cs
  92. 0 0
      Apps/Model/Generate/Message/OuterOpcode.cs
  93. 0 0
      Apps/Model/Module/Actor/AMActorHandler.cs
  94. 0 0
      Apps/Model/Module/Actor/AMActorRpcHandler.cs
  95. 0 0
      Apps/Model/Module/Actor/ActorMessageAttribute.cs
  96. 0 0
      Apps/Model/Module/Actor/ActorMessageDispatcherComponent.cs
  97. 0 0
      Apps/Model/Module/Actor/ActorMessageHandlerAttribute.cs
  98. 0 0
      Apps/Model/Module/Actor/ActorMessageSender.cs
  99. 0 0
      Apps/Model/Module/Actor/ActorMessageSenderComponent.cs
  100. 0 0
      Apps/Model/Module/Actor/IMActorHandler.cs

+ 0 - 0
Server/Server.sln.DotSettings → Apps/App.sln.DotSettings


+ 0 - 0
Server/Server.sln.DotSettings.user → Apps/App.sln.DotSettings.user


+ 4 - 4
Server/App/Server.App.csproj → Apps/App/Apps.App.csproj

@@ -25,13 +25,13 @@
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\Model\Server.Model.csproj" />
-  </ItemGroup>
-
   <ItemGroup>
     <None Update="NLog.config">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
   </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Model\Apps.Model.csproj" />
+  </ItemGroup>
 </Project>

+ 0 - 0
Server/App/NLog.config → Apps/App/NLog.config


+ 0 - 0
Server/App/NLog.xsd → Apps/App/NLog.xsd


+ 0 - 0
Server/App/Program.cs → Apps/App/Program.cs


+ 23 - 3
Server/Hotfix/AppStart_Init.cs → Apps/Hotfix/AppStart_Init.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Net;
+using ET.Client;
 
 namespace ET
 {
@@ -7,7 +8,7 @@ namespace ET
     {
         protected override async ETTask Run(EventType.AppStart args)
         {
-            Game.Scene.AddComponent<ConfigComponent>();
+            Game.Scene.AddComponent<ConfigComponent>().ConfigLoader = new ConfigLoader();
             await ConfigComponent.Instance.LoadAsync();
 
             StartProcessConfig processConfig = StartProcessConfigCategory.Instance.Get(Game.Options.Process);
@@ -27,9 +28,14 @@ namespace ET
             // 数值订阅组件
             Game.Scene.AddComponent<NumericWatcherComponent>();
             
+            Game.Scene.AddComponent<ZoneSceneManagerComponent>();
+            Game.Scene.AddComponent<AIDispatcherComponent>();
+            Game.Scene.AddComponent<RobotCaseDispatcherComponent>();
+            Game.Scene.AddComponent<RobotCaseComponent>();
+            
             Game.Scene.AddComponent<NetThreadComponent>();
             
-            Game.Scene.AddComponent<NavmeshComponent, Func<string, byte[]>>(RecastFileReader.Read);
+            Game.Scene.AddComponent<NavmeshComponent, Func<string, byte[]>>(Server.RecastFileReader.Read);
 
             switch (Game.Options.AppType)
             {
@@ -40,7 +46,7 @@ namespace ET
                     var processScenes = StartSceneConfigCategory.Instance.GetByProcess(Game.Options.Process);
                     foreach (StartSceneConfig startConfig in processScenes)
                     {
-                        await SceneFactory.Create(Game.Scene, startConfig.Id, startConfig.InstanceId, startConfig.Zone, startConfig.Name,
+                        await Server.SceneFactory.Create(Game.Scene, startConfig.Id, startConfig.InstanceId, startConfig.Zone, startConfig.Name,
                             startConfig.Type, startConfig);
                     }
 
@@ -54,6 +60,20 @@ namespace ET
                     Game.Scene.AddComponent<NetInnerComponent, IPEndPoint, int>(NetworkHelper.ToIPEndPoint($"{startMachineConfig.InnerIP}:{startMachineConfig.WatcherPort}"), SessionStreamDispatcherType.SessionStreamDispatcherServerInner);
                     break;
                 }
+                case AppType.Robot:
+                {
+                    var processScenes = StartSceneConfigCategory.Instance.GetByProcess(Game.Options.Process);
+                    foreach (StartSceneConfig startConfig in processScenes)
+                    {
+                        await Server.SceneFactory.Create(Game.Scene, startConfig.Id, startConfig.InstanceId, startConfig.Zone, startConfig.Name, startConfig.Type, startConfig);
+                    }
+            
+                    if (Game.Options.Console == 1)
+                    {
+                        Game.Scene.AddComponent<ConsoleComponent>();
+                    }
+                    break;
+                }
                 case AppType.GameTool:
                     break;
             }

+ 12 - 13
Server/Hotfix/Server.Hotfix.csproj → Apps/Hotfix/Apps.Hotfix.csproj

@@ -19,32 +19,31 @@
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
   <ItemGroup>
-    <Compile Include="..\..\Unity\Codes\Hotfix\Demo\Move\MoveComponentSystem.cs">
-      <Link>Demo\Move\MoveComponentSystem.cs</Link>
-    </Compile>
-    <Compile Include="..\..\Unity\Codes\Hotfix\Module\Config\ConfigComponentSystem.cs">
-      <Link>Module\Config\ConfigComponentSystem.cs</Link>
-    </Compile>
-    <Compile Include="..\..\Unity\Codes\Hotfix\Module\Numeric\NumericChangeEvent_NotifyWatcher.cs">
-      <Link>Module\Numeric\NumericChangeEvent_NotifyWatcher.cs</Link>
-    </Compile>
-    <Compile Include="..\..\Unity\Codes\Hotfix\Module\Numeric\NumericWatcher_Hp_ShowUI.cs">
-      <Link>Module\Numeric\NumericWatcher_Hp_ShowUI.cs</Link>
+    <Compile Include="..\..\Unity\Codes\Hotfix\Module\Numeric\**\*.cs">
+      <Link>Module\Numeric\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
 
     <Compile Include="..\..\Unity\Codes\Hotfix\Module\AI\**\*.cs">
       <Link>Module\AI\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
 
+    <Compile Include="..\..\Unity\Codes\Hotfix\Module\Config\**\*.cs">
+      <Link>Module\Config\%(RecursiveDir)%(FileName)%(Extension)</Link>
+    </Compile>
+
     <Compile Include="..\..\Unity\Codes\Hotfix\Module\Recast\**\*.cs">
       <Link>Module\Recast\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
 
-    <Compile Include="..\..\Unity\Codes\Hotfix\Module\Message\**\*.cs">
+    <Compile Include="..\..\Unity\Codes\Hotfix\Module\Message\**\*.cs"> 
       <Link>Module\Message\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
+
+    <Compile Include="..\..\Unity\Codes\Hotfix\Client\**\*.cs">
+      <Link>Client\%(RecursiveDir)%(FileName)%(Extension)</Link>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\Model\Server.Model.csproj" />
+    <ProjectReference Include="..\Model\Apps.Model.csproj" />
   </ItemGroup>
 </Project>

+ 1 - 1
Server/Hotfix/Config/ConfigLoader.cs → Apps/Hotfix/Config/ConfigLoader.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using System.IO;
 
-namespace ET
+namespace ET.Client
 {
     public class ConfigLoader: IConfigLoader
     {

+ 0 - 0
Server/Hotfix/Handler/C2G_PingHandler.cs → Apps/Hotfix/Handler/C2G_PingHandler.cs


+ 0 - 0
Server/Hotfix/Handler/C2M_ReloadHandler.cs → Apps/Hotfix/Handler/C2M_ReloadHandler.cs


+ 0 - 0
Server/Hotfix/Module/Actor/ActorHelper.cs → Apps/Hotfix/Module/Actor/ActorHelper.cs


+ 0 - 0
Server/Hotfix/Module/Actor/ActorMessageDispatcherComponentSystem.cs → Apps/Hotfix/Module/Actor/ActorMessageDispatcherComponentSystem.cs


+ 0 - 0
Server/Hotfix/Module/Actor/ActorMessageSenderComponentSystem.cs → Apps/Hotfix/Module/Actor/ActorMessageSenderComponentSystem.cs


+ 0 - 0
Server/Hotfix/Module/Actor/MailBoxComponentSystem.cs → Apps/Hotfix/Module/Actor/MailBoxComponentSystem.cs


+ 0 - 0
Server/Hotfix/Module/ActorLocation/ActorLocationSenderComponentSystem.cs → Apps/Hotfix/Module/ActorLocation/ActorLocationSenderComponentSystem.cs


+ 0 - 0
Server/Hotfix/Module/ActorLocation/ActorLocationSenderSystem.cs → Apps/Hotfix/Module/ActorLocation/ActorLocationSenderSystem.cs


+ 5 - 5
Server/Hotfix/Module/ActorLocation/LocationProxyComponentSystem.cs → Apps/Hotfix/Module/ActorLocation/LocationProxyComponentSystem.cs

@@ -30,28 +30,28 @@ namespace ET
         public static async ETTask Add(this LocationProxyComponent self, long key, long instanceId)
         {
             Log.Info($"location proxy add {key}, {instanceId} {TimeHelper.ServerNow()}");
-            await MessageHelper.CallActor(GetLocationSceneId(key),
+            await ActorMessageSenderComponent.Instance.Call(GetLocationSceneId(key),
                 new ObjectAddRequest() { Key = key, InstanceId = instanceId });
         }
 
         public static async ETTask Lock(this LocationProxyComponent self, long key, long instanceId, int time = 60000)
         {
             Log.Info($"location proxy lock {key}, {instanceId} {TimeHelper.ServerNow()}");
-            await MessageHelper.CallActor(GetLocationSceneId(key),
+            await ActorMessageSenderComponent.Instance.Call(GetLocationSceneId(key),
                 new ObjectLockRequest() { Key = key, InstanceId = instanceId, Time = time });
         }
 
         public static async ETTask UnLock(this LocationProxyComponent self, long key, long oldInstanceId, long instanceId)
         {
             Log.Info($"location proxy unlock {key}, {instanceId} {TimeHelper.ServerNow()}");
-            await MessageHelper.CallActor(GetLocationSceneId(key),
+            await ActorMessageSenderComponent.Instance.Call(GetLocationSceneId(key),
                 new ObjectUnLockRequest() { Key = key, OldInstanceId = oldInstanceId, InstanceId = instanceId });
         }
 
         public static async ETTask Remove(this LocationProxyComponent self, long key)
         {
             Log.Info($"location proxy add {key}, {TimeHelper.ServerNow()}");
-            await MessageHelper.CallActor(GetLocationSceneId(key),
+            await ActorMessageSenderComponent.Instance.Call(GetLocationSceneId(key),
                 new ObjectRemoveRequest() { Key = key });
         }
 
@@ -64,7 +64,7 @@ namespace ET
 
             // location server配置到共享区,一个大战区可以配置N多个location server,这里暂时为1
             ObjectGetResponse response =
-                    (ObjectGetResponse) await MessageHelper.CallActor(GetLocationSceneId(key),
+                    (ObjectGetResponse) await ActorMessageSenderComponent.Instance.Call(GetLocationSceneId(key),
                         new ObjectGetRequest() { Key = key });
             return response.InstanceId;
         }

+ 0 - 0
Server/Hotfix/Module/ActorLocation/ObjectAddRequestHandler.cs → Apps/Hotfix/Module/ActorLocation/ObjectAddRequestHandler.cs


+ 0 - 0
Server/Hotfix/Module/ActorLocation/ObjectGetRequestHandler.cs → Apps/Hotfix/Module/ActorLocation/ObjectGetRequestHandler.cs


+ 0 - 0
Server/Hotfix/Module/ActorLocation/ObjectLockRequestHandler.cs → Apps/Hotfix/Module/ActorLocation/ObjectLockRequestHandler.cs


+ 0 - 0
Server/Hotfix/Module/ActorLocation/ObjectRemoveRequestHandler.cs → Apps/Hotfix/Module/ActorLocation/ObjectRemoveRequestHandler.cs


+ 0 - 0
Server/Hotfix/Module/ActorLocation/ObjectUnLockRequestHandler.cs → Apps/Hotfix/Module/ActorLocation/ObjectUnLockRequestHandler.cs


+ 0 - 0
Server/Hotfix/Module/Console/ConsoleComponentSystem.cs → Apps/Hotfix/Module/Console/ConsoleComponentSystem.cs


+ 0 - 0
Server/Hotfix/Module/Console/ReloadConfigConsoleHandler.cs → Apps/Hotfix/Module/Console/ReloadConfigConsoleHandler.cs


+ 0 - 0
Server/Hotfix/Module/Console/ReloadDllConsoleHandler.cs → Apps/Hotfix/Module/Console/ReloadDllConsoleHandler.cs


+ 0 - 0
Server/Hotfix/Module/DB/DBComponentSystem.cs → Apps/Hotfix/Module/DB/DBComponentSystem.cs


+ 0 - 0
Server/Hotfix/Module/DB/DBManagerComponentSystem.cs → Apps/Hotfix/Module/DB/DBManagerComponentSystem.cs


+ 0 - 0
Server/Hotfix/Module/Http/HttpComponentSystem.cs → Apps/Hotfix/Module/Http/HttpComponentSystem.cs


+ 0 - 0
Server/Hotfix/Module/MessageInner/NetInnerComponentSystem.cs → Apps/Hotfix/Module/MessageInner/NetInnerComponentSystem.cs


+ 38 - 0
Apps/Hotfix/Module/RobotCase/RobotCaseComponentSystem.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+
+namespace ET
+{
+    [ObjectSystem]
+    public class RobotCaseComponentAwakeSystem: AwakeSystem<RobotCaseComponent>
+    {
+        public override void Awake(RobotCaseComponent self)
+        {
+            RobotCaseComponent.Instance = self;
+        }
+    }
+
+    [ObjectSystem]
+    public class RobotCaseComponentDestroySystem: DestroySystem<RobotCaseComponent>
+    {
+        public override void Destroy(RobotCaseComponent self)
+        {
+            RobotCaseComponent.Instance = null;
+        }
+    }
+    
+    public static class RobotCaseComponentSystem
+    {
+        public static int GetN(this RobotCaseComponent self)
+        {
+            return ++self.N;
+        }
+        
+        public static async ETTask<RobotCase> New(this RobotCaseComponent self)
+        {
+            await ETTask.CompletedTask;
+            RobotCase robotCase = self.AddChild<RobotCase>();
+            return robotCase;
+        }
+    }
+}

+ 80 - 0
Apps/Hotfix/Module/RobotCase/RobotCaseDispatcherComponentSystem.cs

@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+
+namespace ET
+{
+    [ObjectSystem]
+    public class RobotCaseDispatcherComponentAwakeSystem: AwakeSystem<RobotCaseDispatcherComponent>
+    {
+        public override void Awake(RobotCaseDispatcherComponent self)
+        {
+            RobotCaseDispatcherComponent.Instance = self;
+            self.Load();
+        }
+    }
+
+    [ObjectSystem]
+    public class RobotCaseDispatcherComponentLoadSystem: LoadSystem<RobotCaseDispatcherComponent>
+    {
+        public override void Load(RobotCaseDispatcherComponent self)
+        {
+            self.Load();
+        }
+    }
+    
+    public static class RobotCaseDispatcherComponentSystem
+    {
+        public static void Load(this RobotCaseDispatcherComponent self)
+        {
+            self.Dictionary.Clear();
+
+            HashSet<Type> types = Game.EventSystem.GetTypes(typeof(RobotCaseAttribute));
+
+            foreach (Type type in types)
+            {
+                object[] attrs = type.GetCustomAttributes(typeof(RobotCaseAttribute), false);
+                if (attrs.Length == 0)
+                {
+                    continue;
+                }
+                
+                RobotCaseAttribute attr = attrs[0] as RobotCaseAttribute;
+                if (attr == null)
+                {
+                    continue;
+                }
+                
+                IRobotCase robotCase = Activator.CreateInstance(type) as IRobotCase;
+                if (robotCase == null)
+                {
+                    Log.Error($"RobotCase handle {type.Name} 需要继承 IRobotCase");
+                    continue;
+                }
+                
+                self.Dictionary.Add(attr.CaseType, robotCase);
+            }
+        }
+        
+        public static async ETTask Run(this RobotCaseDispatcherComponent self, int caseType, string line)
+        {
+            if (!self.Dictionary.TryGetValue(caseType, out IRobotCase iRobotCase))
+            {
+                return;
+            }
+
+            try
+            {
+                using (RobotCase robotCase = await RobotCaseComponent.Instance.New())
+                {
+                    robotCase.CommandLine = line;
+                    await iRobotCase.Run(robotCase);
+                }
+            }
+            catch (Exception e)
+            {
+                Log.Error($"{self.DomainZone()} {e}");
+                RobotLog.Console($"RobotCase Error {caseType}:\n\t{e}");
+            }
+        }
+    }
+}

+ 26 - 0
Apps/Hotfix/Robot/Case/RobotCase_FirstCase.cs

@@ -0,0 +1,26 @@
+using System;
+
+namespace ET
+{
+    [RobotCase(RobotCaseType.FirstCase)]
+    public class RobotCase_FirstCase: IRobotCase
+    {
+        public async ETTask Run(RobotCase robotCase)
+        {
+            using ListComponent<Scene> robots = ListComponent<Scene>.Create();
+            
+            // 创建了两个机器人,生命周期是RobotCase,RobotCase_FirstCase.Run执行结束,机器人就会删除
+            await robotCase.NewRobot(2, robots);
+
+            foreach (Scene robotScene in robots)
+            {
+                M2C_TestRobotCase response = await robotScene.GetComponent<SessionComponent>().Session.Call(new C2M_TestRobotCase() {N = robotScene.Zone}) as M2C_TestRobotCase;
+                if (response.N != robotScene.Zone)
+                {
+                    // 跟预期不一致就抛异常,外层会catch住在控制台上打印
+                    throw new Exception($"robot case: {RobotCaseType.FirstCase} run fail!");
+                }
+            }
+        }
+    }
+}

+ 55 - 0
Apps/Hotfix/Robot/Console/CreateRobotConsoleHandler.cs

@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using CommandLine;
+using NLog;
+
+namespace ET
+{
+    [ConsoleHandler(ConsoleMode.CreateRobot)]
+    public class CreateRobotConsoleHandler: IConsoleHandler
+    {
+        public async ETTask Run(ModeContex contex, string content)
+        {
+            switch (content)
+            {
+                case ConsoleMode.CreateRobot:
+                    Log.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; });
+
+                    // 获取当前进程的RobotScene
+                    using (ListComponent<StartSceneConfig> thisProcessRobotScenes = ListComponent<StartSceneConfig>.Create())
+                    {
+                        List<StartSceneConfig> robotSceneConfigs = StartSceneConfigCategory.Instance.Robots;
+                        foreach (StartSceneConfig robotSceneConfig in robotSceneConfigs)
+                        {
+                            if (robotSceneConfig.Process != Game.Options.Process)
+                            {
+                                continue;
+                            }
+                            thisProcessRobotScenes.Add(robotSceneConfig);
+                        }
+                        
+                        // 创建机器人
+                        for (int i = 0; i < options.Num; ++i)
+                        {
+                            int index = i % thisProcessRobotScenes.Count;
+                            StartSceneConfig robotSceneConfig = thisProcessRobotScenes[index];
+                            Scene robotScene = Game.Scene.Get(robotSceneConfig.Id);
+                            RobotManagerComponent robotManagerComponent = robotScene.GetComponent<RobotManagerComponent>();
+                            Scene robot = await robotManagerComponent.NewRobot(Game.Options.Process * 10000 + i);
+                            Log.Console($"create robot {robot.Zone}");
+                            await TimerComponent.Instance.WaitAsync(2000);
+                        }
+                    }
+                    break;
+            }
+            contex.Parent.RemoveComponent<ModeContex>();
+            await ETTask.CompletedTask;
+        }
+    }
+}

+ 100 - 0
Apps/Hotfix/Robot/RobotCaseSystem.cs

@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+
+namespace ET
+{
+    public static class RobotCaseSystem
+    {
+        // 创建机器人,生命周期是RobotCase
+        public static async ETTask NewRobot(this RobotCase self, int count, List<Scene> scenes)
+        {
+            ETTask[] tasks = new ETTask[count];
+            for (int i = 0; i < count; ++i)
+            {
+                tasks[i] = self.NewRobot(scenes);
+            }
+
+            await ETTaskHelper.WaitAll(tasks);
+        }
+
+        private static async ETTask NewRobot(this RobotCase self, List<Scene> scenes)
+        {
+            try
+            {
+                scenes.Add(await self.NewRobot());
+            }
+            catch (Exception e)
+            {
+                Log.Error(e);
+            }
+        }
+
+        // 创建机器人,生命周期是RobotCase
+        public static async ETTask NewZoneRobot(this RobotCase self, int zone, int count, List<Scene> scenes)
+        {
+            ETTask[] tasks = new ETTask[count];
+            for (int i = 0; i < count; ++i)
+            {
+                tasks[i] = self.NewZoneRobot(zone + i, scenes);
+            }
+
+            await ETTaskHelper.WaitAll(tasks);
+        }
+
+        // 这个方法创建的是进程所属的机器人,建议使用RobotCase.NewRobot来创建
+        private static async ETTask NewZoneRobot(this RobotCase self, int zone, List<Scene> scenes)
+        {
+            try
+            {
+                scenes.Add(await self.NewRobot(zone));
+            }
+            catch (Exception e)
+            {
+                Log.Error(e);
+            }
+        }
+
+        public static async ETTask<Scene> NewRobot(this RobotCase self, int zone)
+        {
+            return await self.NewRobot(zone, $"Robot_{zone}");
+        }
+
+        public static async ETTask<Scene> NewRobot(this RobotCase self, int zone, string name)
+        {
+            Scene zoneScene = null;
+            try
+            {
+                zoneScene = Client.SceneFactory.CreateZoneScene(zone, name, self);
+                await Client.LoginHelper.Login(zoneScene, ConstValue.LoginAddress, zone.ToString(), zone.ToString());
+                await Client.EnterMapHelper.EnterMapAsync(zoneScene);
+                Log.Debug($"create robot ok: {zone}");
+                return zoneScene;
+            }
+            catch (Exception e)
+            {
+                zoneScene?.Dispose();
+                throw new Exception($"RobotCase create robot fail, zone: {zone}", e);
+            }
+        }
+
+        private static async ETTask<Scene> NewRobot(this RobotCase self)
+        {
+            int zone = self.GetParent<RobotCaseComponent>().GetN();
+            Scene zoneScene = null;
+
+            try
+            {
+                zoneScene = Client.SceneFactory.CreateZoneScene(zone, $"Robot_{zone}", self);
+                await Client.LoginHelper.Login(zoneScene, ConstValue.LoginAddress, zone.ToString(), zone.ToString());
+                await Client.EnterMapHelper.EnterMapAsync(zoneScene);
+                Log.Debug($"create robot ok: {zone}");
+                return zoneScene;
+            }
+            catch (Exception e)
+            {
+                zoneScene?.Dispose();
+                throw new Exception($"RobotCase create robot fail, zone: {zone}", e);
+            }
+        }
+    }
+}

+ 62 - 0
Apps/Hotfix/Robot/RobotConsoleHandler.cs

@@ -0,0 +1,62 @@
+using System;
+using System.Reflection;
+
+namespace ET
+{
+    [ConsoleHandler(ConsoleMode.Robot)]
+    public class RobotConsoleHandler: IConsoleHandler
+    {
+        public async ETTask Run(ModeContex contex, string content)
+        {
+            string[] ss = content.Split(" ");
+            switch (ss[0])
+            {
+                case ConsoleMode.Robot:
+                    break;
+
+                case "Run":
+                {
+                    int caseType = int.Parse(ss[1]);
+
+                    try
+                    {
+                        RobotLog.Debug($"run case start: {caseType}");
+                        await RobotCaseDispatcherComponent.Instance.Run(caseType, content);
+                        RobotLog.Debug($"run case finish: {caseType}");
+                    }
+                    catch (Exception e)
+                    {
+                        RobotLog.Debug($"run case error: {caseType}\n{e}");
+                    }
+                    break;
+                }
+                case "RunAll":
+                {
+                    FieldInfo[] fieldInfos = typeof (RobotCaseType).GetFields();
+                    foreach (FieldInfo fieldInfo in fieldInfos)
+                    {
+                        int caseType = (int)fieldInfo.GetValue(null);
+                        if (caseType > RobotCaseType.MaxCaseType)
+                        {
+                            RobotLog.Debug($"case > {RobotCaseType.MaxCaseType}: {caseType}");
+                            break;
+                        }
+                        try
+                        {
+                            RobotLog.Debug($"run case start: {caseType}");
+                            await RobotCaseDispatcherComponent.Instance.Run(caseType, content);
+                            RobotLog.Debug($"---------run case finish: {caseType}");
+                        }
+                        catch (Exception e)
+                        {
+                            RobotLog.Debug($"run case error: {caseType}\n{e}");
+                            break;
+                        }
+                    }
+                    break;
+                }
+            }
+            await ETTask.CompletedTask;
+        }
+    }
+}

+ 47 - 0
Apps/Hotfix/Robot/RobotManagerComponentSystem.cs

@@ -0,0 +1,47 @@
+using System;
+using System.Linq;
+
+namespace ET
+{
+    public static class RobotManagerComponentSystem
+    {
+        public static async ETTask<Scene> NewRobot(this RobotManagerComponent self, int zone)
+        {
+            Scene zoneScene = null;
+            try
+            {
+                zoneScene = Client.SceneFactory.CreateZoneScene(zone, "Robot", self);
+                await Client.LoginHelper.Login(zoneScene, ConstValue.LoginAddress, zone.ToString(), zone.ToString());
+                await Client.EnterMapHelper.EnterMapAsync(zoneScene);
+                Log.Debug($"create robot ok: {zone}");
+                return zoneScene;
+            }
+            catch (Exception e)
+            {
+                zoneScene?.Dispose();
+                throw new Exception($"RobotSceneManagerComponent create robot fail, zone: {zone}", e);
+            }
+        }
+        
+        public static void RemoveAll(this RobotManagerComponent self)
+        {
+            foreach (Entity robot in self.Children.Values.ToArray())        
+            {
+                robot.Dispose();
+            }
+        }
+        
+        public static void Remove(this RobotManagerComponent self, long id)
+        {
+            self.GetChild<Scene>(id)?.Dispose();
+        }
+
+        public static void Clear(this RobotManagerComponent self)
+        {
+            foreach (Entity entity in self.Children.Values.ToArray())
+            {
+                entity.Dispose();
+            }
+        }
+    }
+}

+ 31 - 0
Apps/Hotfix/Robot/Scene/RobotSceneFactory.cs

@@ -0,0 +1,31 @@
+namespace ET
+{
+    public static 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.UnOrderMessageDispatcher);
+
+            switch (scene.SceneType)
+            {
+                case SceneType.Robot:
+                    scene.AddComponent<RobotManagerComponent>();
+                    break;
+            }
+
+            return scene;
+        }
+    }
+}

+ 1 - 1
Server/Hotfix/Demo/AOI/AOIEntitySystem.cs → Apps/Hotfix/Server/AOI/AOIEntitySystem.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
     public static class AOIEntitySystem
     {

+ 1 - 1
Server/Hotfix/Demo/AOI/AOIHelper.cs → Apps/Hotfix/Server/AOI/AOIHelper.cs

@@ -1,6 +1,6 @@
 using System.Collections.Generic;
 
-namespace ET
+namespace ET.Server
 {
     public static class AOIHelper
     {

+ 1 - 1
Server/Hotfix/Demo/AOI/AOIManagerComponentSystem.cs → Apps/Hotfix/Server/AOI/AOIManagerComponentSystem.cs

@@ -1,6 +1,6 @@
 using System.Collections.Generic;
 
-namespace ET
+namespace ET.Server
 {
     public static class AOIManagerComponentSystem
     {

+ 1 - 1
Server/Hotfix/Demo/AOI/AOISeeCheckHelper.cs → Apps/Hotfix/Server/AOI/AOISeeCheckHelper.cs

@@ -1,4 +1,4 @@
-namespace ET
+namespace ET.Server
 {
     public static class AOISeeCheckHelper
     {

+ 1 - 1
Server/Hotfix/Demo/AOI/CellSystem.cs → Apps/Hotfix/Server/AOI/CellSystem.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using System.Text;
 
-namespace ET
+namespace ET.Server
 {
     [ObjectSystem]
     public class CellDestroySystem: DestroySystem<Cell>

+ 3 - 3
Server/Hotfix/Demo/AOI/ChangePosition_NotifyAOI.cs → Apps/Hotfix/Server/AOI/ChangePosition_NotifyAOI.cs

@@ -1,11 +1,11 @@
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
     [Event]
-    public class ChangePosition_NotifyAOI: AEvent<EventType.ChangePosition>
+    public class ChangePosition_NotifyAOI: AEvent<ET.EventType.ChangePosition>
     {
-        protected override async ETTask Run(EventType.ChangePosition args)
+        protected override async ETTask Run(ET.EventType.ChangePosition args)
         {
             await ETTask.CompletedTask;
             Vector3 oldPos = args.OldPos;

+ 1 - 1
Server/Hotfix/Demo/Actor_TransferHandler.cs → Apps/Hotfix/Server/Actor_TransferHandler.cs

@@ -2,7 +2,7 @@
 using System.Net;
 
 
-namespace ET
+namespace ET.Server
 {
 	[ActorMessageHandler]
 	public class Actor_TransferHandler : AMActorLocationRpcHandler<Unit, Actor_TransferRequest, Actor_TransferResponse>

+ 2 - 2
Server/Hotfix/Demo/C2G_EnterMapHandler.cs → Apps/Hotfix/Server/C2G_EnterMapHandler.cs

@@ -1,7 +1,7 @@
 using System;
 
 
-namespace ET
+namespace ET.Server
 {
 	[MessageHandler]
 	public class C2G_EnterMapHandler : AMRpcHandler<C2G_EnterMap, G2C_EnterMap>
@@ -17,7 +17,7 @@ namespace ET
 			Scene scene = gateMapComponent.Scene;
 			
 			// 这里可以从DB中加载Unit
-			Unit unit = UnitFactory.Create(scene, player.Id, UnitType.Player);
+			Unit unit = Server.UnitFactory.Create(scene, player.Id, UnitType.Player);
 			unit.AddComponent<UnitGateComponent, long>(session.InstanceId);
 			
 			StartSceneConfig startSceneConfig = StartSceneConfigCategory.Instance.GetBySceneName(session.DomainZone(), "Map1");

+ 1 - 1
Server/Hotfix/Demo/C2G_LoginGateHandler.cs → Apps/Hotfix/Server/C2G_LoginGateHandler.cs

@@ -1,7 +1,7 @@
 using System;
 
 
-namespace ET
+namespace ET.Server
 {
 	[MessageHandler]
 	public class C2G_LoginGateHandler : AMRpcHandler<C2G_LoginGate, G2C_LoginGate>

+ 1 - 1
Server/Hotfix/Demo/C2M_PathfindingResultHandler.cs → Apps/Hotfix/Server/C2M_PathfindingResultHandler.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
 	[ActorMessageHandler]
 	public class C2M_PathfindingResultHandler : AMActorLocationHandler<Unit, C2M_PathfindingResult>

+ 1 - 1
Server/Hotfix/Demo/C2M_StopHandler.cs → Apps/Hotfix/Server/C2M_StopHandler.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
 	[ActorMessageHandler]
 	public class C2M_StopHandler : AMActorLocationHandler<Unit, C2M_Stop>

+ 1 - 1
Server/Hotfix/Demo/C2M_TestRobotCaseHandler.cs → Apps/Hotfix/Server/C2M_TestRobotCaseHandler.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace ET
+namespace ET.Server
 {
 	public class C2M_TestRobotCaseHandler : AMActorLocationRpcHandler<Unit, C2M_TestRobotCase, M2C_TestRobotCase>
 	{

+ 1 - 1
Server/Hotfix/Demo/C2R_LoginHandler.cs → Apps/Hotfix/Server/C2R_LoginHandler.cs

@@ -2,7 +2,7 @@
 using System.Net;
 
 
-namespace ET
+namespace ET.Server
 {
 	[MessageHandler]
 	public class C2R_LoginHandler : AMRpcHandler<C2R_Login, R2C_Login>

+ 1 - 1
Server/Hotfix/Demo/G2M_SessionDisconnectHandler.cs → Apps/Hotfix/Server/G2M_SessionDisconnectHandler.cs

@@ -1,6 +1,6 @@
 
 
-namespace ET
+namespace ET.Server
 {
 	[ActorMessageHandler]
 	public class G2M_SessionDisconnectHandler : AMActorLocationHandler<Unit, G2M_SessionDisconnect>

+ 2 - 2
Server/Hotfix/Demo/M2M_UnitTransferRequestHandler.cs → Apps/Hotfix/Server/M2M_UnitTransferRequestHandler.cs

@@ -1,7 +1,7 @@
 using System;
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
 	[ActorMessageHandler]
 	public class M2M_UnitTransferRequestHandler : AMActorRpcHandler<Scene, M2M_UnitTransferRequest, M2M_UnitTransferResponse>
@@ -28,7 +28,7 @@ namespace ET
 			
 			// 通知客户端创建My Unit
 			M2C_CreateMyUnit m2CCreateUnits = new M2C_CreateMyUnit();
-			m2CCreateUnits.Unit = UnitHelper.CreateUnitInfo(unit);
+			m2CCreateUnits.Unit = Server.UnitHelper.CreateUnitInfo(unit);
 			MessageHelper.SendToClient(unit, m2CCreateUnits);
 			
 			// 加入aoi

+ 1 - 1
Server/Hotfix/Demo/MessageHelper.cs → Apps/Hotfix/Server/MessageHelper.cs

@@ -2,7 +2,7 @@
 
 using System.Collections.Generic;
 
-namespace ET
+namespace ET.Server
 {
     public static class MessageHelper
     {

+ 1 - 1
Server/Hotfix/Demo/Move/MoveHelper.cs → Apps/Hotfix/Server/Move/MoveHelper.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
     public static class MoveHelper
     {

+ 1 - 1
Server/Hotfix/Demo/Move/PathFindHelper.cs → Apps/Hotfix/Server/Move/PathFindHelper.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
     public static class PathFindHelper
     {

+ 1 - 1
Server/Hotfix/Demo/PlayerComponentSystem.cs → Apps/Hotfix/Server/PlayerComponentSystem.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace ET
+namespace ET.Server
 {
     public static class PlayerComponentSystem
     {

+ 1 - 1
Server/Hotfix/Demo/R2G_GetLoginKeyHandler.cs → Apps/Hotfix/Server/R2G_GetLoginKeyHandler.cs

@@ -1,7 +1,7 @@
 using System;
 
 
-namespace ET
+namespace ET.Server
 {
 	[ActorMessageHandler]
 	public class R2G_GetLoginKeyHandler : AMActorRpcHandler<Scene, R2G_GetLoginKey, G2R_GetLoginKey>

+ 1 - 1
Server/Hotfix/Demo/RealmGateAddressHelper.cs → Apps/Hotfix/Server/RealmGateAddressHelper.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 
 
-namespace ET
+namespace ET.Server
 {
 	public static class RealmGateAddressHelper
 	{

+ 1 - 1
Server/Hotfix/Demo/Scene/C2M_TransferMapHandler.cs → Apps/Hotfix/Server/Scene/C2M_TransferMapHandler.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace ET
+namespace ET.Server
 {
 	[ActorMessageHandler]
 	public class C2M_TransferMapHandler : AMActorLocationRpcHandler<Unit, C2M_TransferMap, M2C_TransferMap>

+ 5 - 3
Server/Hotfix/Demo/Scene/SceneFactory.cs → Apps/Hotfix/Server/Scene/SceneFactory.cs

@@ -1,8 +1,6 @@
-
-
 using System.Net;
 
-namespace ET
+namespace ET.Server
 {
     public static class SceneFactory
     {
@@ -35,6 +33,10 @@ namespace ET
                     break;
                 case SceneType.Location:
                     scene.AddComponent<LocationComponent>();
+                    break;
+                case SceneType.Robot:
+                    scene.AddComponent<RobotManagerComponent>();
+                    
                     break;
             }
 

+ 1 - 1
Server/Hotfix/Demo/Session/InnerMessageDispatcherHelper.cs → Apps/Hotfix/Server/Session/InnerMessageDispatcherHelper.cs

@@ -1,7 +1,7 @@
 using System;
 using System.IO;
 
-namespace ET
+namespace ET.Server
 {
     public static class InnerMessageDispatcherHelper
     {

+ 1 - 1
Server/Hotfix/Demo/Session/SessionStreamDispatcherServerInner.cs → Apps/Hotfix/Server/Session/SessionStreamDispatcherServerInner.cs

@@ -1,7 +1,7 @@
 using System;
 using System.IO;
 
-namespace ET
+namespace ET.Server
 {
     [SessionStreamDispatcher(SessionStreamDispatcherType.SessionStreamDispatcherServerInner)]
     public class SessionStreamDispatcherServerInner: ISessionStreamDispatcher

+ 1 - 1
Server/Hotfix/Demo/Session/SessionStreamDispatcherServerOuter.cs → Apps/Hotfix/Server/Session/SessionStreamDispatcherServerOuter.cs

@@ -1,7 +1,7 @@
 using System;
 using System.IO;
 
-namespace ET
+namespace ET.Server
 {
     [SessionStreamDispatcher(SessionStreamDispatcherType.SessionStreamDispatcherServerOuter)]
     public class SessionStreamDispatcherServerOuter: ISessionStreamDispatcher

+ 1 - 1
Server/Hotfix/Demo/SessionPlayerComponentSystem.cs → Apps/Hotfix/Server/SessionPlayerComponentSystem.cs

@@ -1,6 +1,6 @@
 
 
-namespace ET
+namespace ET.Server
 {
 	public static class SessionPlayerComponentSystem
 	{

+ 1 - 1
Server/Hotfix/Demo/Transfer/TransferHelper.cs → Apps/Hotfix/Server/Transfer/TransferHelper.cs

@@ -1,4 +1,4 @@
-namespace ET
+namespace ET.Server
 {
     public static class TransferHelper
     {

+ 2 - 2
Server/Hotfix/Demo/Unit/UnitEnterSightRange_NotifyClient.cs → Apps/Hotfix/Server/Unit/UnitEnterSightRange_NotifyClient.cs

@@ -1,4 +1,4 @@
-namespace ET
+namespace ET.Server
 {
     // 进入视野通知
     [Event]
@@ -22,7 +22,7 @@
 
             Unit ub = b.GetParent<Unit>();
 
-            UnitHelper.NoticeUnitAdd(ua, ub);
+            Server.UnitHelper.NoticeUnitAdd(ua, ub);
         }
     }
 }

+ 1 - 1
Server/Hotfix/Demo/Unit/UnitFactory.cs → Apps/Hotfix/Server/Unit/UnitFactory.cs

@@ -1,7 +1,7 @@
 using System;
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
     public static class UnitFactory
     {

+ 1 - 1
Server/Hotfix/Demo/Unit/UnitHelper.cs → Apps/Hotfix/Server/Unit/UnitHelper.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using UnityEngine;
 
-namespace ET
+namespace ET.Server
 {
     public static class UnitHelper
     {

+ 2 - 2
Server/Hotfix/Demo/Unit/UnitLeaveSightRange_NotifyClient.cs → Apps/Hotfix/Server/Unit/UnitLeaveSightRange_NotifyClient.cs

@@ -1,4 +1,4 @@
-namespace ET
+namespace ET.Server
 {
     // 离开视野
     [Event]
@@ -14,7 +14,7 @@
                 return;
             }
 
-            UnitHelper.NoticeUnitRemove(a.GetParent<Unit>(), b.GetParent<Unit>());
+            Server.UnitHelper.NoticeUnitRemove(a.GetParent<Unit>(), b.GetParent<Unit>());
         }
     }
 }

+ 0 - 0
Server/Hotfix/Watcher/WatcherComponentSystem.cs → Apps/Hotfix/Watcher/WatcherComponentSystem.cs


+ 0 - 0
Server/Hotfix/Watcher/WatcherHelper.cs → Apps/Hotfix/Watcher/WatcherHelper.cs


+ 0 - 0
Server/Model/Server.Model.csproj.user → Apps/Model/App.Model.csproj.user


+ 22 - 45
Server/Model/Server.Model.csproj → Apps/Model/Apps.Model.csproj

@@ -26,32 +26,15 @@
       <Link>Core\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
 
-    <Compile Include="..\..\Unity\Codes\Model\Demo\Unit\UnitType.cs">
-      <Link>Demo\Unit\UnitType.cs</Link>
-    </Compile>
-
-    <Compile Include="..\..\Unity\Codes\Model\Module\Recast\**\*.cs">
+    <Compile Include="..\..\Unity\Codes\Model\Module\Recast\**\*.cs"> 
       <Link>Module\Recast\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
 
-    <Compile Include="..\..\Unity\Codes\Model\Demo\SessionStreamDispatcherType.cs">
-      <Link>Demo\SessionStreamDispatcherType.cs</Link>
-    </Compile>
 
     <Compile Include="..\..\Unity\Assets\Mono\Core\**\*.cs">
       <Link>Core\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
     
-
-    <Compile Include="..\..\Unity\Codes\Model\Demo\Move\MoveComponent.cs">
-      <Link>Demo\Move\MoveComponent.cs</Link>
-    </Compile>
-    
-
-    <Compile Include="..\..\Unity\Codes\Model\Demo\TimerType.cs">
-      <Link>Demo\TimerType.cs</Link>
-    </Compile>
-
     <Compile Include="..\..\Unity\Codes\Model\Module\Config\**\*.cs">
       <Link>Module\Config\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
@@ -66,39 +49,26 @@
     
     <Compile Remove="Libs\**" />
     
-    <Compile Include="..\..\Unity\Codes\Model\Module\ActorLocation\ActorResponse.cs">
-      <Link>Module\ActorLocation\ActorResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\..\Unity\Codes\Model\Module\ActorLocation\IActorLocationMessage.cs">
-      <Link>Module\ActorLocation\IActorLocationMessage.cs</Link>
-    </Compile>
-    <Compile Include="..\..\Unity\Codes\Model\Module\Actor\IActorMessage.cs">
-      <Link>Module\Actor\IActorMessage.cs</Link>
-    </Compile>
+    <Compile Remove="..\..\Unity\Codes\Model\Share\**" />
+    
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="..\..\Unity\Assets\Mono\Module\NetworkTCP\**\*.cs">
-      <Link>Module\NetworkTCP\%(RecursiveDir)%(FileName)%(Extension)</Link>
-    </Compile>
-    <Compile Include="..\..\Unity\Codes\Model\Module\Numeric\INumericWatcher.cs">
-      <Link>Module\Numeric\INumericWatcher.cs</Link>
-    </Compile>
-    <Compile Include="..\..\Unity\Codes\Model\Module\Numeric\NumericComponent.cs">
-      <Link>Module\Numeric\NumericComponent.cs</Link>
+
+    <Compile Include="..\..\Unity\Codes\Model\Module\Actor\**\*.cs">
+      <Link>Module\Actor\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Codes\Model\Module\Numeric\NumericType.cs">
-      <Link>Module\Numeric\NumericType.cs</Link>
+
+    <Compile Include="..\..\Unity\Codes\Model\Module\ActorLocation\**\*.cs">
+      <Link>Module\ActorLocation\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Codes\Model\Module\Numeric\NumericWatcherAttribute.cs">
-      <Link>Module\Numeric\NumericWatcherAttribute.cs</Link>
+    
+    <Compile Include="..\..\Unity\Assets\Mono\Module\NetworkTCP\**\*.cs">
+      <Link>Module\NetworkTCP\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Codes\Model\Module\Numeric\NumericWatcherComponent.cs">
-      <Link>Module\Numeric\NumericWatcherComponent.cs</Link>
+    <Compile Include="..\..\Unity\Codes\Model\Module\Numeric\**\*.cs">
+      <Link>Module\Numeric\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
-  </ItemGroup>
-
-  <ItemGroup>
-
+    
     <Compile Include="..\..\Unity\Assets\Mono\Module\Network\**\*.cs">
       <Link>Module\Network\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
@@ -110,6 +80,13 @@
     <Compile Include="..\..\Unity\Assets\Mono\Module\Message\**\*.cs">
       <Link>Module\Message\%(RecursiveDir)%(FileName)%(Extension)</Link>
     </Compile>
+
+    <Compile Include="..\..\Unity\Codes\Model\Client\**\*.cs">
+      <Link>Client\%(RecursiveDir)%(FileName)%(Extension)</Link>
+    </Compile>
+    <Compile Include="..\..\Unity\Codes\Model\Share\**\*.cs">
+      <Link>Share\%(RecursiveDir)%(FileName)%(Extension)</Link>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\ThirdParty\ETTask\ETTask.csproj" />

+ 0 - 0
Server/Model/Base/DllHelper.cs → Apps/Model/Base/DllHelper.cs


+ 0 - 0
Server/Model/Base/MongoHelper.cs → Apps/Model/Base/MongoHelper.cs


+ 0 - 0
Server/Model/Base/MongoRegister.cs → Apps/Model/Base/MongoRegister.cs


+ 0 - 0
Server/Model/Base/StructBsonSerialize.cs → Apps/Model/Base/StructBsonSerialize.cs


+ 0 - 0
Server/Model/Generate/Config/AIConfig.cs → Apps/Model/Generate/Config/AIConfig.cs


+ 0 - 0
Server/Model/Generate/Config/StartMachineConfig.cs → Apps/Model/Generate/Config/StartMachineConfig.cs


+ 0 - 0
Server/Model/Generate/Config/StartProcessConfig.cs → Apps/Model/Generate/Config/StartProcessConfig.cs


+ 0 - 0
Server/Model/Generate/Config/StartSceneConfig.cs → Apps/Model/Generate/Config/StartSceneConfig.cs


+ 0 - 0
Server/Model/Generate/Config/StartZoneConfig.cs → Apps/Model/Generate/Config/StartZoneConfig.cs


+ 0 - 0
Server/Model/Generate/Config/UnitConfig.cs → Apps/Model/Generate/Config/UnitConfig.cs


+ 0 - 0
Server/Model/Generate/ConfigPartial/StartProcessConfig.cs → Apps/Model/Generate/ConfigPartial/StartProcessConfig.cs


+ 0 - 0
Server/Model/Generate/ConfigPartial/StartSceneConfig.cs → Apps/Model/Generate/ConfigPartial/StartSceneConfig.cs


+ 0 - 0
Server/Model/Generate/Message/InnerMessage.cs → Apps/Model/Generate/Message/InnerMessage.cs


+ 0 - 0
Server/Model/Generate/Message/InnerOpcode.cs → Apps/Model/Generate/Message/InnerOpcode.cs


+ 0 - 0
Server/Model/Generate/Message/MongoMessage.cs → Apps/Model/Generate/Message/MongoMessage.cs


+ 0 - 0
Server/Model/Generate/Message/MongoOpcode.cs → Apps/Model/Generate/Message/MongoOpcode.cs


+ 0 - 0
Server/Model/Generate/Message/OuterMessage.cs → Apps/Model/Generate/Message/OuterMessage.cs


+ 0 - 0
Server/Model/Generate/Message/OuterOpcode.cs → Apps/Model/Generate/Message/OuterOpcode.cs


+ 0 - 0
Server/Model/Module/Actor/AMActorHandler.cs → Apps/Model/Module/Actor/AMActorHandler.cs


+ 0 - 0
Server/Model/Module/Actor/AMActorRpcHandler.cs → Apps/Model/Module/Actor/AMActorRpcHandler.cs


+ 0 - 0
Server/Model/Module/Actor/ActorMessageAttribute.cs → Apps/Model/Module/Actor/ActorMessageAttribute.cs


+ 0 - 0
Server/Model/Module/Actor/ActorMessageDispatcherComponent.cs → Apps/Model/Module/Actor/ActorMessageDispatcherComponent.cs


+ 0 - 0
Server/Model/Module/Actor/ActorMessageHandlerAttribute.cs → Apps/Model/Module/Actor/ActorMessageHandlerAttribute.cs


+ 0 - 0
Server/Model/Module/Actor/ActorMessageSender.cs → Apps/Model/Module/Actor/ActorMessageSender.cs


+ 0 - 0
Server/Model/Module/Actor/ActorMessageSenderComponent.cs → Apps/Model/Module/Actor/ActorMessageSenderComponent.cs


+ 0 - 0
Server/Model/Module/Actor/IMActorHandler.cs → Apps/Model/Module/Actor/IMActorHandler.cs


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff