diff --git a/Application/ApplicationManager.cs b/Application/ApplicationManager.cs
index a1b8cd665..6c15459bc 100644
--- a/Application/ApplicationManager.cs
+++ b/Application/ApplicationManager.cs
@@ -1,5 +1,6 @@
using IW4MAdmin.Application.API.Master;
using IW4MAdmin.Application.EventParsers;
+using IW4MAdmin.Application.Extensions;
using IW4MAdmin.Application.Misc;
using IW4MAdmin.Application.RconParsers;
using SharedLibraryCore;
@@ -427,13 +428,13 @@ namespace IW4MAdmin.Application
else
{
- var unsavedCommands = _commands.Where(_cmd => !cmdConfig.Commands.Keys.Contains(_cmd.GetType().Name));
+ var unsavedCommands = _commands.Where(_cmd => !cmdConfig.Commands.Keys.Contains(_cmd.CommandConfigNameForType()));
commandsToAddToConfig.AddRange(unsavedCommands);
}
foreach (var cmd in commandsToAddToConfig)
{
- cmdConfig.Commands.Add(cmd.GetType().Name,
+ cmdConfig.Commands.Add(cmd.CommandConfigNameForType(),
new CommandProperties()
{
Name = cmd.Name,
diff --git a/Application/Extensions/CommandExtensions.cs b/Application/Extensions/CommandExtensions.cs
new file mode 100644
index 000000000..ca27dfb30
--- /dev/null
+++ b/Application/Extensions/CommandExtensions.cs
@@ -0,0 +1,21 @@
+using IW4MAdmin.Application.Misc;
+using SharedLibraryCore.Interfaces;
+using System.Linq;
+
+namespace IW4MAdmin.Application.Extensions
+{
+ public static class CommandExtensions
+ {
+ ///
+ /// determines the command configuration name for given manager command
+ ///
+ /// command to determine config name for
+ ///
+ public static string CommandConfigNameForType(this IManagerCommand command)
+ {
+ return command.GetType() == typeof(ScriptCommand) ?
+ $"{char.ToUpper(command.Name[0])}{command.Name.Substring(1)}Command" :
+ command.GetType().Name;
+ }
+ }
+}