diff --git a/pages/clientGameArea.html b/pages/clientGameArea.html index 7fb8a2391fca98ab665afce1597e6edd166c5cd3..f56e8418b5fee3a2c624bf788402a9def5e9d250 100644 --- a/pages/clientGameArea.html +++ b/pages/clientGameArea.html @@ -10,8 +10,15 @@
-
-
Bitti
+
+
+

+
+
+ +
diff --git a/pages/clientGameArea.js b/pages/clientGameArea.js index bbfb99d0d5ce709018b1a43e4b93a7f8abbadd83..65f1cf4e5affa24228609719f78a23478121a631 100644 --- a/pages/clientGameArea.js +++ b/pages/clientGameArea.js @@ -366,8 +366,8 @@ function yenidenOyna() { const io = require("socket.io-client"); //Connect http://localhost:3000 -//let game = io.connect("https://mangala-server.herokuapp.com/game"); -let game = io.connect("http://localhost:3000/game"); +let game = io.connect("https://mangala-server.herokuapp.com/game"); +//let game = io.connect("http://localhost:3000/game"); const username = "Kerim"; diff --git a/socketIOServer/server.js b/socketIOServer/server.js index 8effca90680e4d425fbb7ca760b4dfead762f232..8b9f653c9b2386b6269fc4f01576d381328fad4f 100644 --- a/socketIOServer/server.js +++ b/socketIOServer/server.js @@ -1,13 +1,17 @@ // Server Side const express = require("express"); const app = express(); -const port = 3030; -const http = require("http").createServer(); +const port = process.env.PORT || 3000; +const http = require("http").createServer(app); const io = require("socket.io")(http); var gameRooms = []; // Kullanıcıların oluşturmuş oldukları odalar +app.get("/", function (req, res) { + res.sendFile(__dirname + "/index.html"); +}); + io.of("/game").on("connection", (socket) => { socket.emit("welcome", "hello to "); @@ -51,7 +55,7 @@ io.of("/game").on("connection", (socket) => { console.log( `newMsg...: "${username}" kisisinden "${roomKey}" odasindan "${msg}" mesaji yollandi.` ); - socket.broadcast.to(roomKey).emit("newMessage", username, msg); //oda içindeki her user için gönderilir. + socket.broadcast.to(roomKey).emit("newMessage", msg); //oda içindeki her user için gönderilir. }); });