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
475a5d19
Commit
475a5d19
authored
Jul 08, 2019
by
18류지석
Browse files
Options
Browse Files
Download
Plain Diff
시즌 7호 머지
parents
a5784ccc
36e44d27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
15 deletions
+7
-15
Client.js
js/Client.js
+3
-2
server.js
server.js
+4
-13
No files found.
js/Client.js
View file @
475a5d19
...
...
@@ -29,7 +29,8 @@ socket.on('changePhase', function(msg) // number Phase
WordSpace
.
CurrentPhase
=
msg
;
});
socket
.
on
(
'
userDisconnect
'
,
function
(
msg
)
// {num id, str nickname}
socket
.
on
(
'
userDisconnect
'
,
function
(
msg
)
// {num i
ndex , num i
d, str nickname}
{
console
.
log
(
msg
.
id
+
'
/
'
+
msg
.
nickname
+
'
disconnected
'
);
console
.
log
(
msg
.
index
+
'
/
'
+
msg
.
id
+
'
/
'
+
msg
.
nickname
+
'
disconnected
'
);
RoomData
.
players
[
msg
.
index
].
isAlive
=
false
;
});
\ No newline at end of file
server.js
View file @
475a5d19
...
...
@@ -69,19 +69,10 @@ io.on('connection', function(socket)
// 룸에서도 제거
if
(
socket
.
playerData
.
currentRoom
!=
null
)
{
GameServer
.
announceToRoom
(
GameServer
.
findRoomIndex
(
socket
.
playerData
.
currentRoom
.
roomNum
),
'
userDisconnect
'
,
{
id
:
socket
.
playerData
.
id
,
nickname
:
socket
.
playerData
.
nickname
});
let
_idxToDel
=
socket
.
playerData
.
currentRoom
.
currentPlayer
.
findIndex
(
function
(
element
)
{
return
element
.
id
===
socket
.
playerData
.
id
;
});
if
(
idxToDel
!=
-
1
)
{
socket
.
playerData
.
currentRoom
.
currentPlayer
.
splice
(
_idxToDel
,
1
);
}
socket
.
playerData
.
playingData
.
isAlive
=
false
;
socket
.
playerData
.
playingData
.
rank
=
socket
.
playerData
.
currentRoom
.
nextRank
--
;
socket
.
playerData
.
currentRoom
.
currentSocket
.
splice
(
socket
.
playerData
.
playingData
.
index
,
1
);
GameServer
.
announceToRoom
(
GameServer
.
findRoomIndex
(
socket
.
playerData
.
currentRoom
.
roomNum
),
'
userDisconnect
'
,
socket
.
playerData
.
playingData
);
}
}
});
...
...
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