1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

bnhkmji9olijkm8n7brrdgtc678i87jm drgex

This commit is contained in:
Steffo 2017-11-15 10:29:01 +01:00
parent dae3ee2649
commit c5d8f50603
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: C27544372FBB445D
3 changed files with 216 additions and 203 deletions

View file

@ -10,6 +10,8 @@ from discord import Status as DiscordStatus
# Init the config reader # Init the config reader
import configparser import configparser
= u.idle()
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read("config.ini") config.read("config.ini")
@ -127,4 +129,3 @@ def process(arg_discord_connection):
u.dispatcher.add_handler(CommandHandler("discord", cmd_discord)) u.dispatcher.add_handler(CommandHandler("discord", cmd_discord))
u.dispatcher.add_handler(CommandHandler("cast", cmd_cast)) u.dispatcher.add_handler(CommandHandler("cast", cmd_cast))
u.start_polling() u.start_polling()
u.idle()

View file

@ -11,214 +11,227 @@
<body> <body>
<div class="container"> <div class="container">
<h1> <h1>
Dota 2 Royal Games Leaderboards
</h1> </h1>
<table id="dota" class="table table-hover sortable dota"> <div id="dota">
<thead> <h2>
<tr> Dota 2
<th>Royal</th> </h2>
<th>Steam</th> <table class="table table-hover sortable dota">
<th>Wins</th> <thead>
<th>Solo MMR</th>
<th>Party MMR</th>
</tr>
</thead>
<tbody>
{% for record in dota_data %}
<tr> <tr>
<td>{{ record.steam.royal.username }}</td> <th>Royal</th>
<td><a href="http://steamcommunity.com/profiles/{{ record.steam.steam_id }}"><img src="{{ record.steam.avatar_url() }}"> {{ record.steam.persona_name }}</a></td> <th>Steam</th>
<td>{{ record.wins }}</td> <th>Wins</th>
<td>{{ record.solo_mmr if record.solo_mmr is not none}}</td> <th>Solo MMR</th>
<td>{{ record.party_mmr if record.party_mmr is not none}}</td> <th>Party MMR</th>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for record in dota_data %}
<h1> <tr>
Rocket League <td>{{ record.steam.royal.username }}</td>
</h1> <td><a href="http://steamcommunity.com/profiles/{{ record.steam.steam_id }}"><img src="{{ record.steam.avatar_url() }}"> {{ record.steam.persona_name }}</a></td>
<table id="rl" class="table table-hover sortable rl"> <td>{{ record.wins }}</td>
<thead> <td>{{ record.solo_mmr if record.solo_mmr is not none}}</td>
<tr> <td>{{ record.party_mmr if record.party_mmr is not none}}</td>
<th>Royal</th> </tr>
<th>Steam</th> {% endfor %}
<th>Singolo <small>1v1</small></th> </tbody>
<th>Doppio <small>2v2</small></th> </table>
<th>Standard <small>3v3</small></th> </div>
<th>Solo Standard <small>SoloQ</small></th> <div id="rl">
</tr> <h2>
</thead> Rocket League
<tbody> </h2>
{% for record in rl_data %} <table class="table table-hover sortable rl">
<thead>
<tr> <tr>
<td>{{ record.steam.royal.username }}</td> <th>Royal</th>
<td><a href="http://steamcommunity.com/profiles/{{ record.steam.steam_id }}"><img src="{{ record.steam.avatar_url() }}"> {{ record.steam.persona_name }}</a></td> <th>Steam</th>
<td class="rl-rank" sorttable_customkey="{{ record.single_mmr if record.single_mmr is not none }}"> <th>Singolo <small>1v1</small></th>
{% if record.single_rank is not none %} <th>Doppio <small>2v2</small></th>
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.single_rank }}.png"> <th>Standard <small>3v3</small></th>
<div class="rl-rank-text"> <th>Solo Standard <small>SoloQ</small></th>
<div class="rl-rank-number">{{ record.single_mmr }}</div>
<div class="rl-rank-division">Div {{ record.single_div + 1 }}</div>
</div>
{% elif record.single_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text rl-unranked">
<div class="rl-rank-number">{{ record.single_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.doubles_mmr if record.doubles_mmr is not none }}">
{% if record.doubles_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.doubles_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.doubles_mmr }}</div>
<div class="rl-rank-division">Div {{ record.doubles_div + 1 }}</div>
</div>
{% elif record.doubles_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text rl-unranked">
<div class="rl-rank-number">{{ record.doubles_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.standard_mmr if record.standard_mmr is not none }}">
{% if record.standard_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.standard_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.standard_mmr }}</div>
<div class="rl-rank-division">Div {{ record.standard_div + 1 }}</div>
</div>
{% elif record.standard_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text rl-unranked">
<div class="rl-rank-number">{{ record.standard_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.solo_std_mmr if record.solo_std_mmr is not none }}">
{% if record.solo_std_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.solo_std_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.solo_std_mmr }}</div>
<div class="rl-rank-division">Div {{ record.solo_std_div + 1 }}</div>
</div>
{% elif record.solo_std_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text rl-unranked">
<div class="rl-rank-number">{{ record.solo_std_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for record in rl_data %}
<h1> <tr>
Overwatch <td>{{ record.steam.royal.username }}</td>
</h1> <td><a href="http://steamcommunity.com/profiles/{{ record.steam.steam_id }}"><img src="{{ record.steam.avatar_url() }}"> {{ record.steam.persona_name }}</a></td>
<table id="overwatch" class="table table-hover sortable"> <td class="rl-rank" sorttable_customkey="{{ record.single_mmr if record.single_mmr is not none }}">
<thead> {% if record.single_rank is not none %}
<tr> <img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.single_rank }}.png">
<th>Royal</th> <div class="rl-rank-text">
<th>Battletag</th> <div class="rl-rank-number">{{ record.single_mmr }}</div>
<th>Livello</th> <div class="rl-rank-division">Div {{ record.single_div + 1 }}</div>
<th>Rank</th> </div>
</tr> {% elif record.single_mmr is not none %}
</thead> <img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<tbody> <div class="rl-rank-text rl-unranked">
{% for record in ow_data %} <div class="rl-rank-number">{{ record.single_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.doubles_mmr if record.doubles_mmr is not none }}">
{% if record.doubles_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.doubles_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.doubles_mmr }}</div>
<div class="rl-rank-division">Div {{ record.doubles_div + 1 }}</div>
</div>
{% elif record.doubles_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text rl-unranked">
<div class="rl-rank-number">{{ record.doubles_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.standard_mmr if record.standard_mmr is not none }}">
{% if record.standard_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.standard_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.standard_mmr }}</div>
<div class="rl-rank-division">Div {{ record.standard_div + 1 }}</div>
</div>
{% elif record.standard_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text rl-unranked">
<div class="rl-rank-number">{{ record.standard_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.solo_std_mmr if record.solo_std_mmr is not none }}">
{% if record.solo_std_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.solo_std_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.solo_std_mmr }}</div>
<div class="rl-rank-division">Div {{ record.solo_std_div + 1 }}</div>
</div>
{% elif record.solo_std_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text rl-unranked">
<div class="rl-rank-number">{{ record.solo_std_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="overwatch">
<h2>
Overwatch
</h2>
<table class="table table-hover sortable">
<thead>
<tr> <tr>
<td>{{ record.royal.username }}</td> <th>Royal</th>
<td><a href="https://playoverwatch.com/en-us/career/pc/eu/{{ record.__str__(separator='-') }}"><img class="thirtytwo slightly-round" src="{{ record.icon_url() }}"> {{ record }}</a></td> <th>Battletag</th>
<td>{{ record.level }}</td> <th>Livello</th>
<td> <th>Rank</th>
{% if record.rank is not none %} </tr>
<img class="thirtytwo" src="https://d1u1mce87gyfbn.cloudfront.net/game/rank-icons/season-2/rank- </thead>
{% if record.rank < 1500 %}1 <tbody>
{% elif record.rank < 2000 %}2 {% for record in ow_data %}
{% elif record.rank < 2500 %}3 <tr>
{% elif record.rank < 3000 %}4 <td>{{ record.royal.username }}</td>
{% elif record.rank < 3500 %}5 <td><a href="https://playoverwatch.com/en-us/career/pc/eu/{{ record.__str__(separator='-') }}"><img class="thirtytwo slightly-round" src="{{ record.icon_url() }}"> {{ record }}</a></td>
{% elif record.rank < 4000 %}6 <td>{{ record.level }}</td>
{% endif %}.png"> <td>
{{ record.rank }} {% if record.rank is not none %}
<img class="thirtytwo" src="https://d1u1mce87gyfbn.cloudfront.net/game/rank-icons/season-2/rank-
{% if record.rank < 1500 %}1
{% elif record.rank < 2000 %}2
{% elif record.rank < 2500 %}3
{% elif record.rank < 3000 %}4
{% elif record.rank < 3500 %}5
{% elif record.rank < 4000 %}6
{% endif %}.png">
{{ record.rank }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="osu">
<h2>
Osu!
</h2>
<table class="table table-hover sortable">
<thead>
<tr>
<th>Royal</th>
<th>Username</th>
<th>osu!</th>
<th>osu!taiko</th>
<th>osu!catch</th>
<th>osu!mania</th>
</tr>
</thead>
<tbody>
{% for record in osu_data %}
<tr>
<td>{{ record.royal.username }}</td>
<td><a href="https://osu.ppy.sh/users/{{ record.osu_id }}"><img class="thirtytwo" src="https://a.ppy.sh/{{ record.osu_id }}"> {{ record.osu_name }}</a></td>
<td sorttable_customkey="{{ record.std_pp }}">{{ record.std_pp|round(0, "floor")|int if record.std_pp is not none and record.std_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.taiko_pp }}">{{ record.taiko_pp|round(0, "floor")|int if record.taiko_pp is not none and record.taiko_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.catch_pp }}">{{ record.catch_pp|round(0, "floor")|int if record.catch_pp is not none and record.catch_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.mania_pp }}">{{ record.mania_pp|round(0, "floor")|int if record.mania_pp is not none and record.mania_pp >= 1 }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="league">
<h2>
League of Legends
</h2>
<table class="table table-hover sortable">
<thead>
<tr>
<th>Royal</th>
<th>Summoner</th>
<th>Livello</th>
<th>Solo <small>SR</small></th>
<th>Flex <small>SR</small></th>
<th>Flex <small>TT</small></th>
</tr>
</thead>
<tbody>
{% for record in lol_data %}
<tr>
<td>{{ record.royal.username }}</td>
<td><img class="thirtytwo round" src="http://avatar.leagueoflegends.com/EUW1/{{ record.summoner_name }}.png"> {{ record.summoner_name }}</td>
<td>{{ record.level }}</td>
{% if record.solo_division is not none %}
<td sorttable_customkey="{{ (record.solo_division.value + 1) * 6 - record.solo_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.solo_division.name|lower + "_" + record.solo_rank.name|lower + ".png") }}"> {{ record.solo_division.name|capitalize }} {{ record.solo_rank.name }}</td>
{% else %}
<td></td>
{% endif %} {% endif %}
</td> {% if record.flex_division is not none %}
</tr> <td sorttable_customkey="{{ (record.flex_division.value + 1) * 6 - record.flex_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.flex_division.name|lower + "_" + record.flex_rank.name|lower + ".png") }}"> {{ record.flex_division.name|capitalize }} {{ record.flex_rank.name }}</td>
{% endfor %} {% else %}
</tbody> <td></td>
</table> {% endif %}
<h1> {% if record.twtr_division is not none %}
Osu! <td sorttable_customkey="{{ (record.twtr_division.value + 1) * 6 - record.twtr_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.twtr_division.name|lower + "_" + record.twtr_rank.name|lower + ".png") }}"> {{ record.twtr_division.name|capitalize }} {{ record.twtr_rank.name }}</td>
</h1> {% else %}
<table id="osu" class="table table-hover sortable"> <td></td>
<thead> {% endif %}
<tr> </tr>
<th>Royal</th> {% endfor %}
<th>Username</th> </tbody>
<th>osu!</th> </table>
<th>osu!taiko</th> </div>
<th>osu!catch</th>
<th>osu!mania</th>
</tr>
</thead>
<tbody>
{% for record in osu_data %}
<tr>
<td>{{ record.royal.username }}</td>
<td><a href="https://osu.ppy.sh/users/{{ record.osu_id }}"><img class="thirtytwo" src="https://a.ppy.sh/{{ record.osu_id }}"> {{ record.osu_name }}</a></td>
<td sorttable_customkey="{{ record.std_pp }}">{{ record.std_pp|round(0, "floor")|int if record.std_pp is not none and record.std_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.taiko_pp }}">{{ record.taiko_pp|round(0, "floor")|int if record.taiko_pp is not none and record.taiko_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.catch_pp }}">{{ record.catch_pp|round(0, "floor")|int if record.catch_pp is not none and record.catch_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.mania_pp }}">{{ record.mania_pp|round(0, "floor")|int if record.mania_pp is not none and record.mania_pp >= 1 }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<h1>
League of Legends
</h1>
<table class="table table-hover sortable">
<thead>
<tr>
<th>Royal</th>
<th>Summoner</th>
<th>Livello</th>
<th>Solo <small>SR</small></th>
<th>Flex <small>SR</small></th>
<th>Flex <small>TT</small></th>
</tr>
</thead>
<tbody>
{% for record in lol_data %}
<tr>
<td>{{ record.royal.username }}</td>
<td><img class="thirtytwo round" src="http://avatar.leagueoflegends.com/EUW1/{{ record.summoner_name }}.png"> {{ record.summoner_name }}</td>
<td>{{ record.level }}</td>
{% if record.solo_division is not none %}
<td sorttable_customkey="{{ (record.solo_division.value + 1) * 6 - record.solo_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.solo_division.name|lower + "_" + record.solo_rank.name|lower + ".png") }}"> {{ record.solo_division.name|capitalize }} {{ record.solo_rank.name }}</td>
{% else %}
<td></td>
{% endif %}
{% if record.flex_division is not none %}
<td sorttable_customkey="{{ (record.flex_division.value + 1) * 6 - record.flex_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.flex_division.name|lower + "_" + record.flex_rank.name|lower + ".png") }}"> {{ record.flex_division.name|capitalize }} {{ record.flex_rank.name }}</td>
{% else %}
<td></td>
{% endif %}
{% if record.twtr_division is not none %}
<td sorttable_customkey="{{ (record.twtr_division.value + 1) * 6 - record.twtr_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.twtr_division.name|lower + "_" + record.twtr_rank.name|lower + ".png") }}"> {{ record.twtr_division.name|capitalize }} {{ record.twtr_rank.name }}</td>
{% else %}
<td></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div> </div>
</body> </body>
</html> </html>

View file

@ -1,7 +1,6 @@
from flask import Flask, render_template from flask import Flask, render_template
from db import Session, Royal, Steam, RocketLeague, Dota, Osu, Overwatch, LeagueOfLegends from db import Session, Royal, Steam, RocketLeague, Dota, Osu, Overwatch, LeagueOfLegends
from sqlalchemy.orm import joinedload from sqlalchemy.orm import joinedload
from sqlalchemy import func
app = Flask(__name__) app = Flask(__name__)