summaryrefslogtreecommitdiff
path: root/tools/sql
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-10-23 23:15:45 +0200
committerTor Andersson <tor@ccxvii.net>2021-10-28 17:36:03 +0200
commit35c3df0bf9209e79fb93875b1fc3e5afee032028 (patch)
tree3a55991699a22fa7f37835623f00110e41d6e68d /tools/sql
parent3d172bf1b9b323d838c3756d85f75b943aefff0f (diff)
downloadserver-35c3df0bf9209e79fb93875b1fc3e5afee032028.tar.gz
Add PRNG seed to game state.
Log all game actions to a table so they can be replayed.
Diffstat (limited to 'tools/sql')
-rw-r--r--tools/sql/schema.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/sql/schema.txt b/tools/sql/schema.txt
index e731c8c..1623ec3 100644
--- a/tools/sql/schema.txt
+++ b/tools/sql/schema.txt
@@ -55,6 +55,14 @@ CREATE TABLE IF NOT EXISTS games (
state TEXT
);
+CREATE TABLE IF NOT EXISTS replay (
+ game_id INTEGER,
+ time TIMESTAMP,
+ role TEXT,
+ action TEXT,
+ arguments TEXT
+);
+
CREATE TABLE IF NOT EXISTS chats (
game_id INTEGER PRIMARY KEY,
time TIMESTAMP,
@@ -110,6 +118,7 @@ BEGIN
DELETE FROM players WHERE game_id = old.game_id;
DELETE FROM notifications WHERE game_id = old.game_id;
DELETE FROM chats WHERE game_id = old.game_id;
+ DELETE FROM replay WHERE game_id = old.game_id;
END;
DROP VIEW IF EXISTS player_view;