support multiple replays in the same session

This commit is contained in:
Martin Michelsen
2026-05-13 21:25:55 -07:00
parent 2e667bbe50
commit a6c25568ba
7 changed files with 68 additions and 40 deletions
-12
View File
@@ -1095,15 +1095,3 @@ ShellCommand c_create_item(
send_text_message(c->channel, "$C7Item created:\n" + name);
co_return deque<string>{};
});
ShellCommand c_replay_log(
"replay-log", nullptr,
+[](ShellCommand::Args& args) -> asio::awaitable<deque<string>> {
if (args.s->allow_saving_accounts) {
throw runtime_error("Replays cannot be run when account saving is enabled");
}
auto log_f = phosg::fopen_shared(args.args, "rt");
auto replay_session = make_shared<ReplaySession>(args.s, log_f.get(), true);
co_await replay_session->run();
co_return deque<string>{};
});