本文整理汇总了C++中LLViewerRegion::getHost方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::getHost方法的具体用法?C++ LLViewerRegion::getHost怎么用?C++ LLViewerRegion::getHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::getHost方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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 , gSavedSettings.getBOOL( "MiniMapRotate" )) );
if( region )
{
msg.assign("");
std::string fullname;
if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname))
{
// msg.append(fullname);
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : gRlvHandler.getAnonym(fullname) );
// [/RLVa:KB]
msg.append("\n");
}
// msg.append( region->getName() );
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-0.2.0b
msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : rlv_handler_t::cstrHidden );
// [/RLVa:KB]
msg.append("\n");
gSavedSettings.getBOOL( "MiniMapTeleport" ) ?
msg.append(getString("tooltip_tp")) : msg.append(getString("tooltip_map"));
msg.append("\n");
msg.append(getString("tooltip_pan"));
#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
msg.append("\n");
msg.append(getToolTip());
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;
}
if(!handled)
{
return LLPanel::handleToolTip(x, y, msg, sticky_rect_screen);
}
return handled;
}
示例3: returnObjectsFromParcel
void LLPanelScriptLimitsRegionMemory::returnObjectsFromParcel(S32 local_id)
{
LLMessageSystem *msg = gMessageSystem;
LLViewerRegion* region = gAgent.getRegion();
if (!region) return;
LLCtrlListInterface *list = childGetListInterface("scripts_list");
if (!list || list->getItemCount() == 0) return;
std::vector<LLSD>::iterator id_itor;
bool start_message = true;
for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor)
{
LLSD element = *id_itor;
if (!list->isSelected(element["id"].asUUID()))
{
// Selected only
continue;
}
if(element["local_id"].asInteger() != local_id)
{
// Not the parcel we are looking for
continue;
}
if (start_message)
{
msg->newMessageFast(_PREHASH_ParcelReturnObjects);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ParcelData);
msg->addS32Fast(_PREHASH_LocalID, element["local_id"].asInteger());
msg->addU32Fast(_PREHASH_ReturnType, RT_LIST);
start_message = false;
}
msg->nextBlockFast(_PREHASH_TaskIDs);
msg->addUUIDFast(_PREHASH_TaskID, element["id"].asUUID());
if (msg->isSendFullFast(_PREHASH_TaskIDs))
{
msg->sendReliable(region->getHost());
start_message = true;
}
}
if (!start_message)
{
msg->sendReliable(region->getHost());
}
}
示例4: doToObjects
void LLFloaterTopObjects::doToObjects(int action, bool all)
{
LLMessageSystem *msg = gMessageSystem;
LLViewerRegion* region = gAgent.getRegion();
if (!region) return;
LLCtrlListInterface *list = getChild<LLUICtrl>("objects_list")->getListInterface();
if (!list || list->getItemCount() == 0) return;
uuid_vec_t::iterator id_itor;
bool start_message = true;
for (id_itor = mObjectListIDs.begin(); id_itor != mObjectListIDs.end(); ++id_itor)
{
LLUUID task_id = *id_itor;
if (!all && !list->isSelected(task_id))
{
// Selected only
continue;
}
if (start_message)
{
if (action == ACTION_RETURN)
{
msg->newMessageFast(_PREHASH_ParcelReturnObjects);
}
else
{
msg->newMessageFast(_PREHASH_ParcelDisableObjects);
}
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ParcelData);
msg->addS32Fast(_PREHASH_LocalID, -1); // Whole region
msg->addS32Fast(_PREHASH_ReturnType, RT_NONE);
start_message = false;
}
msg->nextBlockFast(_PREHASH_TaskIDs);
msg->addUUIDFast(_PREHASH_TaskID, task_id);
if (msg->isSendFullFast(_PREHASH_TaskIDs))
{
msg->sendReliable(region->getHost());
start_message = true;
}
}
if (!start_message)
{
msg->sendReliable(region->getHost());
}
}
示例5: 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());
}
}
}
}
示例6: onConfirmCloseCircuit
// static
bool LLFloaterMessageLog::onConfirmCloseCircuit(const LLSD& notification, const LLSD& response )
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLCircuitData* cdp = gMessageSystem->mCircuitInfo.findCircuit(LLHost(notification["payload"]["circuittoclose"].asString()));
if(!cdp) return false;
LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(cdp->getHost());
switch(option)
{
case 0: // yes
gMessageSystem->newMessageFast(_PREHASH_CloseCircuit);
gMessageSystem->sendReliable(cdp->getHost());
break;
case 2: // cancel
return false;
break;
case 1: // no
default:
break;
}
if(gMessageSystem->findCircuitCode(cdp->getHost()))
gMessageSystem->disableCircuit(cdp->getHost());
else
gMessageSystem->mCircuitInfo.removeCircuitData(cdp->getHost());
if(regionp)
{
LLHost myhost = regionp->getHost();
LLSD args;
args["MESSAGE"] = "That host had a region associated with it.\nDo you want to clean that up?";
LLSD payload;
payload["regionhost"] = myhost.getString();
LLNotificationsUtil::add("GenericAlertYesCancel", args, payload, onConfirmRemoveRegion);
}
return false;
}
示例7: sendReportViaLegacy
void LLFloaterReporter::sendReportViaLegacy(const LLSD & report)
{
LLViewerRegion *regionp = gAgent.getRegion();
if (!regionp) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_UserReport);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ReportData);
msg->addU8Fast(_PREHASH_ReportType, report["report-type"].asInteger());
msg->addU8(_PREHASH_Category, report["category"].asInteger());
msg->addVector3Fast(_PREHASH_Position, LLVector3(report["position"]));
msg->addU8Fast(_PREHASH_CheckFlags, report["check-flags"].asInteger());
msg->addUUIDFast(_PREHASH_ScreenshotID, report["screenshot-id"].asUUID());
msg->addUUIDFast(_PREHASH_ObjectID, report["object-id"].asUUID());
msg->addUUID("AbuserID", report["abuser-id"].asUUID());
msg->addString("AbuseRegionName", report["abuse-region-name"].asString());
msg->addUUID("AbuseRegionID", report["abuse-region-id"].asUUID());
msg->addStringFast(_PREHASH_Summary, report["summary"].asString());
msg->addString("VersionString", report["version-string"]);
msg->addStringFast(_PREHASH_Details, report["details"] );
msg->sendReliable(regionp->getHost());
}
示例8: send_agent_resume
void send_agent_resume()
{
// Note: used to check for LLWorld initialization before it became a singleton.
// Rather than just remove this check I'm changing it to assure that the message
// system has been initialized. -MG
if (!gMessageSystem)
{
return;
}
gMessageSystem->newMessageFast(_PREHASH_AgentResume);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgentID);
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgentSessionID);
gAgentPauseSerialNum++;
gMessageSystem->addU32Fast(_PREHASH_SerialNum, gAgentPauseSerialNum);
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* regionp = *iter;
gMessageSystem->sendReliable(regionp->getHost());
}
// Reset the FPS counter to avoid an invalid fps
LLViewerStats::getInstance()->mFPSStat.start();
LLAppViewer::instance()->resumeMainloopTimeout();
}
示例9: send_agent_pause
void send_agent_pause()
{
// *NOTE:Mani Pausing the mainloop timeout. Otherwise a long modal event may cause
// the thread monitor to timeout.
LLAppViewer::instance()->pauseMainloopTimeout();
// Note: used to check for LLWorld initialization before it became a singleton.
// Rather than just remove this check I'm changing it to assure that the message
// system has been initialized. -MG
if (!gMessageSystem)
{
return;
}
gMessageSystem->newMessageFast(_PREHASH_AgentPause);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgentID);
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgentSessionID);
gAgentPauseSerialNum++;
gMessageSystem->addU32Fast(_PREHASH_SerialNum, gAgentPauseSerialNum);
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* regionp = *iter;
gMessageSystem->sendReliable(regionp->getHost());
}
gObjectList.mWasPaused = TRUE;
}
示例10: 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());
}
}
}
}
示例11: initialize
void LLFloaterAuction::initialize()
{
mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection();
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
LLParcel* parcelp = mParcelp->getParcel();
if(parcelp && region && !parcelp->getForSale())
{
mParcelHost = region->getHost();
mParcelID = parcelp->getLocalID();
childSetText("parcel_text", parcelp->getName());
childEnable("snapshot_btn");
childEnable("ok_btn");
}
else
{
mParcelHost.invalidate();
if(parcelp && parcelp->getForSale())
{
childSetText("parcel_text", getString("already for sale"));
}
else
{
childSetText("parcel_text", LLStringUtil::null);
}
mParcelID = -1;
childSetEnabled("snapshot_btn", false);
childSetEnabled("ok_btn", false);
}
mImageID.setNull();
mImage = NULL;
}
示例12: plywood_above_head
void ImportTracker::plywood_above_head()
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_Material, 3);
msg->addU32Fast(_PREHASH_AddFlags, FLAGS_CREATE_SELECTED);
LLVolumeParams volume_params;
volume_params.setType(0x01, 0x10);
volume_params.setBeginAndEndS(0.f, 1.f);
volume_params.setBeginAndEndT(0.f, 1.f);
volume_params.setRatio(1, 1);
volume_params.setShear(0, 0);
LLVolumeMessage::packVolumeParams(&volume_params, msg);
msg->addU8Fast(_PREHASH_PCode, 9);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52345f, 0.52346f, 0.52347f));
LLQuaternion rot;
msg->addQuatFast(_PREHASH_Rotation, rot);
LLViewerRegion *region = gAgent.getRegion();
if (!localids.size())
root = (initialPos + linksetoffset);
msg->addVector3Fast(_PREHASH_RayStart, root);
msg->addVector3Fast(_PREHASH_RayEnd, root);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, (U8)0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->sendReliable(region->getHost());
}
示例13: plyWood
void Object::plyWood()
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_Material, 3);
//msg->addU32Fast(_PREHASH_AddFlags, ); // CREATE_SELECTED
LLVolumeParams volume_params;
volume_params.setType(0x01, 0x10);
volume_params.setBeginAndEndS(0.f, 1.f);
volume_params.setBeginAndEndT(0.f, 1.f);
volume_params.setRatio(1, 1);
volume_params.setShear(0, 0);
LLVolumeMessage::packVolumeParams(&volume_params, msg);
msg->addU8Fast(_PREHASH_PCode, 9);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52346f, 0.52347f, 0.52348f));
LLQuaternion rot;
msg->addQuatFast(_PREHASH_Rotation, rot);
LLViewerRegion *region = gAgent.getRegion();
LLVector3 root(0.f,0.f,0.1f);
root+=gAgent.getCameraPositionAgent();
msg->addVector3Fast(_PREHASH_RayStart, root);
msg->addVector3Fast(_PREHASH_RayEnd, root);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, (U8)0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->sendReliable(region->getHost());
}
示例14: 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());
}
示例15: 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() );
}
}
}
}