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-11 06:00:55 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e1261883fae7edcc927c9e18124233ee09438aab
e1261883
1 parent
3ca25d82
점검중인경우 대응
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
app/node/routes/character.js
app/node/routes/character.js
View file @
e126188
...
...
@@ -25,6 +25,10 @@ const getCharacterInfo = async function(nickname, characterCode) {
throw
new
Error
(
"private_character"
);
}
if
(
resp
.
data
.
indexOf
(
"메이플스토리 게임 점검 중에는 이용하실 수 없습니다."
)
>=
0
)
{
throw
new
Error
(
"game_checking"
);
}
const
character
=
{
nickname
:
nickname
,
characterCode
:
characterCode
,
...
...
@@ -117,7 +121,12 @@ const getCharacterInfo = async function(nickname, characterCode) {
};
}
catch
(
error
)
{
console
.
log
(
error
);
return
false
;
if
(
error
.
message
==
"private_character"
)
return
-
1
;
else
if
(
error
.
message
==
"game_checking"
)
return
-
2
;
else
return
-
999
;
}
}
...
...
@@ -129,6 +138,10 @@ const analyzeEquipment = async function(nickname, characterCode, job) {
throw
new
Error
(
"private_character"
);
}
if
(
resp
.
data
.
indexOf
(
"메이플스토리 게임 점검 중에는 이용하실 수 없습니다."
)
>=
0
)
{
throw
new
Error
(
"game_checking"
);
}
const
{
JSDOM
}
=
require
(
'jsdom'
);
const
dom
=
new
JSDOM
(
resp
.
data
);
const
$
=
(
require
(
'jquery'
))(
dom
.
window
);
...
...
@@ -218,7 +231,12 @@ const analyzeEquipment = async function(nickname, characterCode, job) {
};
}
catch
(
error
)
{
console
.
log
(
error
);
return
false
;
if
(
error
.
message
==
"private_character"
)
return
-
1
;
else
if
(
error
.
message
==
"game_checking"
)
return
-
2
;
else
return
-
999
;
}
}
...
...
@@ -378,15 +396,31 @@ module.exports = {
}
const
characterInfo
=
await
getCharacterInfo
(
nickname
,
characterCode
);
if
(
!
characterInfo
)
{
if
(
characterInfo
==
-
1
)
{
// 접근 권한 설정 필요
res
.
status
(
403
).
send
();
return
;
}
else
if
(
characterInfo
==
-
2
)
{
// 점검중
res
.
status
(
503
).
send
();
return
;
}
else
if
(
characterInfo
<
0
)
{
res
.
status
(
400
).
send
();
return
;
}
const
analysisEquipment
=
await
analyzeEquipment
(
nickname
,
characterCode
,
characterInfo
.
character
.
job
);
if
(
!
analysisEquipment
)
{
if
(
analysisEquipment
==
-
1
)
{
// 접근 권한 설정 필요
res
.
status
(
403
).
send
();
return
;
}
else
if
(
analysisEquipment
==
-
2
)
{
// 점검중
res
.
status
(
503
).
send
();
return
;
}
else
if
(
analysisEquipment
<
0
)
{
res
.
status
(
400
).
send
();
return
;
}
const
stats
=
analyzeStats
(
characterInfo
,
analysisEquipment
);
...
...
Please
register
or
login
to post a comment