tanghai пре 2 година
родитељ
комит
e91635acb7
41 измењених фајлова са 207 додато и 43 уклоњено
  1. BIN
      Config/Excel/cs/StartConfig/Benchmark/StartProcessConfigCategory.bytes
  2. BIN
      Config/Excel/cs/StartConfig/Benchmark/StartSceneConfigCategory.bytes
  3. BIN
      Config/Excel/s/StartConfig/Benchmark/StartProcessConfigCategory.bytes
  4. BIN
      Config/Excel/s/StartConfig/Benchmark/StartSceneConfigCategory.bytes
  5. 4 0
      Config/Json/cs/StartConfig/Benchmark/StartProcessConfig.txt
  6. 7 3
      Config/Json/cs/StartConfig/Benchmark/StartSceneConfig.txt
  7. 4 0
      Config/Json/s/StartConfig/Benchmark/StartProcessConfig.txt
  8. 7 3
      Config/Json/s/StartConfig/Benchmark/StartSceneConfig.txt
  9. 0 9
      DotNet/Core/DotNet.Core.csproj
  10. BIN
      Unity/Assets/Config/Excel/StartConfig/Benchmark/StartProcessConfig@s.xlsx
  11. BIN
      Unity/Assets/Config/Excel/StartConfig/Benchmark/StartSceneConfig@s.xlsx
  12. 0 1
      Unity/Assets/Scripts/Core/Entity/SceneType.cs
  13. 2 2
      Unity/Assets/Scripts/Hotfix/Client/Module/Message/NetClientComponentSystem.cs
  14. 8 0
      Unity/Assets/Scripts/Hotfix/Server/Benchmark.meta
  15. 4 15
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/BenchmarkClientComponentSystem.cs
  16. 1 1
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/BenchmarkClientComponentSystem.cs.meta
  17. 13 0
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/BenchmarkServerComponentSystem.cs
  18. 11 0
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/BenchmarkServerComponentSystem.cs.meta
  19. 0 1
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/C2G_BenchmarkHandler.cs
  20. 1 1
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/C2G_BenchmarkHandler.cs.meta
  21. 27 0
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkClient.cs
  22. 11 0
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkClient.cs.meta
  23. 27 0
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkServer.cs
  24. 11 0
      Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkServer.cs.meta
  25. 1 3
      Unity/Assets/Scripts/Hotfix/Server/Demo/Gate/NetServerComponentOnReadEvent.cs
  26. 2 0
      Unity/Assets/Scripts/Hotfix/Server/Module/ActorLocation/ActorMessageLocationHandler.cs
  27. 1 1
      Unity/Assets/Scripts/Hotfix/Server/Module/Message/NetServerComponentSystem.cs
  28. 3 0
      Unity/Assets/Scripts/Hotfix/Share/Module/Actor/ActorMessageHandler.cs
  29. 5 0
      Unity/Assets/Scripts/Model/Generate/ClientServer/ConfigPartial/StartSceneConfig.cs
  30. 5 0
      Unity/Assets/Scripts/Model/Generate/Server/ConfigPartial/StartSceneConfig.cs
  31. 8 0
      Unity/Assets/Scripts/Model/Server/Benchmark.meta
  32. 0 0
      Unity/Assets/Scripts/Model/Server/Benchmark/BenchmarkClientComponent.cs
  33. 0 0
      Unity/Assets/Scripts/Model/Server/Benchmark/BenchmarkClientComponent.cs.meta
  34. 0 0
      Unity/Assets/Scripts/Model/Server/Benchmark/BenchmarkServerComponent.cs
  35. 0 0
      Unity/Assets/Scripts/Model/Server/Benchmark/BenchmarkServerComponent.cs.meta
  36. 1 1
      Unity/Assets/Scripts/Model/Server/Module/Message/MessageHandler.cs
  37. 1 0
      Unity/Assets/Scripts/Model/Share/Entry.cs
  38. 29 0
      Unity/Assets/Scripts/Model/Share/Module/Message/LogMsg.cs
  39. 11 0
      Unity/Assets/Scripts/Model/Share/Module/Message/LogMsg.cs.meta
  40. 1 1
      Unity/Assets/Scripts/Model/Share/Module/Message/Session.cs
  41. 1 1
      Unity/ProjectSettings/ProjectSettings.asset

BIN
Config/Excel/cs/StartConfig/Benchmark/StartProcessConfigCategory.bytes


BIN
Config/Excel/cs/StartConfig/Benchmark/StartSceneConfigCategory.bytes


BIN
Config/Excel/s/StartConfig/Benchmark/StartProcessConfigCategory.bytes


BIN
Config/Excel/s/StartConfig/Benchmark/StartSceneConfigCategory.bytes


+ 4 - 0
Config/Json/cs/StartConfig/Benchmark/StartProcessConfig.txt

@@ -2,4 +2,8 @@
 [1, {"_t":"StartProcessConfig","_id":1,"MachineId":1}],
 [2, {"_t":"StartProcessConfig","_id":2,"MachineId":1}],
 [3, {"_t":"StartProcessConfig","_id":3,"MachineId":1}],
+[4, {"_t":"StartProcessConfig","_id":4,"MachineId":1}],
+[5, {"_t":"StartProcessConfig","_id":5,"MachineId":1}],
+[6, {"_t":"StartProcessConfig","_id":6,"MachineId":1}],
+[7, {"_t":"StartProcessConfig","_id":7,"MachineId":1}],
 ]}

+ 7 - 3
Config/Json/cs/StartConfig/Benchmark/StartSceneConfig.txt

@@ -1,5 +1,9 @@
 {"dict": [
-[1, {"_t":"StartSceneConfig","_id":1,"Process":1,"Zone":1,"SceneType":"BenchmarkServer","Name":"BenchmarkServer","Port":30001}],
-[2, {"_t":"StartSceneConfig","_id":2,"Process":2,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient1","Port":30002}],
-[3, {"_t":"StartSceneConfig","_id":3,"Process":3,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient2","Port":30003}],
+[1, {"_t":"StartSceneConfig","_id":1,"Process":1,"Zone":1,"SceneType":"BenchmarkServer","Name":"BenchmarkServer","Port":10001}],
+[2, {"_t":"StartSceneConfig","_id":2,"Process":2,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient1","Port":0}],
+[3, {"_t":"StartSceneConfig","_id":3,"Process":3,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient2","Port":0}],
+[4, {"_t":"StartSceneConfig","_id":4,"Process":4,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient3","Port":0}],
+[5, {"_t":"StartSceneConfig","_id":5,"Process":5,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient4","Port":0}],
+[6, {"_t":"StartSceneConfig","_id":6,"Process":6,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient5","Port":0}],
+[7, {"_t":"StartSceneConfig","_id":7,"Process":7,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient6","Port":0}],
 ]}

+ 4 - 0
Config/Json/s/StartConfig/Benchmark/StartProcessConfig.txt

@@ -2,4 +2,8 @@
 [1, {"_t":"StartProcessConfig","_id":1,"MachineId":1}],
 [2, {"_t":"StartProcessConfig","_id":2,"MachineId":1}],
 [3, {"_t":"StartProcessConfig","_id":3,"MachineId":1}],
+[4, {"_t":"StartProcessConfig","_id":4,"MachineId":1}],
+[5, {"_t":"StartProcessConfig","_id":5,"MachineId":1}],
+[6, {"_t":"StartProcessConfig","_id":6,"MachineId":1}],
+[7, {"_t":"StartProcessConfig","_id":7,"MachineId":1}],
 ]}

+ 7 - 3
Config/Json/s/StartConfig/Benchmark/StartSceneConfig.txt

@@ -1,5 +1,9 @@
 {"dict": [
-[1, {"_t":"StartSceneConfig","_id":1,"Process":1,"Zone":1,"SceneType":"BenchmarkServer","Name":"BenchmarkServer","Port":30001}],
-[2, {"_t":"StartSceneConfig","_id":2,"Process":2,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient1","Port":30002}],
-[3, {"_t":"StartSceneConfig","_id":3,"Process":3,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient2","Port":30003}],
+[1, {"_t":"StartSceneConfig","_id":1,"Process":1,"Zone":1,"SceneType":"BenchmarkServer","Name":"BenchmarkServer","Port":10001}],
+[2, {"_t":"StartSceneConfig","_id":2,"Process":2,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient1","Port":0}],
+[3, {"_t":"StartSceneConfig","_id":3,"Process":3,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient2","Port":0}],
+[4, {"_t":"StartSceneConfig","_id":4,"Process":4,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient3","Port":0}],
+[5, {"_t":"StartSceneConfig","_id":5,"Process":5,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient4","Port":0}],
+[6, {"_t":"StartSceneConfig","_id":6,"Process":6,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient5","Port":0}],
+[7, {"_t":"StartSceneConfig","_id":7,"Process":7,"Zone":1,"SceneType":"BenchmarkClient","Name":"BenchmarkClient6","Port":0}],
 ]}

+ 0 - 9
DotNet/Core/DotNet.Core.csproj

@@ -39,14 +39,5 @@
       <ProjectReference Include="..\..\Share\Share.SourceGenerator\Share.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
       <ProjectReference Include="..\ThirdParty\DotNet.ThirdParty.csproj" />
     </ItemGroup>
-    
-    <ItemGroup>
-      <Folder Include="..\..\Unity\Assets\Scripts\Core\Fiber\Module\Console\">
-        <Link>Core\Fiber\Module\Console</Link>
-      </Folder>
-      <Folder Include="..\..\Unity\Assets\Scripts\Core\World\Module\Console\">
-        <Link>Core\World\Module\Console</Link>
-      </Folder>
-    </ItemGroup>
 
 </Project>

BIN
Unity/Assets/Config/Excel/StartConfig/Benchmark/StartProcessConfig@s.xlsx


BIN
Unity/Assets/Config/Excel/StartConfig/Benchmark/StartSceneConfig@s.xlsx


+ 0 - 1
Unity/Assets/Scripts/Core/Entity/SceneType.cs

@@ -18,7 +18,6 @@ namespace ET
 		Robot = 1 << 10,
 		BenchmarkClient = 1 << 11,
 		BenchmarkServer = 1 << 12,
-		Benchmark = 1 << 13,
 		Match = 1 << 14,
 		Room = 1 << 15,
 		LockStepClient = 1 << 16,

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

@@ -77,7 +77,7 @@ namespace ET.Client
             long channelId = NetServices.Instance.CreateConnectChannelId();
             Session session = self.AddChildWithId<Session, AService>(channelId, self.AService);
             session.RemoteAddress = realIPEndPoint;
-            if (self.IScene.SceneType != SceneType.Benchmark)
+            if (self.IScene.SceneType != SceneType.BenchmarkClient)
             {
                 session.AddComponent<SessionIdleCheckerComponent>();
             }
@@ -91,7 +91,7 @@ namespace ET.Client
             long channelId = localConn;
             Session session = self.AddChildWithId<Session, AService>(channelId, self.AService);
             session.RemoteAddress = realIPEndPoint;
-            if (self.IScene.SceneType != SceneType.Benchmark)
+            if (self.IScene.SceneType != SceneType.BenchmarkClient)
             {
                 session.AddComponent<SessionIdleCheckerComponent>();
             }

+ 8 - 0
Unity/Assets/Scripts/Hotfix/Server/Benchmark.meta

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

+ 4 - 15
Unity/Assets/Scripts/Hotfix/Server/Demo/Benchmark/BenchmarkClientComponentSystem.cs → Unity/Assets/Scripts/Hotfix/Server/Benchmark/BenchmarkClientComponentSystem.cs

@@ -10,7 +10,7 @@ namespace ET.Server
         [EntitySystem]
         private static void Awake(this BenchmarkClientComponent self)
         {
-            for (int i = 0; i < 50; ++i)
+            for (int i = 0; i < 10; ++i)
             {
                 self.Start().Coroutine();
             }
@@ -18,23 +18,13 @@ namespace ET.Server
 
         private static async ETTask Start(this BenchmarkClientComponent self)
         {
-            await ETTask.CompletedTask;
-            /*
-            await self.Fiber().GetComponent<TimerComponent>().WaitAsync(1000);
-
-            
-            
-            Scene scene = await SceneFactory.CreateServerScene(self, self.Fiber().IdGenerater.GenerateId(), self.Fiber().IdGenerater.GenerateInstanceId(),
-                self.DomainZone(), "bechmark", SceneType.Benchmark);
-            
-            Client.NetClientComponent netClientComponent = scene.AddComponent<Client.NetClientComponent, AddressFamily>(AddressFamily.InterNetwork);
-
-            using Session session = netClientComponent.Create(StartSceneConfigCategory.Instance.BenchmarkServer.OuterIPPort);
+            NetClientComponent netClientComponent = self.Root().GetComponent<NetClientComponent>();
+            using Session session = netClientComponent.Create(StartSceneConfigCategory.Instance.Benchmark.OuterIPPort);
             List<ETTask> list = new List<ETTask>(100000);
 
             async ETTask Call(Session s)
             {
-                using G2C_Benchmark benchmark = await s.Call(C2G_Benchmark.Create(true)) as G2C_Benchmark;
+                using G2C_Benchmark benchmark = await s.Call(C2G_Benchmark.Create()) as G2C_Benchmark;
             }
             
             for (int j = 0; j < 100000000; ++j)
@@ -46,7 +36,6 @@ namespace ET.Server
                 }
                 await ETTaskHelper.WaitAll(list);
             }
-            */
         }
     }
 }

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Server/Demo/Benchmark/BenchmarkClientComponentSystem.cs.meta → Unity/Assets/Scripts/Hotfix/Server/Benchmark/BenchmarkClientComponentSystem.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 9a7a85a66452bf3488c137e5c2caaf2a
+guid: b3ad1eddb5065964d947fec7292db9c7
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 13 - 0
Unity/Assets/Scripts/Hotfix/Server/Benchmark/BenchmarkServerComponentSystem.cs

@@ -0,0 +1,13 @@
+using System.Net;
+
+namespace ET.Server
+{
+    [EntitySystemOf(typeof(BenchmarkServerComponent))]
+    public static partial class BenchmarkServerComponentSystem
+    {
+        [EntitySystem]
+        private static void Awake(this BenchmarkServerComponent self)
+        {
+        }
+    }
+}

+ 11 - 0
Unity/Assets/Scripts/Hotfix/Server/Benchmark/BenchmarkServerComponentSystem.cs.meta

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

+ 0 - 1
Unity/Assets/Scripts/Hotfix/Server/Demo/Benchmark/C2G_BenchmarkHandler.cs → Unity/Assets/Scripts/Hotfix/Server/Benchmark/C2G_BenchmarkHandler.cs

@@ -7,7 +7,6 @@ namespace ET.Server
     {
         protected override async ETTask Run(Session session, C2G_Benchmark request, G2C_Benchmark response)
         {
-            using C2G_Benchmark _ = request;
             BenchmarkServerComponent benchmarkServerComponent = session.Scene().GetComponent<BenchmarkServerComponent>();
             if (benchmarkServerComponent.Count++ % 1000000 == 0)
             {

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Server/Demo/Benchmark/C2G_BenchmarkHandler.cs.meta → Unity/Assets/Scripts/Hotfix/Server/Benchmark/C2G_BenchmarkHandler.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: f26aed201cdde2142bab5f5c301087e9
+guid: 126a4d951160c2d43a641b7da3a0840c
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

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

@@ -0,0 +1,27 @@
+using System.Net;
+using System.Net.Sockets;
+using ET.Client;
+
+namespace ET.Server
+{
+    [Invoke((long)SceneType.BenchmarkClient)]
+    public class FiberInit_BenchmarkClient: 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<ActorInnerComponent>();
+            //root.AddComponent<ActorSenderComponent>();
+            //root.AddComponent<PlayerComponent>();
+            //root.AddComponent<GateSessionKeyComponent>();
+            //root.AddComponent<LocationProxyComponent>();
+            //root.AddComponent<ActorLocationSenderComponent>();
+            root.AddComponent<NetClientComponent, AddressFamily>(AddressFamily.InterNetwork);
+            root.AddComponent<BenchmarkClientComponent>();
+            await ETTask.CompletedTask;
+        }
+    }
+}

+ 11 - 0
Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkClient.cs.meta

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

+ 27 - 0
Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkServer.cs

@@ -0,0 +1,27 @@
+using System.Net;
+using System.Net.Sockets;
+using ET.Client;
+
+namespace ET.Server
+{
+    [Invoke((long)SceneType.BenchmarkServer)]
+    public class FiberInit_BenchmarkServer: 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<ActorInnerComponent>();
+            //root.AddComponent<ActorSenderComponent>();
+            //root.AddComponent<PlayerComponent>();
+            //root.AddComponent<GateSessionKeyComponent>();
+            //root.AddComponent<LocationProxyComponent>();
+            //root.AddComponent<ActorLocationSenderComponent>();
+            root.AddComponent<NetServerComponent, IPEndPoint>(StartSceneConfigCategory.Instance.Benchmark.OuterIPPort);
+            root.AddComponent<BenchmarkServerComponent>();
+            await ETTask.CompletedTask;
+        }
+    }
+}

+ 11 - 0
Unity/Assets/Scripts/Hotfix/Server/Benchmark/FiberInit_BenchmarkServer.cs.meta

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

+ 1 - 3
Unity/Assets/Scripts/Hotfix/Server/Demo/Gate/NetServerComponentOnReadEvent.cs

@@ -1,6 +1,6 @@
 namespace ET.Server
 {
-    [Event(SceneType.Realm | SceneType.Gate)]
+    [Event(SceneType.Realm | SceneType.Gate | SceneType.BenchmarkServer)]
     public class NetServerComponentOnReadEvent: AEvent<Scene, NetServerComponentOnRead>
     {
         protected override async ETTask Run(Scene scene, NetServerComponentOnRead args)
@@ -8,13 +8,11 @@
             Session session = args.Session;
             object message = args.Message;
             Scene root = scene.Root();
-
             if (message is IResponse response)
             {
                 session.OnResponse(response);
                 return;
             }
-			
             // 根据消息接口判断是不是Actor消息,不同的接口做不同的处理,比如需要转发给Chat Scene,可以做一个IChatMessage接口
             switch (message)
             {

+ 2 - 0
Unity/Assets/Scripts/Hotfix/Server/Module/ActorLocation/ActorMessageLocationHandler.cs

@@ -9,6 +9,7 @@ namespace ET.Server
 
         public async ETTask Handle(Entity entity, Address fromAddress, MessageObject actorMessage)
         {
+            using MessageObject _ = actorMessage;
             if (actorMessage is not Message message)
             {
                 Log.Error($"消息类型转换错误: {actorMessage.GetType().FullName} to {typeof (Message).Name}");
@@ -49,6 +50,7 @@ namespace ET.Server
         {
             try
             {
+                using MessageObject _ = actorMessage;
                 if (actorMessage is not Request request)
                 {
                     Log.Error($"消息类型转换错误: {actorMessage.GetType().FullName} to {typeof (Request).Name}");

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Server/Module/Message/NetServerComponentSystem.cs

@@ -64,7 +64,7 @@ namespace ET.Server
             }
             session.LastRecvTime = self.Fiber().TimeInfo.ClientNow();
             
-            Log.Debug(message.ToJson());
+            LogMsg.Instance.Debug(message);
 			
             EventSystem.Instance.Publish(self.Scene(), new NetServerComponentOnRead() {Session = session, Message = message});
         }

+ 3 - 0
Unity/Assets/Scripts/Hotfix/Share/Module/Actor/ActorMessageHandler.cs

@@ -9,6 +9,7 @@ namespace ET
 
         public async ETTask Handle(Entity entity, Address fromAddress, MessageObject actorMessage)
         {
+            using MessageObject _ = actorMessage;
             if (actorMessage is not Message msg)
             {
                 Log.Error($"消息类型转换错误: {actorMessage.GetType().FullName} to {typeof (Message).Name}");
@@ -51,6 +52,8 @@ namespace ET
         {
             try
             {
+                using MessageObject _ = actorMessage;
+                
                 if (actorMessage is not Request request)
                 {
                     Log.Error($"消息类型转换错误: {actorMessage.GetType().FullName} to {typeof (Request).Name}");

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

@@ -26,6 +26,8 @@ namespace ET
 
         public StartSceneConfig Match;
         
+        public StartSceneConfig Benchmark;
+        
         public List<StartSceneConfig> GetByProcess(int process)
         {
             return this.ProcessScenes[process];
@@ -74,6 +76,9 @@ namespace ET
                     case SceneType.Match:
                         this.Match = startSceneConfig;
                         break;
+                    case SceneType.BenchmarkServer:
+                        this.Benchmark = startSceneConfig;
+                        break;
                 }
             }
         }

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

@@ -25,6 +25,8 @@ namespace ET
         public List<StartSceneConfig> Maps = new();
 
         public StartSceneConfig Match;
+
+        public StartSceneConfig Benchmark;
         
         public List<StartSceneConfig> GetByProcess(int process)
         {
@@ -74,6 +76,9 @@ namespace ET
                     case SceneType.Match:
                         this.Match = startSceneConfig;
                         break;
+                    case SceneType.BenchmarkServer:
+                        this.Benchmark = startSceneConfig;
+                        break;
                 }
             }
         }

+ 8 - 0
Unity/Assets/Scripts/Model/Server/Benchmark.meta

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

+ 0 - 0
Unity/Assets/Scripts/Model/Server/Demo/Benchmark/BenchmarkClientComponent.cs → Unity/Assets/Scripts/Model/Server/Benchmark/BenchmarkClientComponent.cs


+ 0 - 0
Unity/Assets/Scripts/Model/Server/Demo/Benchmark/BenchmarkClientComponent.cs.meta → Unity/Assets/Scripts/Model/Server/Benchmark/BenchmarkClientComponent.cs.meta


+ 0 - 0
Unity/Assets/Scripts/Model/Server/Demo/Benchmark/BenchmarkServerComponent.cs → Unity/Assets/Scripts/Model/Server/Benchmark/BenchmarkServerComponent.cs


+ 0 - 0
Unity/Assets/Scripts/Model/Server/Demo/Benchmark/BenchmarkServerComponent.cs.meta → Unity/Assets/Scripts/Model/Server/Benchmark/BenchmarkServerComponent.cs.meta


+ 1 - 1
Unity/Assets/Scripts/Model/Server/Module/Message/MessageHandler.cs

@@ -15,7 +15,7 @@ namespace ET.Server
         {
             try
             {
-                Request request = message as Request;
+                using Request request = message as Request;
                 if (request == null)
                 {
                     throw new Exception($"消息类型转换错误: {message.GetType().FullName} to {typeof (Request).FullName}");

+ 1 - 0
Unity/Assets/Scripts/Model/Share/Entry.cs

@@ -49,6 +49,7 @@ namespace ET
             World.Instance.AddSingleton<ActorMessageDispatcherComponent>();
             World.Instance.AddSingleton<NetServices>();
             World.Instance.AddSingleton<NavmeshComponent>();
+            World.Instance.AddSingleton<LogMsg>();
             
             World.Instance.AddSingleton<FiberManager>();
             

+ 29 - 0
Unity/Assets/Scripts/Model/Share/Module/Message/LogMsg.cs

@@ -0,0 +1,29 @@
+using System.Collections.Generic;
+
+namespace ET
+{
+    public class LogMsg: Singleton<LogMsg>, ISingletonAwake
+    {
+        private readonly HashSet<ushort> ignore = new()
+        {
+            OuterMessage.C2G_Ping, 
+            OuterMessage.G2C_Ping, 
+            OuterMessage.C2G_Benchmark, 
+            OuterMessage.G2C_Benchmark,
+        };
+
+        public void Awake()
+        {
+        }
+
+        public void Debug(object msg)
+        {
+            ushort opcode = OpcodeType.Instance.GetOpcode(msg.GetType());
+            if (this.ignore.Contains(opcode))
+            {
+                return;
+            }
+            Logger.Instance.Debug(msg.ToString());
+        }
+    }
+}

+ 11 - 0
Unity/Assets/Scripts/Model/Share/Module/Message/LogMsg.cs.meta

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

+ 1 - 1
Unity/Assets/Scripts/Model/Share/Module/Message/Session.cs

@@ -140,7 +140,7 @@ namespace ET
         public static void Send(this Session self, ActorId actorId, IMessage message)
         {
             self.LastSendTime = self.Fiber().TimeInfo.ClientNow();
-            Log.Debug(message.ToString());
+            LogMsg.Instance.Debug(message);
             self.AService.Send(self.Id, actorId, message as MessageObject);
         }
     }

+ 1 - 1
Unity/ProjectSettings/ProjectSettings.asset

@@ -839,7 +839,7 @@ PlayerSettings:
   webGLDecompressionFallback: 0
   webGLPowerPreference: 2
   scriptingDefineSymbols:
-    Android: UNITY;ENABLE_VIEW;ENABLE_DLL
+    Android: UNITY;ENABLE_DLL
     Server: UNITY;ENABLE_DLL;ENABLE_VIEW
     Standalone: UNITY;ENABLE_DLL;ENABLE_VIEW
     WebGL: UNITY;ENABLE_DLL;ENABLE_VIEW