mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-11-25 08:33:54 +01:00
fix payout calcs
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user