-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add save/load of the game state, make the router "cheat-proof"
- Loading branch information
Showing
7 changed files
with
177 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.0.5 on 2021-02-10 17:01 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('book', '0011_auto_20200526_1529'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ProgressSave', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('book_page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.BookPage')), | ||
('items', models.ManyToManyField(blank=True, to='book.Item')), | ||
('progress', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.BookProgress')), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.0.5 on 2021-02-10 17:05 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('book', '0012_progresssave'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='progresssave', | ||
name='updated_at', | ||
field=models.DateTimeField(auto_now=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{{ book.title }}: Сохранения</title> | ||
</head> | ||
<body> | ||
<h1> | ||
{{ book.title }} | ||
</h1> | ||
<h2> | ||
{{ page.title }} | ||
</h2> | ||
<a href="{% url 'book' book.id %}">[Продолжить игру]</a> | ||
<br/> | ||
<a href="{% url 'save_new' book.id %}">[Новое сохранение]</a> | ||
<ul> | ||
{% for save in saves %} | ||
<li> | ||
<a href="{% url 'delete_save' book.id save.id %}">[Удалить]</a> | ||
<a href="{% url 'load_from' book.id save.id %}">[Загрузить]</a> | ||
<a href="{% url 'save_to' book.id save.id %}">[Заменить]</a> | ||
[{{ save.updated_at|date:"Y.m.d H:i:s" }}] {{ save.book_page.title }} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters