add db commands and test payout (worked!)

This commit is contained in:
jwinterm
2025-11-23 13:33:04 -05:00
parent fa61d60bc0
commit deca4a4685
20 changed files with 403 additions and 1277 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ class AddressManager {
if (this.gameModeManager) {
try {
await this.gameModeManager.setUserPayoutAddress(socketId, pending);
this.broadcastManager?.sendStatusUpdate(socketId, 'success', 'Payout address saved.');
// this.broadcastManager?.sendStatusUpdate(socketId, 'success', 'Payout address saved.'); // Removed duplicate
this.io.to(socketId).emit('address_confirmed', { address: pending, message: 'Payout address saved.' });
} catch (e) {
const normalized = normalizeError?.(e, 'Failed to save address') || e;
@@ -105,7 +105,7 @@ class AddressManager {
}
} else {
this.pending.delete(socketId);
this.broadcastManager?.sendStatusUpdate(socketId, 'success', 'Payout address accepted (session only).');
// this.broadcastManager?.sendStatusUpdate(socketId, 'success', 'Payout address accepted (session only).'); // Removed duplicate
this.io.to(socketId).emit('address_confirmed', { address: pending, message: 'Payout address accepted (session only).' });
}
if (this.onConfirmed) {
+1 -1
View File
@@ -1,6 +1,6 @@
/**
* Broadcast Manager Module
* Handles all socket.io event broadcasting for the Wowngeon game server
* Handles all socket.io event broadcasting for the Wownerogue game server
* Supports current player-specific events and future spectator broadcasting
*/
+1 -1
View File
@@ -241,7 +241,7 @@ class ConnectionHandler {
this.io.to(socket.id).emit('blockheight', { blockHeight: currentBlock });
// Send connection status
this.broadcastManager.sendStatusUpdate(socket.id, 'connection', 'Connected to Wowngeon server');
this.broadcastManager.sendStatusUpdate(socket.id, 'connection', 'Connected to Wownerogue server');
}
_cleanupExistingMappings(socketId, clientId) {
+6 -1
View File
@@ -1,6 +1,6 @@
/**
* Socket Event Handlers Module
* Handles all socket.io event processing for the Wowngeon game server
* Handles all socket.io event processing for the Wownerogue game server
*/
const user = require('../db/user');
@@ -313,6 +313,11 @@ class SocketHandlers {
const connectionResult = await this.connectionHandler.handleConnection(socket);
if (!connectionResult) return; // Connection was rejected or failed
// Send game mode info to client
if (this.gameModeManager) {
socket.emit('game_mode_info', this.gameModeManager.getGameModeInfo());
}
// Register event handlers
socket.on('chat message', (msg) => this.chatHandler.handleChatMessage(socket, msg, {
handleGameQueue: (socket) => this.queueHandler.handleGameQueue(socket, (socketId) => this.connectionHandler.getUserBySocket(socketId)),