1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

use default settings for maps and quick messages config (remove from IW4MAdminSettings)

This commit is contained in:
RaidMax
2021-07-09 16:50:33 -05:00
parent b63803885b
commit 7a9704b1dc
7 changed files with 48 additions and 34 deletions

View File

@ -613,7 +613,7 @@ namespace IW4MAdmin
{
try
{
message = Manager.GetApplicationSettings().Configuration()
message = _serviceProvider.GetRequiredService<DefaultSettings>()
.QuickMessages
.First(_qm => _qm.Game == GameName)
.Messages[E.Data.Substring(1)];
@ -1138,8 +1138,14 @@ namespace IW4MAdmin
{
Manager.GetApplicationSettings().Configuration().ContactUri = Website;
}
var defaultConfig = _serviceProvider.GetRequiredService<DefaultSettings>();
var gameMaps = defaultConfig?.Maps?.FirstOrDefault(map => map.Game == GameName);
InitializeMaps();
if (gameMaps != null)
{
Maps.AddRange(gameMaps.Maps);
}
WorkingDirectory = basepath.Value;
this.Hostname = hostname;