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": {
|
||||||
"ChatLog_Enable": true,
|
"ChatLog_Enable": true,
|
||||||
"ChatLog_ExcludeMessageContains": "!./",
|
"ChatLog_ExcludeMessageContains": "!./",
|
||||||
|
|
|
||||||
|
|
@ -303,6 +303,9 @@ public class CS2_SimpleAdminConfig : BasePluginConfig
|
||||||
[JsonPropertyName("MenuConfig")]
|
[JsonPropertyName("MenuConfig")]
|
||||||
public MenuConfig MenuConfigs { get; set; } = new();
|
public MenuConfig MenuConfigs { get; set; } = new();
|
||||||
|
|
||||||
|
[JsonPropertyName("DefaultServerIP")]
|
||||||
|
public string DefaultServerIP { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("ChatLog")]
|
[JsonPropertyName("ChatLog")]
|
||||||
public ChatLog ChatLog { get; set; } = new ChatLog();
|
public ChatLog ChatLog { get; set; } = new ChatLog();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,11 @@ 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 hostname = ConVar.Find("hostname")!.StringValue;
|
||||||
var rcon = ConVar.Find("rcon_password")!.StringValue;
|
var rcon = ConVar.Find("rcon_password")!.StringValue;
|
||||||
CS2_SimpleAdmin.IpAddress = address;
|
CS2_SimpleAdmin.IpAddress = address;
|
||||||
|
|
||||||
CS2_SimpleAdmin._logger?.LogInformation("Loaded server with ip {ip}", ipAddress);
|
CS2_SimpleAdmin._logger?.LogInformation("Loaded server with ip {ip}", ipAddress);
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue