// Server-side Socket.IO event handlers
// Connection event io.on('connection', (socket) => {
// Player Management socket.on('createPlayer', (playerData) => { /* ... / }); socket.on('updatePlayer', (playerId, playerData) => { / ... */ });
// Game Management socket.on('createGame', (playerIds) => { /* ... / }); socket.on('setupBoard', (gameId) => { / ... / }); socket.on('startGame', (gameId) => { / ... / }); socket.on('endGame', (gameId) => { / ... */ });
// Game Flow socket.on('switchTurn', (gameId) => { /* ... / }); socket.on('checkGameStatus', (gameId) => { / ... / }); socket.on('checkWinCondition', (gameId) => { / ... */ });
// Board Actions socket.on('resetBoard', (gameId) => { /* ... / }); socket.on('updateBoardState', (gameId, boardState) => { / ... / }); socket.on('getAdjacentHexes', (gameId, position) => { / ... / }); socket.on('validateMove', (gameId, fromPosition, toPosition) => { / ... */ });
// Player Actions socket.on('getAvailableMoves', (gameId, playerId) => { /* ... / }); socket.on('addPieceToBoard', (gameId, playerId, position) => { / ... */ });
// Piece Actions socket.on('movePiece', (gameId, pieceId, toPosition) => { /* ... / }); socket.on('attackPiece', (gameId, attackingPieceId, targetPieceId) => { / ... / }); socket.on('removePiece', (gameId, pieceId) => { / ... */ });
// Game State Management socket.on('saveGameState', (gameId) => { /* ... / }); socket.on('loadGameState', (gameId) => { / ... / }); socket.on('exportGame', (gameId) => { / ... / }); socket.on('importGame', (gameData) => { / ... */ });
// History and Events socket.on('logEvent', (gameId, eventData) => { /* ... / }); socket.on('getGameHistory', (gameId) => { / ... / }); socket.on('clearHistory', (gameId) => { / ... */ });
// Game Statistics socket.on('getPiecesInPlay', (gameId) => { /* ... / }); socket.on('getReservePieces', (gameId) => { / ... */ });
// Disconnect event socket.on('disconnect', () => { /* ... */ }); });