From d626a7156d101d4d8391d7d347be11665b1ee84d Mon Sep 17 00:00:00 2001 From: qornwh1 Date: Thu, 12 Mar 2026 16:09:13 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EB=B3=B4=EC=8A=A4=20=EC=B1=84?= =?UTF-8?q?=EB=84=90=EC=9D=80=20=EC=95=88=EB=9D=84=EC=9A=B4=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EchoClientTester/EchoClientTester.csproj | 6 +++++ ClientTester/EchoClientTester/Program.cs | 22 +++++++++++++++++-- MMOTestServer/MMOserver/Game/GameServer.cs | 5 +++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ClientTester/EchoClientTester/EchoClientTester.csproj b/ClientTester/EchoClientTester/EchoClientTester.csproj index 6c44a04..4a782ef 100644 --- a/ClientTester/EchoClientTester/EchoClientTester.csproj +++ b/ClientTester/EchoClientTester/EchoClientTester.csproj @@ -8,6 +8,12 @@ ClientTester + + + Always + + + diff --git a/ClientTester/EchoClientTester/Program.cs b/ClientTester/EchoClientTester/Program.cs index 512ee14..1720943 100644 --- a/ClientTester/EchoClientTester/Program.cs +++ b/ClientTester/EchoClientTester/Program.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using ClientTester.DummyService; using ClientTester.EchoDummyService; using ClientTester.StressTest; @@ -8,9 +9,23 @@ class EcoClientTester { public static string SERVER_IP = "localhost"; public static int SERVER_PORT = 9500; - public static readonly string CONNECTION_KEY = "test"; + public static string CONNECTION_KEY = ""; public static int CLIENT_COUNT = 50; + private static void LoadConfig() + { + string path = Path.Combine(AppContext.BaseDirectory, "appsettings.json"); + if (!File.Exists(path)) return; + + using JsonDocument doc = JsonDocument.Parse(File.ReadAllText(path)); + JsonElement root = doc.RootElement; + + if (root.TryGetProperty("ServerIp", out JsonElement ip)) SERVER_IP = ip.GetString() ?? SERVER_IP; + if (root.TryGetProperty("ServerPort", out JsonElement port)) SERVER_PORT = port.GetInt32(); + if (root.TryGetProperty("ConnectionKey", out JsonElement key)) CONNECTION_KEY = key.GetString() ?? CONNECTION_KEY; + if (root.TryGetProperty("ClientCount", out JsonElement count)) CLIENT_COUNT = count.GetInt32(); + } + private async Task StartEchoDummyTest() { try @@ -151,6 +166,9 @@ class EcoClientTester // 유니코드 문자(═, ║ 등) 콘솔 깨짐 방지 Console.OutputEncoding = System.Text.Encoding.UTF8; + // appsettings.json 에서 설정 로드 + LoadConfig(); + // 크래시 덤프 핸들러 (Release: .log + .dmp / Debug: .log) CrashDumpHandler.Register(); @@ -169,7 +187,7 @@ class EcoClientTester if (args.Length > 0 && args[0].Equals("stress", StringComparison.OrdinalIgnoreCase)) { // 기본값 - CLIENT_COUNT = 50; + // CLIENT_COUNT = 50; int duration = 60; int sendInterval = 100; int rampInterval = 1000; diff --git a/MMOTestServer/MMOserver/Game/GameServer.cs b/MMOTestServer/MMOserver/Game/GameServer.cs index 5bec060..8aec1e8 100644 --- a/MMOTestServer/MMOserver/Game/GameServer.cs +++ b/MMOTestServer/MMOserver/Game/GameServer.cs @@ -216,6 +216,11 @@ public class GameServer : ServerBase continue; } + if (channel.ChannelId >= 1000) + { + continue; + } + ChannelInfo info = new ChannelInfo(); info.ChannelId = channel.ChannelId; info.ChannelUserCount = channel.UserCount;