Skip to content

Commit

Permalink
Make aircraft rating 64bit integer instead of 32 bit.
Browse files Browse the repository at this point in the history
An integer overflow can happen with 32 bits with a very good, dedicated player.
It caused the stats procesing to crash.
  • Loading branch information
FGlazov committed Nov 25, 2022
1 parent 96f6ec5 commit 9843a38
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ Version 1.5.2

- Add no bombs/bombs filter to mosquito.

Version 1.5.3

- Fix bug where stats would crash if player aircraft rating got too high.
2 changes: 1 addition & 1 deletion src/mod_stats_by_aircraft/aircraft_mod_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class AircraftBucket(models.Model):
plane_lethality = models.FloatField(default=0, db_index=True)
pilot_lethality = models.FloatField(default=0, db_index=True)
elo = models.IntegerField(default=1500, db_index=True)
rating = models.IntegerField(default=0, db_index=True)
rating = models.BigIntegerField(default=0, db_index=True)
max_ak_streak = models.IntegerField(default=0, db_index=True)
max_gk_streak = models.IntegerField(default=0, db_index=True)
kills = models.BigIntegerField(default=0, db_index=True)
Expand Down
20 changes: 20 additions & 0 deletions src/mod_stats_by_aircraft/migrations/0010_fix_rating_crash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-11-25 15:06
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mod_stats_by_aircraft', '0009_fix_captures'),
]

operations = [
migrations.AlterField(
model_name='aircraftbucket',
name='rating',
field=models.BigIntegerField(db_index=True, default=0),
),
]

0 comments on commit 9843a38

Please sign in to comment.