Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
강동현
2021-06-11 01:16:47 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
79509bf302d5ba2a92923714d1e824111e48d368
79509bf3
1 parent
b368366e
게임 도중 입장하지 못하도록 수정
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
server/room/Room.ts
server/test/util/DummySocket.ts
server/room/Room.ts
View file @
79509bf
...
...
@@ -102,7 +102,11 @@ export class Room {
}
public
connect
(
user
:
User
):
void
{
if
(
this
.
users
.
includes
(
user
)
||
this
.
users
.
length
>=
this
.
maxUsers
)
{
if
(
this
.
users
.
includes
(
user
)
||
this
.
users
.
length
>=
this
.
maxUsers
||
this
.
game
)
{
return
;
}
...
...
server/test/util/DummySocket.ts
View file @
79509bf
...
...
@@ -16,6 +16,8 @@ export class DummySocket implements SocketWrapper {
public
setDisconnectHandler
(
handler
:
()
=>
void
)
{}
public
setPingHandler
(
handler
:
()
=>
void
)
{}
public
send
(
raw
:
RawMessage
):
void
{
this
.
receivedMessages
.
push
(
raw
);
}
...
...
@@ -43,4 +45,8 @@ export class DummySocket implements SocketWrapper {
public
notReceived
<
T
extends
ServerOutboundMessageKey
>
(
key
:
T
):
void
{
expect
(
this
.
findMessageIndex
(
key
)
===
-
1
).
eq
(
true
);
}
public
sendPing
():
void
{
// TODO
}
}
...
...
Please
register
or
login
to post a comment