Skip to content

Commit ea58264

Browse files
committed
refactor(配置): 将DiscoveryCenterIp重命名为DiscoveryCenterHost
统一使用Host代替Ip来更准确地描述发现中心地址属性,提高代码可读性和一致性
1 parent e9218e0 commit ea58264

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

GameFrameX.Launcher/StartUp/AppStartUpGame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected override void Init()
104104
MinModuleId = 10,
105105
HttpIsDevelopment = true,
106106
MaxModuleId = 9999,
107-
DiscoveryCenterIp = "127.0.0.1",
107+
DiscoveryCenterHost = "127.0.0.1",
108108
DiscoveryCenterPort = 21001,
109109
DataBaseUrl = "mongodb+srv://gameframex:f9v42aU9DVeFNfAF@gameframex.8taphic.mongodb.net/?retryWrites=true&w=majority",
110110
DataBaseName = "gameframex",

GameFrameX.StartUp/Options/LauncherOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ public sealed class LauncherOptions
376376
/// <summary>
377377
/// 发现中心地址
378378
/// </summary>
379-
[Option(nameof(DiscoveryCenterIp), Description = "发现中心地址")]
380-
public string DiscoveryCenterIp { get; set; }
379+
[Option(nameof(DiscoveryCenterHost), Description = "发现中心地址")]
380+
public string DiscoveryCenterHost { get; set; }
381381

382382
/// <summary>
383383
/// 发现中心端口

GameFrameX.Utility/Setting/AppSetting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public string ToFormatString()
352352
/// <summary>
353353
/// 发现中心地址
354354
/// </summary>
355-
public string DiscoveryCenterIp { get; set; }
355+
public string DiscoveryCenterHost { get; set; }
356356

357357
/// <summary>
358358
/// 发现中心端口

Tests/GameFrameX.Tests/Utility/AppSettingTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ public void DatabaseAndServiceProperties_CanBeSet_ShouldUpdateValues()
417417
appSetting.DataBaseName = "GameDB";
418418
appSetting.Language = "zh-CN";
419419
appSetting.DataCenter = "Beijing";
420-
appSetting.DiscoveryCenterIp = "192.168.1.200";
420+
appSetting.DiscoveryCenterHost = "192.168.1.200";
421421
appSetting.DiscoveryCenterPort = 8500;
422422

423423

@@ -426,7 +426,7 @@ public void DatabaseAndServiceProperties_CanBeSet_ShouldUpdateValues()
426426
Assert.Equal("GameDB", appSetting.DataBaseName);
427427
Assert.Equal("zh-CN", appSetting.Language);
428428
Assert.Equal("Beijing", appSetting.DataCenter);
429-
Assert.Equal("192.168.1.200", appSetting.DiscoveryCenterIp);
429+
Assert.Equal("192.168.1.200", appSetting.DiscoveryCenterHost);
430430
Assert.Equal((ushort)8500, appSetting.DiscoveryCenterPort);
431431
}
432432

0 commit comments

Comments
 (0)