From 1820e2bc88471543ef00469c010347946f8ec090 Mon Sep 17 00:00:00 2001
From: Alex <atm2g19@soton.ac.uk>
Date: Sun, 5 Apr 2020 23:45:18 +0100
Subject: [PATCH] removed excess debuggong logs

---
 public/games/battleships_v2/game.js |  2 +-
 public/games/battleships_v2/game.ts |  2 +-
 src/games/battleships_v2.ts         | 18 +++++++++---------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/public/games/battleships_v2/game.js b/public/games/battleships_v2/game.js
index c104806..c1e9191 100644
--- a/public/games/battleships_v2/game.js
+++ b/public/games/battleships_v2/game.js
@@ -314,7 +314,7 @@ class attack extends base {
             this.shots.push(...shot);
         }),
             this.socket.on("sunk", (ships) => {
-                console.log("sunk");
+                // console.log("sunk");
                 this.placed_ships.push(...ships);
             });
     }
diff --git a/public/games/battleships_v2/game.ts b/public/games/battleships_v2/game.ts
index 93cf751..15227a9 100644
--- a/public/games/battleships_v2/game.ts
+++ b/public/games/battleships_v2/game.ts
@@ -388,7 +388,7 @@ class attack extends base {
 				this.shots.push(...shot);
 			}),
 			this.socket.on("sunk", (ships: ship[]) => {
-				console.log("sunk");
+				// console.log("sunk");
 				this.placed_ships.push(...ships);
 			})
 	}
diff --git a/src/games/battleships_v2.ts b/src/games/battleships_v2.ts
index 7ad2e0c..bddc7a7 100644
--- a/src/games/battleships_v2.ts
+++ b/src/games/battleships_v2.ts
@@ -241,14 +241,14 @@ const battleships_v2: GameConstructor = class battleships_v2 implements Game {
 		if (game_data.data.turn != player.player_no) return false;
 		let opponent_ships: ship[] = game_data.json[(player.player_no + 1) % 2 + 1];
 		if (!opponent_ships) return false;
-		console.log("MARK 1")
+		// console.log("MARK 1")
 		//check not duplicate
 		let shots: shot[] = game_data.json[player.player_no + 3];
 		if (shots.reduce((dup: boolean, s) => dup || (s.x == shot.x && s.y == shot.y), false)) {
 			player.socket.emit("fire");
 			return false;
 		}
-		console.log("MARK 2");
+		// console.log("MARK 2");
 		game_data.data.turn++;
 		game_data.data.turn %= 2;
 		this.db.query("UPDATE game_data SET data_value=? WHERE game_id=? AND data_key=0;", [JSON.stringify(game_data.data), game_data.id]);
@@ -287,12 +287,12 @@ const battleships_v2: GameConstructor = class battleships_v2 implements Game {
 					if (shot.hit && shot.x == X && shot.y == Y) hits--;
 				}
 			}
-			console.log({
-				hits,
-				shot,
-				hit,
-				ship
-			});
+			// console.log({
+			// 	hits,
+			// 	shot,
+			// 	hit,
+			// 	ship
+			// });
 			if (hits == 0 && hit == ship) {
 				console.log("SUNK");
 				player.socket.emit("sunk", [ship]);
@@ -306,7 +306,7 @@ const battleships_v2: GameConstructor = class battleships_v2 implements Game {
 			opp.socket.emit("shot", [shot]);
 			opp.socket.emit("fire");
 		}
-		console.log("MARK 3")
+		// console.log("MARK 3")
 		if (shot.hit) {
 			let hits = shots.reduce((count: number, shot) => count + (shot.hit ? 1 : 0), 0);
 			if (hits >= 19) {
-- 
GitLab