feat : 보스 채널은 안띄운다.
This commit is contained in:
@@ -8,6 +8,12 @@
|
|||||||
<RootNamespace>ClientTester</RootNamespace>
|
<RootNamespace>ClientTester</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="appsettings.json">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="LiteNetLib" Version="2.0.2" />
|
<PackageReference Include="LiteNetLib" Version="2.0.2" />
|
||||||
<PackageReference Include="protobuf-net" Version="3.2.56" />
|
<PackageReference Include="protobuf-net" Version="3.2.56" />
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Text.Json;
|
||||||
using ClientTester.DummyService;
|
using ClientTester.DummyService;
|
||||||
using ClientTester.EchoDummyService;
|
using ClientTester.EchoDummyService;
|
||||||
using ClientTester.StressTest;
|
using ClientTester.StressTest;
|
||||||
@@ -8,9 +9,23 @@ class EcoClientTester
|
|||||||
{
|
{
|
||||||
public static string SERVER_IP = "localhost";
|
public static string SERVER_IP = "localhost";
|
||||||
public static int SERVER_PORT = 9500;
|
public static int SERVER_PORT = 9500;
|
||||||
public static readonly string CONNECTION_KEY = "test";
|
public static string CONNECTION_KEY = "";
|
||||||
public static int CLIENT_COUNT = 50;
|
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()
|
private async Task StartEchoDummyTest()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -151,6 +166,9 @@ class EcoClientTester
|
|||||||
// 유니코드 문자(═, ║ 등) 콘솔 깨짐 방지
|
// 유니코드 문자(═, ║ 등) 콘솔 깨짐 방지
|
||||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||||
|
|
||||||
|
// appsettings.json 에서 설정 로드
|
||||||
|
LoadConfig();
|
||||||
|
|
||||||
// 크래시 덤프 핸들러 (Release: .log + .dmp / Debug: .log)
|
// 크래시 덤프 핸들러 (Release: .log + .dmp / Debug: .log)
|
||||||
CrashDumpHandler.Register();
|
CrashDumpHandler.Register();
|
||||||
|
|
||||||
@@ -169,7 +187,7 @@ class EcoClientTester
|
|||||||
if (args.Length > 0 && args[0].Equals("stress", StringComparison.OrdinalIgnoreCase))
|
if (args.Length > 0 && args[0].Equals("stress", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
// 기본값
|
// 기본값
|
||||||
CLIENT_COUNT = 50;
|
// CLIENT_COUNT = 50;
|
||||||
int duration = 60;
|
int duration = 60;
|
||||||
int sendInterval = 100;
|
int sendInterval = 100;
|
||||||
int rampInterval = 1000;
|
int rampInterval = 1000;
|
||||||
|
|||||||
@@ -216,6 +216,11 @@ public class GameServer : ServerBase
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channel.ChannelId >= 1000)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ChannelInfo info = new ChannelInfo();
|
ChannelInfo info = new ChannelInfo();
|
||||||
info.ChannelId = channel.ChannelId;
|
info.ChannelId = channel.ChannelId;
|
||||||
info.ChannelUserCount = channel.UserCount;
|
info.ChannelUserCount = channel.UserCount;
|
||||||
|
|||||||
Reference in New Issue
Block a user