Compare commits
2 Commits
4bede23085
...
77d64f6a5f
Author | SHA1 | Date | |
---|---|---|---|
77d64f6a5f | |||
c014244b4b |
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -504,9 +504,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "roblox_emulator"
|
||||
version = "0.3.2"
|
||||
version = "0.4.0"
|
||||
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
|
||||
checksum = "f73c50802f947550642aaeb3da2993751c0e37024ac922dec99313068596321e"
|
||||
checksum = "df647d25a9bc8871a838a830ae90776cd31c44d1a74268bd783d1cadcd8fcd93"
|
||||
dependencies = [
|
||||
"glam",
|
||||
"mlua",
|
||||
@ -518,7 +518,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "roblox_emulator_cli"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "roblox_emulator_cli"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
edition = "2021"
|
||||
repository = "https://git.itzana.me/StrafesNET/roblox_emulator_cli"
|
||||
license = "MIT OR Apache-2.0"
|
||||
@ -10,7 +10,7 @@ authors = ["Rhys Lloyd <krakow20@gmail.com>"]
|
||||
[dependencies]
|
||||
anyhow = "1.0.89"
|
||||
clap = { version = "4.5.18", features = ["derive"] }
|
||||
roblox_emulator = { version = "0.3.2", registry = "strafesnet" }
|
||||
roblox_emulator = { version = "0.4.0", registry = "strafesnet" }
|
||||
rbx_binary = { version = "0.7.4", registry = "strafesnet" }
|
||||
rbx_dom_weak = { version = "2.9.0", registry = "strafesnet" }
|
||||
rbx_xml = { version = "0.13.3", registry = "strafesnet" }
|
||||
|
@ -50,7 +50,7 @@ fn run_script(input_file:PathBuf)->anyhow::Result<()>{
|
||||
};
|
||||
let (mut context,script,services)=roblox_emulator::context::Context::script_singleton(source);
|
||||
let runner=roblox_emulator::runner::Runner::new()?;
|
||||
let runnable=runner.runnable_context(&mut context,&services)?;
|
||||
let runnable=runner.runnable_context_with_services(&mut context,&services)?;
|
||||
runnable.run_script(script)?;
|
||||
Ok(())
|
||||
}
|
||||
@ -82,11 +82,11 @@ pub fn read<R:Read>(input:R)->Result<rbx_dom_weak::WeakDom,ReadError>{
|
||||
fn run_model(input_file:PathBuf)->anyhow::Result<()>{
|
||||
let file=std::fs::File::open(input_file)?;
|
||||
let dom=read(file)?;
|
||||
let (dom,services)=roblox_emulator::place::new_place_with_instances_in_workspace(dom);
|
||||
let mut context=roblox_emulator::context::Context::new(dom);
|
||||
let services=context.convert_into_place();
|
||||
let scripts=context.scripts();
|
||||
let runner=roblox_emulator::runner::Runner::new()?;
|
||||
let runnable=runner.runnable_context(&mut context,&services)?;
|
||||
let runnable=runner.runnable_context_with_services(&mut context,&services)?;
|
||||
for script in scripts{
|
||||
runnable.run_script(script)?;
|
||||
}
|
||||
@ -96,11 +96,10 @@ fn run_model(input_file:PathBuf)->anyhow::Result<()>{
|
||||
fn run_place(input_file:PathBuf)->anyhow::Result<()>{
|
||||
let file=std::fs::File::open(input_file)?;
|
||||
let dom=read(file)?;
|
||||
let services=roblox_emulator::place::Services::find_in(&dom).ok_or(anyhow::Error::msg("Could not find Workspace"))?;
|
||||
let mut context=roblox_emulator::context::Context::new(dom);
|
||||
let scripts=context.scripts();
|
||||
let runner=roblox_emulator::runner::Runner::new()?;
|
||||
let runnable=runner.runnable_context(&mut context,&services)?;
|
||||
let runnable=runner.runnable_context(&mut context)?;
|
||||
for script in scripts{
|
||||
runnable.run_script(script)?;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user