Compare commits
4 Commits
a403326341
...
0123d80bb2
Author | SHA1 | Date | |
---|---|---|---|
0123d80bb2 | |||
3e38572869 | |||
6f40b5376e | |||
54af07d15f |
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[registries.strafesnet]
|
||||||
|
index = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
|
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -588,9 +588,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "roblox_emulator"
|
name = "roblox_emulator"
|
||||||
version = "0.4.3"
|
version = "0.4.6"
|
||||||
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
|
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
|
||||||
checksum = "9e5d38699e1474f63a720471ff7720549cb427cb0630fecd4090f17367416495"
|
checksum = "03e2535327bd9069b20caa9df0a5cac87fa886cd2418c7f174016502d584a488"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glam",
|
"glam",
|
||||||
"mlua",
|
"mlua",
|
||||||
@ -603,7 +603,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "roblox_emulator_cli"
|
name = "roblox_emulator_cli"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "roblox_emulator_cli"
|
name = "roblox_emulator_cli"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
repository = "https://git.itzana.me/StrafesNET/roblox_emulator_cli"
|
repository = "https://git.itzana.me/StrafesNET/roblox_emulator_cli"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
@ -10,7 +10,7 @@ authors = ["Rhys Lloyd <krakow20@gmail.com>"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.89"
|
anyhow = "1.0.89"
|
||||||
clap = { version = "4.5.18", features = ["derive"] }
|
clap = { version = "4.5.18", features = ["derive"] }
|
||||||
roblox_emulator = { version = "0.4.3", registry = "strafesnet" }
|
roblox_emulator = { version = "0.4.6", registry = "strafesnet" }
|
||||||
rbx_binary = { version = "0.7.4", registry = "strafesnet" }
|
rbx_binary = { version = "0.7.4", registry = "strafesnet" }
|
||||||
rbx_dom_weak = { version = "2.9.0", registry = "strafesnet" }
|
rbx_dom_weak = { version = "2.9.0", registry = "strafesnet" }
|
||||||
rbx_xml = { version = "0.13.3", registry = "strafesnet" }
|
rbx_xml = { version = "0.13.3", registry = "strafesnet" }
|
||||||
|
11
src/main.rs
11
src/main.rs
@ -42,6 +42,14 @@ fn main()->anyhow::Result<()>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn run_runnable_to_completion(runnable:&roblox_emulator::runner::Runnable)->anyhow::Result<()>{
|
||||||
|
while runnable.has_scheduled_threads()?{
|
||||||
|
runnable.game_tick()?;
|
||||||
|
std::thread::sleep(std::time::Duration::from_nanos(1_000_000_000/60));
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn run_script(input_file:PathBuf)->anyhow::Result<()>{
|
fn run_script(input_file:PathBuf)->anyhow::Result<()>{
|
||||||
let source={
|
let source={
|
||||||
let mut source=String::new();
|
let mut source=String::new();
|
||||||
@ -52,6 +60,7 @@ fn run_script(input_file:PathBuf)->anyhow::Result<()>{
|
|||||||
let runner=roblox_emulator::runner::Runner::new()?;
|
let runner=roblox_emulator::runner::Runner::new()?;
|
||||||
let runnable=runner.runnable_context_with_services(&mut context,&services)?;
|
let runnable=runner.runnable_context_with_services(&mut context,&services)?;
|
||||||
runnable.run_script(script)?;
|
runnable.run_script(script)?;
|
||||||
|
run_runnable_to_completion(&runnable)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,6 +99,7 @@ fn run_model(input_file:PathBuf)->anyhow::Result<()>{
|
|||||||
for script in scripts{
|
for script in scripts{
|
||||||
runnable.run_script(script)?;
|
runnable.run_script(script)?;
|
||||||
}
|
}
|
||||||
|
run_runnable_to_completion(&runnable)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,5 +113,6 @@ fn run_place(input_file:PathBuf)->anyhow::Result<()>{
|
|||||||
for script in scripts{
|
for script in scripts{
|
||||||
runnable.run_script(script)?;
|
runnable.run_script(script)?;
|
||||||
}
|
}
|
||||||
|
run_runnable_to_completion(&runnable)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user