summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-03-05 01:53:44 +0100
committerTor Andersson <tor@ccxvii.net>2022-03-05 16:47:03 +0100
commita82c2e2ce844a93a749a16ac17706fa3e011d9cc (patch)
tree54f01becb30ccfbd6271b4ffffb75acbee0e20e2
parente68627f0e43931e57f9feb92ef0ec79665fc25b9 (diff)
downloadserver-a82c2e2ce844a93a749a16ac17706fa3e011d9cc.tar.gz
Remember options when restarting a game via debugging menu.
-rw-r--r--server.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/server.js b/server.js
index dd88d21..a8a97e1 100644
--- a/server.js
+++ b/server.js
@@ -1720,8 +1720,9 @@ function broadcast_presence(game_id) {
function on_restart(socket, scenario) {
try {
let seed = random_seed();
- let state = socket.rules.setup(seed, scenario, {}, socket.players);
- put_replay(socket.game_id, null, 'setup', [seed, scenario, null, socket.players]);
+ let options = JSON.parse(SQL_SELECT_GAME.get(socket.game_id).options);
+ let state = socket.rules.setup(seed, scenario, options, socket.players);
+ put_replay(socket.game_id, null, 'setup', [seed, scenario, options, socket.players]);
for (let other of clients[socket.game_id]) {
other.seen = 0;
send_state(other, state);