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; }
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; }
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()); } }
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()); } }
// 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()); } } } }
// 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; }
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()); }
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(); }
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; }
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()); } } } }
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; }
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()); }
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()); }
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()); }
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() ); } } } }
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); msg.append("\n"); } msg.append( 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 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; }
void LLFloaterPay::give(S32 amount) { if(mCallback) { // if the amount is 0, that menas that we should use the // text field. if(amount == 0) { amount = atoi(childGetText("amount").c_str()); } sLastAmount = amount; // Try to pay an object. if (mObjectSelection.notNull()) { LLViewerObject* dest_object = gObjectList.findObject(mTargetUUID); if(dest_object) { LLViewerRegion* region = dest_object->getRegion(); if (region) { // Find the name of the root object LLSelectNode* node = mObjectSelection->getFirstRootNode(); std::string object_name; if (node) { object_name = node->mName; } S32 tx_type = TRANS_PAY_OBJECT; if(dest_object->isAvatar()) tx_type = TRANS_GIFT; mCallback(mTargetUUID, region, amount, FALSE, tx_type, object_name); mObjectSelection = NULL; // request the object owner in order to check if the owner needs to be unmuted LLMessageSystem* msg = gMessageSystem; 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, OBJECT_PAY_REQUEST ); msg->addUUIDFast(_PREHASH_ObjectID, mTargetUUID); msg->sendReliable( region->getHost() ); } } } else { // just transfer the L$ mCallback(mTargetUUID, gAgent.getRegion(), amount, mTargetIsGroup, TRANS_GIFT, LLStringUtil::null); // check if the payee needs to be unmuted LLMuteList::getInstance()->autoRemove(mTargetUUID, LLMuteList::AR_MONEY); } } }
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; }
void LLWorld::printPacketsLost() { llinfos << "Simulators:" << llendl; llinfos << "----------" << llendl; LLCircuitData *cdp = NULL; for (region_list_t::iterator iter = mActiveRegionList.begin(); iter != mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; cdp = gMessageSystem->mCircuitInfo.findCircuit(regionp->getHost()); if (cdp) { LLVector3d range = regionp->getCenterGlobal() - gAgent.getPositionGlobal(); llinfos << regionp->getHost() << ", range: " << range.length() << " packets lost: " << cdp->getPacketsLost() << llendl; } } }
LLViewerRegion* LLWorld::getRegion(const LLHost &host) { for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; if (regionp->getHost() == host) { return regionp; } } return NULL; }
// static void LLToolBrushLand::undo() { for(region_list_t::iterator iter = mLastAffectedRegions.begin(); iter != mLastAffectedRegions.end(); ++iter) { LLViewerRegion* regionp = *iter; gMessageSystem->newMessageFast(_PREHASH_UndoLand); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); gMessageSystem->sendMessage(regionp->getHost()); } }
void LLWorld::disconnectRegions() { LLMessageSystem* msg = gMessageSystem; for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; if (regionp == gAgent.getRegion()) { // Skip the main agent continue; } llinfos << "Sending AgentQuitCopy to: " << regionp->getHost() << llendl; msg->newMessageFast(_PREHASH_AgentQuitCopy); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_FuseBlock); msg->addU32Fast(_PREHASH_ViewerCircuitCode, gMessageSystem->mOurCircuitCode); msg->sendMessage(regionp->getHost()); } }
void LLFloaterAuction::initialize() { mParcelUpdateCapUrl.clear(); mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLParcel* parcelp = mParcelp->getParcel(); if(parcelp && region && !parcelp->getForSale()) { mParcelHost = region->getHost(); mParcelID = parcelp->getLocalID(); mParcelUpdateCapUrl = region->getCapability("ParcelPropertiesUpdate"); childSetText("parcel_text", parcelp->getName()); childEnable("snapshot_btn"); childEnable("reset_parcel_btn"); childEnable("start_auction_btn"); LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); if (panel) { // Only enable "Sell to Anyone" on Teen grid or if we don't know the ID yet U32 estate_id = panel->getEstateID(); childSetEnabled("sell_to_anyone_btn", (estate_id == ESTATE_TEEN || estate_id == 0)); } else { // Don't have the panel up, so don't know if we're on the teen grid or not. Default to enabling it childEnable("sell_to_anyone_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("reset_parcel_btn", false); childSetEnabled("sell_to_anyone_btn", false); childSetEnabled("start_auction_btn", false); } mImageID.setNull(); mImage = NULL; }
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(); }
void LLFloaterAuction::initialize() { mParcelUpdateCapUrl.clear(); mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLParcel* parcelp = mParcelp->getParcel(); if(parcelp && region && !parcelp->getForSale()) { mParcelHost = region->getHost(); mParcelID = parcelp->getLocalID(); mParcelUpdateCapUrl = region->getCapability("ParcelPropertiesUpdate"); getChild<LLUICtrl>("parcel_text")->setValue(parcelp->getName()); getChildView("snapshot_btn")->setEnabled(TRUE); getChildView("reset_parcel_btn")->setEnabled(TRUE); getChildView("start_auction_btn")->setEnabled(TRUE); U32 estate_id = LLEstateInfoModel::instance().getID(); // Only enable "Sell to Anyone" on Teen grid or if we don't know the ID yet getChildView("sell_to_anyone_btn")->setEnabled(estate_id == ESTATE_TEEN || estate_id == 0); } else { mParcelHost.invalidate(); if(parcelp && parcelp->getForSale()) { getChild<LLUICtrl>("parcel_text")->setValue(getString("already for sale")); } else { getChild<LLUICtrl>("parcel_text")->setValue(LLStringUtil::null); } mParcelID = -1; getChildView("snapshot_btn")->setEnabled(false); getChildView("reset_parcel_btn")->setEnabled(false); getChildView("sell_to_anyone_btn")->setEnabled(false); getChildView("start_auction_btn")->setEnabled(false); } mImageID.setNull(); mImage = NULL; }
// Reset all the values for the parcel in preparation for a sale void LLFloaterAuction::doResetParcel() { LLParcel* parcelp = mParcelp->getParcel(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (parcelp && region && !mParcelUpdateCapUrl.empty()) { LLSD body; std::string empty; // request new properties update from simulator U32 message_flags = 0x01; body["flags"] = ll_sd_from_U32(message_flags); // Set all the default parcel properties for auction body["local_id"] = parcelp->getLocalID(); U32 parcel_flags = PF_ALLOW_LANDMARK | PF_ALLOW_FLY | PF_CREATE_GROUP_OBJECTS | PF_ALLOW_ALL_OBJECT_ENTRY | PF_ALLOW_GROUP_OBJECT_ENTRY | PF_ALLOW_GROUP_SCRIPTS | PF_RESTRICT_PUSHOBJECT | PF_SOUND_LOCAL | PF_ALLOW_VOICE_CHAT | PF_USE_ESTATE_VOICE_CHAN; body["parcel_flags"] = ll_sd_from_U32(parcel_flags); // Build a parcel name like "Ahern (128,128) PG 4032m" std::ostringstream parcel_name; LLVector3 center_point( parcelp->getCenterpoint() ); center_point.snap(0); // Get rid of fractions parcel_name << region->getName() << " (" << (S32) center_point.mV[VX] << "," << (S32) center_point.mV[VY] << ") " << region->getSimAccessString() << " " << parcelp->getArea() << "m"; std::string new_name(parcel_name.str().c_str()); body["name"] = new_name; getChild<LLUICtrl>("parcel_text")->setValue(new_name); // Set name in dialog as well, since it won't get updated otherwise body["sale_price"] = (S32) 0; body["description"] = empty; body["music_url"] = empty; body["media_url"] = empty; body["media_desc"] = empty; body["media_type"] = LLMIMETypes::getDefaultMimeType(); body["media_width"] = (S32) 0; body["media_height"] = (S32) 0; body["auto_scale"] = (S32) 0; body["media_loop"] = (S32) 0; body["obscure_media"] = (S32) 0; // OBSOLETE - no longer used body["obscure_music"] = (S32) 0; // OBSOLETE - no longer used body["media_id"] = LLUUID::null; body["group_id"] = MAINTENANCE_GROUP_ID; // Use maintenance group body["pass_price"] = (S32) 10; // Defaults to $10 body["pass_hours"] = 0.0f; body["category"] = (U8) LLParcel::C_NONE; body["auth_buyer_id"] = LLUUID::null; body["snapshot_id"] = LLUUID::null; body["user_location"] = ll_sd_from_vector3( LLVector3::zero ); body["user_look_at"] = ll_sd_from_vector3( LLVector3::zero ); body["landing_type"] = (U8) LLParcel::L_DIRECT; llinfos << "Sending parcel update to reset for auction via capability to: " << mParcelUpdateCapUrl << llendl; LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder()); // Send a message to clear the object return time LLMessageSystem *msg = gMessageSystem; msg->newMessageFast(_PREHASH_ParcelSetOtherCleanTime); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ParcelData); msg->addS32Fast(_PREHASH_LocalID, parcelp->getLocalID()); msg->addS32Fast(_PREHASH_OtherCleanTime, 5); // 5 minute object auto-return msg->sendReliable(region->getHost()); // Clear the access lists clearParcelAccessLists(parcelp, region); } }
// <edit> void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed) { LLResourceData* data = (LLResourceData*)user_data; S32 expected_upload_cost = data ? data->mExpectedUploadCost : 0; //LLAssetType::EType pref_loc = data->mPreferredLocation; BOOL is_balance_sufficient = TRUE; if(!data) { LLUploadDialog::modalUploadFinished(); return; } if(result >= 0) { LLFolderType::EType dest_loc = (data->mPreferredLocation == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(data->mAssetInfo.mType) : data->mPreferredLocation; if (LLAssetType::AT_SOUND == data->mAssetInfo.mType || LLAssetType::AT_TEXTURE == data->mAssetInfo.mType || LLAssetType::AT_ANIMATION == data->mAssetInfo.mType) { // Charge the user for the upload. LLViewerRegion* region = gAgent.getRegion(); if(!(can_afford_transaction(expected_upload_cost))) { LLStringUtil::format_map_t args; args["[NAME]"] = data->mAssetInfo.getName(); args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); args["[AMOUNT]"] = llformat("%d", expected_upload_cost); LLFloaterBuyCurrency::buyCurrency( LLTrans::getString("UploadingCosts", args), expected_upload_cost ); is_balance_sufficient = FALSE; } else if(region) { // Charge user for upload gStatusBar->debitBalance(expected_upload_cost); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MoneyTransferRequest); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_MoneyData); msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID()); msg->addUUIDFast(_PREHASH_DestID, LLUUID::null); msg->addU8("Flags", 0); // we tell the sim how much we were expecting to pay so it // can respond to any discrepancy msg->addS32Fast(_PREHASH_Amount, expected_upload_cost); msg->addU8Fast(_PREHASH_AggregatePermNextOwner, (U8)LLAggregatePermissions::AP_EMPTY); msg->addU8Fast(_PREHASH_AggregatePermInventory, (U8)LLAggregatePermissions::AP_EMPTY); msg->addS32Fast(_PREHASH_TransactionType, TRANS_UPLOAD_CHARGE); msg->addStringFast(_PREHASH_Description, NULL); msg->sendReliable(region->getHost()); } } if(is_balance_sufficient) { // Actually add the upload to inventory llinfos << "Adding " << uuid << " to inventory." << llendl; const LLUUID folder_id = gInventory.findCategoryUUIDForType(dest_loc); if(folder_id.notNull()) { U32 next_owner_perms = data->mNextOwnerPerm; if(PERM_NONE == next_owner_perms) { next_owner_perms = PERM_MOVE | PERM_TRANSFER; } create_inventory_item(gAgent.getID(), gAgent.getSessionID(), folder_id, data->mAssetInfo.mTransactionID, data->mAssetInfo.getName(), data->mAssetInfo.getDescription(), data->mAssetInfo.mType, data->mInventoryType, NOT_WEARABLE, next_owner_perms, LLPointer<LLInventoryCallback>(NULL)); } else { llwarns << "Can't find a folder to put it in" << llendl; } } } else // if(result >= 0) { LLSD args; args["FILE"] = LLInventoryType::lookupHumanReadable(data->mInventoryType); args["REASON"] = std::string(LLAssetStorage::getErrorString(result)); LLNotificationsUtil::add("CannotUploadReason", args); } LLUploadDialog::modalUploadFinished(); delete data; data = NULL; }
void LLFloaterBuyLandUI::updateCovenantInfo() { LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(!region) return; U8 sim_access = region->getSimAccess(); std::string rating = LLViewerRegion::accessToString(sim_access); LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); if (region_name) { std::string region_name_txt = region->getName() + " ("+rating +")"; region_name->setText(region_name_txt); LLIconCtrl* rating_icon = getChild<LLIconCtrl>("rating_icon"); LLRect rect = rating_icon->getRect(); S32 region_name_width = llmin(region_name->getRect().getWidth(), region_name->getTextBoundingRect().getWidth()); S32 icon_left_pad = region_name->getRect().mLeft + region_name_width + ICON_PAD; region_name->setToolTip(region_name->getText()); rating_icon->setRect(rect.setOriginAndSize(icon_left_pad, rect.mBottom, rect.getWidth(), rect.getHeight())); switch(sim_access) { case SIM_ACCESS_PG: rating_icon->setValue(getString("icon_PG")); break; case SIM_ACCESS_ADULT: rating_icon->setValue(getString("icon_R")); break; default: rating_icon->setValue(getString("icon_M")); } } LLTextBox* region_type = getChild<LLTextBox>("region_type_text"); if (region_type) { region_type->setText(region->getLocalizedSimProductName()); region_type->setToolTip(region->getLocalizedSimProductName()); } 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->setCommitCallback(onChangeAgreeCovenant, this); } 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()); }
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 // [Ansariel: Display name support] // msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname) ); if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { msg.append(RlvStrings::getAnonym(fullname)); } else { if (LLAvatarNameCache::useDisplayNames()) { LLAvatarName avatar_name; if (LLAvatarNameCache::get(mClosestAgentToCursor, &avatar_name)) { static const LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0); if (phoenix_name_system == 2 || (phoenix_name_system == 1 && avatar_name.mIsDisplayNameDefault)) { fullname = avatar_name.mDisplayName; } else { fullname = avatar_name.getCompleteName(true); } } } msg.append(fullname); } // [/Ansariel: Display name support] // [/RLVa:KB] msg.append("\n"); LLVector3d mypos = gAgent.getPositionGlobal(); LLVector3d position = mClosestAgentPosition; if ( LLFloaterAvatarList::instanceExists() ) { LLAvatarListEntry *ent = LLFloaterAvatarList::getInstance()->getAvatarEntry(mClosestAgentToCursor); if ( NULL != ent ) { //position = LLFloaterAvatarList::AvatarPosition(mClosestAgentToCursor); position = ent->getPosition(); } } LLVector3d delta = position - mypos; F32 distance = (F32)delta.magVec(); //llinfos << distance << " - " << position << llendl; msg.append( llformat("\n(Distance: %.02fm)\n\n",distance) ); } // [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() : RlvStrings::getString(RLV_STRING_HIDDEN) ); // [/RLVa:KB] //msg.append( 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 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; }
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 (mObjectID.notNull()) { // get object info for the user's benefit if (LLViewerObject* objectp = gObjectList.findObject(mObjectID)) { 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()); // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) /* if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) { childSetText("sim_field", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); } */ // [/RLVa:KB] 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() ); } } } }