mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-12-02 11:54:04 +01:00
Fix rewards, make tx hash clickable, add win payout notification, and add entry choice modal
This commit is contained in:
@@ -391,6 +391,17 @@ ALERT_COOLDOWN_MS=3600000
|
||||
# Set to false for Monero stagenet deployments
|
||||
SMIRK_ENABLED=true
|
||||
|
||||
# =============================================================================
|
||||
# SECTION 14b: BLOCK EXPLORER
|
||||
# =============================================================================
|
||||
# URL prefix for linking transaction hashes to a block explorer.
|
||||
# Include the trailing slash. TX hash will be appended directly.
|
||||
# Leave unset to disable clickable TX links in transaction history.
|
||||
#
|
||||
# Wownero: https://explore.wowne.ro/tx/
|
||||
# Monero: https://xmrchain.net/tx/
|
||||
EXPLORER_TX_URL=https://explore.wowne.ro/tx/
|
||||
|
||||
# =============================================================================
|
||||
# SECTION 15: DEVELOPMENT/DEBUG OPTIONS
|
||||
# =============================================================================
|
||||
|
||||
@@ -1071,7 +1071,8 @@ class GameModeManager {
|
||||
allowInCreditsMode: this.configSnapshot?.earlyEntry?.allowInCreditsMode ?? false
|
||||
},
|
||||
// Smirk wallet integration (disabled for Monero stagenet)
|
||||
smirkEnabled: process.env.SMIRK_ENABLED !== 'false'
|
||||
smirkEnabled: process.env.SMIRK_ENABLED !== 'false',
|
||||
explorerTxUrl: process.env.EXPLORER_TX_URL || null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -424,7 +424,7 @@ app.get('/api/user/:socketId/payouts', asyncHandler(async (req, res) => {
|
||||
|
||||
// Calculate total received (confirmed payouts)
|
||||
const totalResult = await db.query(
|
||||
`SELECT COALESCE(SUM(amount), 0) as total_received FROM payouts WHERE user_id = $1 AND status = 'confirmed'`,
|
||||
`SELECT COALESCE(SUM(amount), 0) as total_received FROM payouts WHERE user_id = $1 AND status = 'completed'`,
|
||||
[user.id]
|
||||
);
|
||||
|
||||
|
||||
@@ -463,6 +463,7 @@ class SocketHandlers {
|
||||
}
|
||||
});
|
||||
socket.on('auto_start', () => this.handleAutoStart(socket)); // New handler for start button
|
||||
socket.on('join_queue', () => this.handleJoinQueue(socket)); // Queue instead of auto-start
|
||||
socket.on('early_entry', () => this.handleEarlyEntry(socket)); // Early entry without waiting for block
|
||||
socket.on('address:prompt', () => this.handleAddressPrompt(socket));
|
||||
|
||||
@@ -581,6 +582,32 @@ class SocketHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle join_queue request — adds player to block queue instead of starting immediately
|
||||
*/
|
||||
async handleJoinQueue(socket) {
|
||||
try {
|
||||
await this.queueHandler.handleGameQueue(
|
||||
socket,
|
||||
this.connectionHandler.getUserBySocket.bind(this.connectionHandler)
|
||||
);
|
||||
// queueHandler already emits queue status and adds to queue
|
||||
// Client receives queue_joined event from broadcastManager
|
||||
const pos = this.queueManager.getPlayerIndex(socket.id);
|
||||
if (pos !== -1) {
|
||||
const currentBlock = this.debugManager.getCurrentBlockHeight ? this.debugManager.getCurrentBlockHeight() : 0;
|
||||
socket.emit('queue_joined', {
|
||||
position: pos + 1,
|
||||
currentBlock: currentBlock,
|
||||
nextBlock: currentBlock + 1
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('handleJoinQueue error:', err);
|
||||
this.broadcastManager.sendStatusUpdate(socket.id, 'error', 'Failed to join queue.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle early entry request - start game immediately without waiting for block
|
||||
* Only available for free mode and credits mode (not direct payment mode)
|
||||
|
||||
Reference in New Issue
Block a user