mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 15:11:35 +01:00
ESE custom modifications
This commit is contained in:
10
Round.py
10
Round.py
@@ -36,12 +36,12 @@ class Round:
|
||||
self.blacklist = True
|
||||
|
||||
|
||||
if winnerSide == 2:
|
||||
self.winnerSideString = "Security"
|
||||
self.loserSideString = "Insurgent"
|
||||
if winnerSide == 1:
|
||||
self.winnerSideString = "Red"
|
||||
self.loserSideString = "Blue"
|
||||
else:
|
||||
self.winnerSideString = "Insurgent"
|
||||
self.loserSideString = "Security"
|
||||
self.winnerSideString = "Blue"
|
||||
self.loserSideString = "Red"
|
||||
if mapName:
|
||||
self.mapName = mapName
|
||||
else:
|
||||
|
||||
19
database.py
19
database.py
@@ -31,7 +31,7 @@ class DatabaseConnection:
|
||||
'''Get the total number of players in the database'''
|
||||
|
||||
cursor = self.connPlayers.cursor()
|
||||
cursor.execute("SELECT Count(*) FROM players where games >= 10 and not lastgame is null")
|
||||
cursor.execute("SELECT Count(*) FROM players")
|
||||
count = cursor.fetchone()[0]
|
||||
return count
|
||||
|
||||
@@ -79,8 +79,8 @@ class DatabaseConnection:
|
||||
|
||||
cursor = self.connPlayers.cursor()
|
||||
limit = end - start
|
||||
sqlQuery = '''Select * FROM players where games >= 10
|
||||
and not lastgame is null
|
||||
print(limit, start)
|
||||
sqlQuery = '''Select * FROM players where games >= 1
|
||||
ORDER BY (mu - 2*sigma) DESC LIMIT ? OFFSET ?'''
|
||||
cursor.execute(sqlQuery, (limit, start))
|
||||
rows = cursor.fetchall()
|
||||
@@ -121,11 +121,8 @@ class DatabaseConnection:
|
||||
can't and shouldn't be used to identify a player'''
|
||||
|
||||
cursor = self.connPlayers.cursor()
|
||||
if(player.games < 10):
|
||||
return -1
|
||||
cursor.execute('''SELECT COUNT(*) from players where games >= 10
|
||||
and not lastgame is null
|
||||
and (mu-2*sigma) > (?-2*?);''',
|
||||
cursor.execute('''SELECT COUNT(*) from players
|
||||
where (mu-2*sigma) > (?-2*?);''',
|
||||
(player.mu, player.sigma))
|
||||
rank = cursor.fetchone()[0]
|
||||
return rank
|
||||
@@ -181,9 +178,9 @@ class DatabaseConnection:
|
||||
WHERE timestamp < ? AND id = ?''',
|
||||
(roundObj.startTime.timestamp(), p.playerId))
|
||||
|
||||
if(cursorHist.fetchone()[0] < 10):
|
||||
p.ratingChangeString = "Placements"
|
||||
continue
|
||||
#if(cursorHist.fetchone()[0] < 10):
|
||||
# p.ratingChangeString = "Placements"
|
||||
# continue
|
||||
|
||||
cursorHist.execute('''SELECT mu,sima FROM playerHistoricalData
|
||||
WHERE timestamp < ? AND id = ? order by timestamp DESC LIMIT 1 ''',
|
||||
|
||||
@@ -245,6 +245,7 @@ def leaderboard():
|
||||
if end > maxEntry:
|
||||
start = maxEntry - ( maxEntry % SEGMENT ) - 1
|
||||
end = maxEntry - 1
|
||||
print(maxEntry)
|
||||
reachedEnd = True
|
||||
|
||||
playerList = db.getRankRange(start, end)
|
||||
|
||||
@@ -10,25 +10,6 @@
|
||||
{% include 'navbar_leaderboard.html' %}
|
||||
|
||||
<div class="container mt-3 mb-3" role="main">
|
||||
<div id="playerDisplay" class="playerDisplay mb-3 mt-2">
|
||||
<script>
|
||||
function players(){
|
||||
fetch("/players-online").then(
|
||||
response => response.json()
|
||||
).then(
|
||||
data => {
|
||||
if(data["error"] == ""){
|
||||
document.getElementById("playerDisplay").innerHTML = "Players Online: " + data["player_total"]
|
||||
}else{
|
||||
document.getElementById("playerDisplay").innerHTML = "Players Online: (error)" + data["error"]
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
players()
|
||||
setInterval(players, 2000)
|
||||
</script>
|
||||
</div>
|
||||
<table id="tableMain" class="table table-striped table-bordered table-sm"
|
||||
cellspacing="0">
|
||||
<thead>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<div class="footer-copyright text-center py-3 bg-dark" role="contentinfo">
|
||||
<a style="color: rgba(255,255,255,.5);"
|
||||
class="footerLink" href="https://blog.atlantishq.de/about">Impressum/Legal</a>
|
||||
class="footerLink" href="https://atlantishq.de/impressum">Impressum/Legal</a>
|
||||
<a style="color: rgba(255,255,255,.5);"
|
||||
class="footerLink mid" href="steam://connect/athq.de/:27026">
|
||||
Join the Server!</a>
|
||||
class="footerLink mid" href="https://esports-erlangen.de">
|
||||
ESE Website</a>
|
||||
<a style="color: rgba(255,255,255,.5);"
|
||||
class="footerLink" href="https://github.com/FAUSheppy/skillbird">Star on GitHub</a>
|
||||
</div>
|
||||
|
||||
@@ -15,23 +15,6 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/rounds">Rounds</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/maps">Maps</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav right">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="steam://connect/athq.de/:27026">Server 1</a>
|
||||
</li>
|
||||
<li class="nav-item mr-4">
|
||||
<a class="nav-link" href="steam://connect/athq.de/:27015">Server 2</a>
|
||||
</li>
|
||||
<!--
|
||||
<li class="nav-item">
|
||||
<a class="navbar-brand hover-to-75 patreon" style="position: unset !important;" href="https://www.patreon.com/erlangen_sheppy">Support me
|
||||
</a>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -18,11 +18,6 @@
|
||||
<li class="nav-item">
|
||||
<a id="button-forward" class="nav-link" href="/?page={{ nextPageNumber }}">Forward</a>
|
||||
</li>
|
||||
<li class="nav-item" {% if not gameInProgress %} style="opacity: 0.5" {% endif %}>
|
||||
<a id="button-forward" class="nav-link" href="/livegames">Livegames
|
||||
<div style="font-size: small; color: red; opacity: 1; float: right; margin-left: 10px;">(experimental)</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
<!--
|
||||
@@ -33,9 +28,6 @@
|
||||
<li class="nav-item right mr-2">
|
||||
<a class="nav-link" href="/rounds">Rounds</a>
|
||||
</li>
|
||||
<li class="nav-item right mr-2">
|
||||
<a class="nav-link" href="/maps">Maps</a>
|
||||
</li>
|
||||
<li class="nav-item right">
|
||||
<input id="getPlayer" type="text" aria-label="search for player" class="mt-1"
|
||||
placeholder="search player...">
|
||||
|
||||
@@ -14,13 +14,7 @@
|
||||
</h1>
|
||||
<h3>
|
||||
Rating: <i>{{ player.rating }}</i> <br>
|
||||
{% if player.rank == 0 %}
|
||||
<i><small>Missing {{ 10 - player.games }} placement games!</small></i>
|
||||
{% elif not player.lastGame %}
|
||||
<i><small>Must play a game again before being assigned a rank!</small></i>
|
||||
{% else %}
|
||||
Rank: {{ player.rank }}
|
||||
{%endif%}
|
||||
Rank: {{ player.rank }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="plot-container">
|
||||
|
||||
@@ -41,9 +41,6 @@
|
||||
<div class="col-sm" style="overflow: hidden;">
|
||||
<a href="/player?id={{ p.playerId }}">{{ p.name }}</a>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
{{ p.participation }}%
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
{% if not r.invalid %}
|
||||
<small style="color: green;">
|
||||
@@ -60,9 +57,6 @@
|
||||
<div class="col-sm" style="overflow: hidden;">
|
||||
<a href="/player?id={{ p.playerId }}">{{ p.name }}</a>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
{{ p.participation }}%
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
{% if not r.invalid %}
|
||||
<small style="color: red;">
|
||||
|
||||
Reference in New Issue
Block a user