| Rank | +Player | +Games | +Rating | +Winratio % | +
|---|---|---|---|---|
| {{ count }} | +{{ p.name }} | +{{ p.games }} | +{{ p.rating }} | +{{ p.winratio }}% | +
diff --git a/MapSummary.py b/MapSummary.py index 759ab56..c4d1ada 100644 --- a/MapSummary.py +++ b/MapSummary.py @@ -39,10 +39,24 @@ class MapSummary: self.averageTime = datetime.timedelta(seconds=int(averageSeconds)) mapper = [ 1 if x == 0 else -1 for x in self.predictions ] + reverseMapper = [ 1 if x == 0 else 0 for x in self.predictions ] self.ratingSystemDeviation = 0 - for i in range(0, len(self.confidence)): - self.ratingSystemDeviation += mapper[i] * self.confidence[i] - self.ratingSystemDeviation /= self.totalGames + + confidenceCutoff = 60 + confidenceTupels = list(filter(lambda x: x[1] > confidenceCutoff, + zip(reverseMapper, self.confidence))) + + mapperTupels = list(filter(lambda x: x[1] > confidenceCutoff, + zip(mapper, self.confidence))) + + for i in range(0, len(mapperTupels)): + self.ratingSystemDeviation += mapperTupels[i][0] * max(100, 50+mapperTupels[i][1]) + + self.ratingSystemDeviation /= len(mapperTupels) + self.predictionCorrectPercentage = sum([x[0] for x in confidenceTupels]) + self.predictionCorrectPercentage /= len(confidenceTupels) + self.predictionCorrectPercentage *= 100 + self.predictionCorrectPercentage = round(self.predictionCorrectPercentage) except ZeroDivisionError: pass diff --git a/player.py b/player.py index 2a40f9c..e9f6293 100644 --- a/player.py +++ b/player.py @@ -18,6 +18,7 @@ class PlayerInLeaderboard: self.mu = mu self.sigma = sigma self.rating = int(self.mu) - 2*int(self.sigma) + self.ratingStr = str(self.rating) self.games = int(games) self.wins = int(wins) self.loses = self.games - self.wins diff --git a/server.py b/server.py index f7d4300..438ac84 100755 --- a/server.py +++ b/server.py @@ -66,6 +66,11 @@ def maps(): roundsWithMap = list(filter(lambda r: r.mapName == mapName , rounds)) maps += [MapSummary.MapSummary(roundsWithMap)] + allMaps = MapSummary.MapSummary(rounds) + allMaps.mapName = "All Maps*" + maps += [allMaps] + + mapsFiltered = filter(lambda x: x.mapName, maps) return flask.render_template("maps.html", maps=mapsFiltered) diff --git a/static/buttons.js b/static/buttons.js index 30f796a..9f4d302 100644 --- a/static/buttons.js +++ b/static/buttons.js @@ -22,11 +22,13 @@ if(isLastPage){ } /* if request was a playersearch, move to player */ -targetPlayerElements = document.getElementsByClassName("targetPlayer") -if(targetPlayerElements.length == 1){ +targetPlayer = document.getElementById("targetPlayer") +if(targetPlayer){ /* scrollIntoView broken on android?? wtf */ scrollOptions = {beahviour: "smooth", block:"center"} - targetPlayerElements[0].scrollIntoView(scrollOptions); + targetPlayer.scrollIntoView(scrollOptions); + targetPlayer.style.background = "green"; + targetPlayer.children.forEach(c => c.style.borderColor="green") } /* alert on mobile devices if player was not found */ diff --git a/static/site.css b/static/site.css index f70acda..54835ad 100644 --- a/static/site.css +++ b/static/site.css @@ -250,3 +250,11 @@ body{ .hover-to-75:hover{ opacity: 0.75; } +.patreon{ + background: #d71d1d; + padding-left: 0.5vw; + padding-right: 0.5vw; + border-radius: 10px; + font-style: italic; + font-weight: bold; +} diff --git a/templates/base.html b/templates/base.html index c7886c2..bbddef4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -6,27 +6,35 @@ {% include "default_head_content.html" %} -
+ {% include 'navbar_leaderboard.html' %} -| Rank | +Player | +Games | +Rating | +Winratio % | +
|---|---|---|---|---|
| {{ count }} | +{{ p.name }} | +{{ p.games }} | +{{ p.rating }} | +{{ p.winratio }}% | +
- *Rating System Deviation: Percentage difference between the ratio of correctly predicted games by the rating system, to the average confidence of those predictions. For example: 10 games played, 6 games correctly predicted based on ratings with an average confidence of 50% is +20% deviation. -
+
+ Support me
+