本文整理汇总了C++中LLMessageSystem::addUUID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLMessageSystem::addUUID方法的具体用法?C++ LLMessageSystem::addUUID怎么用?C++ LLMessageSystem::addUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLMessageSystem
的用法示例。
在下文中一共展示了LLMessageSystem::addUUID方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendPickInfoUpdate
void LLPanelPick::sendPickInfoUpdate()
{
// If we don't have a pick id yet, we'll need to generate one,
// otherwise we'll keep overwriting pick_id 00000 in the database.
if (mPickID.isNull())
{
mPickID.generate();
}
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("PickInfoUpdate");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("Data");
msg->addUUID("PickID", mPickID);
msg->addUUID("CreatorID", mCreatorID);
msg->addBOOL("TopPick", mTopPick);
// fills in on simulator if null
msg->addUUID("ParcelID", mParcelID);
msg->addString("Name", mNameEditor->getText());
msg->addString("Desc", mDescEditor->getText());
msg->addUUID("SnapshotID", mSnapshotCtrl->getImageAssetID());
msg->addVector3d("PosGlobal", mPosGlobal);
// Only top picks have a sort order
S32 sort_order;
if (mTopPick)
{
sort_order = atoi(mSortOrderEditor->getText().c_str());
}
else
{
sort_order = 0;
}
msg->addS32("SortOrder", sort_order);
msg->addBOOL("Enabled", mEnabledCheck->get());
gAgent.sendReliableMessage();
}
示例2: postBuild
// virtual
BOOL LLFloaterReporter::postBuild()
{
LLSLURL slurl;
LLAgentUI::buildSLURL(slurl);
getChild<LLUICtrl>("abuse_location_edit")->setValue(slurl.getSLURLString());
enableControls(TRUE);
// convert the position to a string
LLVector3d pos = gAgent.getPositionGlobal();
LLViewerRegion *regionp = gAgent.getRegion();
if (regionp)
{
getChild<LLUICtrl>("sim_field")->setValue(regionp->getName());
pos -= regionp->getOriginGlobal();
}
setPosBox(pos);
// Take a screenshot, but don't draw this floater.
setVisible(FALSE);
takeScreenshot();
setVisible(TRUE);
// Default text to be blank
getChild<LLUICtrl>("object_name")->setValue(LLStringUtil::null);
getChild<LLUICtrl>("owner_name")->setValue(LLStringUtil::null);
mOwnerName = LLStringUtil::null;
getChild<LLUICtrl>("summary_edit")->setFocus(TRUE);
mDefaultSummary = getChild<LLUICtrl>("details_edit")->getValue().asString();
// send a message and ask for information about this region -
// result comes back in processRegionInfo(..)
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("RequestRegionInfo");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
gAgent.sendReliableMessage();
// abuser name is selected from a list
LLUICtrl* le = getChild<LLUICtrl>("abuser_name_edit");
le->setEnabled( false );
LLButton* pick_btn = getChild<LLButton>("pick_btn");
// XUI: Why aren't these in viewerart.ini?
pick_btn->setImages(std::string("UIImgFaceUUID"),
std::string("UIImgFaceSelectedUUID") );
childSetAction("pick_btn", onClickObjPicker, this);
childSetAction("select_abuser", boost::bind(&LLFloaterReporter::onClickSelectAbuser, this));
childSetAction("send_btn", onClickSend, this);
childSetAction("cancel_btn", onClickCancel, this);
// grab the user's name
std::string reporter;
gAgent.buildFullname(reporter);
getChild<LLUICtrl>("reporter_field")->setValue(reporter);
center();
return TRUE;
}
示例3: updateRadarList
//.........这里部分代码省略.........
LLAvatarNameCache::get(prevId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, str_draw_distance_leaving));
}
if (RadarReportSimRangeLeave && (rf.lastRegion == regionSelf || rf.lastRegion.isNull()))
{
make_ui_sound("UISndRadarSimLeave"); // <FS:PP> FIRE-6069: Radar alerts sounds
LLAvatarNameCache::get(prevId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, str_region_leaving));
}
if (RadarLeaveChannelAlert)
{
mRadarLeaveAlerts.push_back(prevId);
}
}
}
static LLCachedControl<S32> RadarAlertChannel(gSavedSettings, "RadarAlertChannel");
U32 num_entering = mRadarEnterAlerts.size();
if (num_entering > 0)
{
mRadarFrameCount++;
S32 chan(RadarAlertChannel);
U32 num_this_pass = llmin(FSRADAR_MAX_AVATARS_PER_ALERT, num_entering);
std::string msg = llformat("%d,%d", mRadarFrameCount, num_this_pass);
U32 loop = 0;
while (loop < num_entering)
{
for (S32 i = 0; i < num_this_pass; i++)
{
msg = llformat("%s,%s", msg.c_str(), mRadarEnterAlerts[loop + i].asString().c_str());
}
LLMessageSystem* msgs = gMessageSystem;
msgs->newMessage("ScriptDialogReply");
msgs->nextBlock("AgentData");
msgs->addUUID("AgentID", gAgent.getID());
msgs->addUUID("SessionID", gAgent.getSessionID());
msgs->nextBlock("Data");
msgs->addUUID("ObjectID", gAgent.getID());
msgs->addS32("ChatChannel", chan);
msgs->addS32("ButtonIndex", 1);
msgs->addString("ButtonLabel", msg.c_str());
gAgent.sendReliableMessage();
loop += num_this_pass;
num_this_pass = llmin(FSRADAR_MAX_AVATARS_PER_ALERT, num_entering - loop);
msg = llformat("%d,%d", mRadarFrameCount, num_this_pass);
}
}
U32 num_leaving = mRadarLeaveAlerts.size();
if (num_leaving > 0)
{
mRadarFrameCount++;
S32 chan(RadarAlertChannel);
U32 num_this_pass = llmin(FSRADAR_MAX_AVATARS_PER_ALERT, num_leaving);
std::string msg = llformat("%d,-%d", mRadarFrameCount, llmin(FSRADAR_MAX_AVATARS_PER_ALERT, num_leaving));
U32 loop = 0;
while (loop < num_leaving)
{
for (S32 i = 0; i < num_this_pass; i++)
{
msg = llformat("%s,%s", msg.c_str(), mRadarLeaveAlerts[loop + i].asString().c_str());
}
LLMessageSystem* msgs = gMessageSystem;
msgs->newMessage("ScriptDialogReply");
msgs->nextBlock("AgentData");
msgs->addUUID("AgentID", gAgent.getID());
msgs->addUUID("SessionID", gAgent.getSessionID());
msgs->nextBlock("Data");
示例4: performQuery
void LLPanelDirLand::performQuery()
{
BOOL inc_pg = childGetValue("incpg").asBoolean();
BOOL inc_mature = childGetValue("incmature").asBoolean();
BOOL inc_adult = childGetValue("incadult").asBoolean();
if (!(inc_pg || inc_mature || inc_adult))
{
LLNotifyBox::showXml("NoContentToSearch");
return;
}
LLMessageSystem* msg = gMessageSystem;
setupNewSearch();
// We could change the UI to allow arbitrary combinations of these options
U32 search_type = ST_ALL;
const std::string& type = childGetValue("type").asString();
if(!type.empty())
{
if (FIND_AUCTION == type) search_type = ST_AUCTION;
else if(FIND_MAINLANDSALES == type) search_type = ST_MAINLAND;
else if(FIND_ESTATESALES == type) search_type = ST_ESTATE;
}
U32 query_flags = 0x0;
if (gAgent.wantsPGOnly()) query_flags |= DFQ_PG_SIMS_ONLY;
bool adult_enabled = gAgent.canAccessAdult();
bool mature_enabled = gAgent.canAccessMature();
if (inc_pg)
{
query_flags |= DFQ_INC_PG;
}
if (inc_mature && mature_enabled)
{
query_flags |= DFQ_INC_MATURE;
}
if (inc_adult && adult_enabled)
{
query_flags |= DFQ_INC_ADULT;
}
// Add old flags in case we are talking to an old dataserver
if (inc_pg && !inc_mature)
{
query_flags |= DFQ_PG_SIMS_ONLY;
}
if (!inc_pg && inc_mature)
{
query_flags |= DFQ_MATURE_SIMS_ONLY;
}
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("results");
if (list)
{
std::string sort_name = list->getSortColumnName();
BOOL sort_asc = list->getSortAscending();
if (sort_name == "name")
{
query_flags |= DFQ_NAME_SORT;
}
else if (sort_name == "price")
{
query_flags |= DFQ_PRICE_SORT;
}
else if (sort_name == "per_meter")
{
query_flags |= DFQ_PER_METER_SORT;
}
else if (sort_name == "area")
{
query_flags |= DFQ_AREA_SORT;
}
if (sort_asc)
{
query_flags |= DFQ_SORT_ASC;
}
}
if (childGetValue("pricecheck").asBoolean())
{
query_flags |= DFQ_LIMIT_BY_PRICE;
}
if (childGetValue("areacheck").asBoolean())
{
query_flags |= DFQ_LIMIT_BY_AREA;
}
msg->newMessage("DirLandQuery");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
//.........这里部分代码省略.........
示例5: LLResourceData
//.........这里部分代码省略.........
mReportType(report_type),
mObjectID(),
mScreenID(),
mAbuserID(),
mDeselectOnClose( FALSE ),
mPicking( FALSE),
mPosition(),
mCopyrightWarningSeen( FALSE ),
mResourceDatap(new LLResourceData())
{
if (report_type == BUG_REPORT)
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_bug.xml");
}
else
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml");
}
childSetText("abuse_location_edit", gAgent.getSLURL() );
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0a
if (rlv_handler_t::isEnabled())
{
// Can't filter these since they get sent as part of the report so just hide them instead
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
{
childSetVisible("abuse_location_edit", false);
childSetVisible("pos_field", false);
}
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
childSetVisible("owner_name", false);
childSetVisible("abuser_name_edit", false);
}
}
// [/RLVa:KB]
LLButton* pick_btn = getChild<LLButton>("pick_btn");
if (pick_btn)
{
// XUI: Why aren't these in viewerart.ini?
pick_btn->setImages( std::string("UIImgFaceUUID"),
std::string("UIImgFaceSelectedUUID") );
childSetAction("pick_btn", onClickObjPicker, this);
}
if (report_type != BUG_REPORT)
{
// abuser name is selected from a list
LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit");
le->setEnabled( FALSE );
}
childSetAction("select_abuser", onClickSelectAbuser, this);
childSetAction("send_btn", onClickSend, this);
childSetAction("cancel_btn", onClickCancel, this);
enableControls(TRUE);
// convert the position to a string
LLVector3d pos = gAgent.getPositionGlobal();
LLViewerRegion *regionp = gAgent.getRegion();
if (regionp)
{
pos -= regionp->getOriginGlobal();
}
setPosBox(pos);
gReporterInstances.addData(report_type, this);
// Take a screenshot, but don't draw this floater.
setVisible(FALSE);
takeScreenshot();
setVisible(TRUE);
// Default text to be blank
childSetText("object_name", LLStringUtil::null);
childSetText("owner_name", LLStringUtil::null);
childSetFocus("summary_edit");
mDefaultSummary = childGetText("details_edit");
gDialogVisible = TRUE;
// only request details for abuse reports (not BUG reports)
if (report_type != BUG_REPORT)
{
// send a message and ask for information about this region -
// result comes back in processRegionInfo(..)
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("RequestRegionInfo");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
gAgent.sendReliableMessage();
};
}
示例6: deactivateSimilarGestures
void LLGestureMgr::deactivateSimilarGestures(LLMultiGesture* in, const LLUUID& in_item_id)
{
const LLUUID& base_in_item_id = get_linked_uuid(in_item_id);
uuid_vec_t gest_item_ids;
// Deactivate all gestures that match
item_map_t::iterator it;
for (it = mActive.begin(); it != mActive.end(); )
{
const LLUUID& item_id = (*it).first;
LLMultiGesture* gest = (*it).second;
// Don't deactivate the gesture we are looking for duplicates of
// (for replaceGesture)
if (!gest || item_id == base_in_item_id)
{
// legal, can have null pointers in list
++it;
}
else if ((!gest->mTrigger.empty() && gest->mTrigger == in->mTrigger)
|| (gest->mKey != KEY_NONE && gest->mKey == in->mKey && gest->mMask == in->mMask))
{
gest_item_ids.push_back(item_id);
stopGesture(gest);
delete gest;
gest = NULL;
mActive.erase(it++);
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
}
else
{
++it;
}
}
// Inform database of the change
LLMessageSystem* msg = gMessageSystem;
BOOL start_message = TRUE;
uuid_vec_t::const_iterator vit = gest_item_ids.begin();
while (vit != gest_item_ids.end())
{
if (start_message)
{
msg->newMessage("DeactivateGestures");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addU32("Flags", 0x0);
start_message = FALSE;
}
msg->nextBlock("Data");
msg->addUUID("ItemID", *vit);
msg->addU32("GestureFlags", 0x0);
if (msg->getCurrentSendTotal() > MTUBYTES)
{
gAgent.sendReliableMessage();
start_message = TRUE;
}
++vit;
}
if (!start_message)
{
gAgent.sendReliableMessage();
}
// Add to the list of names for the user.
for (vit = gest_item_ids.begin(); vit != gest_item_ids.end(); ++vit)
{
LLViewerInventoryItem* item = gInventory.getItem(*vit);
if (!item) continue;
mDeactivateSimilarNames.append(item->getName());
mDeactivateSimilarNames.append("\n");
}
notifyObservers();
}
示例7: activateGestures
void LLGestureMgr::activateGestures(LLViewerInventoryItem::item_array_t& items)
{
// Load up the assets
S32 count = 0;
LLViewerInventoryItem::item_array_t::const_iterator it;
for (it = items.begin(); it != items.end(); ++it)
{
LLViewerInventoryItem* item = *it;
if (isGestureActive(item->getUUID()))
{
continue;
}
else
{ // Make gesture active and persistent through login sessions. -Aura 07-12-06
activateGesture(item->getUUID());
}
count++;
}
mLoadingCount = count;
mDeactivateSimilarNames.clear();
for (it = items.begin(); it != items.end(); ++it)
{
LLViewerInventoryItem* item = *it;
if (isGestureActive(item->getUUID()))
{
continue;
}
// Don't inform server, we'll do that in bulk
const BOOL no_inform_server = FALSE;
const BOOL deactivate_similar = TRUE;
activateGestureWithAsset(item->getUUID(), item->getAssetUUID(),
no_inform_server,
deactivate_similar);
}
// Inform the database of this change
LLMessageSystem* msg = gMessageSystem;
BOOL start_message = TRUE;
for (it = items.begin(); it != items.end(); ++it)
{
LLViewerInventoryItem* item = *it;
if (isGestureActive(item->getUUID()))
{
continue;
}
if (start_message)
{
msg->newMessage("ActivateGestures");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addU32("Flags", 0x0);
start_message = FALSE;
}
msg->nextBlock("Data");
msg->addUUID("ItemID", item->getUUID());
msg->addUUID("AssetID", item->getAssetUUID());
msg->addU32("GestureFlags", 0x0);
if (msg->getCurrentSendTotal() > MTUBYTES)
{
gAgent.sendReliableMessage();
start_message = TRUE;
}
}
if (!start_message)
{
gAgent.sendReliableMessage();
}
}
示例8: onLoadComplete
// static
void LLGestureMgr::onLoadComplete(LLVFS *vfs,
const LLUUID& asset_uuid,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
LLLoadInfo* info = (LLLoadInfo*)user_data;
LLUUID item_id = info->mItemID;
BOOL inform_server = info->mInformServer;
BOOL deactivate_similar = info->mDeactivateSimilar;
delete info;
info = NULL;
LLGestureMgr& self = LLGestureMgr::instance();
self.mLoadingCount--;
if (0 == status)
{
LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
S32 size = file.getSize();
char* buffer = new char[size+1];
if (buffer == NULL)
{
LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
file.read((U8*)buffer, size); /* Flawfinder: ignore */
// ensure there's a trailing NULL so strlen will work.
buffer[size] = '\0';
LLMultiGesture* gesture = new LLMultiGesture();
LLDataPackerAsciiBuffer dp(buffer, size+1);
BOOL ok = gesture->deserialize(dp);
if (ok)
{
if (deactivate_similar)
{
self.deactivateSimilarGestures(gesture, item_id);
// Display deactivation message if this was the last of the bunch.
if (self.mLoadingCount == 0
&& self.mDeactivateSimilarNames.length() > 0)
{
// we're done with this set of deactivations
LLSD args;
args["NAMES"] = self.mDeactivateSimilarNames;
LLNotificationsUtil::add("DeactivatedGesturesTrigger", args);
}
}
LLViewerInventoryItem* item = gInventory.getItem(item_id);
if(item)
{
gesture->mName = item->getName();
}
else
{
// Watch this item and set gesture name when item exists in inventory
self.setFetchID(item_id);
self.startFetch();
}
self.mActive[item_id] = gesture;
// Everything has been successful. Add to the active list.
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
if (inform_server)
{
// Inform the database of this change
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("ActivateGestures");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addU32("Flags", 0x0);
msg->nextBlock("Data");
msg->addUUID("ItemID", item_id);
msg->addUUID("AssetID", asset_uuid);
msg->addU32("GestureFlags", 0x0);
gAgent.sendReliableMessage();
}
callback_map_t::iterator i_cb = self.mCallbackMap.find(item_id);
if(i_cb != self.mCallbackMap.end())
{
i_cb->second(gesture);
self.mCallbackMap.erase(i_cb);
}
self.notifyObservers();
}
else
{
//.........这里部分代码省略.........
示例9: unpackRegionHandshake
//.........这里部分代码省略.........
setSimAccess(sim_access);
setRegionNameAndZone(sim_name);
setOwner(sim_owner);
setIsEstateManager(is_estate_manager);
setWaterHeight(water_height);
setBillableFactor(billable_factor);
setCacheID(cache_id);
LLUUID region_id;
msg->getUUID("RegionInfo2", "RegionID", region_id);
setRegionID(region_id);
// Retrieve the CR-53 (Homestead/Land SKU) information
S32 classID = 0;
S32 cpuRatio = 0;
std::string coloName;
std::string productSKU;
std::string productName;
// the only reasonable way to decide if we actually have any data is to
// check to see if any of these fields have positive sizes
if (msg->getSize("RegionInfo3", "ColoName") > 0 ||
msg->getSize("RegionInfo3", "ProductSKU") > 0 ||
msg->getSize("RegionInfo3", "ProductName") > 0)
{
msg->getS32 ("RegionInfo3", "CPUClassID", classID);
msg->getS32 ("RegionInfo3", "CPURatio", cpuRatio);
msg->getString ("RegionInfo3", "ColoName", coloName);
msg->getString ("RegionInfo3", "ProductSKU", productSKU);
msg->getString ("RegionInfo3", "ProductName", productName);
mClassID = classID;
mCPURatio = cpuRatio;
mColoName = coloName;
mProductSKU = productSKU;
mProductName = productName;
}
LLVLComposition *compp = getComposition();
if (compp)
{
LLUUID tmp_id;
msg->getUUID("RegionInfo", "TerrainDetail0", tmp_id);
compp->setDetailTextureID(0, tmp_id);
msg->getUUID("RegionInfo", "TerrainDetail1", tmp_id);
compp->setDetailTextureID(1, tmp_id);
msg->getUUID("RegionInfo", "TerrainDetail2", tmp_id);
compp->setDetailTextureID(2, tmp_id);
msg->getUUID("RegionInfo", "TerrainDetail3", tmp_id);
compp->setDetailTextureID(3, tmp_id);
F32 tmp_f32;
msg->getF32("RegionInfo", "TerrainStartHeight00", tmp_f32);
compp->setStartHeight(0, tmp_f32);
msg->getF32("RegionInfo", "TerrainStartHeight01", tmp_f32);
compp->setStartHeight(1, tmp_f32);
msg->getF32("RegionInfo", "TerrainStartHeight10", tmp_f32);
compp->setStartHeight(2, tmp_f32);
msg->getF32("RegionInfo", "TerrainStartHeight11", tmp_f32);
compp->setStartHeight(3, tmp_f32);
msg->getF32("RegionInfo", "TerrainHeightRange00", tmp_f32);
compp->setHeightRange(0, tmp_f32);
msg->getF32("RegionInfo", "TerrainHeightRange01", tmp_f32);
compp->setHeightRange(1, tmp_f32);
msg->getF32("RegionInfo", "TerrainHeightRange10", tmp_f32);
compp->setHeightRange(2, tmp_f32);
msg->getF32("RegionInfo", "TerrainHeightRange11", tmp_f32);
compp->setHeightRange(3, tmp_f32);
// If this is an UPDATE (params already ready, we need to regenerate
// all of our terrain stuff, by
if (compp->getParamsReady())
{
getLand().dirtyAllPatches();
}
else
{
compp->setParamsReady();
}
}
// Now that we have the name, we can load the cache file
// off disk.
loadObjectCache();
// After loading cache, signal that simulator can start
// sending data.
// TODO: Send all upstream viewer->sim handshake info here.
LLHost host = msg->getSender();
msg->newMessage("RegionHandshakeReply");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("RegionInfo");
msg->addU32("Flags", 0x0 );
msg->sendReliable(host);
}
示例10: onClickSearch
// static
void LLPanelDirFindAllOld::onClickSearch(void *userdata)
{
LLPanelDirFindAllOld *self = (LLPanelDirFindAllOld *)userdata;
if (self->childGetValue("name").asString().length() < self->mMinSearchChars)
{
return;
};
BOOL inc_pg = self->childGetValue("incpg").asBoolean();
BOOL inc_mature = self->childGetValue("incmature").asBoolean();
BOOL inc_adult = self->childGetValue("incadult").asBoolean();
if (!(inc_pg || inc_mature || inc_adult))
{
LLNotificationsUtil::add("NoContentToSearch");
return;
}
self->setupNewSearch();
// Figure out scope
U32 scope = 0x0;
scope |= DFQ_PEOPLE; // people (not just online = 0x01 | 0x02)
// places handled below
scope |= DFQ_EVENTS; // events
scope |= DFQ_GROUPS; // groups
if (inc_pg)
{
scope |= DFQ_INC_PG;
}
if (inc_mature)
{
scope |= DFQ_INC_MATURE;
}
if (inc_adult)
{
scope |= DFQ_INC_ADULT;
}
if (self->childGetValue("filter_gaming").asBoolean())
{
scope |= DFQ_FILTER_GAMING;
}
// send the message
LLMessageSystem *msg = gMessageSystem;
S32 start_row = 0;
sendDirFindQuery(msg, self->mSearchID, self->childGetValue("name").asString(), scope, start_row);
// Also look up classified ads. JC 12/2005
BOOL filter_auto_renew = FALSE;
U32 classified_flags = pack_classified_flags_request(filter_auto_renew, inc_pg, inc_mature, inc_adult);
msg->newMessage("DirClassifiedQuery");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("QueryData");
msg->addUUID("QueryID", self->mSearchID);
msg->addString("QueryText", self->childGetValue("name").asString());
msg->addU32("QueryFlags", classified_flags);
msg->addU32("Category", 0); // all categories
msg->addS32("QueryStart", 0);
gAgent.sendReliableMessage();
// Need to use separate find places query because places are
// sent using the more compact DirPlacesReply message.
U32 query_flags = DFQ_DWELL_SORT;
if (inc_pg)
{
query_flags |= DFQ_INC_PG;
}
if (inc_mature)
{
query_flags |= DFQ_INC_MATURE;
}
if (inc_adult)
{
query_flags |= DFQ_INC_ADULT;
}
msg->newMessage("DirPlacesQuery");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID() );
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("QueryData");
msg->addUUID("QueryID", self->mSearchID );
msg->addString("QueryText", self->childGetValue("name").asString());
msg->addU32("QueryFlags", query_flags );
msg->addS32("QueryStart", 0 ); // Always get the first 100 when using find ALL
msg->addS8("Category", LLParcel::C_ANY);
msg->addString("SimName", NULL);
gAgent.sendReliableMessage();
}
示例11: send_chat_from_viewer
//void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel)
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-0.2.2a
void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel)
// [/RLVa:KB]
{
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0a
// Only process chat messages (ie not CHAT_TYPE_START, CHAT_TYPE_STOP, etc)
if ( (rlv_handler_t::isEnabled()) && ( (CHAT_TYPE_WHISPER == type) || (CHAT_TYPE_NORMAL == type) || (CHAT_TYPE_SHOUT == type) ) )
{
if (0 == channel)
{
// (We already did this before, but LLChatHandler::handle() calls this directly)
if ( ((CHAT_TYPE_SHOUT == type) || (CHAT_TYPE_NORMAL == type)) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATNORMAL)) )
type = CHAT_TYPE_WHISPER;
else if ( (CHAT_TYPE_SHOUT == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATSHOUT)) )
type = CHAT_TYPE_NORMAL;
else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) )
type = CHAT_TYPE_NORMAL;
// Redirect chat if needed
if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT) || (gRlvHandler.hasBehaviour(RLV_BHVR_REDIREMOTE)) ) &&
(gRlvHandler.redirectChatOrEmote(utf8_out_text)) ) )
{
return;
}
// Filter public chat if sendchat restricted
if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHAT))
gRlvHandler.filterChat(utf8_out_text, true);
}
else
{
// Don't allow chat on a non-public channel if sendchannel restricted (unless the channel is an exception)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHANNEL)) && (!gRlvHandler.isException(RLV_BHVR_SENDCHANNEL, channel)) )
return;
// Don't allow chat on debug channel if @sendchat, @redirchat or @rediremote restricted (shows as public chat on viewers)
if (CHAT_CHANNEL_DEBUG == channel)
{
bool fIsEmote = RlvUtil::isEmote(utf8_out_text);
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHAT)) ||
((!fIsEmote) && (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT))) ||
((fIsEmote) && (gRlvHandler.hasBehaviour(RLV_BHVR_REDIREMOTE))) )
{
return;
}
}
}
}
// [/RLVa:KB]
LLMessageSystem* msg = gMessageSystem;
if(channel >= 0)
{
msg->newMessageFast(_PREHASH_ChatFromViewer);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ChatData);
msg->addStringFast(_PREHASH_Message, utf8_out_text);
msg->addU8Fast(_PREHASH_Type, type);
msg->addS32("Channel", channel);
}
else
{
msg->newMessage("ScriptDialogReply");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("Data");
msg->addUUID("ObjectID", gAgent.getID());
msg->addS32("ChatChannel", channel);
msg->addS32("ButtonIndex", 0);
msg->addString("ButtonLabel", utf8_out_text);
}
gAgent.sendReliableMessage();
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT);
}
示例12: onLoadComplete
// static
void LLGestureManager::onLoadComplete(LLVFS *vfs,
const LLUUID& asset_uuid,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
LLLoadInfo* info = (LLLoadInfo*)user_data;
LLUUID item_id = info->mItemID;
BOOL inform_server = info->mInformServer;
BOOL deactivate_similar = info->mDeactivateSimilar;
delete info;
info = NULL;
gGestureManager.mLoadingCount--;
if (0 == status)
{
LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
S32 size = file.getSize();
char* buffer = new char[size+1];
if (buffer == NULL)
{
llerrs << "Memory Allocation Failed" << llendl;
return;
}
file.read((U8*)buffer, size); /* Flawfinder: ignore */
// ensure there's a trailing NULL so strlen will work.
buffer[size] = '\0';
LLMultiGesture* gesture = new LLMultiGesture();
LLDataPackerAsciiBuffer dp(buffer, size+1);
BOOL ok = gesture->deserialize(dp);
if (ok)
{
if (deactivate_similar)
{
gGestureManager.deactivateSimilarGestures(gesture, item_id);
// Display deactivation message if this was the last of the bunch.
if (gGestureManager.mLoadingCount == 0
&& gGestureManager.mDeactivateSimilarNames.length() > 0)
{
// we're done with this set of deactivations
LLStringUtil::format_map_t args;
args["[NAMES]"] = gGestureManager.mDeactivateSimilarNames;
LLNotifyBox::showXml("DeactivatedGesturesTrigger", args);
}
}
// Everything has been successful. Add to the active list.
gGestureManager.mActive[item_id] = gesture;
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
if (inform_server)
{
// Inform the database of this change
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("ActivateGestures");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addU32("Flags", 0x0);
msg->nextBlock("Data");
msg->addUUID("ItemID", item_id);
msg->addUUID("AssetID", asset_uuid);
msg->addU32("GestureFlags", 0x0);
gAgent.sendReliableMessage();
}
gGestureManager.notifyObservers();
}
else
{
llwarns << "Unable to load gesture" << llendl;
gGestureManager.mActive.erase(item_id);
delete gesture;
gesture = NULL;
}
delete [] buffer;
buffer = NULL;
}
else
{
LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
LLDelayedGestureError::gestureMissing( item_id );
}
//.........这里部分代码省略.........
示例13: performQuery
void LLPanelDirLand::performQuery()
{
LLMessageSystem* msg = gMessageSystem;
setupNewSearch();
// We could change the UI to allow arbitrary combinations of these options
U32 search_type = ST_ALL;
const std::string& type = childGetValue("type").asString();
if(!type.empty())
{
if (FIND_AUCTION == type) search_type = ST_AUCTION;
else if(FIND_MAINLANDSALES == type) search_type = ST_MAINLAND;
else if(FIND_ESTATESALES == type) search_type = ST_ESTATE;
}
U32 query_flags = 0x0;
if (gAgent.mAccess <= SIM_ACCESS_PG) query_flags |= DFQ_PG_SIMS_ONLY;
const std::string& rating = childGetValue("rating").asString();
if (rating == PG_ONLY)
{
query_flags |= DFQ_PG_SIMS_ONLY;
}
else if (rating == MATURE_ONLY)
{
query_flags |= DFQ_MATURE_SIMS_ONLY;
}
LLScrollListCtrl* list = (LLScrollListCtrl*)getChildByName("results");
if (list)
{
std::string sort_name = list->getSortColumnName();
BOOL sort_asc = list->getSortAscending();
if (sort_name == "name")
{
query_flags |= DFQ_NAME_SORT;
}
else if (sort_name == "price")
{
query_flags |= DFQ_PRICE_SORT;
}
else if (sort_name == "per_meter")
{
query_flags |= DFQ_PER_METER_SORT;
}
else if (sort_name == "area")
{
query_flags |= DFQ_AREA_SORT;
}
if (sort_asc)
{
query_flags |= DFQ_SORT_ASC;
}
}
if (childGetValue("pricecheck").asBoolean())
{
query_flags |= DFQ_LIMIT_BY_PRICE;
}
if (childGetValue("areacheck").asBoolean())
{
query_flags |= DFQ_LIMIT_BY_AREA;
}
msg->newMessage("DirLandQuery");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("QueryData");
msg->addUUID("QueryID", getSearchID());
msg->addU32("QueryFlags", query_flags);
msg->addU32("SearchType", search_type);
msg->addS32("Price", childGetValue("priceedit").asInteger());
msg->addS32("Area", childGetValue("areaedit").asInteger());
msg->addS32Fast(_PREHASH_QueryStart,mSearchStart);
gAgent.sendReliableMessage();
}