db.d: count_users() with filtering by any numeric field #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, two existing functions are repurposed to get the number of users who are
privileged
orbanned
for informational display in soulsetup, but these functions could also be, for example, to count/list all users having at least a certain amount offolders
, whosespeed
is between a given range, or any other kind of simple lookup query that is likely to be needed.count_users()
with filtering based on a range of minimum/maximum values of any givenfilter_field
get_usernames()
with filtering based on a range of minimum/maximum values of any givenfilter_field
get_all_usernames()
unused function that was not referenced anywhereOutput of "Server info" in soulsetup:
If the
filter_field
argument is omitted, then all users are counted/retrieved regardless of their min or max values. I.e. total.If any integer
filter_field
is specified, then by default users are counted/retrieved whose field value is non-zero.If a string
filter_field
's is specified, then the nature of the results are undefined, but in any case it is only integers that need to be supported.