mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
make the version name match the actual name for FTP deployment
fix rare issue with summing session scores copy font to expected wwwroot dir in debug mode so we get pretty icons when developing upgrade some packages pretty much reworked the entire server web config to support better validation and stuff.. not really a small fix finish web configuration changes (I think) finish up configuration changes and update shared library nuget
This commit is contained in:
@ -5,6 +5,7 @@ using IW4MAdmin.Application.RconParsers;
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Commands;
|
||||
using SharedLibraryCore.Configuration;
|
||||
using SharedLibraryCore.Configuration.Validation;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.Models;
|
||||
using SharedLibraryCore.Dtos;
|
||||
@ -277,7 +278,7 @@ namespace IW4MAdmin.Application
|
||||
if (newConfig.Servers == null)
|
||||
{
|
||||
ConfigHandler.Set(newConfig);
|
||||
newConfig.Servers = new List<ServerConfiguration>();
|
||||
newConfig.Servers = new ServerConfiguration[1];
|
||||
|
||||
do
|
||||
{
|
||||
@ -292,7 +293,7 @@ namespace IW4MAdmin.Application
|
||||
serverConfig.AddEventParser(parser);
|
||||
}
|
||||
|
||||
newConfig.Servers.Add((ServerConfiguration)serverConfig.Generate());
|
||||
newConfig.Servers[0] = (ServerConfiguration)serverConfig.Generate();
|
||||
} while (Utilities.PromptBool(Utilities.CurrentLocalization.LocalizationIndex["SETUP_SERVER_SAVE"]));
|
||||
|
||||
config = newConfig;
|
||||
@ -314,6 +315,17 @@ namespace IW4MAdmin.Application
|
||||
await ConfigHandler.Save();
|
||||
}
|
||||
|
||||
var validator = new ApplicationConfigurationValidator();
|
||||
var validationResult = validator.Validate(config);
|
||||
|
||||
if (!validationResult.IsValid)
|
||||
{
|
||||
throw new ConfigurationException(Utilities.CurrentLocalization.LocalizationIndex["MANAGER_CONFIGURATION_ERROR"])
|
||||
{
|
||||
Errors = validationResult.Errors.Select(_error => _error.ErrorMessage).ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
foreach (var serverConfig in config.Servers)
|
||||
{
|
||||
Migration.ConfigurationMigration.ModifyLogPath020919(serverConfig);
|
||||
@ -336,7 +348,7 @@ namespace IW4MAdmin.Application
|
||||
}
|
||||
}
|
||||
|
||||
if (config.Servers.Count == 0)
|
||||
if (config.Servers.Length == 0)
|
||||
{
|
||||
throw new ServerException("A server configuration in IW4MAdminSettings.json is invalid");
|
||||
}
|
||||
@ -584,7 +596,7 @@ namespace IW4MAdmin.Application
|
||||
throw lastException;
|
||||
}
|
||||
|
||||
if (successServers != config.Servers.Count)
|
||||
if (successServers != config.Servers.Length)
|
||||
{
|
||||
if (!Utilities.PromptBool(Utilities.CurrentLocalization.LocalizationIndex["MANAGER_START_WITH_ERRORS"]))
|
||||
{
|
||||
|
Reference in New Issue
Block a user