//---------- scanning/incorporating/uploading ----------
#[throws(InternalError)]
-fn incorporate_bundle(ib: &mut InstanceBundles, _ig: &mut Instance,
+fn incorporate_bundle(ib: &mut InstanceBundles, ig: &mut Instance,
id: Id, parsed: Parsed) {
let Parsed { meta, libs } = parsed;
})
};
- let _ = libs; // xxx actually incorporate
+ for lib in libs {
+ ig.local_libs.add(lib);
+ }
let state = State::Loaded(Loaded { meta });
*slot = Some(Note { kind: id.kind, state });
}
// If we are in UNUSED, become BROKEN
- // xxx: make shape libs and specs inaccessible to mgmt commands
- let _ = ();
+ ig.local_libs.clear();
(||{
// If we are in BROKEN, become WRECKAGE
pub links: Arc<LinksTable>,
pub bundle_list: MgmtBundleList, // copy for easy access
pub asset_url_key: AssetUrlKey,
+ pub local_libs: shapelib::Registry,
}
pub struct PlayerRecord {
links: default(),
bundle_list: default(),
asset_url_key: AssetUrlKey::new_random()?,
+ local_libs: default(),
};
let c = InstanceContainer {
links: default(),
bundle_list: default(),
asset_url_key: AssetUrlKey::Dummy,
+ local_libs: default(),
iplayers: default(),
}
}
tokens_clients: default(),
tokens_players: default(),
bundle_list: default(), // set by load_game_bundles
+ local_libs: default(), // set by load_game_bundles
asset_url_key,
};
.entry(data.libname.clone()).or_default()
.push(data);
}
+
+ pub fn clear(&mut self) {
+ self.libs.clear()
+ }
}
pub struct AllRegistries<'ig> {
global: RwLockReadGuard<'static, Option<Registry>>,
- #[allow(dead_code)] ig: &'ig Instance,
+ ig: &'ig Instance,
}
pub struct AllRegistriesIterator<'i> {
regs: &'i AllRegistries<'i>,
loop {
let r = match self.count {
0 => self.regs.global.as_ref(),
+ 1 => Some(&self.regs.ig.local_libs),
_ => return None,
};
self.count += 1;