Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김대욱
/
My_Project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김대욱
2020-06-24 15:51:20 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
927586c1f8b9479e29e66058add9cd3a215b6911
927586c1
1 parent
52004542
app.js_test
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
app.js
app.js
View file @
927586c
...
...
@@ -163,7 +163,7 @@ chat.on('connection', function(conn) {
/* Functions */
function
updateUser
(
id
,
name
)
{
if
(
name
.
length
>
2
&&
name
.
length
<
17
&&
name
.
indexOf
(
' '
)
<
0
&&
!
utils
.
checkUser
(
clients
,
name
)
&&
name
.
match
(
alphanumeric
)
&&
name
!=
'
Console'
&&
name
!=
'
System'
)
{
if
(
name
.
length
>
2
&&
name
.
length
<
17
&&
name
.
indexOf
(
' '
)
<
0
&&
!
utils
.
checkUser
(
clients
,
name
)
&&
name
.
match
(
alphanumeric
)
&&
name
!=
'System'
)
{
if
(
clients
[
id
].
un
==
null
)
{
clients
[
id
].
con
.
write
(
JSON
.
stringify
({
type
:
'server'
,
info
:
'success'
}));
uid
++
;
...
...
@@ -187,7 +187,7 @@ function updateUser(id, name) {
if
(
!
name
.
match
(
alphanumeric
))
motive
=
'format'
;
if
(
name
.
length
<
3
||
name
.
length
>
16
)
motive
=
'length'
;
if
(
utils
.
checkUser
(
clients
,
name
)
||
name
==
'Console'
||
name
==
'System'
)
motive
=
'taken'
;
if
(
utils
.
checkUser
(
clients
,
name
)
||
name
==
'System'
)
motive
=
'taken'
;
if
(
clients
[
id
].
un
!=
null
)
check
=
true
;
clients
[
id
].
con
.
write
(
JSON
.
stringify
({
type
:
'server'
,
info
:
'rejected'
,
reason
:
motive
,
keep
:
check
}));
...
...
Please
register
or
login
to post a comment