diff --git a/quest/events.py b/quest/events.py index 65e2423..d7d4447 100644 --- a/quest/events.py +++ b/quest/events.py @@ -62,9 +62,9 @@ def message(socket, data): try: groups = [0 if d is None else int(d) for d in reg.groups()] dice_num, dice_sides, dice_mod = groups - assert 0 < dice_num < 100 - assert 0 < dice_sides < 100 - assert -1000 < dice_mod < 1000 + assert 1 <= dice_num <= 256 + assert 1 <= dice_sides <= 256 + assert -65536 <= dice_mod <= 65536 except (ValueError, AssertionError): return dice_results = [random.randint(1, dice_sides) for _ in range(dice_num)] diff --git a/quest/forms.py b/quest/forms.py index f4d287f..12987a6 100644 --- a/quest/forms.py +++ b/quest/forms.py @@ -8,14 +8,14 @@ class DiceCallForm(forms.Form): """ The form for the QM making dice calls. """ - diceNum = forms.IntegerField(min_value=1, max_value=99) - diceSides = forms.IntegerField(min_value=1, max_value=99) + diceNum = forms.IntegerField(min_value=1, max_value=256) + diceSides = forms.IntegerField(min_value=1, max_value=65536) diceMod = forms.IntegerField( - min_value=-999, max_value=999, required=False) + min_value=-65536, max_value=65536, required=False) diceChal = forms.IntegerField( - min_value=1, max_value=999, required=False) + min_value=1, max_value=65536, required=False) diceRollsTaken = forms.IntegerField( - min_value=1, max_value=99, required=False) + min_value=1, max_value=256, required=False) diceStrict = forms.BooleanField(required=False) diff --git a/quest/jinja2/quest/quest.html b/quest/jinja2/quest/quest.html index 225feaf..c3eec58 100644 --- a/quest/jinja2/quest/quest.html +++ b/quest/jinja2/quest/quest.html @@ -111,17 +111,17 @@ diff --git a/quest/migrations/0004_auto_20180924_0931.py b/quest/migrations/0004_auto_20180924_0931.py new file mode 100644 index 0000000..92923bc --- /dev/null +++ b/quest/migrations/0004_auto_20180924_0931.py @@ -0,0 +1,34 @@ +# Generated by Django 2.1.1 on 2018-09-24 13:31 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('quest', '0003_quest_anon_name'), + ] + + operations = [ + migrations.AlterField( + model_name='dicecall', + name='dice_challenge', + field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65536)]), + ), + migrations.AlterField( + model_name='dicecall', + name='dice_roll', + field=models.CharField(max_length=16), + ), + migrations.AlterField( + model_name='dicecall', + name='rolls_taken', + field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(256)]), + ), + migrations.AlterField( + model_name='diceroll', + name='roll', + field=models.CharField(max_length=16), + ), + ] diff --git a/quest/models.py b/quest/models.py index 74e7257..8519302 100644 --- a/quest/models.py +++ b/quest/models.py @@ -56,22 +56,22 @@ class DiceCall(models.Model): on_delete=models.CASCADE, primary_key=True, ) - dice_roll = models.CharField(max_length=9) + dice_roll = models.CharField(max_length=16) strict = models.BooleanField() dice_challenge = models.IntegerField( null=True, blank=True, validators=[ - MaxValueValidator(999), - MinValueValidator(1) + MinValueValidator(1), + MaxValueValidator(65536), ] ) rolls_taken = models.IntegerField( null=True, blank=True, validators=[ - MaxValueValidator(99), - MinValueValidator(1) + MinValueValidator(1), + MaxValueValidator(256), ] ) open = models.BooleanField() @@ -87,7 +87,7 @@ class DiceRoll(models.Model): on_delete=models.CASCADE, primary_key=True, ) - roll = models.CharField(max_length=9) + roll = models.CharField(max_length=16) results = models.TextField() total = models.IntegerField()