fix payout calcs

This commit is contained in:
jwinterm
2025-12-24 20:03:26 -05:00
parent 0ff95d3142
commit 2c781ec043
4 changed files with 49 additions and 3 deletions
+24
View File
@@ -94,6 +94,7 @@ const SocketHandlers = {
socket.on('payment_detected', this.onPaymentDetected);
socket.on('show_payment_options', this.onShowPaymentOptions);
socket.on('credits_update', this.onCreditsUpdate);
socket.on('user_count', this.onUserCount);
// Block height handler
socket.on('blockheight', this.onBlockHeight);
@@ -704,6 +705,29 @@ const SocketHandlers = {
}
},
onUserCount: function(data) {
if (!data || typeof data.count !== 'number') return;
SocketHandlers._updateUserCountDisplay(data.count);
},
_updateUserCountDisplay: function(count) {
let el = document.getElementById('userCountDisplay');
if (!el) {
// Create display element next to connection status
const statusDiv = document.querySelector('.status') || document.getElementById('connectionStatus')?.parentElement;
if (statusDiv) {
el = document.createElement('div');
el.id = 'userCountDisplay';
el.style.cssText = 'font-size:12px;color:#0af;margin-top:2px;';
statusDiv.appendChild(el);
}
}
if (el) {
const plural = count === 1 ? '' : 's';
el.innerHTML = `👥 <span style="color:#4ade80;">${count}</span> player${plural} online`;
}
},
// ====== SPECTATOR HANDLERS ======
_spectatorMode: false,