void ImportTracker::send_namedesc(LLSD& prim) { if(prim.has("name")) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectName); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger()); msg->addStringFast(_PREHASH_Name, prim["name"]); msg->sendReliable(gAgent.getRegion()->getHost()); } if(prim.has("description")) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectDescription); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); LLVector3 scale = prim["scale"]; if((scale.mV[VX] > 10.) || (scale.mV[VY] > 10.) || (scale.mV[VZ] > 10.) ) prim["description"] = llformat("<%d, %d, %d>", (U8)scale.mV[VX], (U8)scale.mV[VY], (U8)scale.mV[VZ]); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger()); msg->addStringFast(_PREHASH_Description, prim["description"]); msg->sendReliable(gAgent.getRegion()->getHost()); } }
void ImportTracker::send_namedesc(LLSD& prim) { if(prim.has("name")) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectName); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger()); msg->addStringFast(_PREHASH_Name, prim["name"]); msg->sendReliable(gAgent.getRegion()->getHost()); } if(prim.has("description")) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectDescription); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger()); msg->addStringFast(_PREHASH_Description, prim["description"]); msg->sendReliable(gAgent.getRegion()->getHost()); } }
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 bool PanelRadar::callbackEjectBan(const LLSD& notification, const LLSD& response) { S32 option = LLNotification::getSelectedOption(notification, response); if (2 == option) { // Cancel button. return false; } LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); bool ban_enabled = notification["payload"]["ban_enabled"].asBoolean(); if (0 == option) { // Eject button LLMessageSystem* msg = gMessageSystem; LLViewerObject* avatar = gObjectList.findObject(avatar_id); if (avatar) { U32 flags = 0x0; msg->newMessage("EjectUser"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID() ); msg->addUUID("SessionID", gAgent.getSessionID() ); msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id ); msg->addU32("Flags", flags ); msg->sendReliable( avatar->getRegion()->getHost() ); } } else if (ban_enabled) { // This is tricky. It is similar to say if it is not an 'Eject' button, // and it is also not an 'Cancle' button, and ban_enabled==ture, // it should be the 'Eject and Ban' button. LLMessageSystem* msg = gMessageSystem; LLViewerObject* avatar = gObjectList.findObject(avatar_id); if (avatar) { U32 flags = 0x1; msg->newMessage("EjectUser"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID() ); msg->addUUID("SessionID", gAgent.getSessionID() ); msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id ); msg->addU32("Flags", flags ); msg->sendReliable( avatar->getRegion()->getHost() ); } } return false; }
void LLFloaterAuction::clearParcelAccessLists(LLParcel* parcel, LLViewerRegion* region) { if (!region || !parcel) return; LLUUID transactionUUID; transactionUUID.generate(); LLMessageSystem* msg = gMessageSystem; // Clear access list // parcel->mAccessList.clear(); msg->newMessageFast(_PREHASH_ParcelAccessListUpdate); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); msg->nextBlockFast(_PREHASH_Data); msg->addU32Fast(_PREHASH_Flags, AL_ACCESS); msg->addS32(_PREHASH_LocalID, parcel->getLocalID() ); msg->addUUIDFast(_PREHASH_TransactionID, transactionUUID); msg->addS32Fast(_PREHASH_SequenceID, 1); // sequence_id msg->addS32Fast(_PREHASH_Sections, 0); // num_sections // pack an empty block since there will be no data msg->nextBlockFast(_PREHASH_List); msg->addUUIDFast(_PREHASH_ID, LLUUID::null ); msg->addS32Fast(_PREHASH_Time, 0 ); msg->addU32Fast(_PREHASH_Flags, 0 ); msg->sendReliable( region->getHost() ); // Send message for empty ban list //parcel->mBanList.clear(); msg->newMessageFast(_PREHASH_ParcelAccessListUpdate); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); msg->nextBlockFast(_PREHASH_Data); msg->addU32Fast(_PREHASH_Flags, AL_BAN); msg->addS32(_PREHASH_LocalID, parcel->getLocalID() ); msg->addUUIDFast(_PREHASH_TransactionID, transactionUUID); msg->addS32Fast(_PREHASH_SequenceID, 1); // sequence_id msg->addS32Fast(_PREHASH_Sections, 0); // num_sections // pack an empty block since there will be no data msg->nextBlockFast(_PREHASH_List); msg->addUUIDFast(_PREHASH_ID, LLUUID::null ); msg->addS32Fast(_PREHASH_Time, 0 ); msg->addU32Fast(_PREHASH_Flags, 0 ); 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()); }
// static void LLFloaterPay::payViaObject(money_callback callback, const LLUUID& object_id) { LLViewerObject* object = gObjectList.findObject(object_id); if (!object) return; LLFloaterPay *floater = new LLFloaterPay("Give L$", callback, object_id, TRUE); if (!floater) return; LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); if (!node) { //FIXME: notify user object no longer exists floater->close(); return; } LLHost target_region = object->getRegion()->getHost(); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RequestPayPrice); msg->nextBlockFast(_PREHASH_ObjectData); msg->addUUIDFast(_PREHASH_ObjectID, object_id); msg->sendReliable(target_region); msg->setHandlerFuncFast(_PREHASH_PayPriceReply, processPayPriceReply,(void **)floater); LLUUID owner_id; BOOL is_group = FALSE; node->mPermissions->getOwnership(owner_id, is_group); floater->childSetText("object_name_text",node->mName); floater->finishPayUI(owner_id, is_group); }
static void send_estate_message( const char* request, const LLUUID &target) { LLMessageSystem* msg = gMessageSystem; LLUUID invoice; // This seems to provide an ID so that the sim can say which request it's // replying to. I think this can be ignored for now. invoice.generate(); llinfos << "Sending estate request '" << request << "'" << llendl; msg->newMessage("EstateOwnerMessage"); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used msg->nextBlock("MethodData"); msg->addString("Method", request); msg->addUUID("Invoice", invoice); // Agent id msg->nextBlock("ParamList"); msg->addString("Parameter", gAgent.getID().asString().c_str()); // Target msg->nextBlock("ParamList"); msg->addString("Parameter", target.asString().c_str()); msg->sendReliable(gAgent.getRegion()->getHost()); }
void LLFloaterBulkPermission::updateInventory(LLViewerObject* object, LLViewerInventoryItem* item, U8 key, bool is_new) { LLMemType mt(LLMemType::MTYPE_OBJECT); // This slices the object into what we're concerned about on the viewer. // The simulator will take the permissions and transfer ownership. LLPointer<LLViewerInventoryItem> task_item = new LLViewerInventoryItem(item->getUUID(), mID, item->getPermissions(), item->getAssetUUID(), item->getType(), item->getInventoryType(), item->getName(), item->getDescription(), item->getSaleInfo(), item->getFlags(), item->getCreationDate()); task_item->setTransactionID(item->getTransactionID()); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_UpdateTaskInventory); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_UpdateData); msg->addU32Fast(_PREHASH_LocalID, object->mLocalID); msg->addU8Fast(_PREHASH_Key, key); msg->nextBlockFast(_PREHASH_InventoryData); task_item->packMessage(msg); msg->sendReliable(object->getRegion()->getHost()); }
void LLFloaterTopObjects::onRefresh() { U32 mode = STAT_REPORT_TOP_SCRIPTS; U32 flags = 0; std::string filter = ""; mode = mCurrentMode; flags = mFlags; filter = mFilter; clearList(); LLMessageSystem *msg = gMessageSystem; msg->newMessageFast(_PREHASH_LandStatRequest); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); msg->nextBlockFast(_PREHASH_RequestData); msg->addU32Fast(_PREHASH_ReportType, mode); msg->addU32Fast(_PREHASH_RequestFlags, flags); msg->addStringFast(_PREHASH_Filter, filter); msg->addS32Fast(_PREHASH_ParcelLocalID, 0); msg->sendReliable(gAgent.getRegionHost()); mFilter.clear(); mFlags = 0; }
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 ImportTracker::send_image(LLSD& prim) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectImage); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger()); msg->addStringFast(_PREHASH_MediaURL, NULL); LLPrimitive obj; LLSD tes = prim["textures"]; obj.setNumTEs(U8(tes.size())); for (int i = 0; i < tes.size(); i++) { LLTextureEntry tex; tex.fromLLSD(tes[i]); obj.setTE(U8(i), tex); } obj.packTEMessage(gMessageSystem); msg->sendReliable(gAgent.getRegion()->getHost()); }
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 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 ReplySender::flush() { if (mPending) { mMsg->sendReliable(mCurrHost); mPending = false; } }
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() ); } } } }
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); } } }
bool dxcmd(std::string revised_text, EChatType type) { std::istringstream i(revised_text); std::string command; i >> command; LLStringUtil::toLower(command); if(command != "") { if(command == "###test") { llinfos << "test chat dxchatcmd!" << llendl; return false; } else if(command == "###platform") { llinfos << "rez a platform!" << llendl; LLVector3 agentPos = gAgent.getPositionAgent()+(gAgent.getVelocity()*(F32)0.333); 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_PCode, LL_PCODE_VOLUME); msg->addU8Fast(_PREHASH_Material, LL_MCODE_METAL); if(agentPos.mV[2] > 4096.0)msg->addU32Fast(_PREHASH_AddFlags, FLAGS_CREATE_SELECTED); else msg->addU32Fast(_PREHASH_AddFlags, 0); LLVolumeParams volume_params; volume_params.setType( LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE ); 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); LLVector3 rezpos = agentPos - LLVector3(0.0f,0.0f,2.5f); msg->addVector3Fast(_PREHASH_Scale, LLVector3(20.0f,20.0f,0.25f) ); msg->addQuatFast(_PREHASH_Rotation, LLQuaternion() ); msg->addVector3Fast(_PREHASH_RayStart, rezpos ); msg->addVector3Fast(_PREHASH_RayEnd, rezpos ); msg->addU8Fast(_PREHASH_BypassRaycast, (U8)1 ); msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE ); msg->addU8Fast(_PREHASH_State, 0); msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null ); msg->sendReliable(gAgent.getRegionHost()); return false; } } return true; }
void LLUrlEntryParcel::sendParcelInfoRequest(const LLUUID& parcel_id) { if (sRegionHost == LLHost::invalid || sDisconnected) return; LLMessageSystem *msg = gMessageSystem; msg->newMessage("ParcelInfoRequest"); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, sAgentID ); msg->addUUID("SessionID", sSessionID); msg->nextBlock("Data"); msg->addUUID("ParcelID", parcel_id); msg->sendReliable(sRegionHost); }
void ImportTracker::wear(LLSD &prim) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectAttach); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->addU8Fast(_PREHASH_AttachmentPoint, U8(prim["Attachment"].asInteger())); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger()); msg->addQuatFast(_PREHASH_Rotation, LLQuaternion(0.0f, 0.0f, 0.0f, 1.0f)); msg->sendReliable(gAgent.getRegion()->getHost()); LLVector3 position = prim["attachpos"]; LLSD rot = prim["attachrot"]; LLQuaternion rotq; rotq.mQ[VX] = (F32)(rot[0].asReal()); rotq.mQ[VY] = (F32)(rot[1].asReal()); rotq.mQ[VZ] = (F32)(rot[2].asReal()); rotq.mQ[VW] = (F32)(rot[3].asReal()); LLVector3 rotation = rotq.packToVector3(); U8 data[256]; LLMessageSystem* msg2 = gMessageSystem; msg2->newMessageFast(_PREHASH_MultipleObjectUpdate); msg2->nextBlockFast(_PREHASH_AgentData); msg2->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg2->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg2->nextBlockFast(_PREHASH_ObjectData); msg2->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger()); msg2->addU8Fast(_PREHASH_Type, U8(0x01 | 0x08)); htonmemcpy(&data[0], &(position.mV), MVT_LLVector3, 12); msg2->addBinaryDataFast(_PREHASH_Data, data, 12); msg2->nextBlockFast(_PREHASH_ObjectData); msg2->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger()); msg2->addU8Fast(_PREHASH_Type, U8(0x02 | 0x08)); htonmemcpy(&data[0], &(rotation.mV), MVT_LLQuaternion, 12); msg2->addBinaryDataFast(_PREHASH_Data, data, 12); msg2->sendReliable(gAgent.getRegion()->getHost()); llinfos << "POSITIONED, IMPORT COMPLETED" << llendl; cleanUp(); }
void ImportTracker::send_shape(LLSD& prim) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ObjectShape); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger()); LLVolumeParams params; params.fromLLSD(prim["volume"]); LLVolumeMessage::packVolumeParams(¶ms, msg); msg->sendReliable(gAgent.getRegion()->getHost()); }
// static void LLFloaterAuction::onClickOK(void* data) { LLFloaterAuction* self = (LLFloaterAuction*)(data); if(self->mImageID.notNull()) { LLSD parcel_name = self->childGetValue("parcel_text"); // create the asset std::string* name = new std::string(parcel_name.asString()); gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_IMAGE_TGA, &auction_tga_upload_done, (void*)name, FALSE); self->getWindow()->incBusyCount(); std::string* j2c_name = new std::string(parcel_name.asString()); gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_TEXTURE, &auction_j2c_upload_done, (void*)j2c_name, FALSE); self->getWindow()->incBusyCount(); LLNotifyBox::showXml("UploadingAuctionSnapshot"); } LLMessageSystem* msg = gMessageSystem; msg->newMessage("ViewerStartAuction"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("ParcelData"); msg->addS32("LocalID", self->mParcelID); msg->addUUID("SnapshotID", self->mImageID); msg->sendReliable(self->mParcelHost); // clean up floater, and get out self->mImageID.setNull(); self->mImage = NULL; self->mParcelID = -1; self->mParcelHost.invalidate(); self->close(); }
void ImportTracker::send_vectors(LLSD& prim,int counter) { LLVector3 position = ((LLVector3)prim["position"] * rootrot) + root; LLSD rot = prim["rotation"]; LLQuaternion rotq; rotq.mQ[VX] = (F32)(rot[0].asReal()); rotq.mQ[VY] = (F32)(rot[1].asReal()); rotq.mQ[VZ] = (F32)(rot[2].asReal()); rotq.mQ[VW] = (F32)(rot[3].asReal()); LLVector3 rotation; if(counter == 1) rotation = rotq.packToVector3(); else rotation = (rotq * rootrot).packToVector3(); LLVector3 scale = prim["scale"]; U8 data[256]; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MultipleObjectUpdate); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger()); msg->addU8Fast(_PREHASH_Type, U8(0x01)); htonmemcpy(&data[0], &(position.mV), MVT_LLVector3, 12); msg->addBinaryDataFast(_PREHASH_Data, data, 12); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger()); msg->addU8Fast(_PREHASH_Type, U8(0x02)); htonmemcpy(&data[0], &(rotation.mV), MVT_LLQuaternion, 12); msg->addBinaryDataFast(_PREHASH_Data, data, 12); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger()); msg->addU8Fast(_PREHASH_Type, U8(0x04)); htonmemcpy(&data[0], &(scale.mV), MVT_LLVector3, 12); msg->addBinaryDataFast(_PREHASH_Data, data, 12); msg->sendReliable(gAgent.getRegion()->getHost()); }
// static void LLPanelRequestTools::sendRequest(const std::string& request, const std::string& parameter, const LLHost& host) { LL_INFOS() << "Sending request '" << request << "', '" << parameter << "' to " << host << LL_ENDL; LLMessageSystem* msg = gMessageSystem; msg->newMessage("GodlikeMessage"); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used msg->nextBlock("MethodData"); msg->addString("Method", request); msg->addUUID("Invoice", LLUUID::null); msg->nextBlock("ParamList"); msg->addString("Parameter", parameter); msg->sendReliable(host); }
void LLFloaterTopObjects::onKick(void* data) { LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list"); if (!list) return; LLScrollListItem* first_selected = list->getFirstSelected(); if (!first_selected) return; LLUUID taskid = first_selected->getUUID(); LLMessageSystem* msg = gMessageSystem; msg->newMessage("EstateOwnerMessage"); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used msg->nextBlock("MethodData"); msg->addString("Method", "kickestate"); msg->addUUID("Invoice", LLUUID::null); msg->nextBlock("ParamList"); msg->addString("Parameter", taskid.asString().c_str()); msg->sendReliable(gAgent.getRegionHost()); }
// static void LLFloaterPay::payViaObject(money_callback callback, LLSafeHandle<LLObjectSelection> selection) { // Object that lead to the selection, may be child LLViewerObject* object = selection->getPrimaryObject(); if (!object) return; LLFloaterPay *floater = LLFloaterReg::showTypedInstance<LLFloaterPay>("pay_object", LLSD(object->getID())); if (!floater) return; floater->setCallback(callback); // Hold onto the selection until we close floater->mObjectSelection = selection; LLSelectNode* node = selection->getFirstRootNode(); if (!node) { //FIXME: notify user object no longer exists floater->closeFloater(); return; } LLHost target_region = object->getRegion()->getHost(); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RequestPayPrice); msg->nextBlockFast(_PREHASH_ObjectData); msg->addUUIDFast(_PREHASH_ObjectID, object->getID()); msg->sendReliable(target_region); msg->setHandlerFuncFast(_PREHASH_PayPriceReply, processPayPriceReply,(void **)floater); LLUUID owner_id; BOOL is_group = FALSE; node->mPermissions->getOwnership(owner_id, is_group); floater->childSetText("object_name_text",node->mName); floater->finishPayUI(owner_id, is_group); }
void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj, InventoryObjectList* inv) { // find all of the lsl, leaving off duplicates. We'll remove // all matching asset uuids on compilation success. LLDynamicArray<const char*> names; InventoryObjectList::const_iterator it = inv->begin(); InventoryObjectList::const_iterator end = inv->end(); for ( ; it != end; ++it) { if((*it)->getType() == LLAssetType::AT_LSL_TEXT) { LLViewerObject* object = gObjectList.findObject(viewer_obj->getID()); if (object) { LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); std::string buffer; buffer = std::string("Not running: ") +item->getName(); // *TODO: Translate list->addCommentText(buffer); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Script); msg->addUUIDFast(_PREHASH_ObjectID, viewer_obj->getID()); msg->addUUIDFast(_PREHASH_ItemID, (*it)->getUUID()); msg->addBOOLFast(_PREHASH_Running, FALSE); msg->sendReliable(object->getRegion()->getHost()); } } } nextObject(); }
static void send_eject(const LLUUID& avatar_id, bool ban) { LLMessageSystem* msg = gMessageSystem; LLVOAvatar* avatarp = gObjectList.findAvatar(avatar_id); if (avatarp && avatarp->getRegion()) { U32 flags = 0x0; if (ban) { // eject and add to ban list flags |= 0x1; } msg->newMessage("EjectUser"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id); msg->addU32("Flags", flags); msg->sendReliable( avatarp->getRegion()->getHost()); } }
static void send_freeze(const LLUUID& avatar_id, bool freeze) { U32 flags = 0x0; if (!freeze) { // unfreeze flags |= 0x1; } LLMessageSystem* msg = gMessageSystem; LLVOAvatar* avatarp = gObjectList.findAvatar(avatar_id); if (avatarp && avatarp->getRegion()) { msg->newMessage("FreezeUser"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id); msg->addU32("Flags", flags); msg->sendReliable( avatarp->getRegion()->getHost()); } }