From 073cee376e7d740ec02fac89d17cbaac28bf81f6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 4 May 2021 00:22:36 +0100 Subject: [PATCH] apitest: Make prepare_gameserver do the for_game call Signed-off-by: Ian Jackson --- apitest/apitest.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apitest/apitest.rs b/apitest/apitest.rs index f325bcca..75b60de0 100644 --- a/apitest/apitest.rs +++ b/apitest/apitest.rs @@ -595,7 +595,7 @@ pub fn prepare_tmpdir<'x>(opts: &'x Opts, mut current_exe: &'x str) -> DirSubst #[throws(AE)] pub fn prepare_gameserver(cln: &cleanup_notify::Handle, ds: &DirSubst) - -> (MgmtChannel, Child) { + -> (MgmtChannelForGame, Child) { let config = ds.subst(r##" change_directory = "@abstmp@" base_dir = "@build@" @@ -635,7 +635,7 @@ _ = "error" # rocket #[throws(AE)] fn start_gameserver(cln: &cleanup_notify::Handle, ds: &DirSubst) - -> (MgmtChannel, Child) { + -> (MgmtChannelForGame, Child) { let server_exe = ds.subst("@target@/debug/daemon-otter")?; let mut cmd = Command::new(&server_exe); cmd @@ -659,6 +659,11 @@ fn start_gameserver(cln: &cleanup_notify::Handle, ds: &DirSubst) mgmt_conn.cmd(&MgmtCommand::SetSuperuser(true))?; mgmt_conn.cmd(&MgmtCommand::SelectAccount("server:".parse()?))?; + let mgmt_conn = mgmt_conn.for_game( + TABLE.parse()?, + MgmtGameUpdateMode::Online + ); + (mgmt_conn, child) } @@ -991,11 +996,6 @@ pub fn setup_core(module_paths: &[&str], early_args: EarlyArgPredicate) -> let (mgmt_conn, server_child) = prepare_gameserver(&cln, &ds).did("setup game server")?; - let mgmt_conn = mgmt_conn.for_game( - TABLE.parse()?, - MgmtGameUpdateMode::Online - ); - let instance_name = prepare_game(&ds, &default(), TABLE).context("setup game")?; -- 2.30.2