Skip to content

Add ability to control online players along with max players#36

Open
ChimneySwift wants to merge 1 commit into
Crypnotic:masterfrom
ChimneySwift:master
Open

Add ability to control online players along with max players#36
ChimneySwift wants to merge 1 commit into
Crypnotic:masterfrom
ChimneySwift:master

Conversation

@ChimneySwift
Copy link
Copy Markdown

This PR adds options to set online player counts, much like exists for the max player counts.

Adds the following settings:

    online-player-count {
        # The online player count has three different actions:
        #
        # STATIC - online players will always be the value of `online-player-count`
        # PING - online player count shows the sum of all backend servers' online player counts. Cached every 5 minutes
        # CURRENT - online players matches number of players connected to the proxy
        #
        # `online-player-count` is only used with the STATIC action
        action=CURRENT
        online-player-count=32
    }

I run a multi-proxy network (different geographic locations for each), previously each proxy's online player counts were constantly out of sync and didn't represent actual players on the network. For those in a similar situation (who don't have some kind of advanced multi-proxy system), the PING action would be quite useful.

The STATIC option I just implemented incase someone found it useful, and the CURRENT option mimics default behaviour.

Hopefully you can excuse git being strange with the header, not sure what happened there :>

Comment on lines +2 to +24
* This file is part of Neutron, licensed under the MIT License
*
* Copyright (c) 2020 Crypnotic <crypnoticofficial@gmail.com>
* Copyright (c) 2020 Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might I ask why the formatting was changed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah not sure, might have been my editor and I didn't realize until I submitted the PR (not super familiar with git).

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.

2 participants