mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-11-26 00:53:53 +01:00
add db commands and test payout (worked!)
This commit is contained in:
@@ -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,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
|
||||
*/
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user