Created
June 18, 2020 19:31
-
-
Save Meshiest/46cde3be6ba7b59166b25233360547d2 to your computer and use it in GitHub Desktop.
run a brickadia server in rust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate rexpect; | |
use rexpect::session::spawn_command; | |
use std::ops::DerefMut; | |
use std::process::Command; | |
fn main() { | |
let folder = "server"; | |
let email = "<email>"; | |
let password = "<password>"; | |
let port = 7777; | |
let program = format!( | |
"{}/Brickadia/Binaries/Linux/BrickadiaServer-Linux-Shipping", | |
folder | |
); | |
let mut command = Command::new(program); | |
command.args(vec![ | |
"BrickadiaServer", | |
"-NotInstalled", | |
"-log", | |
format!("-User=\"{}\"", email).as_ref(), | |
format!("-Password=\"{}\"", password).as_ref(), | |
format!("-port=\"{}\"", port).as_ref(), | |
]); | |
let mut pid = spawn_command(command, None).unwrap_or_else(|e| panic!("error: {}", e)); | |
loop { | |
println!("out: {}", pid.deref_mut().read_line().unwrap()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment