8000 change_pop_level_calculations by QuentinGruber · Pull Request #2639 · QuentinGruber/h1z1-server · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

change_pop_level_calculations #2639

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

Merged
merged 1 commit into from
Jun 15, 2025
Merged

Conversation

QuentinGruber
Copy link
Owner
@QuentinGruber QuentinGruber commented Jun 15, 2025

TL;DR

Refactored server population level calculation into a utility function.

What changed?

  • Extracted population level calculation logic from LoginServer class into a new utility function getPopLevel in utils.ts
  • Updated the population thresholds for different levels:
    • LOW: ≤ 20 players
    • MEDIUM: 21-50 players
    • HIGH: 51-120 players
    • FULL: ≥ 121 players
  • Commented out the old inline calculation in loginserver.ts

How to test?

  1. Connect to different game servers with varying player populations
  2. Verify that the population level indicators display correctly based on the new thresholds
  3. Check that servers show the correct population status (LOW/MEDIUM/HIGH/FULL) in the server selection UI

Why make this change?

This change improves code maintainability by centralizing the population level calculation logic in a single utility function. It also standardizes the population thresholds across the application, making it easier to adjust these values in the future if needed.

Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@QuentinGruber QuentinGruber marked this pull request as ready for review June 15, 2025 15:31
@QuentinGruber QuentinGruber force-pushed the 06-15-change_pop_level_calculations branch 2 times, most recently from cf2b437 to 6ea21e5 Compare June 15, 2025 15:43
@QuentinGruber QuentinGruber added this to the 0.45.8 milestone Jun 15, 2025
@QuentinGruber QuentinGruber merged commit 990f6dd into dev Jun 15, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0