Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김세윤
/
LOL_findgg
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김세윤
2020-11-22 00:48:42 +0900
1
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d9037d2bf0a46bc3da70ed9e6fc398d7827b2c7d
d9037d2b
1 parent
a4bdea49
챔피언 사진 업데이트
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
RUTROLL/router/Test.js
RUTROLL/router/main.js
RUTROLL/views/index.ejs
RUTROLL/router/Test.js
View file @
d9037d2
...
...
@@ -2,7 +2,7 @@ module.exports = function(app){
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-
539b7900-4377-44be-80ea-f0a88bb9b641
"
//api
var
apikey
=
"RGAPI-
4591bbaf-8e3f-4afa-91c2-359b66a402b7
"
//api
var
profileIconId
;
//아이콘 번호
var
revisionDate
;
//수정날짜
...
...
@@ -82,7 +82,7 @@ var rotation_champ = new Array();
var
staticUrl
=
"http://ddragon.leagueoflegends.com/cdn/
9
.23.1/data/en_US/champion.json"
;
var
staticUrl
=
"http://ddragon.leagueoflegends.com/cdn/
10
.23.1/data/en_US/champion.json"
;
request
(
staticUrl
,
function
(
error
,
response
,
body
){
var
info_static_champ_json
=
JSON
.
parse
(
body
);
var
champion
=
info_static_champ_json
[
"data"
];
...
...
@@ -91,7 +91,7 @@ var rotation_champ = new Array();
for
(
j
in
champion
[
js
]){
if
(
champion
[
js
][
"key"
]
==
champ_id
[
i
]){
champ_name
[
i
]
=
champion
[
js
][
"id"
];
champ_pic
[
i
]
=
"http://ddragon.leagueoflegends.com/cdn/
9
.23.1/img/champion/"
+
champ_name
[
i
]
+
".png"
;
champ_pic
[
i
]
=
"http://ddragon.leagueoflegends.com/cdn/
10
.23.1/img/champion/"
+
champ_name
[
i
]
+
".png"
;
}
}
...
...
@@ -102,7 +102,7 @@ var rotation_champ = new Array();
for
(
j
in
champion
[
js
]){
if
(
champion
[
js
][
"key"
]
==
rotation_champ
[
i
]){
rotation_name
[
i
]
=
champion
[
js
][
"id"
];
rotation_pic
[
i
]
=
"http://ddragon.leagueoflegends.com/cdn/
9
.23.1/img/champion/"
+
rotation_name
[
i
]
+
".png"
;
rotation_pic
[
i
]
=
"http://ddragon.leagueoflegends.com/cdn/
10
.23.1/img/champion/"
+
rotation_name
[
i
]
+
".png"
;
}
}
...
...
@@ -149,9 +149,9 @@ var rotation_champ = new Array();
var
temp_name
;
var
temp_point
;
var
temp_pic
;
for
(
var
i
=
0
;
i
<
champ_id
.
length
-
1
;
i
++
){
for
(
var
i
=
0
;
i
<
champ_id
.
length
-
1
;
i
++
){
//챔피언 포인트 순으로 sorting
for
(
var
j
=
i
+
1
;
j
<
champ_id
.
length
-
1
;
j
++
)
if
(
champ_point
[
i
]
>
champ_point
[
j
]){
if
(
champ_point
[
i
]
<
champ_point
[
j
]){
temp_id
=
champ_id
[
i
];
temp_name
=
champ_name
[
i
];
temp_point
=
champ_point
[
i
];
...
...
@@ -197,7 +197,7 @@ var rotation_champ = new Array();
res
.
render
(
'index'
,
{
title
:
req
.
params
.
username
,
res
.
render
(
'index'
,
{
title
:
req
.
params
.
username
,
//데이터를 ejs로 넘길 때 사용
c_id
:
champ_id
,
c_name
:
champ_name
,
c_point
:
champ_point
,
...
...
RUTROLL/router/main.js
View file @
d9037d2
...
...
@@ -2,7 +2,7 @@ module.exports = function(app){
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-
df870784-f399-4104-bfbb-1b209aeb597f
"
//api
var
apikey
=
"RGAPI-
4591bbaf-8e3f-4afa-91c2-359b66a402b7
"
//api
var
profileIconId
;
//아이콘 번호
var
revisionDate
;
//수정날짜
...
...
@@ -45,7 +45,7 @@ var matches; //경기정보
var
champ_pic
=
new
Array
();
var
champions_length
=
Object
.
keys
(
champions
).
length
;
for
(
var
i
=
0
;
i
<
champions_length
;
i
++
){
for
(
var
i
=
0
;
i
<
champions_length
;
i
++
){
//챔피언 포인트 계산 식
champ_point
[
i
]
=
(
champions
[
i
][
"stats"
][
"totalSessionsWon"
]
/
champions
[
i
][
"stats"
][
"totalSessionsPlayed"
]
*
200
)
+
((
champions
[
i
][
"stats"
][
"totalAssists"
]
+
champions
[
i
][
"stats"
][
"totalChampionKills"
])
/
champions
[
i
][
"stats"
][
"totalDeathsPerSession"
]
*
100
)
+
(
champions
[
i
][
"stats"
][
"totalSessionsPlayed"
]
*
3
);
...
...
RUTROLL/views/index.ejs
View file @
d9037d2
...
...
@@ -101,7 +101,7 @@
<div
class=
"center"
>
<img
src=
<%=c_pic[i]%
>
width=50, height=50>
<
%= c_name[i] %>
<
%= "point: " +
(1000000/c_point[i]).toFixed(2)
%>
<
%= "point: " +
c_point[i]
%>
<
% } %>
</div>
...
...
김세윤
@2017103973 commented
2020-11-21 15:51:53 UTC
Master
챔피언 숙련도 점수 내림차순 숙련도 점수 그대로 출력 코드 분석
Please
register
or
login
to post a comment