mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
update: Add DefaultServerIP in config
This commit is contained in:
parent
6928f57111
commit
eaab9e3000
3 changed files with 6 additions and 2 deletions
|
|
@ -287,6 +287,7 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"DefaultServerIP": "",
|
||||
"ChatLog": {
|
||||
"ChatLog_Enable": true,
|
||||
"ChatLog_ExcludeMessageContains": "!./",
|
||||
|
|
|
|||
|
|
@ -303,6 +303,9 @@ public class CS2_SimpleAdminConfig : BasePluginConfig
|
|||
[JsonPropertyName("MenuConfig")]
|
||||
public MenuConfig MenuConfigs { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("DefaultServerIP")]
|
||||
public string DefaultServerIP { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("ChatLog")]
|
||||
public ChatLog ChatLog { get; set; } = new ChatLog();
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class ServerManager
|
|||
}
|
||||
}
|
||||
|
||||
var address = $"{ipAddress}:{ConVar.Find("hostport")?.GetPrimitiveValue<int>()}";
|
||||
string? address = !string.IsNullOrWhiteSpace(CS2_SimpleAdmin.Instance.Config.DefaultServerIP) ? CS2_SimpleAdmin.Instance.Config.DefaultServerIP : $"{ipAddress}:{ConVar.Find("hostport")?.GetPrimitiveValue<int>()}";
|
||||
var hostname = ConVar.Find("hostname")!.StringValue;
|
||||
var rcon = ConVar.Find("rcon_password")!.StringValue;
|
||||
CS2_SimpleAdmin.IpAddress = address;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue