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:36:15 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e06caf380d3c528ce3f920bdd65e32b46146acf1
e06caf38
2 parents
a4ac3b89
3807d7cb
Merge branch '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 @
e06caf3
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