debug payouts

This commit is contained in:
jwinterm
2025-12-24 20:54:07 -05:00
parent 371945fc21
commit b062a1a5fa
3 changed files with 11 additions and 5 deletions
+1
View File
@@ -706,6 +706,7 @@ const SocketHandlers = {
},
onUserCount: function(data) {
console.log('👥 User count received:', data);
if (!data || typeof data.count !== 'number') return;
SocketHandlers._updateUserCountDisplay(data.count);
},
+5
View File
@@ -242,6 +242,11 @@ class GameModeManager {
: (multipliers.escape ?? 0);
const amount = Math.round(base * multiplier);
console.log(`🧮 calculatePayout: mode=${normalizedMode}, usingCredits=${usingCredits}, treasureFound=${treasureFound}`);
console.log(` base=${base}, multipliers=${JSON.stringify(multipliers)}, chosen multiplier=${multiplier}`);
console.log(` final amount=${amount} (base * multiplier = ${base} * ${multiplier})`);
return { amount, multiplier, base };
}
+5 -5
View File
@@ -25,11 +25,11 @@ class BroadcastManager {
count = this.io.engine.clientsCount || 0;
}
// Only broadcast if count changed to avoid spam
if (count !== this._lastUserCount) {
this._lastUserCount = count;
this.io.emit('user_count', { count });
}
console.log(`👥 Broadcasting user count: ${count} (last was ${this._lastUserCount})`);
// Always broadcast to ensure new clients get the count
this._lastUserCount = count;
this.io.emit('user_count', { count });
}
/**