void LLPanelDirPlaces::queryCore(const std::string& name, S32 category, U32 flags) { setupNewSearch(); // JC: Sorting by dwell severely impacts the performance of the query. // Instead of sorting on the dataserver, we sort locally once the results // are received. // IW: Re-enabled dwell sort based on new 3-character minimum description // Hopefully we'll move to next-gen Find before this becomes a big problem flags |= DFQ_DWELL_SORT; LLMessageSystem* msg = gMessageSystem; msg->newMessage("DirPlacesQuery"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("QueryData"); msg->addUUID("QueryID", getSearchID()); msg->addString("QueryText", name); msg->addU32("QueryFlags", flags); msg->addS8("Category", (S8)category); // No longer support queries by region name, too many regions // for combobox, no easy way to do autocomplete. JC msg->addString("SimName", ""); msg->addS32Fast(_PREHASH_QueryStart,mSearchStart); gAgent.sendReliableMessage(); }
// 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(); }