diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-04-25 12:18:00 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-04-25 17:56:43 +0200 |
commit | fc3501382c2aa3ef5b692f4f55c2616f9cade3f5 (patch) | |
tree | a047bb94f8f1854c621fa0fba5ed62c8e0d0be14 /tools/unarchive.sh | |
parent | ed2361980b455d1825d811670f329cbcf5624927 (diff) | |
download | server-fc3501382c2aa3ef5b692f4f55c2616f9cade3f5.tar.gz |
Move toolbox scripts to a "bin" directory.
Add a super "rtt" command to run the scripts.
Diffstat (limited to 'tools/unarchive.sh')
-rw-r--r-- | tools/unarchive.sh | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/tools/unarchive.sh b/tools/unarchive.sh deleted file mode 100644 index 6adb300..0000000 --- a/tools/unarchive.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Restore purged game state from archive. - -if [ -z "$1" ] -then - echo 'usage: bash tools/unarchive.sh <gameid>' - exit 1 -fi - -sqlite3 db << EOF - -attach database 'archive.db' as archive; - -begin; - -select 'RESTORE ' || $1 || ' FROM ARCHIVE'; - -.mode table -select * from archive.games where game_id = $1; - -insert or replace into game_state (game_id, state) - select game_id, state - from archive.game_state where game_id = $1; - -insert or replace into game_replay (game_id, replay_id, role, action, arguments) - select game_id, replay_id, role, action, arguments - from archive.game_replay where game_id = $1; - -insert or replace into game_chat (game_id, chat_id, user_id, time, message) - select game_id, chat_id, user_id, time, message - from archive.game_chat where game_id = $1; - -commit; - -EOF |