Merge branch 'master' of github.com:FAUSheppy/open-web-leaderboard

This commit is contained in:
Yannik Schmidt
2020-10-14 00:27:29 +02:00
13 changed files with 235 additions and 116 deletions

View File

@@ -12,8 +12,9 @@ class Round:
losersParsed = json.loads(losers)
self.startTime = startTime
self.winners = [ player.playerFromDict(wp) for wp in winnersParsed ]
self.losers = [ player.playerFromDict(lp) for lp in losersParsed ]
self.id = int(float(timestamp))
self.winners = [ player.playerFromDict(wp, int(duration)) for wp in winnersParsed ]
self.losers = [ player.playerFromDict(lp, int(duration)) for lp in losersParsed ]
self.winnerSide = winnerSide
self.duration = datetime.timedelta(seconds=int(duration))
@@ -28,9 +29,12 @@ class Round:
else:
self.mapName = "unavailiable"
self.confidence = int(confidence * 100)
self.numericPrediction = prediction
if prediction == 0:
self.confidence = (int(confidence * 100) - 50)*2
self.quality = int(150 - self.confidence)
if self.confidence < 50:
self.prediction = "-"
elif prediction == 0:
self.prediction = self.winnerSideString
elif prediction == 1:
self.prediction = self.loserSideString