Toggle navigation
Toggle navigation
This project
Loading...
Sign in
오윤석
/
maplespec.ga
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
4
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
오윤석
2020-06-12 23:57:21 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
496abba3f3f43089516ba46147efa839f0fdc6d6
496abba3
1 parent
45801178
fix: 서버 접속이 불가능한 경우 없는 캐릭터로 뜨는 오류
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
app/node/routes/character.js
app/node/routes/character.js
View file @
496abba
...
...
@@ -8,12 +8,12 @@ const crwalCharacterCode = async function(nickname) {
const
regexResult
=
regex
.
exec
(
resp
.
data
);
if
(
!
regexResult
)
return
false
;
return
-
2
;
return
regexResult
[
1
];
}
catch
(
error
)
{
console
.
log
(
error
);
return
false
;
return
-
1
;
}
}
...
...
@@ -391,7 +391,10 @@ module.exports = {
const
nickname
=
req
.
query
.
nickname
;
const
characterCode
=
await
crwalCharacterCode
(
req
.
query
.
nickname
);
if
(
!
characterCode
)
{
if
(
characterCode
==
-
1
)
{
res
.
status
(
500
).
send
();
return
;
}
else
if
(
characterCode
==
-
2
)
{
res
.
status
(
404
).
send
();
return
;
}
...
...
@@ -429,7 +432,7 @@ module.exports = {
const
efficiency
=
calculateEfficiency
(
stats
,
characterInfo
.
character
.
job
,
analysisEquipment
.
weapon
);
const
buffEfficiency
=
calculateEfficiency
(
buffStats
,
characterInfo
.
character
.
job
,
analysisEquipment
.
weapon
);
res
.
send
(
{
const
result
=
{
info
:
characterInfo
.
character
,
analysis
:
{
default
:
{
...
...
@@ -441,6 +444,9 @@ module.exports = {
efficiency
:
buffEfficiency
}
}
});
};
console
.
log
(
JSON
.
stringify
(
result
));
res
.
send
(
result
);
}
};
\ No newline at end of file
...
...
Please
register
or
login
to post a comment