summaryrefslogtreecommitdiff
path: root/world
diff options
context:
space:
mode:
Diffstat (limited to 'world')
-rw-r--r--world/src/main.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/world/src/main.rs b/world/src/main.rs
index b5ce1a4..d46f4d1 100644
--- a/world/src/main.rs
+++ b/world/src/main.rs
@@ -81,6 +81,9 @@ pub struct Args {
dry_run: bool,
#[arg(long)]
+ put_cache: bool,
+
+ #[arg(long)]
debug_light: bool,
}
@@ -88,7 +91,11 @@ fn main() -> Result<()> {
env_logger::init_from_env("LOG");
let args = Args::parse();
- let store = ResourceStore::new_memory();
+ let store = if args.put_cache {
+ ResourceStore::new_env()?
+ } else {
+ ResourceStore::new_memory()
+ };
let mut prefabs = Vec::new();
let texture_cache = Arc::new(Mutex::new(HashMap::new()));
@@ -249,7 +256,7 @@ fn main() -> Result<()> {
}
let mut size = 0;
- store.iter(|_k, d| size += d.len()).unwrap();
+ store.iter(|_k, len| size += len).unwrap();
info!(
"prefab has network size of {}",
humansize::format_size(size, BINARY)
@@ -293,9 +300,12 @@ fn main() -> Result<()> {
});
}
+ if args.put_cache {
+ return Ok(());
+ }
if args.push {
- store.iter(|k, v| {
- Packet::RespondResource(k, Data(v.to_vec()))
+ store.iter(|k, _| {
+ Packet::RespondResource(k, Data(store.get_raw(k).unwrap().unwrap()))
.write(&mut sock)
.unwrap();
})?;