LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[IDEA] Add Exiled's Player.Get(string) that searches the player by it's partial name

Open Unbistrackted opened this issue 1 year ago • 3 comments

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

Unbistrackted avatar Apr 05 '25 23:04 Unbistrackted

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. 🤙

ImBeryl avatar Apr 09 '25 17:04 ImBeryl

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.

Unbistrackted avatar Apr 09 '25 22:04 Unbistrackted

Resolved in 14.1.3 Thank you for your feedback on LabAPI!

davidsebesta1 avatar Aug 01 '25 21:08 davidsebesta1