Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecs): Allow command names to be case-insensitive #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/SampSharp.Entities/SAMP/Commands/CommandServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
private readonly IEntityManager _entityManager;
private readonly int _prefixParameters;

private readonly Dictionary<string, List<CommandData>> _commands = new();
private readonly Dictionary<string, List<CommandData>> _commands = new(StringComparer.OrdinalIgnoreCase);

/// <summary>Initializes a new instance of the <see cref="CommandServiceBase" /> class.</summary>
protected CommandServiceBase(IEntityManager entityManager, int prefixParameters)
Expand Down Expand Up @@ -75,7 +75,7 @@
var result = false;
var invalidParameters = false;

// TODO: Commands in groups would have spaces in them, the logic above would not work.

Check warning on line 78 in src/SampSharp.Entities/SAMP/Commands/CommandServiceBase.cs

View workflow job for this annotation

GitHub Actions / build

Complete the task associated to this 'TODO' comment.

// Skip command name in inputText for the command
inputText = inputText.Substring(name.Length);
Expand Down Expand Up @@ -364,4 +364,4 @@
public MethodInvoker Invoke;
public Type SystemType;
}
}
}
Loading