Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
M
mangala-pardusacikhack
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Tuğba Fıçıcı
mangala-pardusacikhack
Commits
26001952
Kaydet (Commit)
26001952
authored
May 06, 2021
tarafından
Abdülkerim AKSAK
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Ekranlara overlay eklendi. Server güncellendi.
üst
ba62ebb6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
clientGameArea.html
pages/clientGameArea.html
+9
-2
clientGameArea.js
pages/clientGameArea.js
+2
-2
server.js
socketIOServer/server.js
+7
-3
No files found.
pages/clientGameArea.html
Dosyayı görüntüle @
26001952
...
...
@@ -10,8 +10,15 @@
<body>
<div
class=
"container-fluid"
>
<div
id=
"overlay"
onclick=
"overlayOff()"
>
<div
id=
"text"
>
Bitti
</div>
<div
id=
"overlay"
>
<div>
<p
id=
"text"
></p>
</div>
<div
style=
"position: absolute; top: 50%; left: 40%"
>
<button
class=
"big-button"
onclick=
"yenidenOyna()"
style=
"font-size: 11px; width: 150px"
>
Yeniden Oyna
</button>
</div>
</div>
<div
id=
"overlayOda"
onclick=
"overlayOff()"
>
<div
class=
"row"
style=
"padding: 50px"
>
...
...
pages/clientGameArea.js
Dosyayı görüntüle @
26001952
...
...
@@ -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"
;
...
...
socketIOServer/server.js
Dosyayı görüntüle @
26001952
// Server Side
const
express
=
require
(
"express"
);
const
app
=
express
();
const
port
=
303
0
;
const
http
=
require
(
"http"
).
createServer
();
const
port
=
process
.
env
.
PORT
||
300
0
;
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 <namespcaess>"
);
...
...
@@ -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.
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment