[IDEA] Add Exiled's Player.Get(string) that searches the player by it's partial name
Goal Description
Find the player that's closest to the specified value
Get(string name, bool requiresFullMatch = false)
Notes
https://github.com/ExMod-Team/EXILED/blob/master/EXILED/Exiled.API/Features/Player.cs#L1319
Hello there!
When posting a feature request / idea proposal, we’d prefer if you didn’t just point us to another framework to copy from. :p
Instead, you could use the PR's description to explain a few important details:
- How do you expect string recognition to work?
- Should it return all matches, or just one player?
This would help us understand what you are looking for, then come up with a solution that fits your needs. 🤙
Oh, sorry. Even though it felt kind of "rude" linking, I thought that way could be better understood.
Player.Get(string name, bool requiresFullMatch = false) should return the first person it matches based on lexicographic order, For example, using "audio": Claudio0,Claudio1 → Claudio0 should be the first returned claudio0,Claudio0 → Claudio0 should be the first returned
If it were to return a list of some sort it would be worse since most of the time you would just only need a single player If I needed multiple players, I would simply use Player.List.Where()
Also, if requiresFullMatch is true and either no player matches exactly, or multiple matches partially, it should return null
I hope it's clearer now, and again, I'm sorry for just linking that implementation.
Resolved in 14.1.3 Thank you for your feedback on LabAPI!