summaryrefslogtreecommitdiffstats
path: root/tools/dump_payload
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-03 13:53:39 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-03 13:53:39 +0100
commit9312b112dec178b6689bab6d2b662cc2d8b08c0e (patch)
treed96591c98f22e1e19651c6f595ba80da3ac2591c /tools/dump_payload
parent8b941f42f18c9dbac46127e01c6adc480361a66e (diff)
downloadRustAndDust-9312b112dec178b6689bab6d2b662cc2d8b08c0e.zip
RustAndDust-9312b112dec178b6689bab6d2b662cc2d8b08c0e.tar.gz
tools/dump_payload: generate turns.json
Diffstat (limited to 'tools/dump_payload')
-rwxr-xr-xtools/dump_payload3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/dump_payload b/tools/dump_payload
index e03beb6..27ae33c 100755
--- a/tools/dump_payload
+++ b/tools/dump_payload
@@ -2,3 +2,6 @@
sqlite3 android/assets/data/rustanddust.sqlite 'select payload from states where _g=(select _id from games order by ts desc limit 1)' > state.json
sqlite3 android/assets/data/rustanddust.sqlite 'select payload from turns where _id=(select max(_id) from turns)' > turn.json
+echo "[" > turns.json
+sqlite3 android/assets/data/rustanddust.sqlite 'select payload from turns where _g=(select _id from games order by ts desc limit 1) order by _id' | while read rec; do echo "$rec,"; done >> turns.json
+sed -i '$s/,$/]/' turns.json