aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/llfloaterregioninfo.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp98
1 files changed, 66 insertions, 32 deletions
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index f7c05b5..5833c2f 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -3,6 +3,8 @@
3 * @author Aaron Brashears 3 * @author Aaron Brashears
4 * @brief Implementation of the region info and controls floater and panels. 4 * @brief Implementation of the region info and controls floater and panels.
5 * 5 *
6 * $LicenseInfo:firstyear=2004&license=viewergpl$
7 *
6 * Copyright (c) 2004-2007, Linden Research, Inc. 8 * Copyright (c) 2004-2007, Linden Research, Inc.
7 * 9 *
8 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
@@ -25,6 +27,7 @@
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE. 29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
28 */ 31 */
29 32
30#include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
@@ -201,6 +204,7 @@ LLFloaterRegionInfo::LLFloaterRegionInfo(const LLRect& rect) :
201 mInfoPanels.push_back((LLPanelRegionInfo*)panel); 204 mInfoPanels.push_back((LLPanelRegionInfo*)panel);
202 gUICtrlFactory->buildPanel(panel, "panel_region_covenant.xml"); 205 gUICtrlFactory->buildPanel(panel, "panel_region_covenant.xml");
203 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 206 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
207
204} 208}
205 209
206LLFloaterRegionInfo::~LLFloaterRegionInfo() 210LLFloaterRegionInfo::~LLFloaterRegionInfo()
@@ -234,6 +238,7 @@ void LLFloaterRegionInfo::show(LLViewerRegion* region)
234 msg->addUUID("AgentID", gAgent.getID()); 238 msg->addUUID("AgentID", gAgent.getID());
235 msg->addUUID("SessionID", gAgent.getSessionID()); 239 msg->addUUID("SessionID", gAgent.getSessionID());
236 gAgent.sendReliableMessage(); 240 gAgent.sendReliableMessage();
241
237} 242}
238 243
239// static 244// static
@@ -325,6 +330,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
325 panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); 330 panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE );
326 panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); 331 panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE );
327 panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE ); 332 panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE );
333 panel->childSetValue("block_parcel_search_check", (region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE );
328 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) ); 334 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) );
329 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) ); 335 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) );
330 panel->childSetValue("access_combo", LLSD(LLViewerRegion::accessToString(sim_access)) ); 336 panel->childSetValue("access_combo", LLSD(LLViewerRegion::accessToString(sim_access)) );
@@ -557,6 +563,7 @@ BOOL LLPanelRegionGeneralInfo::postBuild()
557 initCtrl("object_bonus_spin"); 563 initCtrl("object_bonus_spin");
558 initCtrl("access_combo"); 564 initCtrl("access_combo");
559 initCtrl("restrict_pushobject"); 565 initCtrl("restrict_pushobject");
566 initCtrl("block_parcel_search_check");
560 567
561 initHelpBtn("terraform_help", "HelpRegionBlockTerraform"); 568 initHelpBtn("terraform_help", "HelpRegionBlockTerraform");
562 initHelpBtn("fly_help", "HelpRegionBlockFly"); 569 initHelpBtn("fly_help", "HelpRegionBlockFly");
@@ -567,6 +574,7 @@ BOOL LLPanelRegionGeneralInfo::postBuild()
567 initHelpBtn("restrict_pushobject_help", "HelpRegionRestrictPushObject"); 574 initHelpBtn("restrict_pushobject_help", "HelpRegionRestrictPushObject");
568 initHelpBtn("land_resell_help", "HelpRegionLandResell"); 575 initHelpBtn("land_resell_help", "HelpRegionLandResell");
569 initHelpBtn("parcel_changes_help", "HelpParcelChanges"); 576 initHelpBtn("parcel_changes_help", "HelpParcelChanges");
577 initHelpBtn("parcel_search_help", "HelpRegionSearch");
570 578
571 childSetAction("kick_btn", onClickKick, this); 579 childSetAction("kick_btn", onClickKick, this);
572 childSetAction("kick_all_btn", onClickKickAll, this); 580 childSetAction("kick_all_btn", onClickKickAll, this);
@@ -692,52 +700,78 @@ void LLPanelRegionGeneralInfo::onClickManageTelehub(void* data)
692// strings[6] = sim access (0 = unknown, 13 = PG, 21 = Mature) 700// strings[6] = sim access (0 = unknown, 13 = PG, 21 = Mature)
693// strings[7] = restrict pushobject 701// strings[7] = restrict pushobject
694// strings[8] = 'Y' - allow parcel subdivide, 'N' - not 702// strings[8] = 'Y' - allow parcel subdivide, 'N' - not
703// strings[9] = 'Y' - block parcel search, 'N' - allow
695BOOL LLPanelRegionGeneralInfo::sendUpdate() 704BOOL LLPanelRegionGeneralInfo::sendUpdate()
696{ 705{
697 llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl; 706 llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl;
698 strings_t strings;
699 //integers_t integers;
700 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
701 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
702 strings.push_back(strings_t::value_type(buffer));
703
704 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
705 strings.push_back(strings_t::value_type(buffer));
706 707
707 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 708 // First try using a Cap. If that fails use the old method.
708 strings.push_back(strings_t::value_type(buffer)); 709 LLSD body;
710 std::string url = gAgent.getRegion()->getCapability("DispatchRegionInfo");
711 if (!url.empty())
712 {
713 body["block_terraform"] = childGetValue("block_terraform_check");
714 body["block_fly"] = childGetValue("block_fly_check");
715 body["allow_damage"] = childGetValue("allow_damage_check");
716 body["allow_land_resell"] = childGetValue("allow_land_resell_check");
717 body["agent_limit"] = childGetValue("agent_limit_spin");
718 body["prim_bonus"] = childGetValue("object_bonus_spin");
719 body["sim_access"] = childGetValue("access_combo");
720 body["restrict_pushobject"] = childGetValue("restrict_pushobject");
721 body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check");
722 body["block_parcel_search"] = childGetValue("block_parcel_search_check");
723 LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
724 }
725 else
726 {
727 strings_t strings;
728 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
729
730 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
731 strings.push_back(strings_t::value_type(buffer));
732
733 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
734 strings.push_back(strings_t::value_type(buffer));
735
736 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
737 strings.push_back(strings_t::value_type(buffer));
709 738
710 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 739 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
711 strings.push_back(strings_t::value_type(buffer)); 740 strings.push_back(strings_t::value_type(buffer));
712 741
713 F32 value = (F32)childGetValue("agent_limit_spin").asReal(); 742 F32 value = (F32)childGetValue("agent_limit_spin").asReal();
714 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore */ 743 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore */
715 strings.push_back(strings_t::value_type(buffer)); 744 strings.push_back(strings_t::value_type(buffer));
716 745
717 value = (F32)childGetValue("object_bonus_spin").asReal(); 746 value = (F32)childGetValue("object_bonus_spin").asReal();
718 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore */ 747 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore */
719 strings.push_back(strings_t::value_type(buffer)); 748 strings.push_back(strings_t::value_type(buffer));
720 749
721 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str()); 750 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str());
722 snprintf(buffer, MAX_STRING, "%d", (S32)access); /* Flawfinder: ignore */ 751 snprintf(buffer, MAX_STRING, "%d", (S32)access); /* Flawfinder: ignore */
723 strings.push_back(strings_t::value_type(buffer)); 752 strings.push_back(strings_t::value_type(buffer));
724 753
725 snprintf(buffer, MAX_STRING, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 754 snprintf(buffer, MAX_STRING, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
726 strings.push_back(strings_t::value_type(buffer)); 755 strings.push_back(strings_t::value_type(buffer));
727 756
728 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 757 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
729 strings.push_back(strings_t::value_type(buffer)); 758 strings.push_back(strings_t::value_type(buffer));
730 759
731 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 760 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
732 sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings); 761 sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings);
733 762
734 LLViewerRegion* region = gAgent.getRegion(); 763 LLViewerRegion* region = gAgent.getRegion();
735 if (region 764 if (region
736 && access != region->getSimAccess() ) /* Flawfinder: ignore */ 765 && access != region->getSimAccess() ) /* Flawfinder: ignore */
737 { 766 {
738 gViewerWindow->alertXml("RegionMaturityChange"); 767 gViewerWindow->alertXml("RegionMaturityChange");
768 }
739 } 769 }
740 770
771
772 //integers_t integers;
773
774
741 return TRUE; 775 return TRUE;
742} 776}
743 777