Match History schöner gestaltet. Basis MMR haben in der Historie gefehlt. Werden jetzt abgefragt und angezeigt.
This commit is contained in:
parent
9cf54bd051
commit
7021bc8629
|
|
@ -1 +1 @@
|
|||
{"authenticated":true,"discord_id":"277898241750859776","discord_name":"mrteels","db_id":2,"display_name":"Verzweifelter Kultist","discord_avatar_url":"https://cdn.discordapp.com/avatars/277898241750859776/7c3446bb51fafd72b1b4c21124b4994f.png"}
|
||||
{"authenticated":true,"discord_id":"277898241750859776","discord_name":"mrteels","db_id":2,"display_name":"Daniel Nagel","discord_avatar_url":"https://cdn.discordapp.com/avatars/277898241750859776/7c3446bb51fafd72b1b4c21124b4994f.png"}
|
||||
|
|
@ -150,12 +150,18 @@ def get_player_statistics(player_id):
|
|||
sys.*,
|
||||
stat.mmr,
|
||||
stat.games_in_system,
|
||||
stat.points
|
||||
stat.points,
|
||||
stat.avv_points,
|
||||
stat.last_played,
|
||||
stat.win_rate,
|
||||
stat.trend,
|
||||
stat.tyrann_id,
|
||||
stat.pushover_id,
|
||||
stat.nemesis_id
|
||||
FROM gamesystems sys
|
||||
LEFT JOIN player_game_statistic stat
|
||||
ON sys.id = stat.gamesystem_id AND stat.player_id = ?
|
||||
"""
|
||||
|
||||
cursor.execute(query, (player_id,))
|
||||
rows = cursor.fetchall()
|
||||
connection.close()
|
||||
|
|
|
|||
|
|
@ -54,8 +54,16 @@ def init_db():
|
|||
points INTEGER DEFAULT 0,
|
||||
avv_points INTEGER DEFAULT 0,
|
||||
last_played TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
win_rate REAL DEFAULT 0,
|
||||
win_streak INTEGER DEFAULT 0,
|
||||
trend INTEGER DEFAULT 0,
|
||||
tyrann_id INTEGER,
|
||||
pushover_id INTEGER,
|
||||
nemesis_id INTEGER,
|
||||
FOREIGN KEY (player_id) REFERENCES players (id),
|
||||
FOREIGN KEY (tyrann_id) REFERENCES players (id),
|
||||
FOREIGN KEY (pushover_id) REFERENCES players (id),
|
||||
FOREIGN KEY (nemesis_id) REFERENCES players (id),
|
||||
FOREIGN KEY (gamesystem_id) REFERENCES gamesystems (id)
|
||||
)
|
||||
''')
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ def setup_routes():
|
|||
)
|
||||
|
||||
if system_stat:
|
||||
# None-Werte absichern
|
||||
mmr = system_stat["mmr"] or 0
|
||||
games = system_stat["games_in_system"] or 0
|
||||
points = system_stat["points"] or 0
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ def setup_routes():
|
|||
|
||||
player_id = app.storage.user.get('db_id')
|
||||
|
||||
with ui.column().classes('w-full max-w-7xl mx-auto p-4'):
|
||||
with ui.column().classes('w-full mx-auto p-4'):
|
||||
|
||||
with ui.row().classes('w-full items-center justify-between mb-6'):
|
||||
ui.label("Komplette Match Historie").classes("text-3xl font-bold text-white")
|
||||
|
|
@ -42,18 +42,20 @@ def setup_routes():
|
|||
opponent = f"{match['p2_display']} aka {match['p2_discord']}"
|
||||
my_score = match['score_player1']
|
||||
opp_score = match['score_player2']
|
||||
my_mmr_change = match['player1_mmr_change']
|
||||
my_khorne = match['player1_khorne']
|
||||
my_tzeentch = match['player1_tzeentch']
|
||||
my_slaanesh = match['player1_slaanesh']
|
||||
mmr_base = match["player1_base_change"]
|
||||
mmr_change = match['player1_mmr_change']
|
||||
khorne = match['player1_khorne']
|
||||
tzeentch = match['player1_tzeentch']
|
||||
slaanesh = match['player1_slaanesh']
|
||||
else:
|
||||
opponent = f"{match['p1_display']} aka {match['p1_discord']}"
|
||||
my_score = match['score_player2']
|
||||
opp_score = match['score_player1']
|
||||
my_mmr_change = match['player2_mmr_change']
|
||||
my_khorne = match['player2_khorne']
|
||||
my_tzeentch = match['player2_tzeentch']
|
||||
my_slaanesh = match['player2_slaanesh']
|
||||
mmr_base = match["player2_base_change"]
|
||||
mmr_change = match['player2_mmr_change']
|
||||
khorne = match['player2_khorne']
|
||||
tzeentch = match['player2_tzeentch']
|
||||
slaanesh = match['player2_slaanesh']
|
||||
|
||||
if my_score > opp_score:
|
||||
result = "Gewonnen"
|
||||
|
|
@ -70,30 +72,29 @@ def setup_routes():
|
|||
'date': str(match['played_at'])[:10],
|
||||
'system': match['gamesystem_name'],
|
||||
'score': str(my_score),
|
||||
'opponent': opponent,
|
||||
'opp_score': str(opp_score),
|
||||
'result': result,
|
||||
'opponent': (f"{opponent} ({opp_score})"),
|
||||
"basis" : mmr_base,
|
||||
'elo': fmt_signed(round(elo_factor, 2) if elo_factor is not None else None, pending),
|
||||
'rust': fmt_signed(round(rust_factor, 2) if rust_factor is not None else None, pending),
|
||||
'khorne': fmt_signed(my_khorne, pending),
|
||||
'tzeentch': fmt_signed(my_tzeentch, pending),
|
||||
'slaanesh': fmt_signed(my_slaanesh, pending),
|
||||
'mmr': fmt_signed(my_mmr_change, pending),
|
||||
'khorne': fmt_signed(khorne, pending),
|
||||
'tzeentch': fmt_signed(tzeentch, pending),
|
||||
'slaanesh': fmt_signed(slaanesh, pending),
|
||||
'mmr': fmt_signed(mmr_change, pending),
|
||||
})
|
||||
|
||||
columns = [
|
||||
{'name': 'date', 'label': 'Datum', 'field': 'date', 'align': 'left'},
|
||||
{'name': 'system', 'label': 'System', 'field': 'system', 'align': 'left'},
|
||||
{'name': 'score', 'label': 'Eigene Punkte', 'field': 'score', 'align': 'center'},
|
||||
{'name': 'opponent', 'label': 'Gegner', 'field': 'opponent', 'align': 'left'},
|
||||
{'name': 'opp_score','label': 'Gegner Punkte', 'field': 'opp_score','align': 'center'},
|
||||
{'name': 'result', 'label': 'Ergebnis', 'field': 'result', 'align': 'left'},
|
||||
{'name': 'score', 'label': 'Punkte', 'field': 'score', 'align': 'center'},
|
||||
{'name': 'opponent', 'label': 'Gegner (Pkt.)', 'field': 'opponent', 'align': 'left'},
|
||||
{'name': 'elo', 'label': 'Elo Faktor', 'field': 'elo', 'align': 'right'},
|
||||
{'name': 'basisMMR', 'label': 'Basis MMR', 'field': 'basis', 'align': 'right'},
|
||||
{'name': 'rust', 'label': 'Rost Faktor', 'field': 'rust', 'align': 'right'},
|
||||
{'name': 'khorne', 'label': 'Khorne', 'field': 'khorne', 'align': 'right'},
|
||||
{'name': 'tzeentch', 'label': 'Tzeentch', 'field': 'tzeentch', 'align': 'right'},
|
||||
{'name': 'slaanesh', 'label': 'Slaanesh', 'field': 'slaanesh', 'align': 'right'},
|
||||
{'name': 'mmr', 'label': 'MMR Änderung', 'field': 'mmr', 'align': 'right'},
|
||||
{'name': 'mmr', 'label': 'MMR GESAMT', 'field': 'mmr', 'align': 'right'},
|
||||
|
||||
]
|
||||
|
||||
# Shared slot template for colored signed values
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user