Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to Control Command Target for Offline Players #11

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

666pyke
Copy link

@666pyke 666pyke commented Oct 28, 2024

This pull request introduces a new configuration option, allow-offline-players-in-commands, that allows server administrators to control whether currency-related commands can be executed on offline players.

  • Added the configuration option allow-offline-players-in-commands to config.yml:

allow-offline-players-in-commands: true

Determines if commands should be usable on offline players.

Note: Changes to this setting require a server restart to take effect.

allow-offline-players-in-commands: true

  • Updated relevant commands (pay, give, take, etc.) to respect this configuration setting.
    Added checks to prevent issuing currency to players who have never joined the server, improving command reliability.

On servers with a large number of players (e.g., 30,000 to 40,000 offline players), executing currency commands on offline players can lead to significant lag. Allowing administrators to control whether commands can target offline players helps mitigate performance issues and provides more flexibility for managing server resources.

For example, trying to give currency to offline players in such scenarios can cause severe lag: https://prnt.sc/q9LQ8fvvebB9

@666pyke 666pyke requested a review from WillFP as a code owner October 28, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant