summaryrefslogtreecommitdiff
path: root/tools/undo.sh
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-02-17 22:39:14 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-17 22:39:35 +0100
commit6bc0c7f7352779ff3b39e5053ca62f332e4228e7 (patch)
tree080c48ac7bd2955b4a5e7908adbfebee15f9b8cf /tools/undo.sh
parent2394f481b12aeb75db4c61ef00eddfd65bb54e8a (diff)
downloadserver-6bc0c7f7352779ff3b39e5053ca62f332e4228e7.tar.gz
Add script to undo a turn.
Diffstat (limited to 'tools/undo.sh')
-rw-r--r--tools/undo.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/undo.sh b/tools/undo.sh
new file mode 100644
index 0000000..3cd5b4a
--- /dev/null
+++ b/tools/undo.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+if [ -n "$1" ]
+then
+ RID=$(sqlite3 db "select replay_id from game_replay where game_id=$1 order by replay_id desc limit 1")
+ echo $RID
+ sqlite3 db "delete from game_replay where game_id=$1 and replay_id=$RID"
+ node tools/patchgame.js $1
+else
+ echo "usage: bash tools/undo.sh GAME"
+fi