Implement SL-19605 handling of batched material overrides in LargeGenericMessage (#177)

master
Brad Linden 2023-04-19 09:41:07 -07:00 committed by GitHub
parent fcf9db8823
commit 45fdba8fd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 31 deletions

View File

@ -162,49 +162,43 @@ public:
LLSD message;
sparam_t::const_iterator it = strings.begin();
if (it != strings.end())
bool success = true;
for(const std::string& llsdRaw : strings)
{
const std::string& llsdRaw = *it++;
std::istringstream llsdData(llsdRaw);
if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length()))
{
LL_WARNS() << "LLGLTFMaterialOverrideDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL;
success = false;
continue;
}
}
else
{
// malformed message, nothing we can do to handle it
LL_DEBUGS("GLTF") << "Empty message" << LL_ENDL;
return false;
}
LLGLTFOverrideCacheEntry object_override;
if (!object_override.fromLLSD(message))
{
// malformed message, nothing we can do to handle it
LL_DEBUGS("GLTF") << "Message without id:" << message << LL_ENDL;
return false;
}
// Cache the data
{
LL_DEBUGS("GLTF") << "material overrides cache" << LL_ENDL;
LLViewerRegion * region = LLWorld::instance().getRegionFromHandle(object_override.mRegionHandle);
if (region)
LLGLTFOverrideCacheEntry object_override;
if (!object_override.fromLLSD(message))
{
region->cacheFullUpdateGLTFOverride(object_override);
// malformed message, nothing we can do to handle it
LL_DEBUGS("GLTF") << "Message without id:" << message << LL_ENDL;
success = false;
continue;
}
else
// Cache the data
{
LL_WARNS("GLTF") << "could not access region for material overrides message cache, region_handle: " << LL_ENDL;
LLViewerRegion * region = LLWorld::instance().getRegionFromHandle(object_override.mRegionHandle);
if (region)
{
region->cacheFullUpdateGLTFOverride(object_override);
}
else
{
LL_WARNS("GLTF") << "could not access region for material overrides message cache, region_handle: " << LL_ENDL;
}
}
applyData(object_override);
}
applyData(object_override);
return true;
return success;
}
void doSelectionCallbacks(const LLUUID& object_id, S32 side)