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-18 04:35:59 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
3807d7cbb033cf89875941d65c6e2c0c7e91d035
3807d7cb
2 parents
9a8c52df
467fb41d
Merge branch 'feature/2-character_page' into develop
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
app/node/routes/character.js
app/node/routes/character.js
View file @
3807d7c
axios
=
require
(
'axios'
);
const
crwalCharacterCode
=
async
function
(
nickname
)
{
const
crwalCharacterCode
=
async
function
(
nickname
,
isReboot
=
false
)
{
try
{
const
resp
=
await
axios
.
get
(
"https://maplestory.nexon.com/Ranking/World/Total?c="
+
encodeURI
(
nickname
));
const
resp
=
await
axios
.
get
(
"https://maplestory.nexon.com/Ranking/World/Total?c="
+
encodeURI
(
nickname
)
+
"&w="
+
(
isReboot
?
"0"
:
"254"
)
);
const
regex
=
new
RegExp
(
`<dt><a href=\\"\\/Common\\/Character\\/Detail\\/[^\\?]+?\\?p=(.+?)\\"\\s+target=.+?\\/>
${
nickname
}
<\\/a><\\/dt>`
);
const
regexResult
=
regex
.
exec
(
resp
.
data
);
if
(
!
regexResult
)
return
-
2
;
if
(
!
regexResult
)
{
if
(
isReboot
)
return
-
2
;
else
return
await
crwalCharacterCode
(
nickname
,
true
);
}
return
regexResult
[
1
];
}
catch
(
error
)
{
...
...
@@ -245,6 +249,13 @@ const analyzeStats = function(characterInfo, analysisEquipment) {
const
job
=
jobModel
[
characterInfo
.
character
.
job
];
const
jobDefault
=
jobModel
.
default
;
const
weaponConst
=
require
(
'../model/weapon'
)[
analysisEquipment
.
weapon
]
||
1
;
let
rebootDamage
=
0
;
if
(
characterInfo
.
character
.
server
.
name
.
indexOf
(
"리부트"
)
==
0
)
{
// 리부트, 리부트2 월드 반영
rebootDamage
=
parseInt
(
characterInfo
.
character
.
level
/
2
);
}
const
stats
=
{
major
:
{
pure
:
0
,
...
...
@@ -258,7 +269,8 @@ const analyzeStats = function(characterInfo, analysisEquipment) {
all
:
characterInfo
.
stats
.
damageHyper
+
analysisEquipment
.
damagePercent
+
job
.
stats
.
passive
.
damage
.
all
+
jobDefault
.
stats
.
passive
.
damage
.
all
,
jobDefault
.
stats
.
passive
.
damage
.
all
+
rebootDamage
,
boss
:
characterInfo
.
stats
.
bossAttackDamage
},
finalDamage
:
job
.
stats
.
passive
.
finalDamage
,
...
...
Please
register
or
login
to post a comment