From 2bde55ef9cc9b7eeb445bea21b41ed5621ea05be Mon Sep 17 00:00:00 2001 From: Scott Reiter Date: Thu, 18 May 2023 14:50:40 -0500 Subject: [PATCH 1/4] added socket io performance tuning --- client/.eslintcache | 1 - client/package.json | 3 ++- client/yarn.lock | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) delete mode 100644 client/.eslintcache diff --git a/client/.eslintcache b/client/.eslintcache deleted file mode 100644 index 0ca7853..0000000 --- a/client/.eslintcache +++ /dev/null @@ -1 +0,0 @@ -[{"/home/wabamn/dev/apps/gungi.io/client/src/index.tsx":"1","/home/wabamn/dev/apps/gungi.io/client/src/App.tsx":"2","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Header.tsx":"3","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Mobility.tsx":"4","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/StockpilePanel.tsx":"5","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/TowerDetails.tsx":"6","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/TurnIndictor.tsx":"7","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Board.tsx":"8","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Coordinates.tsx":"9","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Square.tsx":"10","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Piece.tsx":"11","/home/wabamn/dev/apps/gungi.io/client/src/pages/Home.tsx":"12","/home/wabamn/dev/apps/gungi.io/client/src/pages/About.tsx":"13","/home/wabamn/dev/apps/gungi.io/client/src/pages/Game.tsx":"14","/home/wabamn/dev/apps/gungi.io/client/src/pages/Contact.tsx":"15","/home/wabamn/dev/apps/gungi.io/client/src/pages/NotFound.tsx":"16","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Footer.tsx":"17","/home/wabamn/dev/apps/gungi.io/client/src/stores/GungiStore.ts":"18","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Empty.tsx":"19","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/HeroParticles.tsx":"20","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Button.tsx":"21","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx":"22","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Wrapper.tsx":"23","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Paragraph.tsx":"24","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Panel.tsx":"25","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/GameButton.tsx":"26","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/LobbyButton.tsx":"27","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx":"28","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx":"29","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Input.tsx":"30","/home/wabamn/dev/apps/gungi.io/client/src/utils/flipBoard.ts":"31","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Title.tsx":"32","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Subtitle.tsx":"33","/home/wabamn/dev/apps/gungi.io/client/src/components/game/GungiGame.tsx":"34","/home/wabamn/dev/apps/gungi.io/client/src/components/game/Login.tsx":"35","/home/wabamn/dev/apps/gungi.io/client/src/components/game/Lobby.tsx":"36","/home/wabamn/dev/apps/gungi.io/client/src/utils/symbolToNameMap.ts":"37","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/MobileWarning.tsx":"38","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/CapturedPanel.tsx":"39","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/PieceIcon.tsx":"40","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/MoveHistory.tsx":"41","/home/wabamn/dev/apps/gungi.io/client/src/typings/types.ts":"42","/home/wabamn/dev/apps/gungi.io/client/src/utils/fileToLetterMap.ts":"43"},{"size":192,"mtime":1613225993839,"results":"44","hashOfConfig":"45"},{"size":726,"mtime":1622385411620,"results":"46","hashOfConfig":"45"},{"size":1753,"mtime":1622472392665,"results":"47","hashOfConfig":"45"},{"size":3056,"mtime":1619959081480,"results":"48","hashOfConfig":"45"},{"size":2637,"mtime":1622468110355,"results":"49","hashOfConfig":"45"},{"size":2780,"mtime":1622898228243,"results":"50","hashOfConfig":"45"},{"size":1152,"mtime":1621120571236,"results":"51","hashOfConfig":"45"},{"size":2544,"mtime":1622473987035,"results":"52","hashOfConfig":"45"},{"size":3351,"mtime":1610889188900,"results":"53","hashOfConfig":"45"},{"size":8301,"mtime":1630157926371,"results":"54","hashOfConfig":"45"},{"size":5435,"mtime":1622374025800,"results":"55","hashOfConfig":"45"},{"size":1583,"mtime":1630158211821,"results":"56","hashOfConfig":"45"},{"size":9495,"mtime":1624114750469,"results":"57","hashOfConfig":"45"},{"size":5182,"mtime":1624117075319,"results":"58","hashOfConfig":"45"},{"size":3365,"mtime":1623510058742,"results":"59","hashOfConfig":"45"},{"size":1589,"mtime":1621607650124,"results":"60","hashOfConfig":"45"},{"size":539,"mtime":1621176736788,"results":"61","hashOfConfig":"45"},{"size":692,"mtime":1621118597436,"results":"62","hashOfConfig":"45"},{"size":480,"mtime":1613426672881,"results":"63","hashOfConfig":"45"},{"size":2620,"mtime":1613321705990,"results":"64","hashOfConfig":"45"},{"size":1089,"mtime":1621636617424,"results":"65","hashOfConfig":"45"},{"size":262,"mtime":1621636591514,"results":"66","hashOfConfig":"45"},{"size":244,"mtime":1613321741598,"results":"67","hashOfConfig":"45"},{"size":303,"mtime":1621636641594,"results":"68","hashOfConfig":"45"},{"size":390,"mtime":1622371722840,"results":"69","hashOfConfig":"45"},{"size":1641,"mtime":1621636610784,"results":"70","hashOfConfig":"45"},{"size":1232,"mtime":1621636592084,"results":"71","hashOfConfig":"45"},{"size":218,"mtime":1613321712763,"results":"72","hashOfConfig":"45"},{"size":249,"mtime":1613321744015,"results":"73","hashOfConfig":"45"},{"size":461,"mtime":1621636628284,"results":"74","hashOfConfig":"45"},{"size":515,"mtime":1613783931529,"results":"75","hashOfConfig":"45"},{"size":423,"mtime":1620484467937,"results":"76","hashOfConfig":"45"},{"size":270,"mtime":1619968862080,"results":"77","hashOfConfig":"45"},{"size":11102,"mtime":1629215589872,"results":"78","hashOfConfig":"45"},{"size":1870,"mtime":1630158203601,"results":"79","hashOfConfig":"45"},{"size":4919,"mtime":1622385499390,"results":"80","hashOfConfig":"45"},{"size":565,"mtime":1622372728080,"results":"81","hashOfConfig":"45"},{"size":572,"mtime":1622898088753,"results":"82","hashOfConfig":"45"},{"size":1658,"mtime":1622898271243,"results":"83","hashOfConfig":"45"},{"size":838,"mtime":1622469690145,"results":"84","hashOfConfig":"45"},{"size":2039,"mtime":1622901055373,"results":"85","hashOfConfig":"45"},{"size":1104,"mtime":1623513245732,"results":"86","hashOfConfig":"45"},{"size":324,"mtime":1622473094955,"results":"87","hashOfConfig":"45"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},"1s6khl8",{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"113","messages":"114","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"115","messages":"116","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"117","messages":"118","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"119","messages":"120","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"121","messages":"122","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"123","messages":"124","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"125","messages":"126","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"127","messages":"128","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"129","messages":"130","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"131","messages":"132","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"133","messages":"134","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"135","messages":"136","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"137","messages":"138","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"139","messages":"140","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"141","messages":"142","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"143","messages":"144","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"145","messages":"146","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"147","messages":"148","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"149","messages":"150","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"151","messages":"152","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"153","messages":"154","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"155","messages":"156","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"157","messages":"158","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"159","messages":"160","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"161","messages":"162","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"163","messages":"164","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"165","messages":"166","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"167","messages":"168","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"169","messages":"170","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"171","messages":"172","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"173","messages":"174","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},"/home/wabamn/dev/apps/gungi.io/client/src/index.tsx",[],["175","176"],"/home/wabamn/dev/apps/gungi.io/client/src/App.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Header.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Mobility.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/StockpilePanel.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/TowerDetails.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/TurnIndictor.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Board.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Coordinates.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Square.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Piece.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/Home.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/About.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/Game.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/Contact.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/NotFound.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Footer.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/stores/GungiStore.ts",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Empty.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/HeroParticles.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Button.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Wrapper.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Paragraph.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Panel.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/GameButton.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/LobbyButton.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Input.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/utils/flipBoard.ts",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Title.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Subtitle.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/game/GungiGame.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/game/Login.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/game/Lobby.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/utils/symbolToNameMap.ts",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/MobileWarning.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/CapturedPanel.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/PieceIcon.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/MoveHistory.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/typings/types.ts",[],"/home/wabamn/dev/apps/gungi.io/client/src/utils/fileToLetterMap.ts",[],{"ruleId":"177","replacedBy":"178"},{"ruleId":"179","replacedBy":"180"},"no-native-reassign",["181"],"no-negated-in-lhs",["182"],"no-global-assign","no-unsafe-negation"] \ No newline at end of file diff --git a/client/package.json b/client/package.json index 088d3ec..60a67ec 100644 --- a/client/package.json +++ b/client/package.json @@ -19,6 +19,7 @@ "react-router-dom": "^5.2.0", "react-scripts": "4.0.1", "socket.io-client": "^3.1.2", + "socket.io-msgpack-parser": "^3.0.2", "styled-components": "^5.2.1", "sweetalert2": "^11.0.16", "sweetalert2-react-content": "^4.0.1", @@ -26,7 +27,7 @@ }, "proxy": "http://localhost:4000", "scripts": { - "start": "react-scripts start", + "start": "rm .eslintcache && react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" diff --git a/client/yarn.lock b/client/yarn.lock index 53f32ab..d535f5b 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -7863,6 +7863,11 @@ normalize-url@^3.0.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== +notepack.io@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/notepack.io/-/notepack.io-2.2.0.tgz#d7ea71d1cb90094f88c6f3c8d84277c2d0cd101c" + integrity sha512-9b5w3t5VSH6ZPosoYnyDONnUTF8o0UkBw7JLA6eBlYJWyGT1Q3vQa8Hmuj1/X6RYvHjjygBDgw6fJhe0JEojfw== + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -10368,6 +10373,14 @@ socket.io-client@^3.1.2: parseuri "0.0.6" socket.io-parser "~4.0.4" +socket.io-msgpack-parser@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/socket.io-msgpack-parser/-/socket.io-msgpack-parser-3.0.2.tgz#34c4d69acd0fa2a0eede98c14e29fa9f6a5b880a" + integrity sha512-1e76bJ1PCKi9H+JiYk+S29PBJvknHjQWM7Mtj0hjF2KxDA6b6rQxv3rTsnwBoz/haZOhlCDIMQvPATbqYeuMxg== + dependencies: + component-emitter "~1.3.0" + notepack.io "~2.2.0" + socket.io-parser@~4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.0.4.tgz#9ea21b0d61508d18196ef04a2c6b9ab630f4c2b0" From ca568a5bc9d691c1bdfd964e7087f0449e6b27ff Mon Sep 17 00:00:00 2001 From: Derek Chapman Date: Thu, 18 May 2023 15:56:04 -0500 Subject: [PATCH 2/4] added highlights for playable spaces --- client/.eslintcache | 2 +- client/src/components/gameboard/Piece.tsx | 4 +- client/src/components/gameboard/Square.tsx | 191 ++++++--------------- client/src/components/hooks/useGetMove.tsx | 109 ++++++++++++ client/src/pages/Game.tsx | 1 + client/src/stores/GungiStore.ts | 1 + 6 files changed, 167 insertions(+), 141 deletions(-) create mode 100644 client/src/components/hooks/useGetMove.tsx diff --git a/client/.eslintcache b/client/.eslintcache index 0ca7853..e484310 100644 --- a/client/.eslintcache +++ b/client/.eslintcache @@ -1 +1 @@ -[{"/home/wabamn/dev/apps/gungi.io/client/src/index.tsx":"1","/home/wabamn/dev/apps/gungi.io/client/src/App.tsx":"2","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Header.tsx":"3","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Mobility.tsx":"4","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/StockpilePanel.tsx":"5","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/TowerDetails.tsx":"6","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/TurnIndictor.tsx":"7","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Board.tsx":"8","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Coordinates.tsx":"9","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Square.tsx":"10","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Piece.tsx":"11","/home/wabamn/dev/apps/gungi.io/client/src/pages/Home.tsx":"12","/home/wabamn/dev/apps/gungi.io/client/src/pages/About.tsx":"13","/home/wabamn/dev/apps/gungi.io/client/src/pages/Game.tsx":"14","/home/wabamn/dev/apps/gungi.io/client/src/pages/Contact.tsx":"15","/home/wabamn/dev/apps/gungi.io/client/src/pages/NotFound.tsx":"16","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Footer.tsx":"17","/home/wabamn/dev/apps/gungi.io/client/src/stores/GungiStore.ts":"18","/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Empty.tsx":"19","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/HeroParticles.tsx":"20","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Button.tsx":"21","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx":"22","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Wrapper.tsx":"23","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Paragraph.tsx":"24","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Panel.tsx":"25","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/GameButton.tsx":"26","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/LobbyButton.tsx":"27","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx":"28","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx":"29","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Input.tsx":"30","/home/wabamn/dev/apps/gungi.io/client/src/utils/flipBoard.ts":"31","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Title.tsx":"32","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Subtitle.tsx":"33","/home/wabamn/dev/apps/gungi.io/client/src/components/game/GungiGame.tsx":"34","/home/wabamn/dev/apps/gungi.io/client/src/components/game/Login.tsx":"35","/home/wabamn/dev/apps/gungi.io/client/src/components/game/Lobby.tsx":"36","/home/wabamn/dev/apps/gungi.io/client/src/utils/symbolToNameMap.ts":"37","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/MobileWarning.tsx":"38","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/CapturedPanel.tsx":"39","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/PieceIcon.tsx":"40","/home/wabamn/dev/apps/gungi.io/client/src/components/ui/MoveHistory.tsx":"41","/home/wabamn/dev/apps/gungi.io/client/src/typings/types.ts":"42","/home/wabamn/dev/apps/gungi.io/client/src/utils/fileToLetterMap.ts":"43"},{"size":192,"mtime":1613225993839,"results":"44","hashOfConfig":"45"},{"size":726,"mtime":1622385411620,"results":"46","hashOfConfig":"45"},{"size":1753,"mtime":1622472392665,"results":"47","hashOfConfig":"45"},{"size":3056,"mtime":1619959081480,"results":"48","hashOfConfig":"45"},{"size":2637,"mtime":1622468110355,"results":"49","hashOfConfig":"45"},{"size":2780,"mtime":1622898228243,"results":"50","hashOfConfig":"45"},{"size":1152,"mtime":1621120571236,"results":"51","hashOfConfig":"45"},{"size":2544,"mtime":1622473987035,"results":"52","hashOfConfig":"45"},{"size":3351,"mtime":1610889188900,"results":"53","hashOfConfig":"45"},{"size":8301,"mtime":1630157926371,"results":"54","hashOfConfig":"45"},{"size":5435,"mtime":1622374025800,"results":"55","hashOfConfig":"45"},{"size":1583,"mtime":1630158211821,"results":"56","hashOfConfig":"45"},{"size":9495,"mtime":1624114750469,"results":"57","hashOfConfig":"45"},{"size":5182,"mtime":1624117075319,"results":"58","hashOfConfig":"45"},{"size":3365,"mtime":1623510058742,"results":"59","hashOfConfig":"45"},{"size":1589,"mtime":1621607650124,"results":"60","hashOfConfig":"45"},{"size":539,"mtime":1621176736788,"results":"61","hashOfConfig":"45"},{"size":692,"mtime":1621118597436,"results":"62","hashOfConfig":"45"},{"size":480,"mtime":1613426672881,"results":"63","hashOfConfig":"45"},{"size":2620,"mtime":1613321705990,"results":"64","hashOfConfig":"45"},{"size":1089,"mtime":1621636617424,"results":"65","hashOfConfig":"45"},{"size":262,"mtime":1621636591514,"results":"66","hashOfConfig":"45"},{"size":244,"mtime":1613321741598,"results":"67","hashOfConfig":"45"},{"size":303,"mtime":1621636641594,"results":"68","hashOfConfig":"45"},{"size":390,"mtime":1622371722840,"results":"69","hashOfConfig":"45"},{"size":1641,"mtime":1621636610784,"results":"70","hashOfConfig":"45"},{"size":1232,"mtime":1621636592084,"results":"71","hashOfConfig":"45"},{"size":218,"mtime":1613321712763,"results":"72","hashOfConfig":"45"},{"size":249,"mtime":1613321744015,"results":"73","hashOfConfig":"45"},{"size":461,"mtime":1621636628284,"results":"74","hashOfConfig":"45"},{"size":515,"mtime":1613783931529,"results":"75","hashOfConfig":"45"},{"size":423,"mtime":1620484467937,"results":"76","hashOfConfig":"45"},{"size":270,"mtime":1619968862080,"results":"77","hashOfConfig":"45"},{"size":11102,"mtime":1629215589872,"results":"78","hashOfConfig":"45"},{"size":1870,"mtime":1630158203601,"results":"79","hashOfConfig":"45"},{"size":4919,"mtime":1622385499390,"results":"80","hashOfConfig":"45"},{"size":565,"mtime":1622372728080,"results":"81","hashOfConfig":"45"},{"size":572,"mtime":1622898088753,"results":"82","hashOfConfig":"45"},{"size":1658,"mtime":1622898271243,"results":"83","hashOfConfig":"45"},{"size":838,"mtime":1622469690145,"results":"84","hashOfConfig":"45"},{"size":2039,"mtime":1622901055373,"results":"85","hashOfConfig":"45"},{"size":1104,"mtime":1623513245732,"results":"86","hashOfConfig":"45"},{"size":324,"mtime":1622473094955,"results":"87","hashOfConfig":"45"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},"1s6khl8",{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"113","messages":"114","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"115","messages":"116","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"117","messages":"118","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"119","messages":"120","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"121","messages":"122","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"123","messages":"124","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"125","messages":"126","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"127","messages":"128","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"129","messages":"130","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"131","messages":"132","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"133","messages":"134","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"135","messages":"136","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"137","messages":"138","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"139","messages":"140","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"141","messages":"142","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"143","messages":"144","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"145","messages":"146","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"147","messages":"148","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"149","messages":"150","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"151","messages":"152","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"153","messages":"154","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"155","messages":"156","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"157","messages":"158","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"159","messages":"160","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"161","messages":"162","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"163","messages":"164","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"165","messages":"166","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"167","messages":"168","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"169","messages":"170","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"171","messages":"172","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},{"filePath":"173","messages":"174","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"90"},"/home/wabamn/dev/apps/gungi.io/client/src/index.tsx",[],["175","176"],"/home/wabamn/dev/apps/gungi.io/client/src/App.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Header.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Mobility.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/StockpilePanel.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/TowerDetails.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/TurnIndictor.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Board.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Coordinates.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Square.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Piece.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/Home.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/About.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/Game.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/Contact.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/pages/NotFound.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/Footer.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/stores/GungiStore.ts",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/gameboard/Empty.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/HeroParticles.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Button.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Wrapper.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Paragraph.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Panel.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/GameButton.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/LobbyButton.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Input.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/utils/flipBoard.ts",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Title.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/styles/Subtitle.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/game/GungiGame.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/game/Login.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/game/Lobby.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/utils/symbolToNameMap.ts",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/MobileWarning.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/CapturedPanel.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/PieceIcon.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/components/ui/MoveHistory.tsx",[],"/home/wabamn/dev/apps/gungi.io/client/src/typings/types.ts",[],"/home/wabamn/dev/apps/gungi.io/client/src/utils/fileToLetterMap.ts",[],{"ruleId":"177","replacedBy":"178"},{"ruleId":"179","replacedBy":"180"},"no-native-reassign",["181"],"no-negated-in-lhs",["182"],"no-global-assign","no-unsafe-negation"] \ No newline at end of file +[{"/Users/djchapman/test stuff/gungi.io/client/src/index.tsx":"1","/Users/djchapman/test stuff/gungi.io/client/src/App.tsx":"2","/Users/djchapman/test stuff/gungi.io/client/src/pages/Home.tsx":"3","/Users/djchapman/test stuff/gungi.io/client/src/pages/About.tsx":"4","/Users/djchapman/test stuff/gungi.io/client/src/pages/Contact.tsx":"5","/Users/djchapman/test stuff/gungi.io/client/src/pages/NotFound.tsx":"6","/Users/djchapman/test stuff/gungi.io/client/src/pages/Game.tsx":"7","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/Footer.tsx":"8","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/Header.tsx":"9","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/Mobility.tsx":"10","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Button.tsx":"11","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx":"12","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Wrapper.tsx":"13","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Panel.tsx":"14","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Paragraph.tsx":"15","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Subtitle.tsx":"16","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Title.tsx":"17","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/HeroParticles.tsx":"18","/Users/djchapman/test stuff/gungi.io/client/src/components/game/GungiGame.tsx":"19","/Users/djchapman/test stuff/gungi.io/client/src/components/game/Login.tsx":"20","/Users/djchapman/test stuff/gungi.io/client/src/components/game/Lobby.tsx":"21","/Users/djchapman/test stuff/gungi.io/client/src/stores/GungiStore.ts":"22","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/CapturedPanel.tsx":"23","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/MoveHistory.tsx":"24","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/GameButton.tsx":"25","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/StockpilePanel.tsx":"26","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx":"27","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/LobbyButton.tsx":"28","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx":"29","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/TurnIndictor.tsx":"30","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/TowerDetails.tsx":"31","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Input.tsx":"32","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/MobileWarning.tsx":"33","/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Board.tsx":"34","/Users/djchapman/test stuff/gungi.io/client/src/utils/symbolToNameMap.ts":"35","/Users/djchapman/test stuff/gungi.io/client/src/utils/fileToLetterMap.ts":"36","/Users/djchapman/test stuff/gungi.io/client/src/typings/types.ts":"37","/Users/djchapman/test stuff/gungi.io/client/src/utils/flipBoard.ts":"38","/Users/djchapman/test stuff/gungi.io/client/src/components/ui/PieceIcon.tsx":"39","/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Piece.tsx":"40","/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Coordinates.tsx":"41","/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Empty.tsx":"42","/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Square.tsx":"43","/Users/djchapman/test stuff/gungi.io/client/src/components/hooks/useGetMove.tsx":"44"},{"size":192,"mtime":1684347705122,"results":"45","hashOfConfig":"46"},{"size":726,"mtime":1684347705100,"results":"47","hashOfConfig":"46"},{"size":1581,"mtime":1684347705122,"results":"48","hashOfConfig":"46"},{"size":9495,"mtime":1684347705122,"results":"49","hashOfConfig":"46"},{"size":3365,"mtime":1684347705122,"results":"50","hashOfConfig":"46"},{"size":1589,"mtime":1684347705122,"results":"51","hashOfConfig":"46"},{"size":5215,"mtime":1684350639142,"results":"52","hashOfConfig":"46"},{"size":539,"mtime":1684347705120,"results":"53","hashOfConfig":"46"},{"size":1753,"mtime":1684347705120,"results":"54","hashOfConfig":"46"},{"size":3056,"mtime":1684347705120,"results":"55","hashOfConfig":"46"},{"size":1089,"mtime":1684347705121,"results":"56","hashOfConfig":"46"},{"size":262,"mtime":1684347705121,"results":"57","hashOfConfig":"46"},{"size":244,"mtime":1684347705122,"results":"58","hashOfConfig":"46"},{"size":390,"mtime":1684347705121,"results":"59","hashOfConfig":"46"},{"size":303,"mtime":1684347705121,"results":"60","hashOfConfig":"46"},{"size":270,"mtime":1684347705121,"results":"61","hashOfConfig":"46"},{"size":423,"mtime":1684347705121,"results":"62","hashOfConfig":"46"},{"size":2620,"mtime":1684347705121,"results":"63","hashOfConfig":"46"},{"size":11102,"mtime":1684347705119,"results":"64","hashOfConfig":"46"},{"size":1868,"mtime":1684347705119,"results":"65","hashOfConfig":"46"},{"size":4919,"mtime":1684347705119,"results":"66","hashOfConfig":"46"},{"size":765,"mtime":1684427354215,"results":"67","hashOfConfig":"46"},{"size":1658,"mtime":1684347705120,"results":"68","hashOfConfig":"46"},{"size":2039,"mtime":1684347705120,"results":"69","hashOfConfig":"46"},{"size":1641,"mtime":1684347705121,"results":"70","hashOfConfig":"46"},{"size":2637,"mtime":1684347705120,"results":"71","hashOfConfig":"46"},{"size":218,"mtime":1684347705121,"results":"72","hashOfConfig":"46"},{"size":1232,"mtime":1684347705121,"results":"73","hashOfConfig":"46"},{"size":249,"mtime":1684347705122,"results":"74","hashOfConfig":"46"},{"size":1152,"mtime":1684347705121,"results":"75","hashOfConfig":"46"},{"size":2780,"mtime":1684347705120,"results":"76","hashOfConfig":"46"},{"size":461,"mtime":1684347705121,"results":"77","hashOfConfig":"46"},{"size":572,"mtime":1684347705120,"results":"78","hashOfConfig":"46"},{"size":2544,"mtime":1684347705119,"results":"79","hashOfConfig":"46"},{"size":565,"mtime":1684347705123,"results":"80","hashOfConfig":"46"},{"size":324,"mtime":1684347705123,"results":"81","hashOfConfig":"46"},{"size":1104,"mtime":1684347705122,"results":"82","hashOfConfig":"46"},{"size":515,"mtime":1684347705123,"results":"83","hashOfConfig":"46"},{"size":838,"mtime":1684347705120,"results":"84","hashOfConfig":"46"},{"size":5437,"mtime":1684427638838,"results":"85","hashOfConfig":"46"},{"size":3351,"mtime":1684347705119,"results":"86","hashOfConfig":"46"},{"size":480,"mtime":1684347705119,"results":"87","hashOfConfig":"46"},{"size":6003,"mtime":1684443148592,"results":"88","hashOfConfig":"46"},{"size":4767,"mtime":1684439999748,"results":"89","hashOfConfig":"46"},{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},"1lz7msy",{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"113","messages":"114","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"115","messages":"116","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"117","messages":"118","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"119","messages":"120","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"121","messages":"122","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"123","messages":"124","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"125","messages":"126","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"127","messages":"128","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"129","messages":"130","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"131","messages":"132","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"133","messages":"134","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"135","messages":"136","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"137","messages":"138","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"139","messages":"140","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"141","messages":"142","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"143","messages":"144","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"145","messages":"146","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"147","messages":"148","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"149","messages":"150","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"151","messages":"152","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"153","messages":"154","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"155","messages":"156","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"157","messages":"158","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"159","messages":"160","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"161","messages":"162","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"163","messages":"164","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"165","messages":"166","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"167","messages":"168","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"169","messages":"170","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"171","messages":"172","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"173","messages":"174","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},{"filePath":"175","messages":"176","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"177","messages":"178","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"92"},"/Users/djchapman/test stuff/gungi.io/client/src/index.tsx",[],["179","180"],"/Users/djchapman/test stuff/gungi.io/client/src/App.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/pages/Home.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/pages/About.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/pages/Contact.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/pages/NotFound.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/pages/Game.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/Footer.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/Header.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/Mobility.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Button.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Wrapper.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Panel.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Paragraph.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Subtitle.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Title.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/HeroParticles.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/game/GungiGame.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/game/Login.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/game/Lobby.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/stores/GungiStore.ts",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/CapturedPanel.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/MoveHistory.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/GameButton.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/StockpilePanel.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/LobbyButton.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/TurnIndictor.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/TowerDetails.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/styles/Input.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/MobileWarning.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Board.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/utils/symbolToNameMap.ts",[],"/Users/djchapman/test stuff/gungi.io/client/src/utils/fileToLetterMap.ts",[],"/Users/djchapman/test stuff/gungi.io/client/src/typings/types.ts",[],"/Users/djchapman/test stuff/gungi.io/client/src/utils/flipBoard.ts",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/ui/PieceIcon.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Piece.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Coordinates.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Empty.tsx",[],"/Users/djchapman/test stuff/gungi.io/client/src/components/gameboard/Square.tsx",["181"],"/Users/djchapman/test stuff/gungi.io/client/src/components/hooks/useGetMove.tsx",[],{"ruleId":"182","replacedBy":"183"},{"ruleId":"184","replacedBy":"185"},{"ruleId":"186","severity":1,"message":"187","line":126,"column":5,"nodeType":"188","endLine":126,"endColumn":86,"suggestions":"189"},"no-native-reassign",["190"],"no-negated-in-lhs",["191"],"react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'convertIdToGameSquare', 'getMove', and 'socketPlayerColor'. Either include them or remove the dependency array.","ArrayExpression",["192"],"no-global-assign","no-unsafe-negation",{"desc":"193","fix":"194"},"Update the dependencies array to be: [gungiStore.isDragging, gungiStore.gameState?.legal_moves, props.id, legalSquare, getMove, socketPlayerColor, convertIdToGameSquare]",{"range":"195","text":"196"},[3791,3872],"[gungiStore.isDragging, gungiStore.gameState?.legal_moves, props.id, legalSquare, getMove, socketPlayerColor, convertIdToGameSquare]"] \ No newline at end of file diff --git a/client/src/components/gameboard/Piece.tsx b/client/src/components/gameboard/Piece.tsx index f71b422..559b99d 100644 --- a/client/src/components/gameboard/Piece.tsx +++ b/client/src/components/gameboard/Piece.tsx @@ -76,7 +76,7 @@ export const Piece: React.FC = observer( translation, })); - gungiStore.isDragging = true; + gungiStore.setIsDragging(true) gungiStore.currentSelected = squareId ?? stockId; if (gungiStore.currentSelected === squareId && squareId !== undefined) { const pos = squareId.split('-'); @@ -144,7 +144,7 @@ export const Piece: React.FC = observer( isDragging: false, })); - gungiStore.isDragging = false; + gungiStore.setIsDragging(false) }, [gungiStore]); useEffect(() => { diff --git a/client/src/components/gameboard/Square.tsx b/client/src/components/gameboard/Square.tsx index 1a98bcf..5aed5e4 100644 --- a/client/src/components/gameboard/Square.tsx +++ b/client/src/components/gameboard/Square.tsx @@ -1,15 +1,15 @@ import { observer } from 'mobx-react-lite'; -import React, { useContext, useState } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { GungiStoreContext } from 'src/stores/GungiStore'; import { GameState, Move, Piece, User } from 'src/typings/types'; import styled from 'styled-components'; -import Swal from 'sweetalert2'; -import withReactContent from 'sweetalert2-react-content'; +import { useGetMove } from '../hooks/useGetMove'; enum HighlightType { NONE = 'none', HIGHLIGHT = 'highlight', CHECK = 'check', + HINT = 'hint' } const handleHighlightColorChange = (color: HighlightType) => { @@ -18,21 +18,29 @@ const handleHighlightColorChange = (color: HighlightType) => { return '#a152ff66;'; case HighlightType.CHECK: return '#ff6060ab'; + case HighlightType.HINT: + return "rgba(0, 0, 0, 0.2)" default: return 'transparent'; } }; const Wrapper = styled.div<{ highlight: HighlightType; hover: boolean }>` - background-color: ${(props) => handleHighlightColorChange(props.highlight)}; + background-color: ${(props) => props.hover && props.highlight === HighlightType.HINT ? 'transparent' : handleHighlightColorChange(props.highlight)}; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: relative; - outline: ${(props) => (props.hover ? '5px solid #b683ca' : 'none')}; - outline-offset: ${(props) => (props.hover ? '-4.5px' : '0')}; + border: ${(props) => (props.hover ? '5px solid #b683ca' : 'none')}; + border-offset: ${(props) => (props.hover ? '-4.5px' : '0')}; cursor: ${(props) => (props.hover ? '-webkit-grabbing' : '0')}; + ${(props) => props.highlight === HighlightType.HINT && !props.hover ? ` + padding: 32.2%; + background-clip: content-box; + border-radius: 50%; + box-sizing: border-box;` : '' + } `; const Hint = styled.div<{ show: boolean; capture: boolean }>` @@ -80,8 +88,9 @@ interface SquareProps { export const Square: React.FC = observer((props) => { const [isOver, setIsOver] = useState(false); + const [legalSquare, setLegalSquare] = useState(false) const gungiStore = useContext(GungiStoreContext); - + const { getMove } = useGetMove() let socketPlayerColor: string = ''; if (props.socketPlayer?.userType === 'creator') { socketPlayerColor = 'w'; @@ -89,8 +98,6 @@ export const Square: React.FC = observer((props) => { socketPlayerColor = 'b'; } - const swal = withReactContent(Swal); - const convertIdToGameSquare = (id: string) => { if (socketPlayerColor === 'b') { const rank = parseInt(id.split('-')[0]); @@ -101,6 +108,23 @@ export const Square: React.FC = observer((props) => { return id; }; + useEffect(() => { + console.log('dragging') + console.log(gungiStore.isDragging) + if (gungiStore.isDragging) { + const move = getMove(socketPlayerColor, convertIdToGameSquare(props.id), props.id, true) + const isLegalSquare = (gungiStore.gameState?.legal_moves.some( + (x) => + JSON.stringify(x.src) === JSON.stringify(move?.src) && + x.dst === move?.dst && + x.type === move?.type + )) + setLegalSquare(isLegalSquare || false) + } else { + setLegalSquare(false) + } + }, [gungiStore.isDragging, gungiStore.gameState?.legal_moves, props.id, legalSquare]) + const getSquareHighlightFromGameState = ( currentSelected?: string, gameState?: GameState @@ -108,7 +132,7 @@ export const Square: React.FC = observer((props) => { if ( currentSelected === props.id || gameState?.history.slice(-1)[0]?.src === - convertIdToGameSquare(props.id) || + convertIdToGameSquare(props.id) || gameState?.history.slice(-1)[0]?.dst === convertIdToGameSquare(props.id) ) { return HighlightType.HIGHLIGHT; @@ -133,12 +157,15 @@ export const Square: React.FC = observer((props) => { tower.splice(-1, 1); } + const curHighlight = getSquareHighlightFromGameState( + gungiStore.currentSelected, + gungiStore.gameState + ) + + return ( { if (!props.hasPiece) { @@ -152,130 +179,18 @@ export const Square: React.FC = observer((props) => { }} onMouseUp={() => { setIsOver(false); - let src: string | Piece | null = gungiStore.currentSelected ?? null; - let selectedPieceColor = ''; - if (src?.split('-').length !== 2) { - src = { - type: src ? src.substr(1) : '', - color: src ? src.substr(0, 1) : '', - }; - } else if (src.split('-').length === 2) { - const currCords = gungiStore.currentSelected?.split('-'); - const srcRank = parseInt(currCords ? currCords[0] : '-1'); - const srcFile = parseInt(currCords ? currCords[1] : '-1'); - for (let i = 0; i < 3; i++) { - let piece = - socketPlayerColor === 'w' - ? gungiStore.gameState?.board[9 - srcRank][srcFile - 1][i] - : gungiStore.gameState?.board[srcRank - 1][9 - srcFile][i]; - if (piece) { - selectedPieceColor = piece.color; - } - } - - if (socketPlayerColor === 'b') { - src = `${10 - srcRank}-${10 - srcFile}`; - } - } - + const move = getMove(socketPlayerColor, convertIdToGameSquare(props.id), props.id, false) if ( - (gungiStore.currentSelected?.substr(0, 1) === - gungiStore.gameState?.turn || - selectedPieceColor === gungiStore.gameState?.turn) && - socketPlayerColor === gungiStore.gameState?.turn + gungiStore.gameState?.legal_moves.some( + (x) => + JSON.stringify(x.src) === JSON.stringify(move?.src) && + x.dst === move?.dst && + x.type === move.type + ) && move ) { - // check if in legal moves - const rank = parseInt(props.id.split('-')[0]); - const file = parseInt(props.id.split('-')[1]); - const dst = - socketPlayerColor === 'b' ? `${10 - rank}-${10 - file}` : props.id; - - let moveType = ''; - if (!gungiStore.squareSelected) { - moveType = 'place'; - } else if (gungiStore.squareSelected) { - // if mouse up on empty square => movement - let boardCoords = convertIdToGameSquare(props.id); - const realRank = parseInt(boardCoords.split('-')[0]); - const realFile = parseInt(boardCoords.split('-')[1]); - - const tower = - gungiStore.gameState.board[9 - realRank][realFile - 1]; - if (tower) { - let top: Piece | null = null; - for (let i = 2; i >= 0; i--) { - if (tower[i] !== null) { - top = tower[i]; - break; - } - } - - if (top === null) { - moveType = 'move'; - } else if (gungiStore.currentSelected !== props.id) { - if (top.color === socketPlayerColor) { - moveType = 'stack'; - } else { - swal - .fire({ - title: Attack or Stack?, - showConfirmButton: true, - showDenyButton: true, - confirmButtonText: 'Attack', - confirmButtonColor: '#F53C5E', - denyButtonText: 'Stack', - denyButtonColor: '#F5AB3C', - }) - .then((response) => { - if (response.isConfirmed) { - moveType = 'attack'; - } else if (response.isDenied) { - moveType = 'stack'; - } - - const move = { - src, - dst, - type: moveType, - }; - - if ( - gungiStore.gameState?.legal_moves.some( - (x) => - JSON.stringify(x.src) === - JSON.stringify(move.src) && - x.dst === move.dst && - x.type === move.type - ) - ) { - gungiStore.currentSelected = undefined; - gungiStore.hints = undefined; - props.makeMoveCallback(move); - } - }); - } - } - } - } - - const move = { - src, - dst, - type: moveType, - }; - - if ( - gungiStore.gameState.legal_moves.some( - (x) => - JSON.stringify(x.src) === JSON.stringify(move.src) && - x.dst === move.dst && - x.type === move.type - ) - ) { - gungiStore.currentSelected = undefined; - gungiStore.hints = undefined; - props.makeMoveCallback(move); - } + gungiStore.currentSelected = undefined; + gungiStore.hints = undefined; + props.makeMoveCallback(move); } }} onMouseLeave={() => { @@ -283,7 +198,7 @@ export const Square: React.FC = observer((props) => { }} > {props.children} - = observer((props) => { capture={props.hasPiece} /> {props.tower && tower && <>{tower}} - + ); }); diff --git a/client/src/components/hooks/useGetMove.tsx b/client/src/components/hooks/useGetMove.tsx new file mode 100644 index 0000000..4072ad2 --- /dev/null +++ b/client/src/components/hooks/useGetMove.tsx @@ -0,0 +1,109 @@ +import { useContext } from "react"; +import { GungiStoreContext } from 'src/stores/GungiStore'; +import { Piece } from "src/typings/types"; +import Swal from "sweetalert2"; +import withReactContent from "sweetalert2-react-content"; + +export const useGetMove = () => { + const swal = withReactContent(Swal); + const gungiStore = useContext(GungiStoreContext); + return { + getMove: (socketPlayerColor: string, gameSquare: string, id: string, isDragging: boolean) => { + let src: string | Piece | null = gungiStore.currentSelected ?? null; + let selectedPieceColor = ''; + if (src?.split('-').length !== 2) { + src = { + type: src ? src.substr(1) : '', + color: src ? src.substr(0, 1) : '', + }; + } else if (src.split('-').length === 2) { + const currCords = gungiStore.currentSelected?.split('-'); + const srcRank = parseInt(currCords ? currCords[0] : '-1'); + const srcFile = parseInt(currCords ? currCords[1] : '-1'); + for (let i = 0; i < 3; i++) { + let piece = + socketPlayerColor === 'w' + ? gungiStore.gameState?.board[9 - srcRank][srcFile - 1][i] + : gungiStore.gameState?.board[srcRank - 1][9 - srcFile][i]; + if (piece) { + selectedPieceColor = piece.color; + } + } + + if (socketPlayerColor === 'b') { + src = `${10 - srcRank}-${10 - srcFile}`; + } + } + + if ( + (gungiStore.currentSelected?.substr(0, 1) === + gungiStore.gameState?.turn || + selectedPieceColor === gungiStore.gameState?.turn) && + socketPlayerColor === gungiStore.gameState?.turn + ) { + // check if in legal moves + const rank = parseInt(id.split('-')[0]); + const file = parseInt(id.split('-')[1]); + const dst = + socketPlayerColor === 'b' ? `${10 - rank}-${10 - file}` : id; + + let moveType = ''; + if (!gungiStore.squareSelected) { + moveType = 'place'; + } else if (gungiStore.squareSelected) { + // if mouse up on empty square => movement + let boardCoords = gameSquare; + const realRank = parseInt(boardCoords.split('-')[0]); + const realFile = parseInt(boardCoords.split('-')[1]); + + const tower = + gungiStore.gameState.board[9 - realRank][realFile - 1]; + if (tower) { + let top: Piece | null = null; + for (let i = 2; i >= 0; i--) { + if (tower[i] !== null) { + top = tower[i]; + break; + } + } + + if (top === null) { + moveType = 'move'; + } else if (gungiStore.currentSelected !== id) { + if (top.color === socketPlayerColor) { + moveType = 'stack'; + } else if (!isDragging) { + swal + .fire({ + title: Attack or Stack?, + showConfirmButton: true, + showDenyButton: true, + confirmButtonText: 'Attack', + confirmButtonColor: '#F53C5E', + denyButtonText: 'Stack', + denyButtonColor: '#F5AB3C', + }) + .then((response) => { + if (response.isConfirmed) { + moveType = 'attack'; + } else if (response.isDenied) { + moveType = 'stack'; + } + }); + } + } + } + } + + const move = { + src, + dst, + type: moveType, + }; + return move + } + + return undefined + } + } +} diff --git a/client/src/pages/Game.tsx b/client/src/pages/Game.tsx index 6fcdcae..2c4e4ed 100644 --- a/client/src/pages/Game.tsx +++ b/client/src/pages/Game.tsx @@ -59,6 +59,7 @@ export const Game: React.FC = ({ history }) => { }; const makeMove = (move: Move) => { + console.log({ roomId, move }) socket.emit('make_move', { roomId, move }); }; diff --git a/client/src/stores/GungiStore.ts b/client/src/stores/GungiStore.ts index 2325c05..2acbe05 100644 --- a/client/src/stores/GungiStore.ts +++ b/client/src/stores/GungiStore.ts @@ -5,6 +5,7 @@ import { GameState, Square } from 'src/typings/types'; class GungiStore { @observable gameState: GameState | undefined = undefined; @observable isDragging = false; + @observable setIsDragging = (value: boolean) => this.isDragging = value @observable currentSelected: string | undefined = undefined; @observable squareSelected: Square | undefined = undefined; @observable prevMoveFrom: string | undefined = undefined; From 28262e5aa825f85cfe94baa44405d801bd23793e Mon Sep 17 00:00:00 2001 From: Scott Reiter Date: Thu, 18 May 2023 16:00:40 -0500 Subject: [PATCH 3/4] all my code --- .gitignore | 2 ++ client/.eslintcache | 1 + client/src/components/game/GungiGame.tsx | 2 ++ client/src/components/gameboard/Piece.tsx | 6 ++-- client/src/components/ui/StockpilePanel.tsx | 7 +++- server/deploy.sh | 9 ----- server/package.json | 4 +++ server/src/index.ts | 26 ++++++++++++--- server/tsconfig.json | 1 - server/yarn.lock | 37 +++++++++++++++++++++ 10 files changed, 77 insertions(+), 18 deletions(-) create mode 100644 client/.eslintcache delete mode 100644 server/deploy.sh diff --git a/.gitignore b/.gitignore index 8101a41..45860a1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ /**/dist /.pnp .pnp.js +.yarn +.yarnrc.yml # testing /coverage diff --git a/client/.eslintcache b/client/.eslintcache new file mode 100644 index 0000000..c518d2a --- /dev/null +++ b/client/.eslintcache @@ -0,0 +1 @@ +[{"/Users/sreiter/gungi.io/client/src/index.tsx":"1","/Users/sreiter/gungi.io/client/src/App.tsx":"2","/Users/sreiter/gungi.io/client/src/pages/Home.tsx":"3","/Users/sreiter/gungi.io/client/src/pages/About.tsx":"4","/Users/sreiter/gungi.io/client/src/pages/Game.tsx":"5","/Users/sreiter/gungi.io/client/src/pages/Contact.tsx":"6","/Users/sreiter/gungi.io/client/src/pages/NotFound.tsx":"7","/Users/sreiter/gungi.io/client/src/components/ui/Footer.tsx":"8","/Users/sreiter/gungi.io/client/src/components/ui/Header.tsx":"9","/Users/sreiter/gungi.io/client/src/components/ui/Mobility.tsx":"10","/Users/sreiter/gungi.io/client/src/components/ui/styles/Button.tsx":"11","/Users/sreiter/gungi.io/client/src/components/ui/styles/HeroParticles.tsx":"12","/Users/sreiter/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx":"13","/Users/sreiter/gungi.io/client/src/components/ui/styles/Wrapper.tsx":"14","/Users/sreiter/gungi.io/client/src/components/ui/styles/Title.tsx":"15","/Users/sreiter/gungi.io/client/src/components/ui/styles/Panel.tsx":"16","/Users/sreiter/gungi.io/client/src/components/ui/styles/Paragraph.tsx":"17","/Users/sreiter/gungi.io/client/src/components/ui/styles/Subtitle.tsx":"18","/Users/sreiter/gungi.io/client/src/components/game/GungiGame.tsx":"19","/Users/sreiter/gungi.io/client/src/components/game/Lobby.tsx":"20","/Users/sreiter/gungi.io/client/src/components/game/Login.tsx":"21","/Users/sreiter/gungi.io/client/src/stores/GungiStore.ts":"22","/Users/sreiter/gungi.io/client/src/components/ui/MobileWarning.tsx":"23","/Users/sreiter/gungi.io/client/src/components/ui/styles/GameButton.tsx":"24","/Users/sreiter/gungi.io/client/src/components/ui/styles/Input.tsx":"25","/Users/sreiter/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx":"26","/Users/sreiter/gungi.io/client/src/components/ui/styles/LobbyButton.tsx":"27","/Users/sreiter/gungi.io/client/src/components/ui/MoveHistory.tsx":"28","/Users/sreiter/gungi.io/client/src/components/ui/StockpilePanel.tsx":"29","/Users/sreiter/gungi.io/client/src/components/ui/CapturedPanel.tsx":"30","/Users/sreiter/gungi.io/client/src/components/ui/TowerDetails.tsx":"31","/Users/sreiter/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx":"32","/Users/sreiter/gungi.io/client/src/components/ui/TurnIndictor.tsx":"33","/Users/sreiter/gungi.io/client/src/components/gameboard/Board.tsx":"34","/Users/sreiter/gungi.io/client/src/utils/fileToLetterMap.ts":"35","/Users/sreiter/gungi.io/client/src/utils/symbolToNameMap.ts":"36","/Users/sreiter/gungi.io/client/src/typings/types.ts":"37","/Users/sreiter/gungi.io/client/src/utils/flipBoard.ts":"38","/Users/sreiter/gungi.io/client/src/components/gameboard/Piece.tsx":"39","/Users/sreiter/gungi.io/client/src/components/ui/PieceIcon.tsx":"40","/Users/sreiter/gungi.io/client/src/components/gameboard/Coordinates.tsx":"41","/Users/sreiter/gungi.io/client/src/components/gameboard/Empty.tsx":"42","/Users/sreiter/gungi.io/client/src/components/gameboard/Square.tsx":"43"},{"size":192,"mtime":1684347143505,"results":"44","hashOfConfig":"45"},{"size":726,"mtime":1684347143483,"results":"46","hashOfConfig":"45"},{"size":1581,"mtime":1684347143505,"results":"47","hashOfConfig":"45"},{"size":9495,"mtime":1684347143505,"results":"48","hashOfConfig":"45"},{"size":5182,"mtime":1684438957846,"results":"49","hashOfConfig":"45"},{"size":3365,"mtime":1684347143505,"results":"50","hashOfConfig":"45"},{"size":1589,"mtime":1684347143505,"results":"51","hashOfConfig":"45"},{"size":539,"mtime":1684347143503,"results":"52","hashOfConfig":"45"},{"size":1753,"mtime":1684347143503,"results":"53","hashOfConfig":"45"},{"size":3056,"mtime":1684347143503,"results":"54","hashOfConfig":"45"},{"size":1089,"mtime":1684347143504,"results":"55","hashOfConfig":"45"},{"size":2620,"mtime":1684347143504,"results":"56","hashOfConfig":"45"},{"size":262,"mtime":1684347143504,"results":"57","hashOfConfig":"45"},{"size":244,"mtime":1684347143505,"results":"58","hashOfConfig":"45"},{"size":423,"mtime":1684347143505,"results":"59","hashOfConfig":"45"},{"size":390,"mtime":1684347143504,"results":"60","hashOfConfig":"45"},{"size":303,"mtime":1684347143505,"results":"61","hashOfConfig":"45"},{"size":270,"mtime":1684347143505,"results":"62","hashOfConfig":"45"},{"size":11208,"mtime":1684442651561,"results":"63","hashOfConfig":"45"},{"size":4919,"mtime":1684347143502,"results":"64","hashOfConfig":"45"},{"size":1868,"mtime":1684347143502,"results":"65","hashOfConfig":"45"},{"size":692,"mtime":1684347143505,"results":"66","hashOfConfig":"45"},{"size":572,"mtime":1684347143503,"results":"67","hashOfConfig":"45"},{"size":1641,"mtime":1684347143504,"results":"68","hashOfConfig":"45"},{"size":461,"mtime":1684347143504,"results":"69","hashOfConfig":"45"},{"size":218,"mtime":1684347143504,"results":"70","hashOfConfig":"45"},{"size":1232,"mtime":1684347143504,"results":"71","hashOfConfig":"45"},{"size":2039,"mtime":1684347143503,"results":"72","hashOfConfig":"45"},{"size":2774,"mtime":1684442256998,"results":"73","hashOfConfig":"45"},{"size":1658,"mtime":1684347143503,"results":"74","hashOfConfig":"45"},{"size":2780,"mtime":1684347143504,"results":"75","hashOfConfig":"45"},{"size":249,"mtime":1684347143505,"results":"76","hashOfConfig":"45"},{"size":1152,"mtime":1684347143504,"results":"77","hashOfConfig":"45"},{"size":2544,"mtime":1684347143503,"results":"78","hashOfConfig":"45"},{"size":324,"mtime":1684347143506,"results":"79","hashOfConfig":"45"},{"size":565,"mtime":1684347143506,"results":"80","hashOfConfig":"45"},{"size":1104,"mtime":1684347143506,"results":"81","hashOfConfig":"45"},{"size":515,"mtime":1684347143506,"results":"82","hashOfConfig":"45"},{"size":5516,"mtime":1684442540288,"results":"83","hashOfConfig":"45"},{"size":838,"mtime":1684347143504,"results":"84","hashOfConfig":"45"},{"size":3351,"mtime":1684347143503,"results":"85","hashOfConfig":"45"},{"size":480,"mtime":1684347143503,"results":"86","hashOfConfig":"45"},{"size":8301,"mtime":1684347143503,"results":"87","hashOfConfig":"45"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1jvmdix",{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"160","messages":"161","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"166","messages":"167","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"168","messages":"169","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"172","messages":"173","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/sreiter/gungi.io/client/src/index.tsx",[],"/Users/sreiter/gungi.io/client/src/App.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Home.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/About.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Game.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Contact.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/NotFound.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Footer.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Header.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Mobility.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Button.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/HeroParticles.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Wrapper.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Title.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Panel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Paragraph.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Subtitle.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/GungiGame.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/Lobby.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/Login.tsx",[],"/Users/sreiter/gungi.io/client/src/stores/GungiStore.ts",[],"/Users/sreiter/gungi.io/client/src/components/ui/MobileWarning.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/GameButton.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Input.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/LobbyButton.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/MoveHistory.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/StockpilePanel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/CapturedPanel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/TowerDetails.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/TurnIndictor.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Board.tsx",[],"/Users/sreiter/gungi.io/client/src/utils/fileToLetterMap.ts",[],"/Users/sreiter/gungi.io/client/src/utils/symbolToNameMap.ts",[],"/Users/sreiter/gungi.io/client/src/typings/types.ts",[],"/Users/sreiter/gungi.io/client/src/utils/flipBoard.ts",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Piece.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/PieceIcon.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Coordinates.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Empty.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Square.tsx",[]] \ No newline at end of file diff --git a/client/src/components/game/GungiGame.tsx b/client/src/components/game/GungiGame.tsx index 1fba070..b1e372d 100644 --- a/client/src/components/game/GungiGame.tsx +++ b/client/src/components/game/GungiGame.tsx @@ -353,6 +353,7 @@ export const GungiGame: React.FC = observer( playerName={`${blackPlayer?.username}`} playerStockPile={gameState?.stockpile_black} armySize={gameState.armysize_black} + isSocketPlayer={socketPlayerColor === 'b'} />
@@ -361,6 +362,7 @@ export const GungiGame: React.FC = observer( playerName={`${whitePlayer?.username}`} playerStockPile={gameState?.stockpile_white} armySize={gameState.armysize_white} + isSocketPlayer={socketPlayerColor === 'w'} /> diff --git a/client/src/components/gameboard/Piece.tsx b/client/src/components/gameboard/Piece.tsx index f71b422..80ac98e 100644 --- a/client/src/components/gameboard/Piece.tsx +++ b/client/src/components/gameboard/Piece.tsx @@ -32,6 +32,7 @@ interface PieceProps { stockId?: string; orientation?: string; socketPlayerColor?: string; + isSocketPlayer?: boolean; } export const Piece: React.FC = observer( @@ -43,6 +44,7 @@ export const Piece: React.FC = observer( stockId, orientation, socketPlayerColor, + isSocketPlayer }) => { const [state, setState] = useState({ isDragging: false, @@ -168,12 +170,12 @@ export const Piece: React.FC = observer( transform: `translate(${state.translation.x}px, ${state.translation.y}px)`, zIndex: state.isDragging ? 900 : 4, position: state.isDragging ? 'absolute' : 'relative', - pointerEvents: state.isDragging ? 'none' : '', + pointerEvents: state.isDragging || !isSocketPlayer ? 'none' : '', width: variant === 'normal' ? '80%' : '2.5rem', display: 'block', margin: variant === 'normal' ? '10.02% auto' : '0', }), - [state.isDragging, state.translation, variant] + [state.isDragging, state.translation, variant, isSocketPlayer] ); return ( diff --git a/client/src/components/ui/StockpilePanel.tsx b/client/src/components/ui/StockpilePanel.tsx index 2cd508b..d88cb9a 100644 --- a/client/src/components/ui/StockpilePanel.tsx +++ b/client/src/components/ui/StockpilePanel.tsx @@ -14,6 +14,7 @@ interface StockpilePanelProps { playerName: string; playerStockPile: StockPiece[]; armySize: number; + isSocketPlayer: boolean; } export const StockpilePanel: React.FC = observer( @@ -76,15 +77,19 @@ export const StockpilePanel: React.FC = observer( classes={{ badge: classes.customBadge }} className={classes.margin} > - + diff --git a/server/deploy.sh b/server/deploy.sh deleted file mode 100644 index 4aec5bd..0000000 --- a/server/deploy.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -echo What should the version be? -read VERSION - -docker build -t jwyce/gungi:$VERSION . -docker push jwyce/gungi:$VERSION - -ssh root@165.22.180.188 "docker pull jwyce/gungi:$VERSION && docker tag jwyce/gungi:$VERSION dokku/api:$VERSION && dokku deploy api $VERSION" \ No newline at end of file diff --git a/server/package.json b/server/package.json index db3f58f..8fcaf85 100644 --- a/server/package.json +++ b/server/package.json @@ -15,11 +15,15 @@ "author": "", "license": "MIT", "dependencies": { + "bufferutil": "^4.0.7", "cors": "^2.8.5", "dotenv-safe": "^8.2.0", + "eiows": "^6.3.0", "express": "^4.17.1", "gungi.js": "1.0.20", "socket.io": "^3.1.2", + "socket.io-msgpack-parser": "^3.0.2", + "utf-8-validate": "^6.0.3", "uuid": "^8.3.2" }, "devDependencies": { diff --git a/server/src/index.ts b/server/src/index.ts index 0dc7c51..900ba78 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -3,9 +3,8 @@ import 'dotenv-safe/config'; import cors from 'cors'; import express from 'express'; import { v4 } from 'uuid'; - -import { InMemorySessionStore, Move, User } from './sessionStore'; import { logoSvg } from './helper'; +import { InMemorySessionStore, Move, User } from './sessionStore'; const PORT = process.env.PORT; const app = express(); @@ -19,9 +18,26 @@ app.use( const http = require('http').Server(app); const io = require('socket.io')(http, { cors: { origin: process.env.CORS_ORIGIN, methods: ['GET', 'POST'] }, - upgradeTimeout: 30000, - pingInterval: 10000, - pingTimeout: 60000, + wsEngine: 'eiows', + pingInterval: 50, + perMessageDeflate: { + threshold: 250, // defaults to 1024 + + zlibDeflateOptions: { + chunkSize: 8 * 1024, // defaults to 16 * 1024 + }, + + zlibInflateOptions: { + windowBits: 14, // defaults to 15 + memLevel: 7, // defaults to 8 + }, + + clientNoContextTakeover: true, // defaults to negotiated value. + serverNoContextTakeover: true, // defaults to negotiated value. + serverMaxWindowBits: 10, // defaults to negotiated value. + + concurrencyLimit: 20, // defaults to 10 + } }); const { Gungi } = require('gungi.js'); diff --git a/server/tsconfig.json b/server/tsconfig.json index e97397b..2c96ab2 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -7,7 +7,6 @@ "outDir": "./dist", "moduleResolution": "node", "removeComments": true, - "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "noImplicitThis": true, diff --git a/server/yarn.lock b/server/yarn.lock index 4314f5a..fd3ea93 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -226,6 +226,13 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== +bufferutil@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" + integrity sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== + dependencies: + node-gyp-build "^4.3.0" + bytes@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" @@ -458,6 +465,11 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= +eiows@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/eiows/-/eiows-6.3.0.tgz#04574d8aa8cef2fa9adc1b1b2376dba322702d62" + integrity sha512-BTCQ6hyDx1EgUjs7SBeLiXfXHQZWyR0pYSVe1hJm4QPNopDLbhaCd6SxOiB3LLzH7NPthM7W05d5s+7/wF+fSA== + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -934,6 +946,11 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +node-gyp-build@^4.3.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" + integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== + nodemon@^2.0.6: version "2.0.7" resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.7.tgz#6f030a0a0ebe3ea1ba2a38f71bf9bab4841ced32" @@ -967,6 +984,11 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== +notepack.io@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/notepack.io/-/notepack.io-2.2.0.tgz#d7ea71d1cb90094f88c6f3c8d84277c2d0cd101c" + integrity sha512-9b5w3t5VSH6ZPosoYnyDONnUTF8o0UkBw7JLA6eBlYJWyGT1Q3vQa8Hmuj1/X6RYvHjjygBDgw6fJhe0JEojfw== + object-assign@^4: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -1178,6 +1200,14 @@ socket.io-adapter@~2.1.0: resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.1.0.tgz#edc5dc36602f2985918d631c1399215e97a1b527" integrity sha512-+vDov/aTsLjViYTwS9fPy5pEtTkrbEKsw2M+oVSoFGw6OD1IpvlV1VPhUzNbofCQ8oyMbdYJqDtGdmHQK6TdPg== +socket.io-msgpack-parser@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/socket.io-msgpack-parser/-/socket.io-msgpack-parser-3.0.2.tgz#34c4d69acd0fa2a0eede98c14e29fa9f6a5b880a" + integrity sha512-1e76bJ1PCKi9H+JiYk+S29PBJvknHjQWM7Mtj0hjF2KxDA6b6rQxv3rTsnwBoz/haZOhlCDIMQvPATbqYeuMxg== + dependencies: + component-emitter "~1.3.0" + notepack.io "~2.2.0" + socket.io-parser@~4.0.3: version "4.0.4" resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.0.4.tgz#9ea21b0d61508d18196ef04a2c6b9ab630f4c2b0" @@ -1382,6 +1412,13 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" +utf-8-validate@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-6.0.3.tgz#7d8c936d854e86b24d1d655f138ee27d2636d777" + integrity sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA== + dependencies: + node-gyp-build "^4.3.0" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" From 785f1cf72cdc48594ab8ddc145707de2b4031c86 Mon Sep 17 00:00:00 2001 From: Scott Reiter Date: Thu, 18 May 2023 16:47:23 -0500 Subject: [PATCH 4/4] pushed --- client/.eslintcache | 2 +- client/src/components/game/GungiGame.tsx | 5 +++-- client/src/components/gameboard/Board.tsx | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/.eslintcache b/client/.eslintcache index 655b110..45d6d10 100644 --- a/client/.eslintcache +++ b/client/.eslintcache @@ -1 +1 @@ -[{"/Users/sreiter/gungi.io/client/src/index.tsx":"1","/Users/sreiter/gungi.io/client/src/App.tsx":"2","/Users/sreiter/gungi.io/client/src/pages/Home.tsx":"3","/Users/sreiter/gungi.io/client/src/pages/About.tsx":"4","/Users/sreiter/gungi.io/client/src/pages/Game.tsx":"5","/Users/sreiter/gungi.io/client/src/pages/Contact.tsx":"6","/Users/sreiter/gungi.io/client/src/pages/NotFound.tsx":"7","/Users/sreiter/gungi.io/client/src/components/ui/Footer.tsx":"8","/Users/sreiter/gungi.io/client/src/components/ui/Header.tsx":"9","/Users/sreiter/gungi.io/client/src/components/ui/Mobility.tsx":"10","/Users/sreiter/gungi.io/client/src/components/ui/styles/Button.tsx":"11","/Users/sreiter/gungi.io/client/src/components/ui/styles/HeroParticles.tsx":"12","/Users/sreiter/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx":"13","/Users/sreiter/gungi.io/client/src/components/ui/styles/Wrapper.tsx":"14","/Users/sreiter/gungi.io/client/src/components/ui/styles/Title.tsx":"15","/Users/sreiter/gungi.io/client/src/components/ui/styles/Panel.tsx":"16","/Users/sreiter/gungi.io/client/src/components/ui/styles/Paragraph.tsx":"17","/Users/sreiter/gungi.io/client/src/components/ui/styles/Subtitle.tsx":"18","/Users/sreiter/gungi.io/client/src/components/game/GungiGame.tsx":"19","/Users/sreiter/gungi.io/client/src/components/game/Lobby.tsx":"20","/Users/sreiter/gungi.io/client/src/components/game/Login.tsx":"21","/Users/sreiter/gungi.io/client/src/stores/GungiStore.ts":"22","/Users/sreiter/gungi.io/client/src/components/ui/MobileWarning.tsx":"23","/Users/sreiter/gungi.io/client/src/components/ui/styles/GameButton.tsx":"24","/Users/sreiter/gungi.io/client/src/components/ui/styles/Input.tsx":"25","/Users/sreiter/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx":"26","/Users/sreiter/gungi.io/client/src/components/ui/styles/LobbyButton.tsx":"27","/Users/sreiter/gungi.io/client/src/components/ui/MoveHistory.tsx":"28","/Users/sreiter/gungi.io/client/src/components/ui/StockpilePanel.tsx":"29","/Users/sreiter/gungi.io/client/src/components/ui/CapturedPanel.tsx":"30","/Users/sreiter/gungi.io/client/src/components/ui/TowerDetails.tsx":"31","/Users/sreiter/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx":"32","/Users/sreiter/gungi.io/client/src/components/ui/TurnIndictor.tsx":"33","/Users/sreiter/gungi.io/client/src/components/gameboard/Board.tsx":"34","/Users/sreiter/gungi.io/client/src/utils/fileToLetterMap.ts":"35","/Users/sreiter/gungi.io/client/src/utils/symbolToNameMap.ts":"36","/Users/sreiter/gungi.io/client/src/typings/types.ts":"37","/Users/sreiter/gungi.io/client/src/utils/flipBoard.ts":"38","/Users/sreiter/gungi.io/client/src/components/gameboard/Piece.tsx":"39","/Users/sreiter/gungi.io/client/src/components/ui/PieceIcon.tsx":"40","/Users/sreiter/gungi.io/client/src/components/gameboard/Coordinates.tsx":"41","/Users/sreiter/gungi.io/client/src/components/gameboard/Empty.tsx":"42","/Users/sreiter/gungi.io/client/src/components/gameboard/Square.tsx":"43"},{"size":192,"mtime":1684347143505,"results":"44","hashOfConfig":"45"},{"size":726,"mtime":1684347143483,"results":"46","hashOfConfig":"45"},{"size":1581,"mtime":1684347143505,"results":"47","hashOfConfig":"45"},{"size":9495,"mtime":1684347143505,"results":"48","hashOfConfig":"45"},{"size":5182,"mtime":1684438957846,"results":"49","hashOfConfig":"45"},{"size":3365,"mtime":1684347143505,"results":"50","hashOfConfig":"45"},{"size":1589,"mtime":1684347143505,"results":"51","hashOfConfig":"45"},{"size":539,"mtime":1684347143503,"results":"52","hashOfConfig":"45"},{"size":1753,"mtime":1684347143503,"results":"53","hashOfConfig":"45"},{"size":3056,"mtime":1684347143503,"results":"54","hashOfConfig":"45"},{"size":1089,"mtime":1684347143504,"results":"55","hashOfConfig":"45"},{"size":2620,"mtime":1684347143504,"results":"56","hashOfConfig":"45"},{"size":262,"mtime":1684347143504,"results":"57","hashOfConfig":"45"},{"size":244,"mtime":1684347143505,"results":"58","hashOfConfig":"45"},{"size":423,"mtime":1684347143505,"results":"59","hashOfConfig":"45"},{"size":390,"mtime":1684347143504,"results":"60","hashOfConfig":"45"},{"size":303,"mtime":1684347143505,"results":"61","hashOfConfig":"45"},{"size":270,"mtime":1684347143505,"results":"62","hashOfConfig":"45"},{"size":11208,"mtime":1684442651561,"results":"63","hashOfConfig":"45"},{"size":4919,"mtime":1684347143502,"results":"64","hashOfConfig":"45"},{"size":1868,"mtime":1684347143502,"results":"65","hashOfConfig":"45"},{"size":692,"mtime":1684347143505,"results":"66","hashOfConfig":"45"},{"size":572,"mtime":1684347143503,"results":"67","hashOfConfig":"45"},{"size":1641,"mtime":1684347143504,"results":"68","hashOfConfig":"45"},{"size":461,"mtime":1684347143504,"results":"69","hashOfConfig":"45"},{"size":218,"mtime":1684347143504,"results":"70","hashOfConfig":"45"},{"size":1232,"mtime":1684347143504,"results":"71","hashOfConfig":"45"},{"size":2039,"mtime":1684347143503,"results":"72","hashOfConfig":"45"},{"size":2774,"mtime":1684442256998,"results":"73","hashOfConfig":"45"},{"size":1658,"mtime":1684347143503,"results":"74","hashOfConfig":"45"},{"size":2780,"mtime":1684347143504,"results":"75","hashOfConfig":"45"},{"size":249,"mtime":1684347143505,"results":"76","hashOfConfig":"45"},{"size":1152,"mtime":1684347143504,"results":"77","hashOfConfig":"45"},{"size":2544,"mtime":1684347143503,"results":"78","hashOfConfig":"45"},{"size":324,"mtime":1684347143506,"results":"79","hashOfConfig":"45"},{"size":565,"mtime":1684347143506,"results":"80","hashOfConfig":"45"},{"size":1104,"mtime":1684347143506,"results":"81","hashOfConfig":"45"},{"size":515,"mtime":1684347143506,"results":"82","hashOfConfig":"45"},{"size":5516,"mtime":1684442540288,"results":"83","hashOfConfig":"45"},{"size":838,"mtime":1684347143504,"results":"84","hashOfConfig":"45"},{"size":3351,"mtime":1684347143503,"results":"85","hashOfConfig":"45"},{"size":480,"mtime":1684347143503,"results":"86","hashOfConfig":"45"},{"size":8301,"mtime":1684347143503,"results":"87","hashOfConfig":"45"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1jvmdix",{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"160","messages":"161","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"166","messages":"167","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"168","messages":"169","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"172","messages":"173","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/sreiter/gungi.io/client/src/index.tsx",[],"/Users/sreiter/gungi.io/client/src/App.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Home.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/About.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Game.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Contact.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/NotFound.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Footer.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Header.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Mobility.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Button.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/HeroParticles.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Wrapper.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Title.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Panel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Paragraph.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Subtitle.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/GungiGame.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/Lobby.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/Login.tsx",[],"/Users/sreiter/gungi.io/client/src/stores/GungiStore.ts",[],"/Users/sreiter/gungi.io/client/src/components/ui/MobileWarning.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/GameButton.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Input.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/LobbyButton.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/MoveHistory.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/StockpilePanel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/CapturedPanel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/TowerDetails.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/TurnIndictor.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Board.tsx",[],"/Users/sreiter/gungi.io/client/src/utils/fileToLetterMap.ts",[],"/Users/sreiter/gungi.io/client/src/utils/symbolToNameMap.ts",[],"/Users/sreiter/gungi.io/client/src/typings/types.ts",[],"/Users/sreiter/gungi.io/client/src/utils/flipBoard.ts",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Piece.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/PieceIcon.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Coordinates.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Empty.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Square.tsx",[]] +[{"/Users/sreiter/gungi.io/client/src/index.tsx":"1","/Users/sreiter/gungi.io/client/src/App.tsx":"2","/Users/sreiter/gungi.io/client/src/pages/NotFound.tsx":"3","/Users/sreiter/gungi.io/client/src/pages/About.tsx":"4","/Users/sreiter/gungi.io/client/src/pages/Contact.tsx":"5","/Users/sreiter/gungi.io/client/src/pages/Home.tsx":"6","/Users/sreiter/gungi.io/client/src/pages/Game.tsx":"7","/Users/sreiter/gungi.io/client/src/components/ui/Footer.tsx":"8","/Users/sreiter/gungi.io/client/src/components/ui/Header.tsx":"9","/Users/sreiter/gungi.io/client/src/components/ui/Mobility.tsx":"10","/Users/sreiter/gungi.io/client/src/components/ui/styles/Wrapper.tsx":"11","/Users/sreiter/gungi.io/client/src/components/ui/styles/Button.tsx":"12","/Users/sreiter/gungi.io/client/src/components/ui/styles/Panel.tsx":"13","/Users/sreiter/gungi.io/client/src/components/ui/styles/Paragraph.tsx":"14","/Users/sreiter/gungi.io/client/src/components/ui/styles/HeroParticles.tsx":"15","/Users/sreiter/gungi.io/client/src/components/ui/styles/Title.tsx":"16","/Users/sreiter/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx":"17","/Users/sreiter/gungi.io/client/src/components/ui/styles/Subtitle.tsx":"18","/Users/sreiter/gungi.io/client/src/components/game/Lobby.tsx":"19","/Users/sreiter/gungi.io/client/src/components/game/Login.tsx":"20","/Users/sreiter/gungi.io/client/src/components/game/GungiGame.tsx":"21","/Users/sreiter/gungi.io/client/src/stores/GungiStore.ts":"22","/Users/sreiter/gungi.io/client/src/components/ui/MobileWarning.tsx":"23","/Users/sreiter/gungi.io/client/src/components/ui/styles/GameButton.tsx":"24","/Users/sreiter/gungi.io/client/src/components/ui/styles/LobbyButton.tsx":"25","/Users/sreiter/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx":"26","/Users/sreiter/gungi.io/client/src/components/ui/styles/Input.tsx":"27","/Users/sreiter/gungi.io/client/src/components/ui/MoveHistory.tsx":"28","/Users/sreiter/gungi.io/client/src/components/ui/CapturedPanel.tsx":"29","/Users/sreiter/gungi.io/client/src/components/ui/StockpilePanel.tsx":"30","/Users/sreiter/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx":"31","/Users/sreiter/gungi.io/client/src/components/ui/TurnIndictor.tsx":"32","/Users/sreiter/gungi.io/client/src/components/ui/TowerDetails.tsx":"33","/Users/sreiter/gungi.io/client/src/components/gameboard/Board.tsx":"34","/Users/sreiter/gungi.io/client/src/typings/types.ts":"35","/Users/sreiter/gungi.io/client/src/utils/symbolToNameMap.ts":"36","/Users/sreiter/gungi.io/client/src/utils/fileToLetterMap.ts":"37","/Users/sreiter/gungi.io/client/src/utils/flipBoard.ts":"38","/Users/sreiter/gungi.io/client/src/components/ui/PieceIcon.tsx":"39","/Users/sreiter/gungi.io/client/src/components/gameboard/Piece.tsx":"40","/Users/sreiter/gungi.io/client/src/components/gameboard/Empty.tsx":"41","/Users/sreiter/gungi.io/client/src/components/gameboard/Coordinates.tsx":"42","/Users/sreiter/gungi.io/client/src/components/gameboard/Square.tsx":"43","/Users/sreiter/gungi.io/client/src/components/hooks/useGetMove.tsx":"44"},{"size":192,"mtime":1684347143505,"results":"45","hashOfConfig":"46"},{"size":726,"mtime":1684347143483,"results":"47","hashOfConfig":"46"},{"size":1589,"mtime":1684347143505,"results":"48","hashOfConfig":"46"},{"size":9495,"mtime":1684347143505,"results":"49","hashOfConfig":"46"},{"size":3365,"mtime":1684347143505,"results":"50","hashOfConfig":"46"},{"size":1581,"mtime":1684347143505,"results":"51","hashOfConfig":"46"},{"size":5215,"mtime":1684444562286,"results":"52","hashOfConfig":"46"},{"size":539,"mtime":1684347143503,"results":"53","hashOfConfig":"46"},{"size":1753,"mtime":1684347143503,"results":"54","hashOfConfig":"46"},{"size":3056,"mtime":1684347143503,"results":"55","hashOfConfig":"46"},{"size":244,"mtime":1684347143505,"results":"56","hashOfConfig":"46"},{"size":1089,"mtime":1684347143504,"results":"57","hashOfConfig":"46"},{"size":390,"mtime":1684347143504,"results":"58","hashOfConfig":"46"},{"size":303,"mtime":1684347143505,"results":"59","hashOfConfig":"46"},{"size":2620,"mtime":1684347143504,"results":"60","hashOfConfig":"46"},{"size":423,"mtime":1684347143505,"results":"61","hashOfConfig":"46"},{"size":262,"mtime":1684347143504,"results":"62","hashOfConfig":"46"},{"size":270,"mtime":1684347143505,"results":"63","hashOfConfig":"46"},{"size":4919,"mtime":1684347143502,"results":"64","hashOfConfig":"46"},{"size":1868,"mtime":1684347143502,"results":"65","hashOfConfig":"46"},{"size":11266,"mtime":1684446253285,"results":"66","hashOfConfig":"46"},{"size":765,"mtime":1684444562287,"results":"67","hashOfConfig":"46"},{"size":572,"mtime":1684347143503,"results":"68","hashOfConfig":"46"},{"size":1641,"mtime":1684347143504,"results":"69","hashOfConfig":"46"},{"size":1232,"mtime":1684347143504,"results":"70","hashOfConfig":"46"},{"size":218,"mtime":1684347143504,"results":"71","hashOfConfig":"46"},{"size":461,"mtime":1684347143504,"results":"72","hashOfConfig":"46"},{"size":2039,"mtime":1684347143503,"results":"73","hashOfConfig":"46"},{"size":1658,"mtime":1684347143503,"results":"74","hashOfConfig":"46"},{"size":2774,"mtime":1684445611280,"results":"75","hashOfConfig":"46"},{"size":249,"mtime":1684347143505,"results":"76","hashOfConfig":"46"},{"size":1152,"mtime":1684347143504,"results":"77","hashOfConfig":"46"},{"size":2780,"mtime":1684347143504,"results":"78","hashOfConfig":"46"},{"size":2626,"mtime":1684446223047,"results":"79","hashOfConfig":"46"},{"size":1104,"mtime":1684347143506,"results":"80","hashOfConfig":"46"},{"size":565,"mtime":1684347143506,"results":"81","hashOfConfig":"46"},{"size":324,"mtime":1684347143506,"results":"82","hashOfConfig":"46"},{"size":515,"mtime":1684347143506,"results":"83","hashOfConfig":"46"},{"size":838,"mtime":1684347143504,"results":"84","hashOfConfig":"46"},{"size":5518,"mtime":1684445122428,"results":"85","hashOfConfig":"46"},{"size":480,"mtime":1684347143503,"results":"86","hashOfConfig":"46"},{"size":3351,"mtime":1684347143503,"results":"87","hashOfConfig":"46"},{"size":6003,"mtime":1684444562286,"results":"88","hashOfConfig":"46"},{"size":4767,"mtime":1684444562286,"results":"89","hashOfConfig":"46"},{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1jvmdix",{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"160","messages":"161","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"166","messages":"167","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"168","messages":"169","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"172","messages":"173","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"174","messages":"175","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"176","messages":"177","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/sreiter/gungi.io/client/src/index.tsx",[],"/Users/sreiter/gungi.io/client/src/App.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/NotFound.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/About.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Contact.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Home.tsx",[],"/Users/sreiter/gungi.io/client/src/pages/Game.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Footer.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Header.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/Mobility.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Wrapper.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Button.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Panel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Paragraph.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/HeroParticles.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Title.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/GlobalStyle.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Subtitle.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/Lobby.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/Login.tsx",[],"/Users/sreiter/gungi.io/client/src/components/game/GungiGame.tsx",[],"/Users/sreiter/gungi.io/client/src/stores/GungiStore.ts",[],"/Users/sreiter/gungi.io/client/src/components/ui/MobileWarning.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/GameButton.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/LobbyButton.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/LoadingContainer.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/Input.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/MoveHistory.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/CapturedPanel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/StockpilePanel.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/styles/WrapperSpaceBetween.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/TurnIndictor.tsx",[],"/Users/sreiter/gungi.io/client/src/components/ui/TowerDetails.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Board.tsx",[],"/Users/sreiter/gungi.io/client/src/typings/types.ts",[],"/Users/sreiter/gungi.io/client/src/utils/symbolToNameMap.ts",[],"/Users/sreiter/gungi.io/client/src/utils/fileToLetterMap.ts",[],"/Users/sreiter/gungi.io/client/src/utils/flipBoard.ts",[],"/Users/sreiter/gungi.io/client/src/components/ui/PieceIcon.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Piece.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Empty.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Coordinates.tsx",[],"/Users/sreiter/gungi.io/client/src/components/gameboard/Square.tsx",["178"],"/Users/sreiter/gungi.io/client/src/components/hooks/useGetMove.tsx",[],{"ruleId":"179","severity":1,"message":"180","line":126,"column":5,"nodeType":"181","endLine":126,"endColumn":86,"suggestions":"182"},"react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'convertIdToGameSquare', 'getMove', and 'socketPlayerColor'. Either include them or remove the dependency array.","ArrayExpression",["183"],{"desc":"184","fix":"185"},"Update the dependencies array to be: [gungiStore.isDragging, gungiStore.gameState?.legal_moves, props.id, legalSquare, getMove, socketPlayerColor, convertIdToGameSquare]",{"range":"186","text":"187"},[3791,3872],"[gungiStore.isDragging, gungiStore.gameState?.legal_moves, props.id, legalSquare, getMove, socketPlayerColor, convertIdToGameSquare]"] \ No newline at end of file diff --git a/client/src/components/game/GungiGame.tsx b/client/src/components/game/GungiGame.tsx index b1e372d..f287b69 100644 --- a/client/src/components/game/GungiGame.tsx +++ b/client/src/components/game/GungiGame.tsx @@ -169,6 +169,7 @@ export const GungiGame: React.FC = observer( board={gameState.board} orientation={orientation} socketPlayer={socketPlayer} + isTurn={gameState?.turn} makeMoveCallback={makeMoveCallback} /> @@ -353,7 +354,7 @@ export const GungiGame: React.FC = observer( playerName={`${blackPlayer?.username}`} playerStockPile={gameState?.stockpile_black} armySize={gameState.armysize_black} - isSocketPlayer={socketPlayerColor === 'b'} + isSocketPlayer={socketPlayer?.userType === 'opponent'} />
@@ -362,7 +363,7 @@ export const GungiGame: React.FC = observer( playerName={`${whitePlayer?.username}`} playerStockPile={gameState?.stockpile_white} armySize={gameState.armysize_white} - isSocketPlayer={socketPlayerColor === 'w'} + isSocketPlayer={socketPlayer?.userType === 'creator'} /> diff --git a/client/src/components/gameboard/Board.tsx b/client/src/components/gameboard/Board.tsx index 19953f1..58b8743 100644 --- a/client/src/components/gameboard/Board.tsx +++ b/client/src/components/gameboard/Board.tsx @@ -22,6 +22,7 @@ interface BoardProps { board: (PieceType | null)[][][]; orientation: string; socketPlayer: User | undefined; + isTurn: string; makeMoveCallback: (move: Move) => void; } @@ -29,6 +30,7 @@ export const Board: React.FC = ({ board, orientation, socketPlayer, + isTurn, makeMoveCallback, }) => { const squares: any[] = []; @@ -74,6 +76,7 @@ export const Board: React.FC = ({ icon={`${topPiece?.color}${topIndex + 1}${topPiece?.type}.svg`} orientation={orientation} socketPlayerColor={socketPlayerColor} + isSocketPlayer={isTurn === socketPlayerColor} belowIcon={ pieceBelow ? `${pieceBelow?.color}${topIndex}${pieceBelow?.type}.svg`