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:37:02 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
f941661b60e5b11f376942a8e1bf0d410878c4ca
f941661b
2 parents
f0790c1c
e06caf38
Merge branch 'master' into release
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 @
f941661
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