本文整理汇总了C++中LLViewerRegion::capabilitiesReceived方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::capabilitiesReceived方法的具体用法?C++ LLViewerRegion::capabilitiesReceived怎么用?C++ LLViewerRegion::capabilitiesReceived使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::capabilitiesReceived方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: requestGetAgentState
void LLPathfindingManager::requestGetAgentState()
{
LLViewerRegion *currentRegion = getCurrentRegion();
if (currentRegion == NULL)
{
mAgentStateSignal(FALSE);
}
else
{
if (!currentRegion->capabilitiesReceived())
{
currentRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetAgentStateForRegion, this, _1));
}
else if (!isPathfindingEnabledForRegion(currentRegion))
{
mAgentStateSignal(FALSE);
}
else
{
std::string agentStateURL = getAgentStateURLForRegion(currentRegion);
llassert(!agentStateURL.empty());
LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL);
LLHTTPClient::get(agentStateURL, responder);
}
}
}
示例2: requestGetCharacters
void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_request_callback_t pCharactersCallback) const
{
LLPathfindingObjectListPtr emptyCharacterListPtr;
LLViewerRegion *currentRegion = getCurrentRegion();
if (currentRegion == NULL)
{
pCharactersCallback(pRequestId, kRequestNotEnabled, emptyCharacterListPtr);
}
else if (!currentRegion->capabilitiesReceived())
{
pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr);
currentRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetCharactersForRegion, this, _1, pRequestId, pCharactersCallback));
}
else
{
std::string charactersURL = getCharactersURLForCurrentRegion();
if (charactersURL.empty())
{
pCharactersCallback(pRequestId, kRequestNotEnabled, emptyCharacterListPtr);
}
else
{
pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr);
LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback);
LLHTTPClient::get(charactersURL, charactersResponder);
}
}
}
示例3: refresh
void LLFloaterObjectWeights::refresh()
{
LLSelectMgr* sel_mgr = LLSelectMgr::getInstance();
if (sel_mgr->getSelection()->isEmpty())
{
updateIfNothingSelected();
}
else
{
S32 prim_count = sel_mgr->getSelection()->getObjectCount();
S32 link_count = sel_mgr->getSelection()->getRootObjectCount();
F32 prim_equiv = sel_mgr->getSelection()->getSelectedLinksetCost();
mSelectedObjects->setText(llformat("%d", link_count));
mSelectedPrims->setText(llformat("%d", prim_count));
mSelectedOnLand->setText(llformat("%.1d", (S32)prim_equiv));
LLCrossParcelFunctor func;
if (sel_mgr->getSelection()->applyToRootObjects(&func, true))
{
// Some of the selected objects cross parcel bounds.
// We don't display object weights and land impacts in this case.
const std::string text = getString("nothing_selected");
mRezzedOnLand->setText(text);
mRemainingCapacity->setText(text);
mTotalCapacity->setText(text);
toggleLandImpactsLoadingIndicators(false);
}
LLViewerRegion* region = gAgent.getRegion();
if (region && region->capabilitiesReceived())
{
for (LLObjectSelection::valid_root_iterator iter = sel_mgr->getSelection()->valid_root_begin();
iter != sel_mgr->getSelection()->valid_root_end(); ++iter)
{
LLAccountingCostManager::getInstance()->addObject((*iter)->getObject()->getID());
}
std::string url = region->getCapability("ResourceCostSelected");
if (!url.empty())
{
// Update the transaction id before the new fetch request
generateTransactionID();
LLAccountingCostManager::getInstance()->fetchCosts(Roots, url, getObserverHandle());
toggleWeightsLoadingIndicators(true);
}
}
else
{
//LL_WARNS() << "Failed to get region capabilities" << LL_ENDL;
llwarns << "Failed to get region capabilities" << llendl;
}
}
}
示例4: idle
void IMPEnvironmentSettings::idle(void* user_data)
{
IMPEnvironmentSettings* self = (IMPEnvironmentSettings*)user_data;
LLViewerRegion* region = gAgent.getRegion();
if(region && region->capabilitiesReceived())
{
LLUUID region_id = region->getRegionID();
if( region_id != self->mRegionID)
{
self->mRegionID = region_id;
self->getEnvironmentSettings();
}
}
}
示例5: requestGetLinksets
void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const
{
LLPathfindingObjectListPtr emptyLinksetListPtr;
LLViewerRegion *currentRegion = getCurrentRegion();
if (currentRegion == NULL)
{
pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr);
}
else if (!currentRegion->capabilitiesReceived())
{
pLinksetsCallback(pRequestId, kRequestStarted, emptyLinksetListPtr);
currentRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetLinksetsForRegion, this, _1, pRequestId, pLinksetsCallback));
}
else
{
std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion();
std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion();
if (objectLinksetsURL.empty() || terrainLinksetsURL.empty())
{
pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr);
}
else
{
pLinksetsCallback(pRequestId, kRequestStarted, emptyLinksetListPtr);
bool doRequestTerrain = isAllowViewTerrainProperties();
LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain));
LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr);
LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder);
if (doRequestTerrain)
{
LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder);
}
}
}
}
示例6: processGetAllQueue
void LLMaterialMgr::processGetAllQueue()
{
getall_queue_t::iterator loopRegion = mGetAllQueue.begin();
while (mGetAllQueue.end() != loopRegion)
{
getall_queue_t::iterator itRegion = loopRegion++;
const LLUUID& region_id = *itRegion;
LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id);
if (regionp == NULL)
{
LL_WARNS("Materials") << "Unknown region with id " << region_id.asString() << LL_ENDL;
clearGetQueues(region_id); // Invalidates region_id
continue;
}
else if (!regionp->capabilitiesReceived() || regionp->materialsCapThrottled())
{
continue;
}
std::string capURL = regionp->getCapability(MATERIALS_CAPABILITY_NAME);
if (capURL.empty())
{
LL_WARNS("Materials") << "Capability '" << MATERIALS_CAPABILITY_NAME
<< "' is not defined on the current region '" << regionp->getName() << "'" << LL_ENDL;
clearGetQueues(region_id); // Invalidates region_id
continue;
}
LL_DEBUGS("Materials") << "GET all for region " << region_id << "url " << capURL << LL_ENDL;
LLHTTPClient::ResponderPtr materialsResponder = new LLMaterialsResponder("GET", capURL, boost::bind(&LLMaterialMgr::onGetAllResponse, this, _1, _2, *itRegion));
LLHTTPClient::get(capURL, materialsResponder);
regionp->resetMaterialsCapThrottle();
mGetAllPending.insert(std::pair<LLUUID, F64>(region_id, LLFrameTimer::getTotalSeconds()));
mGetAllQueue.erase(itRegion); // Invalidates region_id
}
}
示例7: processPutQueue
void LLMaterialMgr::processPutQueue()
{
typedef std::map<LLViewerRegion*, LLSD> regionput_request_map;
regionput_request_map requests;
put_queue_t::iterator loopQueue = mPutQueue.begin();
while (mPutQueue.end() != loopQueue)
{
put_queue_t::iterator itQueue = loopQueue++;
const LLUUID& object_id = itQueue->first;
const LLViewerObject* objectp = gObjectList.findObject(object_id);
if ( !objectp )
{
LL_WARNS("Materials") << "Object is NULL" << LL_ENDL;
mPutQueue.erase(itQueue);
}
else
{
LLViewerRegion* regionp = objectp->getRegion();
if ( !regionp )
{
LL_WARNS("Materials") << "Object region is NULL" << LL_ENDL;
mPutQueue.erase(itQueue);
}
else if ( regionp->capabilitiesReceived() && !regionp->materialsCapThrottled())
{
LLSD& facesData = requests[regionp];
facematerial_map_t& face_map = itQueue->second;
U32 max_entries = regionp->getMaxMaterialsPerTransaction();
facematerial_map_t::iterator itFace = face_map.begin();
while ( (face_map.end() != itFace) && (facesData.size() < (int)max_entries) )
{
LLSD faceData = LLSD::emptyMap();
faceData[MATERIALS_CAP_FACE_FIELD] = static_cast<LLSD::Integer>(itFace->first);
faceData[MATERIALS_CAP_OBJECT_ID_FIELD] = static_cast<LLSD::Integer>(objectp->getLocalID());
if (!itFace->second.isNull())
{
faceData[MATERIALS_CAP_MATERIAL_FIELD] = itFace->second.asLLSD();
}
facesData.append(faceData);
face_map.erase(itFace++);
}
if (face_map.empty())
{
mPutQueue.erase(itQueue);
}
}
}
}
for (regionput_request_map::const_iterator itRequest = requests.begin(); itRequest != requests.end(); ++itRequest)
{
LLViewerRegion* regionp = itRequest->first;
std::string capURL = regionp->getCapability(MATERIALS_CAPABILITY_NAME);
if (capURL.empty())
{
LL_WARNS("Materials") << "Capability '" << MATERIALS_CAPABILITY_NAME
<< "' is not defined on region '" << regionp->getName() << "'" << LL_ENDL;
continue;
}
LLSD materialsData = LLSD::emptyMap();
materialsData[MATERIALS_CAP_FULL_PER_FACE_FIELD] = itRequest->second;
std::string materialString = zip_llsd(materialsData);
S32 materialSize = materialString.size();
if (materialSize > 0)
{
LLSD::Binary materialBinary;
materialBinary.resize(materialSize);
memcpy(materialBinary.data(), materialString.data(), materialSize);
LLSD putData = LLSD::emptyMap();
putData[MATERIALS_CAP_ZIP_FIELD] = materialBinary;
LL_DEBUGS("Materials") << "put for " << itRequest->second.size() << " faces to region " << itRequest->first->getName() << LL_ENDL;
LLHTTPClient::ResponderPtr materialsResponder = new LLMaterialsResponder("PUT", capURL, boost::bind(&LLMaterialMgr::onPutResponse, this, _1, _2));
LLHTTPClient::put(capURL, putData, materialsResponder);
regionp->resetMaterialsCapThrottle();
}
else
{
LL_ERRS("debugMaterials") << "cannot zip LLSD binary content" << LL_ENDL;
}
}
}
示例8: processGetQueue
void LLMaterialMgr::processGetQueue()
{
get_queue_t::iterator loopRegionQueue = mGetQueue.begin();
while (mGetQueue.end() != loopRegionQueue)
{
get_queue_t::iterator itRegionQueue = loopRegionQueue++;
const LLUUID& region_id = itRegionQueue->first;
if (isGetAllPending(region_id))
{
continue;
}
LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id);
if (!regionp)
{
LL_WARNS("Materials") << "Unknown region with id " << region_id.asString() << LL_ENDL;
mGetQueue.erase(itRegionQueue);
continue;
}
else if (!regionp->capabilitiesReceived() || regionp->materialsCapThrottled())
{
continue;
}
else if (mGetAllRequested.end() == mGetAllRequested.find(region_id))
{
LL_DEBUGS("Materials") << "calling getAll for " << regionp->getName() << LL_ENDL;
getAll(region_id);
continue;
}
const std::string capURL = regionp->getCapability(MATERIALS_CAPABILITY_NAME);
if (capURL.empty())
{
LL_WARNS("Materials") << "Capability '" << MATERIALS_CAPABILITY_NAME
<< "' is not defined on region '" << regionp->getName() << "'" << LL_ENDL;
mGetQueue.erase(itRegionQueue);
continue;
}
LLSD materialsData = LLSD::emptyArray();
material_queue_t& materials = itRegionQueue->second;
U32 max_entries = regionp->getMaxMaterialsPerTransaction();
material_queue_t::iterator loopMaterial = materials.begin();
while ( (materials.end() != loopMaterial) && (materialsData.size() < (int)max_entries) )
{
material_queue_t::iterator itMaterial = loopMaterial++;
materialsData.append((*itMaterial).asLLSD());
materials.erase(itMaterial);
markGetPending(region_id, *itMaterial);
}
if (materials.empty())
{
mGetQueue.erase(itRegionQueue);
}
std::string materialString = zip_llsd(materialsData);
S32 materialSize = materialString.size();
if (materialSize <= 0)
{
LL_ERRS("Materials") << "cannot zip LLSD binary content" << LL_ENDL;
return;
}
LLSD::Binary materialBinary;
materialBinary.resize(materialSize);
memcpy(materialBinary.data(), materialString.data(), materialSize);
LLSD postData = LLSD::emptyMap();
postData[MATERIALS_CAP_ZIP_FIELD] = materialBinary;
LLHTTPClient::ResponderPtr materialsResponder = new LLMaterialsResponder("POST", capURL, boost::bind(&LLMaterialMgr::onGetResponse, this, _1, _2, region_id));
LL_DEBUGS("Materials") << "POSTing to region '" << regionp->getName() << "' at '"<< capURL << " for " << materialsData.size() << " materials."
<< "\ndata: " << ll_pretty_print_sd(materialsData) << LL_ENDL;
LLHTTPClient::post(capURL, postData, materialsResponder);
regionp->resetMaterialsCapThrottle();
}
}
示例9: idle
// static
// Called every frame - send render weight requests to every region
void LLAvatarRenderInfoAccountant::idle()
{
if (sRenderInfoReportTimer.hasExpired())
{
const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds
const F32 SECS_BETWEEN_REGION_REQUEST = 60.0; // Update each region every 60 seconds
S32 num_avs = LLCharacter::sInstances.size();
if (logRenderInfo())
{
LL_INFOS() << "LRI: Scanning all regions and checking for render info updates"
<< LL_ENDL;
}
// Check all regions and see if it's time to fetch/send data
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* regionp = *iter;
if (regionp &&
regionp->isAlive() &&
regionp->capabilitiesReceived() && // Region has capability URLs available
regionp->getRenderInfoRequestTimer().hasExpired()) // Time to make request
{
sendRenderInfoToRegion(regionp);
getRenderInfoFromRegion(regionp);
// Reset this regions timer, moving to longer intervals if there are lots of avatars around
regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST + (2.f * num_avs));
}
}
// We scanned all the regions, reset the request timer.
sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS);
}
/* Singu TODO: RenderAutoMuteFunctions
static LLCachedControl<U32> render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions", 0);
static U32 prev_render_auto_mute_functions = (U32) -1;
if (prev_render_auto_mute_functions != render_auto_mute_functions)
{
prev_render_auto_mute_functions = render_auto_mute_functions;
// Adjust menus
BOOL show_items = (BOOL)(render_auto_mute_functions & 0x04);
gMenuAvatarOther->setItemVisible( std::string("Normal"), show_items);
gMenuAvatarOther->setItemVisible( std::string("Always use impostor"), show_items);
gMenuAvatarOther->setItemVisible( std::string("Never use impostor"), show_items);
gMenuAvatarOther->setItemVisible( std::string("Impostor seperator"), show_items);
gMenuAttachmentOther->setItemVisible( std::string("Normal"), show_items);
gMenuAttachmentOther->setItemVisible( std::string("Always use impostor"), show_items);
gMenuAttachmentOther->setItemVisible( std::string("Never use impostor"), show_items);
gMenuAttachmentOther->setItemVisible( std::string("Impostor seperator"), show_items);
if (!show_items)
{ // Turning off visual muting
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{ // Make sure all AVs have the setting cleared
LLVOAvatar* inst = (LLVOAvatar*) *iter;
inst->setCachedVisualMute(false);
}
}
}*/
}
示例10: backgroundFetch
void LLInventoryModelBackgroundFetch::backgroundFetch()
{
LLViewerRegion* region = gAgent.getRegion();
if (mBackgroundFetchActive && region && region->capabilitiesReceived())
{
if (gSavedSettings.getBOOL("UseHTTPInventory"))
{
// If we'll be using the capability, we'll be sending batches and the background thing isn't as important.
std::string url = region->getCapability("FetchInventory2");
if (!url.empty())
{
bool mPerServicePtr_initialized = !!mPerServicePtr;
if (!mPerServicePtr_initialized)
{
// One time initialization needed for bulkFetch().
std::string servicename = AIPerService::extract_canonical_servicename(url);
if (!servicename.empty())
{
llinfos << "Initialized service name for bulk inventory fetching with \"" << servicename << "\"." << llendl;
mPerServicePtr = AIPerService::instance(servicename);
mPerServicePtr_initialized = true;
}
}
if (mPerServicePtr_initialized)
{
bulkFetch();
return;
}
}
}
#if 1
//--------------------------------------------------------------------------------
// DEPRECATED OLD CODE
//
// No more categories to fetch, stop fetch process.
if (mFetchQueue.empty())
{
llinfos << "Inventory fetch completed" << llendl;
setAllFoldersFetched();
return;
}
F32 fast_fetch_time = lerp(mMinTimeBetweenFetches, mMaxTimeBetweenFetches, 0.1f);
F32 slow_fetch_time = lerp(mMinTimeBetweenFetches, mMaxTimeBetweenFetches, 0.5f);
if (mTimelyFetchPending && mFetchTimer.getElapsedTimeF32() > slow_fetch_time)
{
// double timeouts on failure
mMinTimeBetweenFetches = llmin(mMinTimeBetweenFetches * 2.f, 10.f);
mMaxTimeBetweenFetches = llmin(mMaxTimeBetweenFetches * 2.f, 120.f);
lldebugs << "Inventory fetch times grown to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl;
// fetch is no longer considered "timely" although we will wait for full time-out.
mTimelyFetchPending = FALSE;
}
while(1)
{
if (mFetchQueue.empty())
{
break;
}
if(gDisconnected)
{
// just bail if we are disconnected.
break;
}
const FetchQueueInfo info = mFetchQueue.front();
if (info.mIsCategory)
{
LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID);
// Category has been deleted, remove from queue.
if (!cat)
{
mFetchQueue.pop_front();
continue;
}
if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches &&
LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
{
// Category exists but has no children yet, fetch the descendants
// for now, just request every time and rely on retry timer to throttle.
if (cat->fetch())
{
mFetchTimer.reset();
mTimelyFetchPending = TRUE;
}
else
{
// The catagory also tracks if it has expired and here it says it hasn't
// yet. Get out of here because nothing is going to happen until we
// update the timers.
break;
//.........这里部分代码省略.........