Small change.
This commit is contained in:
parent
d670871a4f
commit
241d596178
@ -45,23 +45,20 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
public static void Parse(string line)
|
public static void Parse(string line)
|
||||||
{
|
{
|
||||||
string output = string.Empty;
|
string output = string.Empty;
|
||||||
string command;
|
|
||||||
string parameters;
|
|
||||||
var found = false;
|
var found = false;
|
||||||
|
|
||||||
if (line == null) return;
|
if (line == null) return;
|
||||||
if (line.Trim() == string.Empty) return;
|
if (line.Trim() == string.Empty) return;
|
||||||
|
|
||||||
if (!ExtractCommandAndParameters(line, out command, out parameters))
|
if (!ExtractCommandAndParameters(line, out var command, out var parameters))
|
||||||
{
|
{
|
||||||
output = "Unknown command: " + line;
|
output = "Unknown command: " + line;
|
||||||
Logger.Error(output);
|
Logger.Error(output);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var pair in CommandGroups)
|
foreach (var pair in CommandGroups.Where(pair => pair.Key.Name == command))
|
||||||
{
|
{
|
||||||
if (pair.Key.Name != command) continue;
|
|
||||||
output = pair.Value.Handle(parameters);
|
output = pair.Value.Handle(parameters);
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@ -73,10 +70,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output != string.Empty)
|
Logger.Success(output != string.Empty ? output : "Command executed successfully.");
|
||||||
Logger.Success(output);
|
|
||||||
else
|
|
||||||
Logger.Success("Command executed successfully.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
user.block.title