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

feat(Server): add a setter for maxPlayers #6261

Open
wants to merge 2 commits into
base: minor-next
Choose a base branch
from

Conversation

cooldogedev
Copy link
Contributor

Introduction

This PR allows plugins to modify the server's max players count during runtime

Relevant issues

Changes

API changes

Added Server::setMaxPlayers(int $maxPlayers): void

Behavioural changes

Backwards compatibility

Follow-up

Tests

I tested this PR by doing the following (tick all that apply):

  • Writing PHPUnit tests (commit these in the tests/phpunit folder)
  • Playtesting using a Minecraft client (provide screenshots or a video)
  • Writing a test plugin (provide the code and sample output)
  • Other (provide details)

@jasonw4331 jasonw4331 added Category: API Related to the plugin API Status: Insufficiently Tested Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Feb 19, 2024
@SOF3
Copy link
Member

SOF3 commented Feb 21, 2024

note that this is a BC break, e.g. for plugins that do a SplFixedArray($server->getMaxPlayers())

@dktapps
Copy link
Member

dktapps commented Feb 21, 2024

does anyone do that?

@BrandPVP
Copy link
Contributor

BrandPVP commented Feb 22, 2024

there is no bc break because there is no such plugins that call setMaxPlayers()

@Wraith0x10
Copy link

rip i was about to make a pr doing this too 🙏

@dktapps dktapps added the BC break Breaks API compatibility label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Breaks API compatibility Category: API Related to the plugin API Status: Insufficiently Tested Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants