// 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; }
// static BOOL LLFloaterMessageLog::onClickCloseCircuit(void* user_data) { LLNetListItem* itemp = (LLNetListItem*)user_data; LLCircuitData* cdp = (LLCircuitData*)itemp->mCircuitData; if(!cdp) return FALSE; LLHost myhost = cdp->getHost(); LLSD args; args["MESSAGE"] = "This will delete local circuit data.\nDo you want to tell the remote host to close the circuit too?"; LLSD payload; payload["circuittoclose"] = myhost.getString(); LLNotificationsUtil::add("GenericAlertYesCancel", args, payload, onConfirmCloseCircuit); return TRUE; }
LLViewerRegionImpl(LLViewerRegion * region, LLHost const & host) : mHost(host), mCompositionp(NULL), mEventPoll(NULL), // I'd prefer to set the LLCapabilityListener name to match the region // name -- it's disappointing that's not available at construction time. // We could instead store an LLCapabilityListener*, making // setRegionNameAndZone() replace the instance. Would that pose // consistency problems? Can we even request a capability before calling // setRegionNameAndZone()? // For testability -- the new Michael Feathers paradigm -- // LLCapabilityListener binds all the globals it expects to need at // construction time. mCapabilityListener(host.getString(), gMessageSystem, *region, gAgent.getID(), gAgent.getSessionID()) { }
LLViewerRegion::LLViewerRegion(const U64 &handle, const LLHost &host, const U32 grids_per_region_edge, const U32 grids_per_patch_edge, const F32 region_width_meters) : mCenterGlobal(), mHandle(handle), mHost( host ), mTimeDilation(1.0f), mName(""), mZoning(""), mOwnerID(), mIsEstateManager(FALSE), mCompositionp(NULL), mRegionFlags( REGION_FLAGS_DEFAULT ), mSimAccess( SIM_ACCESS_MIN ), mBillableFactor(1.0), mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT), mClassID(0), mCPURatio(0), mColoName("unknown"), mProductSKU("unknown"), mProductName("unknown"), mHttpUrl(""), mCacheLoaded(FALSE), mCacheDirty(FALSE), mCacheID(), mEventPoll(NULL), mReleaseNotesRequested(FALSE), // I'd prefer to set the LLCapabilityListener name to match the region // name -- it's disappointing that's not available at construction time. // We could instead store an LLCapabilityListener*, making // setRegionNameAndZone() replace the instance. Would that pose // consistency problems? Can we even request a capability before calling // setRegionNameAndZone()? // For testability -- the new Michael Feathers paradigm -- // LLCapabilityListener binds all the globals it expects to need at // construction time. mCapabilityListener(host.getString(), gMessageSystem, *this, gAgent.getID(), gAgent.getSessionID()) { mWidth = region_width_meters; mOriginGlobal = from_region_handle(handle); updateRenderMatrix(); mLandp = new LLSurface('l', NULL); if (!gNoRender) { // Create the composition layer for the surface mCompositionp = new LLVLComposition(mLandp, grids_per_region_edge, region_width_meters/grids_per_region_edge); mCompositionp->setSurface(mLandp); // Create the surfaces mLandp->setRegion(this); mLandp->create(grids_per_region_edge, grids_per_patch_edge, mOriginGlobal, mWidth); } if (!gNoRender) { mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); } else { mParcelOverlay = NULL; } setOriginGlobal(from_region_handle(handle)); calculateCenterGlobal(); // Create the object lists initStats(); //create object partitions //MUST MATCH declaration of eObjectPartitions mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD mObjectPartition.push_back(new LLTerrainPartition()); //PARTITION_TERRAIN mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE mObjectPartition.push_back(new LLCloudPartition()); //PARTITION_CLOUD mObjectPartition.push_back(new LLGrassPartition()); //PARTITION_GRASS mObjectPartition.push_back(new LLVolumePartition()); //PARTITION_VOLUME mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE mObjectPartition.push_back(NULL); //PARTITION_NONE }