Cuberite Forum

Full Version: Question about FindAndDoWithPlayer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm working on fixing Core issue #135, and the documentation for FindAndDoWithPlayer seems lacking.

Is it case-sensitive or insensitive?
It's case-insensitive. It uses the RateCompareString function, and that compares each character by making them uppercase first: https://github.com/mc-server/MCServer/bl...s.cpp#L303
Great, thanks for the solution.

Actually, thinking about this problem with plugins in general, I think we need a function DoWithClosestMatchedPlayer. Lots of functions require this and they all implement it slightly differently, inconsistently enough to be annoying to end users.

Do you think this is something that we need?
Isn't that what FindAndDoWithPlayer does?
You're right, I read through the code and it does do that.

Then I need to change the documentation, it says that it'll run the callback on all matching players.