Added getOnlinePlayersFromNation function for API use #9
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.
Description:
I added a getOnlinePlayersFromNation function to help improve efficiency of checking online players from a nation. Right now you have to manually comb through every single player in a nation and check if "isOnline" is true. I am in a nation with around 500 players and with sending 1 request per second it takes around 8.5 minutes to get a list of only around 12 players. The API also cannot handle shorter intervals as it returns an HTTP 429, "Too many requests." If this gets approved I plan on sending another pull request in the API repo.
New Nodes/Commands/ConfigOptions:
Relevant Towny Issue ticket:
By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.