本文整理汇总了C++中LLViewerRegion::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::getName方法的具体用法?C++ LLViewerRegion::getName怎么用?C++ LLViewerRegion::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: httpSuccess
virtual void httpSuccess()
{
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if (regionp)
{
const LLSD& content = getContent();
if (LLAvatarRenderInfoAccountant::logRenderInfo())
{
LL_INFOS() << "LRI: Result for avatar weights POST for region " << regionp->getName()
<< ": " << content << LL_ENDL;
}
if (content.isMap())
{
if (content.has(KEY_ERROR))
{
const LLSD & error = content[KEY_ERROR];
LL_WARNS() << "Avatar render info POST error: "
<< error[KEY_IDENTIFIER]
<< ": " << error[KEY_MESSAGE]
<< " from region " << regionp->getName()
<< LL_ENDL;
}
}
}
else
{
LL_INFOS() << "Avatar render weight POST result recieved but region not found for "
<< mRegionHandle << LL_ENDL;
}
}
示例2: removeRegion
void LLWorld::removeRegion(const LLHost &host)
{
F32 x, y;
LLViewerRegion *regionp = getRegion(host);
if (!regionp)
{
llwarns << "Trying to remove region that doesn't exist!" << llendl;
return;
}
if (regionp == gAgent.getRegion())
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
{
LLViewerRegion* reg = *iter;
llwarns << "RegionDump: " << reg->getName()
<< " " << reg->getHost()
<< " " << reg->getOriginGlobal()
<< llendl;
}
llwarns << "Agent position global " << gAgent.getPositionGlobal()
<< " agent " << gAgent.getPositionAgent()
<< llendl;
llwarns << "Regions visited " << gAgent.getRegionsVisited() << llendl;
llwarns << "gFrameTimeSeconds " << gFrameTimeSeconds << llendl;
llwarns << "Disabling region " << regionp->getName() << " that agent is in!" << llendl;
LLAppViewer::instance()->forceDisconnect(LLTrans::getString("YouHaveBeenDisconnected"));
regionp->saveObjectCache() ; //force to save objects here in case that the object cache is about to be destroyed.
return;
}
from_region_handle(regionp->getHandle(), &x, &y);
llinfos << "Removing region " << x << ":" << y << llendl;
mRegionList.remove(regionp);
mActiveRegionList.remove(regionp);
mCulledRegionList.remove(regionp);
mVisibleRegionList.remove(regionp);
mRegionRemovedSignal(regionp);
//double check all objects of this region are removed.
gObjectList.clearAllMapObjectsInRegion(regionp) ;
//llassert_always(!gObjectList.hasMapObjectInRegion(regionp)) ;
updateWaterObjects();
delete regionp;
}
示例3: removeRegion
void LLWorld::removeRegion(const LLHost &host)
{
F32 x, y;
LLViewerRegion *regionp = getRegion(host);
if (!regionp)
{
llwarns << "Trying to remove region that doesn't exist!" << llendl;
return;
}
if (regionp == gAgent.getRegion())
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
{
LLViewerRegion* reg = *iter;
llwarns << "RegionDump: " << reg->getName()
<< " " << reg->getHost()
<< " " << reg->getOriginGlobal()
<< llendl;
}
llwarns << "Agent position global " << gAgent.getPositionGlobal()
<< " agent " << gAgent.getPositionAgent()
<< llendl;
llwarns << "Regions visited " << gAgent.getRegionsVisited() << llendl;
llwarns << "gFrameTimeSeconds " << gFrameTimeSeconds << llendl;
llwarns << "Disabling region " << regionp->getName() << " that agent is in!" << llendl;
LLAppViewer::instance()->forceDisconnect("You have been disconnected from the region you were in.");
return;
}
from_region_handle(regionp->getHandle(), &x, &y);
llinfos << "Removing region " << x << ":" << y << llendl;
mRegionList.remove(regionp);
mActiveRegionList.remove(regionp);
mCulledRegionList.remove(regionp);
mVisibleRegionList.remove(regionp);
delete regionp;
updateWaterObjects();
}
示例4: refresh
void LLPanelRequestTools::refresh()
{
std::string buffer = childGetValue("destination");
LLCtrlListInterface *list = childGetListInterface("destination");
if (!list) return;
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
list->addSimpleElement(SELECTION);
list->addSimpleElement(AGENT_REGION);
for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin();
iter != gWorldp->mActiveRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
LLString name = regionp->getName();
//MK
if (RRenabled && gAgent.mRRInterface.mContainsShowloc)
{
name = "(Hidden)";
}
//mk
if (!name.empty())
{
list->addSimpleElement(name);
}
}
if(!buffer.empty())
{
list->selectByValue(buffer);
}
else
{
list->selectByValue(SELECTION);
}
}
示例5: onClickSetLocation
void LLPanelPickEdit::onClickSetLocation()
{
// Save location for later use.
setPosGlobal(gAgent.getPositionGlobal());
std::string parcel_name, region_name;
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (parcel)
{
mParcelId = parcel->getID();
parcel_name = parcel->getName();
}
LLViewerRegion* region = gAgent.getRegion();
if(region)
{
region_name = region->getName();
}
setPickLocation(createLocationText(getLocationNotice(), parcel_name, region_name, getPosGlobal()));
mLocationChanged = true;
enableSaveButton(TRUE);
}
示例6: onClickRequest
// static
void LLPanelRequestTools::onClickRequest(void* data)
{
LLPanelRequestTools* self = (LLPanelRequestTools*)data;
const std::string dest = self->childGetValue("destination").asString();
if(dest == SELECTION)
{
std::string req = self->childGetValue("request");
req = req.substr(0, req.find_first_of(" "));
std::string param = self->childGetValue("parameter");
gSelectMgr->sendGodlikeRequest(req, param);
}
else if(dest == AGENT_REGION)
{
self->sendRequest(gAgent.getRegionHost());
}
else
{
// find region by name
for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin();
iter != gWorldp->mActiveRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
if(dest == regionp->getName())
{
// found it
self->sendRequest(regionp->getHost());
}
}
}
}
示例7: trigger_hippo_bug
void trigger_hippo_bug(void*)
{
BOOL chat = FALSE;
LLViewerRegion* region = gAgent.getRegion();
const char* name = (region ? region->getName().c_str() : NULL);
if (name)
{
if ( name[0] == 'A'
|| name[0] == 'E'
|| name[0] == 'I'
|| name[0] == 'O'
|| name[0] == 'U')
{
chat = TRUE;
}
else if (ll_frand() > 0.5f)
{
chat = TRUE;
}
}
if (chat)
{
LLChat chat("hippos!");
chat.mFromName = "Ghostly Bug";
LLFloaterChat::addChat(chat);
}
}
示例8: refresh
void LLPanelRequestTools::refresh()
{
std::string buffer = childGetValue("destination");
LLCtrlListInterface *list = childGetListInterface("destination");
if (!list) return;
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
list->addSimpleElement(SELECTION);
list->addSimpleElement(AGENT_REGION);
for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin();
iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
std::string name = regionp->getName();
if (!name.empty())
{
list->addSimpleElement(name);
}
}
if(!buffer.empty())
{
list->selectByValue(buffer);
}
else
{
list->selectByValue(SELECTION);
}
}
示例9: handleToolTip
BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen )
{
BOOL handled = FALSE;
if (gDisconnected)
{
return FALSE;
}
LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) );
if( region )
{
msg.assign( region->getName() );
#ifndef LL_RELEASE_FOR_DOWNLOAD
std::string buffer;
msg.append("\n");
buffer = region->getHost().getHostName();
msg.append(buffer);
msg.append("\n");
buffer = region->getHost().getString();
msg.append(buffer);
#endif
// *TODO: put this under the control of XUI so it can be
// translated.
msg.append("\n(Double-click to open Map)");
S32 SLOP = 4;
localPointToScreen(
x - SLOP, y - SLOP,
&(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) );
sticky_rect_screen->mRight = sticky_rect_screen->mLeft + 2 * SLOP;
sticky_rect_screen->mTop = sticky_rect_screen->mBottom + 2 * SLOP;
}
handled = TRUE;
return handled;
}
示例10: refresh
void LLPanelRequestTools::refresh()
{
std::string buffer = getChild<LLUICtrl>("destination")->getValue();
LLCtrlListInterface *list = childGetListInterface("destination");
if (!list) return;
S32 last_item = list->getItemCount();
if (last_item >=3)
{
list->selectItemRange(2,last_item);
list->operateOnSelection(LLCtrlListInterface::OP_DELETE);
}
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* regionp = *iter;
std::string name = regionp->getName();
if (!name.empty())
{
list->addSimpleElement(name);
}
}
if(!buffer.empty())
{
list->selectByValue(buffer);
}
else
{
list->operateOnSelection(LLCtrlListInterface::OP_DESELECT);
}
}
示例11: updateCovenantInfo
void LLFloaterBuyLandUI::updateCovenantInfo()
{
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
if(!region) return;
LLTextBox* region_name = getChild<LLTextBox>("region_name_text");
if (region_name)
{
region_name->setText(region->getName());
}
LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause");
if (resellable_clause)
{
if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL)
{
resellable_clause->setText(getString("can_not_resell"));
}
else
{
resellable_clause->setText(getString("can_resell"));
}
}
LLTextBox* changeable_clause = getChild<LLTextBox>("changeable_clause");
if (changeable_clause)
{
if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES)
{
changeable_clause->setText(getString("can_change"));
}
else
{
changeable_clause->setText(getString("can_not_change"));
}
}
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
if(check)
{
check->set(false);
check->setEnabled(true);
check->setCallbackUserData(this);
check->setCommitCallback(onChangeAgreeCovenant);
}
LLTextBox* box = getChild<LLTextBox>("covenant_text");
if(box)
{
box->setVisible(FALSE);
}
// send EstateCovenantInfo message
LLMessageSystem *msg = gMessageSystem;
msg->newMessage("EstateCovenantRequest");
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
msg->sendReliable(region->getHost());
}
示例12: onClickRequest
void LLPanelRequestTools::onClickRequest()
{
const std::string dest = getChild<LLUICtrl>("destination")->getValue().asString();
if(dest == SELECTION)
{
std::string req =getChild<LLUICtrl>("request")->getValue();
req = req.substr(0, req.find_first_of(" "));
std::string param = getChild<LLUICtrl>("parameter")->getValue();
LLSelectMgr::getInstance()->sendGodlikeRequest(req, param);
}
else if(dest == AGENT_REGION)
{
sendRequest(gAgent.getRegionHost());
}
else
{
// find region by name
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* regionp = *iter;
if(dest == regionp->getName())
{
// found it
sendRequest(regionp->getHost());
}
}
}
}
示例13: onClickSet
// static
void LLPanelClassified::onClickSet(void* data)
{
LLPanelClassified* self = (LLPanelClassified*)data;
// Save location for later.
self->mPosGlobal = gAgent.getPositionGlobal();
std::string location_text;
std::string regionName = "(will update after publish)";
LLViewerRegion* pRegion = gAgent.getRegion();
if (pRegion)
{
regionName = pRegion->getName();
}
location_text.assign(regionName);
location_text.append(", ");
S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS;
S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS;
S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]);
location_text.append(self->mSimName);
location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
self->mLocationEditor->setText(location_text);
self->mLocationChanged = true;
self->setDefaultAccessCombo();
// Set this to null so it updates on the next save.
self->mParcelID.setNull();
onCommitAny(NULL, data);
}
示例14: getObjectInfo
void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
{
// TODO --
// 1 need to send to correct simulator if object is not
// in same simulator as agent
// 2 display info in widget window that gives feedback that
// we have recorded the object info
// 3 can pick avatar ==> might want to indicate when a picked
// object is an avatar, attachment, or other category
mObjectID = object_id;
if (LLUUID::null != mObjectID)
{
// get object info for the user's benefit
LLViewerObject* objectp = NULL;
objectp = gObjectList.findObject( mObjectID );
if (objectp)
{
if ( objectp->isAttachment() )
{
objectp = (LLViewerObject*)objectp->getRoot();
mObjectID = objectp->getID();
}
// correct the region and position information
LLViewerRegion *regionp = objectp->getRegion();
if (regionp)
{
getChild<LLUICtrl>("sim_field")->setValue(regionp->getName());
LLVector3d global_pos;
global_pos.setVec(objectp->getPositionRegion());
setPosBox(global_pos);
}
if (objectp->isAvatar())
{
setFromAvatarID(mObjectID);
}
else
{
// we have to query the simulator for information
// about this object
LLMessageSystem* msg = gMessageSystem;
U32 request_flags = COMPLAINT_REPORT_REQUEST;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, request_flags );
msg->addUUIDFast(_PREHASH_ObjectID, mObjectID);
LLViewerRegion* regionp = objectp->getRegion();
msg->sendReliable( regionp->getHost() );
}
}
}
}
示例15: getSearchURLSuffix
// static
std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult)
{
std::string url = gSavedSettings.getString("SearchURLSuffix2");
// if the mature checkbox is unchecked, modify query to remove
// terms with given phrase from the result set
// This builds a value from 1-7 by or-ing together the flags, and then converts
// it to a string.
std::string substring="[MATURITY]";
S32 maturityFlag =
(inc_pg ? SEARCH_PG : SEARCH_NONE) |
(inc_mature ? SEARCH_MATURE : SEARCH_NONE) |
(inc_adult ? SEARCH_ADULT : SEARCH_NONE);
url.replace(url.find(substring), substring.length(), boost::lexical_cast<std::string>(maturityFlag));
// Include region and x/y position, not for the GSA, but
// just to get logs on the web server for search_proxy.php
// showing where people were standing when they searched.
std::string region_name;
LLViewerRegion* region = gAgent.getRegion();
if (region)
{
region_name = region->getName();
}
// take care of spaces in names
region_name = LLURI::escape(region_name);
substring = "[REGION]";
url.replace(url.find(substring), substring.length(), region_name);
LLVector3 pos_region = gAgent.getPositionAgent();
std::string x = llformat("%.0f", pos_region.mV[VX]);
substring = "[X]";
url.replace(url.find(substring), substring.length(), x);
std::string y = llformat("%.0f", pos_region.mV[VY]);
substring = "[Y]";
url.replace(url.find(substring), substring.length(), y);
std::string z = llformat("%.0f", pos_region.mV[VZ]);
substring = "[Z]";
url.replace(url.find(substring), substring.length(), z);
LLUUID session_id = gAgent.getSessionID();
std::string session_string = session_id.getString();
substring = "[SESSION]";
url.replace(url.find(substring), substring.length(), session_string);
// set the currently selected language by asking the pref setting
std::string language_string = LLUI::getLanguage();
std::string language_tag = "[LANG]";
url.replace( url.find( language_tag ), language_tag.length(), language_string );
// and set the flag for the teen grid
std::string teen_string = gAgent.isTeen() ? "y" : "n";
std::string teen_tag = "[TEEN]";
url.replace( url.find( teen_tag ), teen_tag.length(), teen_string );
return url;
}