Hub Routing Overhaul
This update fully rewrites and stabilizes the hub routing and fallback system.
Focus: reliability, smooth player flow, and clean messaging.
✨ Improvements
Smart Hub Selection
- Added intelligent hub selection based on player count
- Automatically routes players to the best available hub
- Supports soft/hard limits for load balancing
Reliable Fallback System
- Players are now correctly routed when any server goes down
- Behavior:
- → Sends to available hub if one exists
- → Sends to fallback only if no hubs are online
- Works globally across all servers
Continuous Hub Detection
- Fallback server now continuously searches for available hubs
- Players are automatically moved when a hub becomes available
- No manual reconnect needed
Connection Throttling
- Added randomized delays (100–500ms) for reconnect attempts
- Added staggered delays (200–1000ms) when many players are waiting
- Prevents hub flooding during mass reconnects
Messaging System
- All routing messages now come from messages.yml
- Clean and consistent user experience
Added messages:
- routing.searching → shown when player enters fallback
- routing.found → shown when a hub is found
- Removed redundant message spam from scheduler
Internal Changes
- Reworked LimboRouterListener for better tracking and cleanup
- Improved FallbackListener routing logic
- Added HubUtil#getBestAvailableHub() for smart selection
- Added HubUtil#isHub() helper method
- Fixed initial join handling via ServerConnectBlockerListener
- Made sendMessage() accessible across components
Fixes
- Fixed players not being routed correctly when servers go down
- Fixed fallback not connecting when hubs are unavailable
- Fixed hub detection inconsistencies
- Fixed message duplication issues
- Fixed improper routing during initial join
Result
- Stable server switching
- Correct fallback behavior
- Smooth recovery from server downtime
- Clean, controlled messaging
- Scalable for large player counts
⬇️ Update Notes
- No config changes required
- Fully backward compatible
- Restart proxy after update (no reload)