mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 07:01:36 +01:00
fix some problems with livegames
This commit is contained in:
10
database.py
10
database.py
@@ -134,8 +134,8 @@ class DatabaseConnection:
|
|||||||
'''Get current live games'''
|
'''Get current live games'''
|
||||||
|
|
||||||
cursor = self.connPlayers.cursor()
|
cursor = self.connPlayers.cursor()
|
||||||
cursor.execute('''SELECT * FROM live WHERE time > ? LIMIT 2''',
|
cursor.execute('''SELECT * FROM live WHERE time > ? ORDER BY time DESC LIMIT 2''', (
|
||||||
(datetime.datetime.now().timestamp(),))
|
(datetime.datetime.now() - datetime.timedelta(minutes=100)).timestamp(),))
|
||||||
|
|
||||||
liveRounds = []
|
liveRounds = []
|
||||||
for row in cursor:
|
for row in cursor:
|
||||||
@@ -150,8 +150,10 @@ class DatabaseConnection:
|
|||||||
security += [p]
|
security += [p]
|
||||||
p.update({"active_time":-1})
|
p.update({"active_time":-1})
|
||||||
|
|
||||||
dbRow = [time, json.dumps(insurgent), json.loads(security), "N/A", 0, 0 ,0]
|
dbRow = [time, json.dumps(insurgent), json.dumps(security), -1, "N/A", duration, 0 ,0]
|
||||||
r = Round.Round(row)
|
r = Round.Round(dbRow)
|
||||||
|
r.winners = [ self.getPlayerById(p.playerId) for p in r.winners]
|
||||||
|
r.losers = [ self.getPlayerById(p.playerId) for p in r.losers]
|
||||||
r.id = trackingID
|
r.id = trackingID
|
||||||
liveRounds += [r]
|
liveRounds += [r]
|
||||||
|
|
||||||
|
|||||||
@@ -19,16 +19,10 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<h1>Tracking ID {{ r.id }}</h1>
|
<h4>Tracking ID {{ r.id }}</h1>
|
||||||
<h4>{{ r.startTime }}</h4>
|
<h2>{{ r.startTime }}</h4>
|
||||||
<h4>Map: {{ r.mapName }}</h4>
|
<h4>Map: {{ r.mapName }}</h4>
|
||||||
<h4>Duration: {{ r.duration }}</h4>
|
<h4>Duration: {{ r.duration }}</h4>
|
||||||
|
|
||||||
{% if r.invalid %}
|
|
||||||
<div>
|
|
||||||
<h5 style="color: red;">{{ r.invalid | safe }}</h5>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -41,7 +35,28 @@
|
|||||||
<h5>Security</h5>
|
<h5>Security</h5>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<h6>Name</h6>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<h6>Rating</h6>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<h6>Name</h6>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<h6>Rating</h6>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
{# WINNERS == INSURGENT for livegames #}
|
{# WINNERS == INSURGENT for livegames #}
|
||||||
@@ -51,11 +66,7 @@
|
|||||||
<a href="/player?id={{ p.playerId }}">{{ p.name }}</a>
|
<a href="/player?id={{ p.playerId }}">{{ p.name }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
{% if not r.invalid %}
|
{{ p.rating }}
|
||||||
<small style="color: green;">
|
|
||||||
{{ p.ratingChangeString | safe }}
|
|
||||||
</small>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -68,14 +79,7 @@
|
|||||||
<a href="/player?id={{ p.playerId }}">{{ p.name }}</a>
|
<a href="/player?id={{ p.playerId }}">{{ p.name }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
{{ p.participation }}%
|
{{ p.rating }}
|
||||||
</div>
|
|
||||||
<div class="col-sm">
|
|
||||||
{% if not r.invalid %}
|
|
||||||
<small style="color: red;">
|
|
||||||
{{ p.ratingChangeString | safe }}
|
|
||||||
</small>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user