Skip to content
Snippets Groups Projects
Commit 911aba0c authored by Brad Kittenbrink's avatar Brad Kittenbrink
Browse files

SL-18458 VOCache cleanup region_handle message encoding.

Really wish there were a native way to send S64/U64 values in llsd.
parent 3cc3e6a5
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -693,20 +693,13 @@ void LLGLTFMaterialList::writeCacheOverrides(LLSD const & message, std::string c ...@@ -693,20 +693,13 @@ void LLGLTFMaterialList::writeCacheOverrides(LLSD const & message, std::string c
// default to main region if message doesn't specify // default to main region if message doesn't specify
LLViewerRegion * region = gAgent.getRegion();; LLViewerRegion * region = gAgent.getRegion();;
if (message.has("region_handle")) if (message.has("region_handle_low") && message.has("region_handle_high"))
{ {
// TODO start requiring this once server sends this for all messages // TODO start requiring this once server sends this for all messages
std::vector<U8> const & buffer = message["region_handle"].asBinary(); U64 region_handle_low = message["region_handle_low"].asInteger();
if (buffer.size() == sizeof(U64)) U64 region_handle_high = message["region_handle_high"].asInteger();
{ U64 region_handle = (region_handle_low & 0x00000000ffffffffUL) || (region_handle_high << 32);
U64 region_handle = ntohll(*reinterpret_cast<U64 const *>(&buffer[0])); region = LLWorld::instance().getRegionFromHandle(region_handle);
region = LLWorld::instance().getRegionFromHandle(region_handle);
}
else
{
LL_WARNS() << "bad region_handle in material override message" << LL_ENDL;
llassert(false);
}
} }
if (region) { if (region) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment