From 1d4858ae851f879ddfc303fd360b525e30ffa0de Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 11 Feb 2013 01:14:09 -0500 Subject: [PATCH] Add support for two non-SL grid features/flags. Adds support for GamingData cap, and flags: PF_GAMING, DFQ_FILTER_GAMING, REGION_FLAGS_GAMING, and REGION_FLAGS_HIDE_FROM_SEARCH Adds GamingCheck to floater_about_land.xml Adds filter_gaming checkboxes to floater_directory* xmls Adds "is gaming" and "hide from search" checkboxes to floater_god_tools.xml --- indra/llinventory/llparcelflags.h | 1 + indra/llmessage/llqueryflags.h | 2 + indra/llmessage/llregionflags.h | 2 + indra/newview/app_settings/settings.xml | 78 +++++++++++++++++++ indra/newview/hippogridmanager.cpp | 4 +- indra/newview/llfloatergodtools.cpp | 20 +++++ indra/newview/llfloaterland.cpp | 8 ++ indra/newview/llfloaterland.h | 1 + indra/newview/llpaneldirclassified.cpp | 3 + indra/newview/llpaneldirevents.cpp | 4 + indra/newview/llpaneldirfind.cpp | 26 +++++-- indra/newview/llpaneldirfind.h | 4 +- indra/newview/llpaneldirgroups.cpp | 7 ++ indra/newview/llpaneldirland.cpp | 8 ++ indra/newview/llpaneldirplaces.cpp | 8 ++ indra/newview/llviewerregion.cpp | 1 + .../default/xui/en-us/floater_about_land.xml | 1 + .../default/xui/en-us/floater_directory.xml | 5 ++ .../default/xui/en-us/floater_directory2.xml | 6 ++ .../default/xui/en-us/floater_directory3.xml | 7 ++ .../default/xui/en-us/floater_god_tools.xml | 4 +- 21 files changed, 190 insertions(+), 10 deletions(-) diff --git a/indra/llinventory/llparcelflags.h b/indra/llinventory/llparcelflags.h index 122468e91..343044727 100644 --- a/indra/llinventory/llparcelflags.h +++ b/indra/llinventory/llparcelflags.h @@ -59,6 +59,7 @@ const U32 PF_URL_WEB_PAGE = 1 << 19; // The "media URL" is an HTML page const U32 PF_URL_RAW_HTML = 1 << 20; // The "media URL" is a raw HTML string like

Foo

const U32 PF_RESTRICT_PUSHOBJECT = 1 << 21; // Restrict push object to either on agent or on scripts owned by parcel owner const U32 PF_DENY_ANONYMOUS = 1 << 22; // Deny all non identified/transacted accounts +const U32 PF_GAMING = 1 << 23; // Denotes a gaming parcel on certain grids // const U32 PF_DENY_IDENTIFIED = 1 << 23; // Deny identified accounts // const U32 PF_DENY_TRANSACTED = 1 << 24; // Deny identified accounts const U32 PF_ALLOW_GROUP_SCRIPTS = 1 << 25; // Allow scripts owned by group diff --git a/indra/llmessage/llqueryflags.h b/indra/llmessage/llqueryflags.h index 14a62de04..311c90000 100644 --- a/indra/llmessage/llqueryflags.h +++ b/indra/llmessage/llqueryflags.h @@ -66,6 +66,8 @@ const U32 DFQ_INC_NEW_VIEWER = (DFQ_INC_PG | DFQ_INC_MATURE | DFQ_INC_ADULT); // const U32 DFQ_ADULT_SIMS_ONLY = 0x1 << 27; +const U32 DFQ_FILTER_GAMING = 0x1 << 28; + // Sell Type flags const U32 ST_AUCTION = 0x1 << 1; const U32 ST_NEWBIE = 0x1 << 2; diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h index 1cf940918..686033899 100644 --- a/indra/llmessage/llregionflags.h +++ b/indra/llmessage/llregionflags.h @@ -51,6 +51,8 @@ const U64 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7); // All content wiped once per night const U64 REGION_FLAGS_SANDBOX = (1 << 8); +const U64 REGION_FLAGS_GAMING = (1 << 10); // Denotes a gaming region on certain grids +const U64 REGION_FLAGS_HIDE_FROM_SEARCH = (1 << 11); // Hides region from search on certain grids const U64 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies const U64 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13); const U64 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4a5ae4e6b..3f48c89f0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5768,6 +5768,84 @@ This should be as low as possible, but too low may break functionality Value 10.0 + FilterGamingSearchAll + + Comment + Filter results flagged gaming in everything search + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + + FilterGamingClassifieds + + Comment + Filter results flagged gaming in classifieds search + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + + FilterGamingEvents + + Comment + Filter results flagged gaming in event search + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + + FilterGamingGroups + + Comment + Filter results flagged gaming in groups search + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + + FilterGamingLand + + Comment + Filter results flagged gaming in land search + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + + FilterGamingSims + + Comment + Filter results flagged gaming in sim search + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + FilterItemsPerFrame Comment diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index 674206e79..18663b175 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -357,7 +357,7 @@ std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const } else if (ty == SEARCH_ALL_TEMPLATE) { - return "lang=[LANG]&mat=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]"; + return "lang=[LANG]&mat=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]&dice=[DICE]"; } else { @@ -400,7 +400,7 @@ std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const } else if (ty == SEARCH_ALL_TEMPLATE) { - return "lang=[LANG]&m=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]"; + return "lang=[LANG]&m=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]&dice=[DICE]"; } else { diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 4ab128f1b..e0a979c7e 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -461,6 +461,10 @@ BOOL LLPanelRegionTools::postBuild() getChild("block terraform")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this)); getChild("allow transfer")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this)); getChild("is sandbox")->setCommitCallback( boost::bind(&LLPanelRegionTools::onChangeAnything, this)); + getChild("is gaming")->setVisible(!gAgent.getRegion()->getCapability("GamingData").empty()); + getChild("is gaming")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this)); + getChild("hide from search")->setVisible(!gHippoGridManager->getConnectedGrid()->isSecondLife()); + getChild("hide from search")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this)); childSetAction("Bake Terrain", boost::bind(&LLPanelRegionTools::onBakeTerrain, this)); childSetAction("Revert Terrain", boost::bind(&LLPanelRegionTools::onRevertTerrain, this)); @@ -670,6 +674,14 @@ U64 LLPanelRegionTools::getRegionFlags() const { flags |= REGION_FLAGS_SANDBOX; } + if (getChild("is gaming")->getValue().asBoolean()) + { + flags |= REGION_FLAGS_GAMING; + } + if (getChild("hide from search")->getValue().asBoolean()) + { + flags |= REGION_FLAGS_HIDE_FROM_SEARCH; + } return flags; } @@ -708,6 +720,14 @@ U64 LLPanelRegionTools::getRegionFlagsMask() const { flags &= ~REGION_FLAGS_SANDBOX; } + if (!getChild("is gaming")->getValue().asBoolean()) + { + flags &= ~REGION_FLAGS_GAMING; + } + if (!getChild("hide from search")->getValue().asBoolean()) + { + flags &= ~REGION_FLAGS_HIDE_FROM_SEARCH; + } return flags; } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 292d7b62c..93fe292fa 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1859,6 +1859,7 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) mSetBtn(NULL), mClearBtn(NULL), mMatureCtrl(NULL), + mGamingCtrl(NULL), mPushRestrictionCtrl(NULL), mSeeAvatarsCtrl(NULL), mParcel(parcel), @@ -1936,6 +1937,10 @@ BOOL LLPanelLandOptions::postBuild() mMatureCtrl = getChild( "MatureCheck"); childSetCommitCallback("MatureCheck", onCommitAny, this); + + mGamingCtrl = getChild( "GamingCheck"); + childSetCommitCallback("GamingCheck", onCommitAny, this); + mGamingCtrl->setVisible(!gAgent.getRegion()->getCapability("GamingData").empty()); mPublishHelpButton = getChild("?"); mPublishHelpButton->setClickedCallback(onClickPublishHelp, this); @@ -2165,6 +2170,7 @@ void LLPanelLandOptions::refresh() mMatureCtrl->setToolTip(getString("mature_check_adult_tooltip")); } } + mGamingCtrl->set(parcel->getParcelFlag(PF_GAMING)); } } } @@ -2302,6 +2308,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) BOOL mature_publish = self->mMatureCtrl->get(); BOOL push_restriction = self->mPushRestrictionCtrl->get(); BOOL see_avs = self->mSeeAvatarsCtrl->get(); + bool gaming = self->mGamingCtrl->get(); BOOL show_directory = self->mCheckShowDirectory->get(); // we have to get the index from a lookup, not from the position in the dropdown! S32 category_index = LLParcel::getCategoryFromString(self->mCategoryCombo->getSelectedValue()); @@ -2336,6 +2343,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setParcelFlag(PF_SHOW_DIRECTORY, show_directory); parcel->setParcelFlag(PF_ALLOW_PUBLISH, allow_publish); parcel->setParcelFlag(PF_MATURE_PUBLISH, mature_publish); + parcel->setParcelFlag(PF_GAMING, gaming); parcel->setParcelFlag(PF_RESTRICT_PUSHOBJECT, push_restriction); parcel->setCategory((LLParcel::ECategory)category_index); parcel->setLandingType((LLParcel::ELandingType)landing_type_index); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index c17b16032..4dd7b962b 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -362,6 +362,7 @@ private: LLButton* mClearBtn; LLCheckBoxCtrl *mMatureCtrl; + LLCheckBoxCtrl *mGamingCtrl; LLCheckBoxCtrl *mPushRestrictionCtrl; LLCheckBoxCtrl *mSeeAvatarsCtrl; LLButton *mPublishHelpButton; diff --git a/indra/newview/llpaneldirclassified.cpp b/indra/newview/llpaneldirclassified.cpp index eaa83aff0..19a9884b0 100644 --- a/indra/newview/llpaneldirclassified.cpp +++ b/indra/newview/llpaneldirclassified.cpp @@ -121,6 +121,8 @@ BOOL LLPanelDirClassified::postBuild() // Don't do this every time we open find, it's expensive; require clicking 'search' //requestClassified(); + childSetVisible("filter_gaming", !gAgent.getRegion()->getCapability("GamingData").empty()); + return TRUE; } @@ -206,6 +208,7 @@ void LLPanelDirClassified::performQuery() BOOL filter_auto_renew = FALSE; U32 query_flags = pack_classified_flags_request(filter_auto_renew, inc_pg, inc_mature, inc_adult); //if (gAgent.isTeen()) query_flags |= DFQ_PG_SIMS_ONLY; + if (childGetValue("filter_gaming")) query_flags |= DFQ_FILTER_GAMING; U32 category = childGetValue("Category").asInteger(); diff --git a/indra/newview/llpaneldirevents.cpp b/indra/newview/llpaneldirevents.cpp index 44bea8693..e27aff354 100644 --- a/indra/newview/llpaneldirevents.cpp +++ b/indra/newview/llpaneldirevents.cpp @@ -51,6 +51,7 @@ #include "llpanelevent.h" #include "llappviewer.h" #include "llnotificationsutil.h" +#include "llviewerregion.h" BOOL gDisplayEventHack = FALSE; @@ -94,6 +95,8 @@ BOOL LLPanelDirEvents::postBuild() } gDisplayEventHack = FALSE; + childSetVisible("filter_gaming", !gAgent.getRegion()->getCapability("GamingData").empty()); + return TRUE; } @@ -181,6 +184,7 @@ void LLPanelDirEvents::performQueryOrDelete(U32 event_id) if ( childGetValue("incpg").asBoolean() ) scope |= DFQ_INC_PG; if ( childGetValue("incmature").asBoolean() ) scope |= DFQ_INC_MATURE; if ( childGetValue("incadult").asBoolean() ) scope |= DFQ_INC_ADULT; + if (childGetValue("filter_gaming").asBoolean()) scope |= DFQ_FILTER_GAMING; // Add old query flags in case we are talking to an old server if ( childGetValue("incpg").asBoolean() && !childGetValue("incmature").asBoolean()) diff --git a/indra/newview/llpaneldirfind.cpp b/indra/newview/llpaneldirfind.cpp index 94edad4dd..ca8a3843a 100644 --- a/indra/newview/llpaneldirfind.cpp +++ b/indra/newview/llpaneldirfind.cpp @@ -161,6 +161,8 @@ BOOL LLPanelDirFind::postBuild() navigateToDefaultPage(); } + childSetVisible("filter_gaming", !gAgent.getRegion()->getCapability("GamingData").empty()); + return TRUE; } @@ -309,9 +311,9 @@ void LLPanelDirFind::navigateToDefaultPage() mWebBrowser->navigateTo( start_url ); } } -// static -std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const std::string& collection, - bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) + +const std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const std::string& collection, + bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) const { std::string url; if (search_text.empty()) @@ -363,8 +365,8 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const llinfos << "web search url " << url << llendl; return url; } -// static -std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) + +const std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) const { std::string url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_TEMPLATE, is_web); llinfos << "Suffix template " << url << llendl; @@ -426,6 +428,13 @@ std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, boo std::string teen_string = gAgent.isTeen() ? "y" : "n"; std::string teen_tag = "[TEEN]"; url.replace( url.find( teen_tag ), teen_tag.length(), teen_string ); + + // and set the flag for gaming areas if not on SL Grid. + if (!gHippoGridManager->getConnectedGrid()->isSecondLife()) + { + substring = "[DICE]"; + url.replace(url.find(substring), substring.length(), childGetValue("filter_gaming").asBoolean() ? "y" : "n"); + } } } @@ -561,6 +570,8 @@ BOOL LLPanelDirFindAllOld::postBuild() childDisable("Search"); setDefaultBtn( "Search" ); + childSetVisible("filter_gaming", !gAgent.getRegion()->getCapability("GamingData").empty()); + return TRUE; } @@ -623,6 +634,11 @@ void LLPanelDirFindAllOld::onClickSearch(void *userdata) scope |= DFQ_INC_ADULT; } + if (self->childGetValue("filter_gaming").asBoolean()) + { + scope |= DFQ_FILTER_GAMING; + } + // send the message LLMessageSystem *msg = gMessageSystem; S32 start_row = 0; diff --git a/indra/newview/llpaneldirfind.h b/indra/newview/llpaneldirfind.h index 670f30c7e..931ab0737 100644 --- a/indra/newview/llpaneldirfind.h +++ b/indra/newview/llpaneldirfind.h @@ -61,8 +61,8 @@ public: virtual void navigateToDefaultPage(); void focus(); - static std::string buildSearchURL(const std::string& search_text, const std::string& collection, bool inc_pg, bool inc_mature, bool inc_adult, bool is_web); - static std::string getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web); + const std::string buildSearchURL(const std::string& search_text, const std::string& collection, bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) const; + const std::string getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) const; private: static void onClickBack( void* data ); diff --git a/indra/newview/llpaneldirgroups.cpp b/indra/newview/llpaneldirgroups.cpp index 009e68367..965d9ccbd 100644 --- a/indra/newview/llpaneldirgroups.cpp +++ b/indra/newview/llpaneldirgroups.cpp @@ -40,6 +40,7 @@ #include "message.h" #include "llqueryflags.h" #include "llviewercontrol.h" +#include "llviewerregion.h" #include "llviewerwindow.h" #include "llnotificationsutil.h" @@ -60,6 +61,8 @@ BOOL LLPanelDirGroups::postBuild() childDisable("Search"); setDefaultBtn( "Search" ); + childSetVisible("filter_gaming", !gAgent.getRegion()->getCapability("GamingData").empty()); + return TRUE; } @@ -130,6 +133,10 @@ void LLPanelDirGroups::performQuery() { scope |= DFQ_INC_ADULT; } + if (childGetValue("filter_gaming").asBoolean()) + { + scope |= DFQ_FILTER_GAMING; + } mCurrentSortColumn = "score"; mCurrentSortAscending = FALSE; diff --git a/indra/newview/llpaneldirland.cpp b/indra/newview/llpaneldirland.cpp index d89c049fa..ced4a42ad 100644 --- a/indra/newview/llpaneldirland.cpp +++ b/indra/newview/llpaneldirland.cpp @@ -52,6 +52,7 @@ #include "lltextbox.h" #include "llviewercontrol.h" #include "llviewermessage.h" +#include "llviewerregion.h" #include "hippogridmanager.h" @@ -125,6 +126,8 @@ BOOL LLPanelDirLand::postBuild() } } + childSetVisible("filter_gaming", !gAgent.getRegion()->getCapability("GamingData").empty()); + return TRUE; } @@ -213,6 +216,11 @@ void LLPanelDirLand::performQuery() { query_flags |= DFQ_INC_ADULT; } + + if (childGetValue("filter_gaming").asBoolean()) + { + query_flags |= DFQ_FILTER_GAMING; + } // Add old flags in case we are talking to an old dataserver if (inc_pg && !inc_mature) diff --git a/indra/newview/llpaneldirplaces.cpp b/indra/newview/llpaneldirplaces.cpp index 96070b4b0..17ae01373 100644 --- a/indra/newview/llpaneldirplaces.cpp +++ b/indra/newview/llpaneldirplaces.cpp @@ -57,6 +57,7 @@ #include "lluiconstants.h" #include "llviewercontrol.h" #include "llviewermessage.h" +#include "llviewerregion.h" #include "llworldmap.h" LLPanelDirPlaces::LLPanelDirPlaces(const std::string& name, LLFloaterDirectory* floater) @@ -98,6 +99,8 @@ BOOL LLPanelDirPlaces::postBuild() childSetEnabled("Category", true); } + childSetVisible("filter_gaming", !gAgent.getRegion()->getCapability("GamingData").empty()); + // Don't prepopulate the places list, as it hurts the database as of 2006-12-04. JC // initialQuery(); @@ -198,6 +201,11 @@ void LLPanelDirPlaces::performQuery() { flags |= DFQ_INC_ADULT; } + + if (childGetValue("filter_gaming").asBoolean()) + { + flags |= DFQ_FILTER_GAMING; + } // Pack old query flag in case we are talking to an old server if ( ((flags & DFQ_INC_PG) == DFQ_INC_PG) && !((flags & DFQ_INC_MATURE) == DFQ_INC_MATURE) ) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f9ede98c7..40672b945 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1613,6 +1613,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("FetchInventoryDescendents2"); } + capabilityNames.append("GamingData"); //Used by certain grids. capabilityNames.append("GetDisplayNames"); capabilityNames.append("GetMesh"); capabilityNames.append("GetObjectCost"); diff --git a/indra/newview/skins/default/xui/en-us/floater_about_land.xml b/indra/newview/skins/default/xui/en-us/floater_about_land.xml index cd3dabed2..122ef6d05 100644 --- a/indra/newview/skins/default/xui/en-us/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en-us/floater_about_land.xml @@ -745,6 +745,7 @@ Only large parcels can be listed in search. mouse_opaque="true" name="MatureCheck" radio_style="false" tool_tip=" " width="107" /> + Mature Content diff --git a/indra/newview/skins/default/xui/en-us/floater_directory.xml b/indra/newview/skins/default/xui/en-us/floater_directory.xml index 28151eb71..f034425a6 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory.xml @@ -68,6 +68,7 @@ font="SansSerifSmall" height="16" initial_value="false" label="Adult content" left="450" mouse_opaque="true" name="incadult" width="156" /> +