Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
30e0a44f
Commit
30e0a44f
authored
Jul 08, 2019
by
18신대성
Committed by
18류지석
Jul 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
살아있는 사람 카운트를 RoomData에 추가함
parent
555b6d21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
Client.js
js/Client.js
+2
-0
main.js
js/main.js
+2
-1
No files found.
js/Client.js
View file @
30e0a44f
...
...
@@ -14,6 +14,7 @@ socket.on('syncRoomData', function(msg) // {num roomNum, [] players}
console
.
log
(
msg
);
RoomData
.
roomNum
=
msg
.
roomNum
;
RoomData
.
players
=
msg
.
players
;
RoomData
.
aliveCount
=
msg
.
players
.
length
;
});
socket
.
on
(
'
startGame
'
,
function
()
{
...
...
@@ -41,4 +42,5 @@ socket.on('userDisconnect', function(msg) // {num index , num id, str nickname}
{
console
.
log
(
msg
.
index
+
'
/
'
+
msg
.
id
+
'
/
'
+
msg
.
nickname
+
'
disconnected
'
);
RoomData
.
players
[
msg
.
index
].
isAlive
=
false
;
RoomData
.
aliveCount
--
;
});
\ No newline at end of file
js/main.js
View file @
30e0a44f
...
...
@@ -25,4 +25,5 @@ PlayerData.nickname = '홍길동'; //플레이어 닉네임
var
RoomData
=
RoomData
||
{};
RoomData
.
roomNum
=
-
1
;
RoomData
.
players
=
null
;
\ No newline at end of file
RoomData
.
players
=
null
;
RoomData
.
aliveCount
=
-
1
;
\ No newline at end of file
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