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:56 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
8477d10bd8f138afb5b9c36efcdb4ba7304a4083
8477d10b
2 parents
b368366e
79509bf3
Merge branch 'bugfix/prevent-ingame-join' into develop
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 @
8477d10
...
...
@@ -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 @
8477d10
...
...
@@ -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