summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-08-05 22:17:10 +0200
committerTor Andersson <tor@ccxvii.net>2022-08-06 11:20:16 +0200
commit6a72d2b30417c68e74b77d8dc6699573f9e033d5 (patch)
tree0551018a6fe77c289314a4a7e0e9c91416e091c4 /tools
parent5c1d5d9c2a74502e40f67ef47337a97349be0d0d (diff)
downloadserver-6a72d2b30417c68e74b77d8dc6699573f9e033d5.tar.gz
Fix patchgame script.
Diffstat (limited to 'tools')
-rw-r--r--tools/patchgame.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/patchgame.js b/tools/patchgame.js
index 1eeaf9c..86c0580 100644
--- a/tools/patchgame.js
+++ b/tools/patchgame.js
@@ -13,7 +13,7 @@ let db = new sqlite3("./db");
let game_id = process.argv[2];
let title_id = db.prepare("select title_id from games where game_id=?").pluck().get(game_id);
let rules = require("../public/" + title_id + "/rules.js");
-let log = db.prepare("select rowid,* from game_replay where game_id=?").all(game_id);
+let log = db.prepare("select * from game_replay where game_id=?").all(game_id);
let save = db.prepare("select state from game_state where game_id=?").pluck().get(game_id);
fs.writeFileSync("backup-" + game_id + ".txt", save);
@@ -40,5 +40,5 @@ db.prepare("update game_state set active=?, state=? where game_id=?").run(game.a
if (i < log.length) {
console.log("BROKEN ENTRIES: %d", log.length-i);
- console.log(`sqlite3 db "delete from game_replay where game_id=${game_id} and rowid>=${log[i].rowid}"`);
+ console.log(`sqlite3 db "delete from game_replay where game_id=${game_id} and replay_id>=${log[i].replay_id}"`);
}