Complete milestone 09 world integration gate (#75)
Native code generation / deterministic (push) Failing after 8m37s
Imaging and meshing gate / native (push) Successful in 5m24s
Native Rust workspace compile / compile (push) Failing after 6m15s

This commit is contained in:
hugo committed 2026-08-10 21:19:43 +00:00
1 parent 55424dbd7f
commit fdda05b53f
18 files changed
+767 -82

No files matched your search

+42 -7
View File
@@ -11,6 +11,7 @@ use libremetaverse_types::compat::{CancellationToken, HttpResponse, Uri};
use libremetaverse_types::{AssetType, UUID};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::sync::Arc;
use std::time::{Duration, Instant};
const MAX_FOLDER_DEPTH_REQUEST: i32 = 50;
const MAX_AIS_OBJECTS: usize = 100_000;
@@ -110,6 +111,31 @@ impl InventoryAISClient {
caps.capability_uri(name.to_owned())
}
fn wait_for_capability(
&self,
name: &str,
cancellation: &CancellationToken,
) -> Result<Option<Uri>, Error> {
let client = self.client()?;
let Some(simulator) = client.native_network()?.current_sim() else {
return Ok(None);
};
let Some(caps) = simulator.native_caps() else {
return Ok(None);
};
let deadline = Instant::now() + Duration::from_secs(2);
loop {
cancellation.throw_if_cancellation_requested()?;
if let Some(uri) = caps.capability_uri(name.to_owned())? {
return Ok(Some(uri));
}
if caps.seed_request_finished() || Instant::now() >= deadline {
return Ok(None);
}
std::thread::sleep(Duration::from_millis(1));
}
}
pub(crate) fn native_is_available(&self) -> bool {
self.capability(Self::INVENTORY_CAP_NAME)
.ok()
@@ -147,7 +173,7 @@ impl InventoryAISClient {
) -> Result<Option<(HttpResponse, Vec<u8>)>, Error> {
let token = Self::token(cancellation_token);
token.throw_if_cancellation_requested()?;
let Some(capability) = self.capability(cap_name)? else {
let Some(capability) = self.wait_for_capability(cap_name, &token)? else {
return Ok(None);
};
let bytes = match payload {
@@ -359,18 +385,27 @@ impl InventoryAISClient {
new_inventory: OSD,
cancellation_token: Option<CancellationToken>,
) -> Result<Vec<InventoryItem>, Error> {
let path = format!("category/{parent_uuid}?tid={}", Self::tid()?);
let (_, _, _, links) = self
.mutation(
let Some((response, bytes)) = self
.request(
Self::INVENTORY_CAP_NAME,
"POST",
path,
format!("category/{parent_uuid}"),
BTreeMap::new(),
Some(new_inventory),
false,
cancellation_token,
)
.await?;
.await?
else {
return Ok(Vec::new());
};
if !Self::status_ok(&response) {
return Err(Error::HttpRequest);
}
let Some(map) = Self::decode_map(bytes)? else {
return Ok(Vec::new());
};
let (folders, items, links) = self.parse_all_map(&map)?;
self.reconcile(&map, &folders, &items, &links)?;
Ok(links)
}