diff --git a/soos-client/src/components/town/Town.tsx b/soos-client/src/components/town/Town.tsx index a27cd1d..160725a 100644 --- a/soos-client/src/components/town/Town.tsx +++ b/soos-client/src/components/town/Town.tsx @@ -48,7 +48,7 @@ export const Town = (props: TownProps) => { let townSize = 10, points:string = ""; let svg = null; - switch (gameTown.townLevel) { + switch (gameTown.townLevel + (premove?1:0)) { case 0: case 1: townSize = settlementSize; @@ -85,7 +85,7 @@ export const Town = (props: TownProps) => { // // ); - svg = makeTownSVG(townSize,points,playerColor,highlighted); + svg = makeTownSVG(townSize,points,playerColor,highlighted||premove); const { x, y } = vertexCoordsToPixels(gameTown.coords!); diff --git a/soos-client/src/features/gameView/GameView.tsx b/soos-client/src/features/gameView/GameView.tsx index c83e45f..89c5a6d 100644 --- a/soos-client/src/features/gameView/GameView.tsx +++ b/soos-client/src/features/gameView/GameView.tsx @@ -75,12 +75,12 @@ export const GameView = (props: GameViewProps) => { socket.emit('playerId', receivePlayerId); socket.on('updateGameState', updateGameState); - socket.on('premoves', setPremoves); + socket.on('setPremoves', setPremoves); return () => { // socket.off("playerId", receivePlayerId); socket.off('updateGameState', updateGameState); - socket.off('premoves', setPremoves); + socket.off('setPremoves', setPremoves); }; }, []); @@ -105,8 +105,9 @@ export const GameView = (props: GameViewProps) => { resources={game.players[playerId].cards} closeWindowHandler={() => setIsTradeWindowShowing(false)} executeTradeHandler={(tradeIn: number, tradeFor: number) => { - game.executeTrade(tradeIn, tradeFor, playerId); - game.forceUpdate(); + //game.executeTrade(tradeIn, tradeFor, playerId); + //game.forceUpdate(); + socket.emit('trade',tradeIn,tradeFor); }} />, ); @@ -166,8 +167,9 @@ export const GameView = (props: GameViewProps) => {