for e in elos:
session.add(elos[e])
- if game_type_cd == 'duel':
- self.process_elos(session, "dm")
+ # no longer calculate DM elo for a duel game
+ # if game_type_cd == 'duel':
+ # self.process_elos(session, "dm")
def update_elos(self, session, elos, scores, ep):
adjustment = scorefactor_real - scorefactor_elo
eloadjust[ei.player_id] += adjustment
eloadjust[ej.player_id] -= adjustment
+
elo_deltas = {}
for pid in pids:
- elo_delta = eloadjust[pid] * elos[pid].k * ep.global_K / float(len(elos) - 1)
+ new_elo = max(float(elos[pid].elo) + eloadjust[pid] * elos[pid].k * ep.global_K / float(len(elos) - 1), ep.floor)
+
+ # delta is new minus old
+ elo_deltas[pid] = new_elo - float(elos[pid].elo)
- if float(elos[pid].elo) + elo_delta < ep.floor:
- elo_deltas[pid] = elos[pid].elo - ep.floor
- else:
- elo_deltas[pid] = elo_delta
+ log.debug("Player {0}'s Elo going from {1} to {2}.".format(pid,
+ elos[pid].elo, new_elo))
- # can't go below the floor
- elos[pid].elo = max(float(elos[pid].elo) + elo_delta, ep.floor)
+ elos[pid].elo = new_elo
elos[pid].games += 1
self.save_elo_deltas(session, elo_deltas)
</td>
${scoreboard_row(game_type_cd, pgstat)}
<td>${pgstat.score}</td>
- % if pgstat.elo_delta == "0.00":
- <td></td>
- % else:
- <td>${pgstat.elo_delta}</td>
- % endif
</tr>
% endfor
</tbody>
<th class="deaths">Deaths</th>
<th class="suicides">Suicides</th>
<th class="score">Score</th>
- <th class="points">Points</th>
</tr>
</thead>
% endif
<th class="fck" title="Flag Carrier Kill">FCK</th>
<th class="returns">Returns</th>
<th class="score">Score</th>
- <th class="points">Points</th>
</tr>
</thead>
% endif