chiark / gitweb /
wip prepare game
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Dec 2020 22:01:47 +0000 (22:01 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Dec 2020 22:01:47 +0000 (22:01 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
wdriver.rs

index fd3486c91ceba8594e0ded2997603e63a2047bb7..9b59a9a190fc52f01bfa1238e8f53a6e4955ee11 100644 (file)
@@ -32,6 +32,8 @@ pub type AE = anyhow::Error;
 
 pub const URL : &str = "http://localhost:8000";
 
+const CONFIG : &str = "server-config.toml";
+
 pub trait AlwaysContext<T,E> {
   fn always_context(self, msg: &'static str) -> anyhow::Result<T>;
   fn just_warn(self, msg: &'static str) -> Option<T>;
@@ -384,8 +386,6 @@ _ = "error" # rocket
 "game::updates" = 'trace'
 "##);
 
-  const CONFIG : &str = "server-config.toml";
-
   fs::write(CONFIG, &config)
     .context(CONFIG).context("create server config")?;
 
@@ -406,6 +406,10 @@ _ = "error" # rocket
     .context(server_exe).context("game server")?;
 }
 
+#[throws(AE)]
+pub fn prepare_game(_ds: &DirSubst) {
+}
+
 #[throws(AE)]
 fn prepare_geckodriver(cln: &cleanup_notify::Handle) {
   const EXPECTED : &str = "Listening on 127.0.0.1:4444";
@@ -476,6 +480,7 @@ pub fn setup(exe_module_path: &str) -> Setup {
 
   prepare_xserver(&cln, &ds).always_context("setup X server")?;
   prepare_gameserver(&cln, &ds).always_context("setup game server")?;
+  prepare_game(&ds).context("setup game")?;
 
   let final_hook = FinalInfoCollection;