diff options
Diffstat (limited to 'DSACore/Commands/CommandHandler.cs')
-rw-r--r-- | DSACore/Commands/CommandHandler.cs | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/DSACore/Commands/CommandHandler.cs b/DSACore/Commands/CommandHandler.cs index f43633f..6879045 100644 --- a/DSACore/Commands/CommandHandler.cs +++ b/DSACore/Commands/CommandHandler.cs @@ -10,8 +10,8 @@ namespace DSACore.Commands { public static CommandResponse ExecuteCommand(Command cmd) { - string res = string.Empty; - ResponseType type = ResponseType.Broadcast; + var res = string.Empty; + var type = ResponseType.Broadcast; switch (cmd.CmdIdentifier.ToLower()) { case "addChar": @@ -21,7 +21,7 @@ namespace DSACore.Commands case "wert": case "werte": case "char": - res = Commands.HeldList.ListAsync(cmd.CharId, cmd.CmdText); + res = HeldList.ListAsync(cmd.CharId, cmd.CmdText); break; case "help": case "man": @@ -54,23 +54,16 @@ namespace DSACore.Commands case "npc": res = NpcCommands.CreateNpc(cmd.CharId, cmd.CmdTexts, cmd.Cmdmodifier); break; - } - if (res == string.Empty) - { - res= Proben(cmd.Name, cmd.CmdIdentifier, cmd.CmdText, cmd.Cmdmodifier); - } - if (res != string.Empty) - { - return new CommandResponse(res, type); - } + if (res == string.Empty) res = Proben(cmd.Name, cmd.CmdIdentifier, cmd.CmdText, cmd.Cmdmodifier); + if (res != string.Empty) return new CommandResponse(res, type); return new CommandResponse($"Kommando {cmd.CmdIdentifier} nicht gefunden", ResponseType.Error); } private static string Proben(string name, string command, string waffe, int erschwernis = 0) { - string res = string.Empty; + var res = string.Empty; switch (command.ToLower()) { case "f": @@ -138,4 +131,4 @@ namespace DSACore.Commands throw new NotImplementedException("access char by id ore name and group id"); } } -} +}
\ No newline at end of file |