瀏覽代碼

【优化】1.增加压测配置启动bat;2.优化目录,hotfix与module对应

johnclot69 1 年之前
父節點
當前提交
08f0be292b

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

@@ -22,6 +22,15 @@
         <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     </PropertyGroup>
     <ItemGroup>
+        <Compile Include="..\..\Unity\Assets\Scripts\Codes\Hotfix\Client\Session\NetClientComponentOnReadEvent.cs">
+          <Link>Client\Session\NetClientComponentOnReadEvent.cs</Link>
+        </Compile>
+        <Compile Include="..\..\Unity\Assets\Scripts\Codes\Hotfix\Client\Session\NetClientComponentSystem.cs">
+          <Link>Client\Session\NetClientComponentSystem.cs</Link>
+        </Compile>
+        <Compile Include="..\..\Unity\Assets\Scripts\Codes\Hotfix\Client\Session\SessionComponentSystem.cs">
+          <Link>Client\Session\SessionComponentSystem.cs</Link>
+        </Compile>
         <Compile Include="..\..\Unity\Assets\Scripts\Codes\Hotfix\Share\**\*.cs">
             <Link>Share\%(RecursiveDir)%(FileName)%(Extension)</Link>
         </Compile>

+ 0 - 0
DotNet/Hotfix/Session/NetInnerComponentOnReadEvent.cs → DotNet/Hotfix/Module/Message/NetInnerComponentOnReadEvent.cs


+ 0 - 0
DotNet/Hotfix/Session/NetServerComponentOnReadEvent.cs → DotNet/Hotfix/Module/Message/NetServerComponentOnReadEvent.cs


+ 0 - 0
DotNet/Hotfix/Session/SessionIdleCheckerComponentSystem.cs → DotNet/Hotfix/Module/Message/SessionIdleCheckerComponentSystem.cs


+ 20 - 17
DotNet/Hotfix/Scenes/Benchmark/BenchmarkClientComponentSystem.cs

@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Net.Sockets;
+using ET.Client;
 
 namespace ET.Server
 {
@@ -18,25 +19,27 @@ namespace ET.Server
 
         private static async ETTask Start(this BenchmarkClientComponent self)
         {
-            await ETTask.CompletedTask;
-            //await TimerComponent.Instance.WaitAsync(1000);
+            await TimerComponent.Instance.WaitAsync(1000);
 
-            //Scene scene = await SceneFactory.CreateServerScene(self, IdGenerater.Instance.GenerateId(), IdGenerater.Instance.GenerateInstanceId(),
-            //    self.DomainZone(), "bechmark", SceneType.Benchmark);
-            
-            //NetClientComponent netClientComponent = scene.AddComponent<NetClientComponent, AddressFamily>(AddressFamily.InterNetwork);
+            Scene scene = await SceneFactory.CreateServerScene(self, IdGenerater.Instance.GenerateId(), IdGenerater.Instance.GenerateInstanceId(),
+                self.DomainZone(), "bechmark", SceneType.Benchmark);
 
-            //using Session session = netClientComponent.Create(StartSceneConfigCategory.Instance.BenchmarkServer.OuterIPPort);
-            //List<ETTask<IResponse>> list = new List<ETTask<IResponse>>(100000);
-            //for (int j = 0; j < 100000000; ++j)
-            //{
-            //    list.Clear();
-            //    for (int i = 0; i < list.Capacity; ++i)
-            //    {
-            //        list.Add(session.Call(new C2G_Benchmark()));
-            //    }
-            //    await ETTaskHelper.WaitAll(list);
-            //}
+            NetClientComponent netClientComponent = scene.AddComponent<NetClientComponent, AddressFamily, NetworkProtocol>(
+                AddressFamily.InterNetwork,
+                NetworkProtocol.KCP
+            );
+
+            using Session session = netClientComponent.Create(StartSceneConfigCategory.Instance.BenchmarkServer.OuterIPPort);
+            List<ETTask<IResponse>> list = new List<ETTask<IResponse>>(100000);
+            for (int j = 0; j < 100000000; ++j)
+            {
+                list.Clear();
+                for (int i = 0; i < list.Capacity; ++i)
+                {
+                    list.Add(session.Call(new C2G_Benchmark()));
+                }
+                await ETTaskHelper.WaitAll(list);
+            }
         }
     }
 }

+ 6 - 0
DotNet/Model/DotNet.Model.csproj

@@ -24,6 +24,12 @@
         <Optimize>true</Optimize>
     </PropertyGroup>
     <ItemGroup>
+        <Compile Include="..\..\Unity\Assets\Scripts\Codes\Model\Client\Message\NetClientComponent.cs">
+          <Link>Client\Module\Message\NetClientComponent.cs</Link>
+        </Compile>
+        <Compile Include="..\..\Unity\Assets\Scripts\Codes\Model\Client\Session\SessionComponent.cs">
+          <Link>Client\Session\SessionComponent.cs</Link>
+        </Compile>
         <Compile Include="..\..\Unity\Assets\Scripts\Codes\Model\Share\**\*.cs">
             <Link>Share\%(RecursiveDir)%(FileName)%(Extension)</Link>
         </Compile>

+ 5 - 0
GameServer/启动游戏服-Benchmark配置.bat

@@ -0,0 +1,5 @@
+@echo off
+
+cd DebugBin
+App.exe --AppType=Server --StartConfig=StartConfig/Benchmark
+@pause