aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloaterregioninfo.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llfloaterregioninfo.cpp')
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp329
1 files changed, 163 insertions, 166 deletions
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index 90d8af9..ffd7d48 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -47,6 +47,7 @@
47 47
48#include "llagent.h" 48#include "llagent.h"
49#include "llalertdialog.h" 49#include "llalertdialog.h"
50#include "llappviewer.h"
50#include "llfloateravatarpicker.h" 51#include "llfloateravatarpicker.h"
51#include "llbutton.h" 52#include "llbutton.h"
52#include "llcheckboxctrl.h" 53#include "llcheckboxctrl.h"
@@ -77,12 +78,11 @@
77#include "llviewerwindow.h" 78#include "llviewerwindow.h"
78#include "llvlcomposition.h" 79#include "llvlcomposition.h"
79 80
81#define ELAR_ENABLED 0 // Enable when server support is implemented
82
80const S32 TERRAIN_TEXTURE_COUNT = 4; 83const S32 TERRAIN_TEXTURE_COUNT = 4;
81const S32 CORNER_COUNT = 4; 84const S32 CORNER_COUNT = 4;
82 85
83extern LLString gLastVersionChannel;
84
85
86///---------------------------------------------------------------------------- 86///----------------------------------------------------------------------------
87/// Local class declaration 87/// Local class declaration
88///---------------------------------------------------------------------------- 88///----------------------------------------------------------------------------
@@ -263,7 +263,7 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
263 LLDispatcher::unpackMessage(msg, request, invoice, strings); 263 LLDispatcher::unpackMessage(msg, request, invoice, strings);
264 if(invoice != getLastInvoice()) 264 if(invoice != getLastInvoice())
265 { 265 {
266 llwarns << "Mismatched Estate message: " << request.c_str() << llendl; 266 llwarns << "Mismatched Estate message: " << request << llendl;
267 return; 267 return;
268 } 268 }
269 269
@@ -271,9 +271,7 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
271 dispatch.dispatch(request, invoice, strings); 271 dispatch.dispatch(request, invoice, strings);
272 272
273 LLViewerRegion* region = gAgent.getRegion(); 273 LLViewerRegion* region = gAgent.getRegion();
274 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 274 panel->updateControls(region);
275 panel->setCtrlsEnabled(allow_modify);
276
277} 275}
278 276
279 277
@@ -294,7 +292,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
294 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 292 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
295 293
296 // extract message 294 // extract message
297 char sim_name[MAX_STRING]; /* Flawfinder: ignore*/ 295 std::string sim_name;
298 U32 region_flags; 296 U32 region_flags;
299 U8 agent_limit; 297 U8 agent_limit;
300 F32 object_bonus_factor; 298 F32 object_bonus_factor;
@@ -304,7 +302,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
304 F32 terrain_lower_limit; 302 F32 terrain_lower_limit;
305 BOOL use_estate_sun; 303 BOOL use_estate_sun;
306 F32 sun_hour; 304 F32 sun_hour;
307 msg->getString("RegionInfo", "SimName", MAX_STRING, sim_name); 305 msg->getString("RegionInfo", "SimName", sim_name);
308 msg->getU32("RegionInfo", "RegionFlags", region_flags); 306 msg->getU32("RegionInfo", "RegionFlags", region_flags);
309 msg->getU8("RegionInfo", "MaxAgents", agent_limit); 307 msg->getU8("RegionInfo", "MaxAgents", agent_limit);
310 msg->getF32("RegionInfo", "ObjectBonusFactor", object_bonus_factor); 308 msg->getF32("RegionInfo", "ObjectBonusFactor", object_bonus_factor);
@@ -488,7 +486,7 @@ bool LLPanelRegionInfo::refreshFromRegion(LLViewerRegion* region)
488 486
489void LLPanelRegionInfo::sendEstateOwnerMessage( 487void LLPanelRegionInfo::sendEstateOwnerMessage(
490 LLMessageSystem* msg, 488 LLMessageSystem* msg,
491 const char* request, 489 const std::string& request,
492 const LLUUID& invoice, 490 const LLUUID& invoice,
493 const strings_t& strings) 491 const strings_t& strings)
494{ 492{
@@ -513,43 +511,38 @@ void LLPanelRegionInfo::sendEstateOwnerMessage(
513 for(; it != end; ++it) 511 for(; it != end; ++it)
514 { 512 {
515 msg->nextBlock("ParamList"); 513 msg->nextBlock("ParamList");
516 msg->addString("Parameter", (*it).c_str()); 514 msg->addString("Parameter", *it);
517 } 515 }
518 } 516 }
519 msg->sendReliable(mHost); 517 msg->sendReliable(mHost);
520} 518}
521 519
522void LLPanelRegionInfo::enableButton(const char* btn_name, BOOL enable) 520void LLPanelRegionInfo::enableButton(const std::string& btn_name, BOOL enable)
523{ 521{
524 childSetEnabled(btn_name, enable); 522 childSetEnabled(btn_name, enable);
525} 523}
526 524
527void LLPanelRegionInfo::disableButton(const char* btn_name) 525void LLPanelRegionInfo::disableButton(const std::string& btn_name)
528{ 526{
529 childDisable(btn_name); 527 childDisable(btn_name);
530} 528}
531 529
532void LLPanelRegionInfo::initCtrl(const char* name) 530void LLPanelRegionInfo::initCtrl(const std::string& name)
533{ 531{
534 childSetCommitCallback(name, onChangeAnything, this); 532 childSetCommitCallback(name, onChangeAnything, this);
535} 533}
536 534
537void LLPanelRegionInfo::initTextCtrl(const char* name) 535void LLPanelRegionInfo::initHelpBtn(const std::string& name, const std::string& xml_alert)
538{ 536{
539 childSetCommitCallback(name, onChangeAnything, this); 537 childSetAction(name, onClickHelp, new std::string(xml_alert));
540 childSetKeystrokeCallback("abuse_email_address", onChangeText, this);
541}
542
543void LLPanelRegionInfo::initHelpBtn(const char* name, const char* xml_alert)
544{
545 childSetAction(name, onClickHelp, (void*)xml_alert);
546} 538}
547 539
548// static 540// static
549void LLPanelRegionInfo::onClickHelp(void* data) 541void LLPanelRegionInfo::onClickHelp(void* data)
550{ 542{
551 const char* xml_alert = (const char*)data; 543 const std::string* xml_alert = (std::string*)data;
552 gViewerWindow->alertXml(xml_alert); 544 gViewerWindow->alertXml(*xml_alert);
545 delete xml_alert;
553} 546}
554 547
555///////////////////////////////////////////////////////////////////////////// 548/////////////////////////////////////////////////////////////////////////////
@@ -630,7 +623,7 @@ void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& name
630 strings_t strings; 623 strings_t strings;
631 // [0] = our agent id 624 // [0] = our agent id
632 // [1] = target agent id 625 // [1] = target agent id
633 char buffer[MAX_STRING]; /* Flawfinder: ignore*/ 626 std::string buffer;
634 gAgent.getID().toString(buffer); 627 gAgent.getID().toString(buffer);
635 strings.push_back(buffer); 628 strings.push_back(buffer);
636 629
@@ -658,7 +651,7 @@ void LLPanelRegionGeneralInfo::onKickAllCommit(S32 option, void* userdata)
658 if(!self) return; 651 if(!self) return;
659 strings_t strings; 652 strings_t strings;
660 // [0] = our agent id 653 // [0] = our agent id
661 char buffer[MAX_STRING]; /* Flawfinder: ignore*/ 654 std::string buffer;
662 gAgent.getID().toString(buffer); 655 gAgent.getID().toString(buffer);
663 strings.push_back(buffer); 656 strings.push_back(buffer);
664 657
@@ -672,13 +665,13 @@ void LLPanelRegionGeneralInfo::onKickAllCommit(S32 option, void* userdata)
672void LLPanelRegionGeneralInfo::onClickMessage(void* userdata) 665void LLPanelRegionGeneralInfo::onClickMessage(void* userdata)
673{ 666{
674 llinfos << "LLPanelRegionGeneralInfo::onClickMessage" << llendl; 667 llinfos << "LLPanelRegionGeneralInfo::onClickMessage" << llendl;
675 gViewerWindow->alertXmlEditText("MessageRegion", LLString::format_map_t(), 668 gViewerWindow->alertXmlEditText("MessageRegion", LLStringUtil::format_map_t(),
676 NULL, NULL, 669 NULL, NULL,
677 onMessageCommit, userdata); 670 onMessageCommit, userdata);
678} 671}
679 672
680// static 673// static
681void LLPanelRegionGeneralInfo::onMessageCommit(S32 option, const LLString& text, void* userdata) 674void LLPanelRegionGeneralInfo::onMessageCommit(S32 option, const std::string& text, void* userdata)
682{ 675{
683 if(option != 0) return; 676 if(option != 0) return;
684 if(text.empty()) return; 677 if(text.empty()) return;
@@ -693,7 +686,7 @@ void LLPanelRegionGeneralInfo::onMessageCommit(S32 option, const LLString& text,
693 // [4] message 686 // [4] message
694 strings.push_back("-1"); 687 strings.push_back("-1");
695 strings.push_back("-1"); 688 strings.push_back("-1");
696 char buffer[MAX_STRING]; /* Flawfinder: ignore*/ 689 std::string buffer;
697 gAgent.getID().toString(buffer); 690 gAgent.getID().toString(buffer);
698 strings.push_back(buffer); 691 strings.push_back(buffer);
699 std::string name; 692 std::string name;
@@ -740,7 +733,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
740 body["prim_bonus"] = childGetValue("object_bonus_spin"); 733 body["prim_bonus"] = childGetValue("object_bonus_spin");
741 // the combo box stores strings "Mature" and "PG", but we have to convert back to a number, 734 // the combo box stores strings "Mature" and "PG", but we have to convert back to a number,
742 // because the sim doesn't know from strings for this stuff 735 // because the sim doesn't know from strings for this stuff
743 body["sim_access"] = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str()); 736 body["sim_access"] = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString());
744 body["restrict_pushobject"] = childGetValue("restrict_pushobject"); 737 body["restrict_pushobject"] = childGetValue("restrict_pushobject");
745 body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check"); 738 body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check");
746 body["block_parcel_search"] = childGetValue("block_parcel_search_check"); 739 body["block_parcel_search"] = childGetValue("block_parcel_search_check");
@@ -750,44 +743,43 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
750 else 743 else
751 { 744 {
752 strings_t strings; 745 strings_t strings;
753 char buffer[MAX_STRING]; /* Flawfinder: ignore*/ 746 std::string buffer;
754 747
755 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 748 buffer = llformat("%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N"));
756 strings.push_back(strings_t::value_type(buffer)); 749 strings.push_back(strings_t::value_type(buffer));
757 750
758 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 751 buffer = llformat("%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N"));
759 strings.push_back(strings_t::value_type(buffer)); 752 strings.push_back(strings_t::value_type(buffer));
760 753
761 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 754 buffer = llformat("%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N"));
762 strings.push_back(strings_t::value_type(buffer)); 755 strings.push_back(strings_t::value_type(buffer));
763 756
764 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 757 buffer = llformat("%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N"));
765 strings.push_back(strings_t::value_type(buffer)); 758 strings.push_back(strings_t::value_type(buffer));
766 759
767 F32 value = (F32)childGetValue("agent_limit_spin").asReal(); 760 F32 value = (F32)childGetValue("agent_limit_spin").asReal();
768 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore */ 761 buffer = llformat("%f", value);
769 strings.push_back(strings_t::value_type(buffer)); 762 strings.push_back(strings_t::value_type(buffer));
770 763
771 value = (F32)childGetValue("object_bonus_spin").asReal(); 764 value = (F32)childGetValue("object_bonus_spin").asReal();
772 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore */ 765 buffer = llformat("%f", value);
773 strings.push_back(strings_t::value_type(buffer)); 766 strings.push_back(strings_t::value_type(buffer));
774 767
775 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str()); 768 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString());
776 snprintf(buffer, MAX_STRING, "%d", (S32)access); /* Flawfinder: ignore */ 769 buffer = llformat("%d", (S32)access);
777 strings.push_back(strings_t::value_type(buffer)); 770 strings.push_back(strings_t::value_type(buffer));
778 771
779 snprintf(buffer, MAX_STRING, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 772 buffer = llformat("%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N"));
780 strings.push_back(strings_t::value_type(buffer)); 773 strings.push_back(strings_t::value_type(buffer));
781 774
782 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 775 buffer = llformat("%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N"));
783 strings.push_back(strings_t::value_type(buffer)); 776 strings.push_back(strings_t::value_type(buffer));
784 777
785 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 778 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
786 sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings); 779 sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings);
787 780
788 LLViewerRegion* region = gAgent.getRegion(); 781 LLViewerRegion* region = gAgent.getRegion();
789 if (region 782 if (region && access != region->getSimAccess() )
790 && access != region->getSimAccess() ) /* Flawfinder: ignore */
791 { 783 {
792 gViewerWindow->alertXml("RegionMaturityChange"); 784 gViewerWindow->alertXml("RegionMaturityChange");
793 } 785 }
@@ -818,8 +810,7 @@ BOOL LLPanelRegionDebugInfo::postBuild()
818 initHelpBtn("restart_help", "HelpRegionRestart"); 810 initHelpBtn("restart_help", "HelpRegionRestart");
819 811
820 childSetAction("choose_avatar_btn", onClickChooseAvatar, this); 812 childSetAction("choose_avatar_btn", onClickChooseAvatar, this);
821 childSetAction("return_scripted_other_land_btn", onClickReturnScriptedOtherLand, this); 813 childSetAction("return_btn", onClickReturn, this);
822 childSetAction("return_scripted_all_btn", onClickReturnScriptedAll, this);
823 childSetAction("top_colliders_btn", onClickTopColliders, this); 814 childSetAction("top_colliders_btn", onClickTopColliders, this);
824 childSetAction("top_scripts_btn", onClickTopScripts, this); 815 childSetAction("top_scripts_btn", onClickTopScripts, this);
825 childSetAction("restart_btn", onClickRestart, this); 816 childSetAction("restart_btn", onClickRestart, this);
@@ -834,10 +825,13 @@ bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region)
834 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 825 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
835 setCtrlsEnabled(allow_modify); 826 setCtrlsEnabled(allow_modify);
836 childDisable("apply_btn"); 827 childDisable("apply_btn");
837 828 childDisable("target_avatar_name");
829
838 childSetEnabled("choose_avatar_btn", allow_modify); 830 childSetEnabled("choose_avatar_btn", allow_modify);
839 childSetEnabled("return_scripted_other_land_btn", allow_modify && !mTargetAvatar.isNull()); 831 childSetEnabled("return_scripts", allow_modify && !mTargetAvatar.isNull());
840 childSetEnabled("return_scripted_all_btn", allow_modify && !mTargetAvatar.isNull()); 832 childSetEnabled("return_other_land", allow_modify && !mTargetAvatar.isNull());
833 childSetEnabled("return_estate_wide", allow_modify && !mTargetAvatar.isNull());
834 childSetEnabled("return_btn", allow_modify && !mTargetAvatar.isNull());
841 childSetEnabled("top_colliders_btn", allow_modify); 835 childSetEnabled("top_colliders_btn", allow_modify);
842 childSetEnabled("top_scripts_btn", allow_modify); 836 childSetEnabled("top_scripts_btn", allow_modify);
843 childSetEnabled("restart_btn", allow_modify); 837 childSetEnabled("restart_btn", allow_modify);
@@ -851,15 +845,15 @@ BOOL LLPanelRegionDebugInfo::sendUpdate()
851{ 845{
852 llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl; 846 llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl;
853 strings_t strings; 847 strings_t strings;
854 char buffer[MAX_STRING]; /* Flawfinder: ignore */ 848 std::string buffer;
855 849
856 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 850 buffer = llformat("%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N"));
857 strings.push_back(buffer); 851 strings.push_back(buffer);
858 852
859 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 853 buffer = llformat("%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N"));
860 strings.push_back(buffer); 854 strings.push_back(buffer);
861 855
862 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 856 buffer = llformat("%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N"));
863 strings.push_back(buffer); 857 strings.push_back(buffer);
864 858
865 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 859 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
@@ -883,61 +877,56 @@ void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& na
883} 877}
884 878
885// static 879// static
886void LLPanelRegionDebugInfo::onClickReturnScriptedOtherLand(void* data) 880void LLPanelRegionDebugInfo::onClickReturn(void* data)
887{ 881{
888 LLPanelRegionDebugInfo* panelp = (LLPanelRegionDebugInfo*) data; 882 LLPanelRegionDebugInfo* panelp = (LLPanelRegionDebugInfo*) data;
889 if (panelp->mTargetAvatar.isNull()) return; 883 if (panelp->mTargetAvatar.isNull()) return;
890 884
891 LLString::format_map_t args; 885 LLStringUtil::format_map_t args;
892 args["[USER_NAME]"] = panelp->childGetValue("target_avatar_name").asString(); 886 args["[USER_NAME]"] = panelp->childGetValue("target_avatar_name").asString();
893 gViewerWindow->alertXml("ReturnScriptedOnOthersLand", args, callbackReturnScriptedOtherLand, data); 887 gViewerWindow->alertXml("EstateObjectReturn", args, callbackReturn, data);
894} 888}
895 889
896// static 890// static
897void LLPanelRegionDebugInfo::callbackReturnScriptedOtherLand( S32 option, void* userdata ) 891void LLPanelRegionDebugInfo::callbackReturn( S32 option, void* userdata )
898{ 892{
899 if (option != 0) return; 893 if (option != 0) return;
900 894
901 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) userdata; 895 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) userdata;
902 if (!self->mTargetAvatar.isNull()) 896 if (!self->mTargetAvatar.isNull())
903 { 897 {
904 U32 flags = 0; 898 U32 flags = SWD_ALWAYS_RETURN_OBJECTS;
905 flags = flags | SWD_OTHERS_LAND_ONLY;
906 flags = flags | SWD_ALWAYS_RETURN_OBJECTS;
907 flags |= SWD_SCRIPTED_ONLY;
908
909 send_sim_wide_deletes(self->mTargetAvatar, flags);
910 }
911}
912 899
913// static 900 if (self->childGetValue("return_scripts").asBoolean())
914void LLPanelRegionDebugInfo::onClickReturnScriptedAll(void* data) 901 {
915{ 902 flags |= SWD_SCRIPTED_ONLY;
916 LLPanelRegionDebugInfo* panelp = (LLPanelRegionDebugInfo*) data; 903 }
917 if (panelp->mTargetAvatar.isNull()) return; 904
918 905 if (self->childGetValue("return_other_land").asBoolean())
919 906 {
920 LLString::format_map_t args; 907 flags |= SWD_OTHERS_LAND_ONLY;
921 args["[USER_NAME]"] = panelp->childGetValue("target_avatar_name").asString(); 908 }
922 gViewerWindow->alertXml("ReturnScriptedOnAllLand", args, callbackReturnScriptedAll, data);
923}
924
925// static
926void LLPanelRegionDebugInfo::callbackReturnScriptedAll( S32 option, void* userdata )
927{
928 if (option != 0) return;
929 909
930 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) userdata; 910 if (self->childGetValue("return_estate_wide").asBoolean())
931 if (!self->mTargetAvatar.isNull()) 911 {
932 { 912 // send as estate message - routed by spaceserver to all regions in estate
933 U32 flags = 0; 913 strings_t strings;
934 flags |= SWD_ALWAYS_RETURN_OBJECTS; 914 strings.push_back(llformat("%d", flags));
935 flags |= SWD_SCRIPTED_ONLY; 915 strings.push_back(self->mTargetAvatar.asString());
936 916
937 send_sim_wide_deletes(self->mTargetAvatar, flags); 917 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
918
919 self->sendEstateOwnerMessage(gMessageSystem, "estateobjectreturn", invoice, strings);
920 }
921 else
922 {
923 // send to this simulator only
924 send_sim_wide_deletes(self->mTargetAvatar, flags);
925 }
938 } 926 }
939} 927}
940 928
929
941// static 930// static
942void LLPanelRegionDebugInfo::onClickTopColliders(void* data) 931void LLPanelRegionDebugInfo::onClickTopColliders(void* data)
943{ 932{
@@ -1018,10 +1007,10 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
1018 1007
1019 LLVLComposition* compp = region->getComposition(); 1008 LLVLComposition* compp = region->getComposition();
1020 LLTextureCtrl* texture_ctrl; 1009 LLTextureCtrl* texture_ctrl;
1021 char buffer[MAX_STRING]; /* Flawfinder: ignore */ 1010 std::string buffer;
1022 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1011 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1023 { 1012 {
1024 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */ 1013 buffer = llformat("texture_detail_%d", i);
1025 texture_ctrl = getChild<LLTextureCtrl>(buffer); 1014 texture_ctrl = getChild<LLTextureCtrl>(buffer);
1026 if(texture_ctrl) 1015 if(texture_ctrl)
1027 { 1016 {
@@ -1034,9 +1023,9 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
1034 1023
1035 for(S32 i = 0; i < CORNER_COUNT; ++i) 1024 for(S32 i = 0; i < CORNER_COUNT; ++i)
1036 { 1025 {
1037 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */ 1026 buffer = llformat("height_start_spin_%d", i);
1038 childSetValue(buffer, LLSD(compp->getStartHeight(i))); 1027 childSetValue(buffer, LLSD(compp->getStartHeight(i)));
1039 snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */ 1028 buffer = llformat("height_range_spin_%d", i);
1040 childSetValue(buffer, LLSD(compp->getHeightRange(i))); 1029 childSetValue(buffer, LLSD(compp->getHeightRange(i)));
1041 } 1030 }
1042 1031
@@ -1048,18 +1037,18 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
1048BOOL LLPanelRegionTextureInfo::postBuild() 1037BOOL LLPanelRegionTextureInfo::postBuild()
1049{ 1038{
1050 LLPanelRegionInfo::postBuild(); 1039 LLPanelRegionInfo::postBuild();
1051 char buffer[MAX_STRING]; /* Flawfinder: ignore */ 1040 std::string buffer;
1052 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1041 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1053 { 1042 {
1054 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */ 1043 buffer = llformat("texture_detail_%d", i);
1055 initCtrl(buffer); 1044 initCtrl(buffer);
1056 } 1045 }
1057 1046
1058 for(S32 i = 0; i < CORNER_COUNT; ++i) 1047 for(S32 i = 0; i < CORNER_COUNT; ++i)
1059 { 1048 {
1060 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */ 1049 buffer = llformat("height_start_spin_%d", i);
1061 initCtrl(buffer); 1050 initCtrl(buffer);
1062 snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */ 1051 buffer = llformat("height_range_spin_%d", i);
1063 initCtrl(buffer); 1052 initCtrl(buffer);
1064 } 1053 }
1065 1054
@@ -1081,9 +1070,8 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1081 } 1070 }
1082 1071
1083 LLTextureCtrl* texture_ctrl; 1072 LLTextureCtrl* texture_ctrl;
1084 char buffer[MAX_STRING]; /* Flawfinder: ignore */ 1073 std::string buffer;
1085 char buffer2[MAX_STRING]; /* Flawfinder: ignore */ 1074 std::string id_str;
1086 char id_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1087 LLMessageSystem* msg = gMessageSystem; 1075 LLMessageSystem* msg = gMessageSystem;
1088 strings_t strings; 1076 strings_t strings;
1089 1077
@@ -1091,24 +1079,24 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1091 1079
1092 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1080 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1093 { 1081 {
1094 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */ 1082 buffer = llformat("texture_detail_%d", i);
1095 texture_ctrl = getChild<LLTextureCtrl>(buffer); 1083 texture_ctrl = getChild<LLTextureCtrl>(buffer);
1096 if(texture_ctrl) 1084 if(texture_ctrl)
1097 { 1085 {
1098 LLUUID tmp_id(texture_ctrl->getImageAssetID()); 1086 LLUUID tmp_id(texture_ctrl->getImageAssetID());
1099 tmp_id.toString(id_str); 1087 tmp_id.toString(id_str);
1100 snprintf(buffer, MAX_STRING, "%d %s", i, id_str); /* Flawfinder: ignore */ 1088 buffer = llformat("%d %s", i, id_str.c_str());
1101 strings.push_back(strings_t::value_type(buffer)); 1089 strings.push_back(buffer);
1102 } 1090 }
1103 } 1091 }
1104 sendEstateOwnerMessage(msg, "texturedetail", invoice, strings); 1092 sendEstateOwnerMessage(msg, "texturedetail", invoice, strings);
1105 strings.clear(); 1093 strings.clear();
1106 for(S32 i = 0; i < CORNER_COUNT; ++i) 1094 for(S32 i = 0; i < CORNER_COUNT; ++i)
1107 { 1095 {
1108 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */ 1096 buffer = llformat("height_start_spin_%d", i);
1109 snprintf(buffer2, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */ 1097 std::string buffer2 = llformat("height_range_spin_%d", i);
1110 snprintf(buffer, MAX_STRING, "%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); /* Flawfinder: ignore */ 1098 std::string buffer3 = llformat("%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal());
1111 strings.push_back(strings_t::value_type(buffer)); 1099 strings.push_back(buffer3);
1112 } 1100 }
1113 sendEstateOwnerMessage(msg, "textureheights", invoice, strings); 1101 sendEstateOwnerMessage(msg, "textureheights", invoice, strings);
1114 strings.clear(); 1102 strings.clear();
@@ -1120,8 +1108,8 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes()
1120{ 1108{
1121 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1109 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1122 { 1110 {
1123 char buffer[MAX_STRING]; /* Flawfinder: ignore */ 1111 std::string buffer;
1124 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */ 1112 buffer = llformat("texture_detail_%d", i);
1125 LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(buffer); 1113 LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(buffer);
1126 if (!texture_ctrl) continue; 1114 if (!texture_ctrl) continue;
1127 1115
@@ -1136,7 +1124,7 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes()
1136 1124
1137 if (components != 3) 1125 if (components != 3)
1138 { 1126 {
1139 LLString::format_map_t args; 1127 LLStringUtil::format_map_t args;
1140 args["[TEXTURE_NUM]"] = llformat("%d",i+1); 1128 args["[TEXTURE_NUM]"] = llformat("%d",i+1);
1141 args["[TEXTURE_BIT_DEPTH]"] = llformat("%d",components * 8); 1129 args["[TEXTURE_BIT_DEPTH]"] = llformat("%d",components * 8);
1142 gViewerWindow->alertXml("InvalidTerrainBitDepth", args); 1130 gViewerWindow->alertXml("InvalidTerrainBitDepth", args);
@@ -1146,7 +1134,7 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes()
1146 if (width > 512 || height > 512) 1134 if (width > 512 || height > 512)
1147 { 1135 {
1148 1136
1149 LLString::format_map_t args; 1137 LLStringUtil::format_map_t args;
1150 args["[TEXTURE_NUM]"] = llformat("%d",i+1); 1138 args["[TEXTURE_NUM]"] = llformat("%d",i+1);
1151 args["[TEXTURE_SIZE_X]"] = llformat("%d",width); 1139 args["[TEXTURE_SIZE_X]"] = llformat("%d",width);
1152 args["[TEXTURE_SIZE_Y]"] = llformat("%d",height); 1140 args["[TEXTURE_SIZE_Y]"] = llformat("%d",height);
@@ -1222,21 +1210,21 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
1222BOOL LLPanelRegionTerrainInfo::sendUpdate() 1210BOOL LLPanelRegionTerrainInfo::sendUpdate()
1223{ 1211{
1224 llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl; 1212 llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl;
1225 char buffer[MAX_STRING]; /* Flawfinder: ignore */ 1213 std::string buffer;
1226 strings_t strings; 1214 strings_t strings;
1227 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1215 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1228 1216
1229 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("water_height_spin").asReal()); /* Flawfinder: ignore */ 1217 buffer = llformat("%f", (F32)childGetValue("water_height_spin").asReal());
1230 strings.push_back(buffer); 1218 strings.push_back(buffer);
1231 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_raise_spin").asReal()); /* Flawfinder: ignore */ 1219 buffer = llformat("%f", (F32)childGetValue("terrain_raise_spin").asReal());
1232 strings.push_back(buffer); 1220 strings.push_back(buffer);
1233 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_lower_spin").asReal()); /* Flawfinder: ignore */ 1221 buffer = llformat("%f", (F32)childGetValue("terrain_lower_spin").asReal());
1234 strings.push_back(buffer); 1222 strings.push_back(buffer);
1235 snprintf(buffer, MAX_STRING, "%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 1223 buffer = llformat("%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N"));
1236 strings.push_back(buffer); 1224 strings.push_back(buffer);
1237 snprintf(buffer, MAX_STRING, "%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */ 1225 buffer = llformat("%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N"));
1238 strings.push_back(buffer); 1226 strings.push_back(buffer);
1239 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("sun_hour_slider").asReal() ); /* Flawfinder: ignore */ 1227 buffer = llformat("%f", (F32)childGetValue("sun_hour_slider").asReal() );
1240 strings.push_back(buffer); 1228 strings.push_back(buffer);
1241 1229
1242 // Grab estate information in case the user decided to set the 1230 // Grab estate information in case the user decided to set the
@@ -1262,11 +1250,11 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
1262 estate_sun_hour = panel->getSunHour(); 1250 estate_sun_hour = panel->getSunHour();
1263 } 1251 }
1264 1252
1265 snprintf(buffer, MAX_STRING, "%s", (estate_global_time ? "Y" : "N") ); /* Flawfinder: ignore */ 1253 buffer = llformat("%s", (estate_global_time ? "Y" : "N") );
1266 strings.push_back(buffer); 1254 strings.push_back(buffer);
1267 snprintf(buffer, MAX_STRING, "%s", (estate_fixed_sun ? "Y" : "N") ); /* Flawfinder: ignore */ 1255 buffer = llformat("%s", (estate_fixed_sun ? "Y" : "N") );
1268 strings.push_back(buffer); 1256 strings.push_back(buffer);
1269 snprintf(buffer, MAX_STRING, "%f", estate_sun_hour); /* Flawfinder: ignore */ 1257 buffer = llformat("%f", estate_sun_hour);
1270 strings.push_back(buffer); 1258 strings.push_back(buffer);
1271 1259
1272 sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings); 1260 sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings);
@@ -1317,7 +1305,7 @@ void LLPanelRegionTerrainInfo::onClickDownloadRaw(void* data)
1317 llwarns << "No file" << llendl; 1305 llwarns << "No file" << llendl;
1318 return; 1306 return;
1319 } 1307 }
1320 LLString filepath = picker.getFirstFile(); 1308 std::string filepath = picker.getFirstFile();
1321 1309
1322 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data; 1310 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data;
1323 strings_t strings; 1311 strings_t strings;
@@ -1336,7 +1324,7 @@ void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data)
1336 llwarns << "No file" << llendl; 1324 llwarns << "No file" << llendl;
1337 return; 1325 return;
1338 } 1326 }
1339 LLString filepath = picker.getFirstFile(); 1327 std::string filepath = picker.getFirstFile();
1340 1328
1341 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data; 1329 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data;
1342 strings_t strings; 1330 strings_t strings;
@@ -1451,7 +1439,7 @@ void LLPanelEstateInfo::onClickAddAllowedAgent(void* user_data)
1451 { 1439 {
1452 //args 1440 //args
1453 1441
1454 LLString::format_map_t args; 1442 LLStringUtil::format_map_t args;
1455 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1443 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1456 gViewerWindow->alertXml("MaxAllowedAgentOnRegion", args); 1444 gViewerWindow->alertXml("MaxAllowedAgentOnRegion", args);
1457 return; 1445 return;
@@ -1473,7 +1461,7 @@ void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data)
1473 if (!list) return; 1461 if (!list) return;
1474 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) 1462 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS)
1475 { 1463 {
1476 LLString::format_map_t args; 1464 LLStringUtil::format_map_t args;
1477 args["[MAX_GROUPS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1465 args["[MAX_GROUPS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1478 gViewerWindow->alertXml("MaxAllowedGroupsOnRegion", args); 1466 gViewerWindow->alertXml("MaxAllowedGroupsOnRegion", args);
1479 return; 1467 return;
@@ -1525,7 +1513,7 @@ void LLPanelEstateInfo::onClickAddBannedAgent(void* user_data)
1525 if (!list) return; 1513 if (!list) return;
1526 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) 1514 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS)
1527 { 1515 {
1528 LLString::format_map_t args; 1516 LLStringUtil::format_map_t args;
1529 args["[MAX_BANNED]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1517 args["[MAX_BANNED]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1530 gViewerWindow->alertXml("MaxBannedAgentsOnRegion", args); 1518 gViewerWindow->alertXml("MaxBannedAgentsOnRegion", args);
1531 return; 1519 return;
@@ -1547,7 +1535,7 @@ void LLPanelEstateInfo::onClickAddEstateManager(void* user_data)
1547 if (!list) return; 1535 if (!list) return;
1548 if (list->getItemCount() >= ESTATE_MAX_MANAGERS) 1536 if (list->getItemCount() >= ESTATE_MAX_MANAGERS)
1549 { // Tell user they can't add more managers 1537 { // Tell user they can't add more managers
1550 LLString::format_map_t args; 1538 LLStringUtil::format_map_t args;
1551 args["[MAX_MANAGER]"] = llformat("%d",ESTATE_MAX_MANAGERS); 1539 args["[MAX_MANAGER]"] = llformat("%d",ESTATE_MAX_MANAGERS);
1552 gViewerWindow->alertXml("MaxManagersOnRegion", args); 1540 gViewerWindow->alertXml("MaxManagersOnRegion", args);
1553 } 1541 }
@@ -1569,7 +1557,7 @@ void LLPanelEstateInfo::onClickRemoveEstateManager(void* user_data)
1569struct LLKickFromEstateInfo 1557struct LLKickFromEstateInfo
1570{ 1558{
1571 LLPanelEstateInfo *mEstatePanelp; 1559 LLPanelEstateInfo *mEstatePanelp;
1572 LLString mDialogName; 1560 std::string mDialogName;
1573 LLUUID mAgentID; 1561 LLUUID mAgentID;
1574}; 1562};
1575 1563
@@ -1605,7 +1593,7 @@ void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names,
1605 kick_info->mAgentID = ids[0]; 1593 kick_info->mAgentID = ids[0];
1606 1594
1607 //Bring up a confirmation dialog 1595 //Bring up a confirmation dialog
1608 LLString::format_map_t args; 1596 LLStringUtil::format_map_t args;
1609 args["[EVIL_USER]"] = names[0]; 1597 args["[EVIL_USER]"] = names[0];
1610 gViewerWindow->alertXml(kick_info->mDialogName, args, LLPanelEstateInfo::kickUserConfirm, (void*)kick_info); 1598 gViewerWindow->alertXml(kick_info->mDialogName, args, LLPanelEstateInfo::kickUserConfirm, (void*)kick_info);
1611 1599
@@ -1619,14 +1607,14 @@ void LLPanelEstateInfo::kickUserConfirm(S32 option, void* userdata)
1619 1607
1620 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1608 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1621 strings_t strings; 1609 strings_t strings;
1622 char buffer[MAX_STRING]; /* Flawfinder: ignore*/ 1610 std::string buffer;
1623 1611
1624 switch(option) 1612 switch(option)
1625 { 1613 {
1626 case 0: 1614 case 0:
1627 //Kick User 1615 //Kick User
1628 kick_info->mAgentID.toString(buffer); 1616 kick_info->mAgentID.toString(buffer);
1629 strings.push_back(strings_t::value_type(buffer)); 1617 strings.push_back(buffer);
1630 1618
1631 kick_info->mEstatePanelp->sendEstateOwnerMessage(gMessageSystem, "kickestate", invoice, strings); 1619 kick_info->mEstatePanelp->sendEstateOwnerMessage(gMessageSystem, "kickestate", invoice, strings);
1632 break; 1620 break;
@@ -1681,7 +1669,7 @@ typedef std::vector<LLUUID> AgentOrGroupIDsVector;
1681struct LLEstateAccessChangeInfo 1669struct LLEstateAccessChangeInfo
1682{ 1670{
1683 U32 mOperationFlag; // ESTATE_ACCESS_BANNED_AGENT_ADD, _REMOVE, etc. 1671 U32 mOperationFlag; // ESTATE_ACCESS_BANNED_AGENT_ADD, _REMOVE, etc.
1684 LLString mDialogName; 1672 std::string mDialogName;
1685 AgentOrGroupIDsVector mAgentOrGroupIDs; // List of agent IDs to apply to this change 1673 AgentOrGroupIDsVector mAgentOrGroupIDs; // List of agent IDs to apply to this change
1686}; 1674};
1687 1675
@@ -1700,14 +1688,14 @@ void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data)
1700 } 1688 }
1701 else 1689 else
1702 { 1690 {
1703 LLString::format_map_t args; 1691 LLStringUtil::format_map_t args;
1704 args["[ALL_ESTATES]"] = all_estates_text(); 1692 args["[ALL_ESTATES]"] = all_estates_text();
1705 gViewerWindow->alertXml(change_info->mDialogName, args, accessCoreConfirm, (void*)change_info); 1693 gViewerWindow->alertXml(change_info->mDialogName, args, accessCoreConfirm, (void*)change_info);
1706 } 1694 }
1707} 1695}
1708 1696
1709// static 1697// static
1710void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const char* dialog_name) 1698void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dialog_name)
1711{ 1699{
1712 LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo; 1700 LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo;
1713 change_info->mOperationFlag = operation_flag; 1701 change_info->mOperationFlag = operation_flag;
@@ -1767,7 +1755,7 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co
1767 int currentCount = (list ? list->getItemCount() : 0); 1755 int currentCount = (list ? list->getItemCount() : 0);
1768 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) 1756 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS)
1769 { 1757 {
1770 LLString::format_map_t args; 1758 LLStringUtil::format_map_t args;
1771 args["[NUM_ADDED]"] = llformat("%d",ids.size()); 1759 args["[NUM_ADDED]"] = llformat("%d",ids.size());
1772 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1760 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1773 args["[LIST_TYPE]"] = "Allowed Residents"; 1761 args["[LIST_TYPE]"] = "Allowed Residents";
@@ -1783,7 +1771,7 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co
1783 int currentCount = (list ? list->getItemCount() : 0); 1771 int currentCount = (list ? list->getItemCount() : 0);
1784 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) 1772 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS)
1785 { 1773 {
1786 LLString::format_map_t args; 1774 LLStringUtil::format_map_t args;
1787 args["[NUM_ADDED]"] = llformat("%d",ids.size()); 1775 args["[NUM_ADDED]"] = llformat("%d",ids.size());
1788 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1776 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1789 args["[LIST_TYPE]"] = "Banned Residents"; 1777 args["[LIST_TYPE]"] = "Banned Residents";
@@ -1802,14 +1790,14 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co
1802 else 1790 else
1803 { 1791 {
1804 // ask if this estate or all estates with this owner 1792 // ask if this estate or all estates with this owner
1805 LLString::format_map_t args; 1793 LLStringUtil::format_map_t args;
1806 args["[ALL_ESTATES]"] = all_estates_text(); 1794 args["[ALL_ESTATES]"] = all_estates_text();
1807 gViewerWindow->alertXml(change_info->mDialogName, args, accessCoreConfirm, (void*)change_info); 1795 gViewerWindow->alertXml(change_info->mDialogName, args, accessCoreConfirm, (void*)change_info);
1808 } 1796 }
1809} 1797}
1810 1798
1811// static 1799// static
1812void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const char* dialog_name, const char* list_ctrl_name) 1800void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name)
1813{ 1801{
1814 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 1802 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
1815 if (!panel) return; 1803 if (!panel) return;
@@ -1866,7 +1854,7 @@ void LLPanelEstateInfo::accessRemoveCore2(S32 option, void* data)
1866 } 1854 }
1867 else 1855 else
1868 { 1856 {
1869 LLString::format_map_t args; 1857 LLStringUtil::format_map_t args;
1870 args["[ALL_ESTATES]"] = all_estates_text(); 1858 args["[ALL_ESTATES]"] = all_estates_text();
1871 gViewerWindow->alertXml(change_info->mDialogName, 1859 gViewerWindow->alertXml(change_info->mDialogName,
1872 args, 1860 args,
@@ -1953,12 +1941,12 @@ void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_
1953 msg->addString("Method", "estateaccessdelta"); 1941 msg->addString("Method", "estateaccessdelta");
1954 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); 1942 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice());
1955 1943
1956 char buf[MAX_STRING]; /* Flawfinder: ignore*/ 1944 std::string buf;
1957 gAgent.getID().toString(buf); 1945 gAgent.getID().toString(buf);
1958 msg->nextBlock("ParamList"); 1946 msg->nextBlock("ParamList");
1959 msg->addString("Parameter", buf); 1947 msg->addString("Parameter", buf);
1960 1948
1961 snprintf(buf, MAX_STRING, "%u", flags); /* Flawfinder: ignore */ 1949 buf = llformat("%u", flags);
1962 msg->nextBlock("ParamList"); 1950 msg->nextBlock("ParamList");
1963 msg->addString("Parameter", buf); 1951 msg->addString("Parameter", buf);
1964 1952
@@ -1979,8 +1967,7 @@ void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_
1979 gAgent.sendReliableMessage(); 1967 gAgent.sendReliableMessage();
1980} 1968}
1981 1969
1982 1970void LLPanelEstateInfo::updateControls(LLViewerRegion* region)
1983bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region)
1984{ 1971{
1985 BOOL god = gAgent.isGodlike(); 1972 BOOL god = gAgent.isGodlike();
1986 BOOL owner = (region && (region->getOwner() == gAgent.getID())); 1973 BOOL owner = (region && (region->getOwner() == gAgent.getID()));
@@ -1996,13 +1983,22 @@ bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region)
1996 childSetEnabled("remove_banned_avatar_btn", god || owner || manager); 1983 childSetEnabled("remove_banned_avatar_btn", god || owner || manager);
1997 childSetEnabled("message_estate_btn", god || owner || manager); 1984 childSetEnabled("message_estate_btn", god || owner || manager);
1998 childSetEnabled("kick_user_from_estate_btn", god || owner || manager); 1985 childSetEnabled("kick_user_from_estate_btn", god || owner || manager);
1986#if ELAR_ENABLED
1999 childSetEnabled("abuse_email_address", god || owner || manager); 1987 childSetEnabled("abuse_email_address", god || owner || manager);
1988#else
1989 childSetEnabled("abuse_email_address", false);
1990#endif
2000 1991
2001 // estate managers can't add estate managers 1992 // estate managers can't add estate managers
2002 childSetEnabled("add_estate_manager_btn", god || owner); 1993 childSetEnabled("add_estate_manager_btn", god || owner);
2003 childSetEnabled("remove_estate_manager_btn", god || owner); 1994 childSetEnabled("remove_estate_manager_btn", god || owner);
2004 childSetEnabled("estate_manager_name_list", god || owner); 1995 childSetEnabled("estate_manager_name_list", god || owner);
1996}
2005 1997
1998bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region)
1999{
2000 updateControls(region);
2001
2006 // let the parent class handle the general data collection. 2002 // let the parent class handle the general data collection.
2007 bool rv = LLPanelRegionInfo::refreshFromRegion(region); 2003 bool rv = LLPanelRegionInfo::refreshFromRegion(region);
2008 2004
@@ -2057,7 +2053,8 @@ BOOL LLPanelEstateInfo::postBuild()
2057 initCtrl("limit_payment"); 2053 initCtrl("limit_payment");
2058 initCtrl("limit_age_verified"); 2054 initCtrl("limit_age_verified");
2059 initCtrl("voice_chat_check"); 2055 initCtrl("voice_chat_check");
2060 initTextCtrl("abuse_email_address"); 2056 childSetCommitCallback("abuse_email_address", onChangeAnything, this);
2057 childSetKeystrokeCallback("abuse_email_address", onChangeText, this);
2061 2058
2062 initHelpBtn("estate_manager_help", "HelpEstateEstateManager"); 2059 initHelpBtn("estate_manager_help", "HelpEstateEstateManager");
2063 initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime"); 2060 initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime");
@@ -2305,10 +2302,10 @@ void LLPanelEstateInfo::commitEstateInfoDataserver()
2305 msg->nextBlock("ParamList"); 2302 msg->nextBlock("ParamList");
2306 msg->addString("Parameter", getEstateName()); 2303 msg->addString("Parameter", getEstateName());
2307 2304
2308 char buf[MAX_STRING]; /* Flawfinder: ignore*/ 2305 std::string buffer;
2309 snprintf(buf, MAX_STRING, "%u", computeEstateFlags()); /* Flawfinder: ignore */ 2306 buffer = llformat("%u", computeEstateFlags());
2310 msg->nextBlock("ParamList"); 2307 msg->nextBlock("ParamList");
2311 msg->addString("Parameter", buf); 2308 msg->addString("Parameter", buffer);
2312 2309
2313 F32 sun_hour = getSunHour(); 2310 F32 sun_hour = getSunHour();
2314 if (childGetValue("use_global_time_check").asBoolean()) 2311 if (childGetValue("use_global_time_check").asBoolean())
@@ -2316,9 +2313,9 @@ void LLPanelEstateInfo::commitEstateInfoDataserver()
2316 sun_hour = 0.f; // 0 = global time 2313 sun_hour = 0.f; // 0 = global time
2317 } 2314 }
2318 2315
2319 snprintf(buf, MAX_STRING, "%d", (S32)(sun_hour*1024.0f)); /* Flawfinder: ignore */ 2316 buffer = llformat("%d", (S32)(sun_hour*1024.0f));
2320 msg->nextBlock("ParamList"); 2317 msg->nextBlock("ParamList");
2321 msg->addString("Parameter", buf); 2318 msg->addString("Parameter", buffer);
2322 2319
2323 gAgent.sendMessage(); 2320 gAgent.sendMessage();
2324} 2321}
@@ -2489,8 +2486,8 @@ void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent,
2489// static 2486// static
2490void LLPanelEstateInfo::callbackCacheName( 2487void LLPanelEstateInfo::callbackCacheName(
2491 const LLUUID& id, 2488 const LLUUID& id,
2492 const char* first, 2489 const std::string& first,
2493 const char* last, 2490 const std::string& last,
2494 BOOL is_group, 2491 BOOL is_group,
2495 void*) 2492 void*)
2496{ 2493{
@@ -2505,9 +2502,7 @@ void LLPanelEstateInfo::callbackCacheName(
2505 } 2502 }
2506 else 2503 else
2507 { 2504 {
2508 name = first; 2505 name = first + " " + last;
2509 name += " ";
2510 name += last;
2511 } 2506 }
2512 2507
2513 self->setOwnerName(name); 2508 self->setOwnerName(name);
@@ -2556,7 +2551,7 @@ BOOL LLPanelEstateInfo::checkRemovalButton(std::string name)
2556 2551
2557 // enable the remove button if something is selected 2552 // enable the remove button if something is selected
2558 LLNameListCtrl* name_list = getChild<LLNameListCtrl>(name); 2553 LLNameListCtrl* name_list = getChild<LLNameListCtrl>(name);
2559 childSetEnabled(btn_name.c_str(), name_list && name_list->getFirstSelected() ? TRUE : FALSE); 2554 childSetEnabled(btn_name, name_list && name_list->getFirstSelected() ? TRUE : FALSE);
2560 2555
2561 return (btn_name != ""); 2556 return (btn_name != "");
2562} 2557}
@@ -2576,13 +2571,13 @@ BOOL LLPanelEstateInfo::checkSunHourSlider(LLUICtrl* child_ctrl)
2576void LLPanelEstateInfo::onClickMessageEstate(void* userdata) 2571void LLPanelEstateInfo::onClickMessageEstate(void* userdata)
2577{ 2572{
2578 llinfos << "LLPanelEstateInfo::onClickMessageEstate" << llendl; 2573 llinfos << "LLPanelEstateInfo::onClickMessageEstate" << llendl;
2579 gViewerWindow->alertXmlEditText("MessageEstate", LLString::format_map_t(), 2574 gViewerWindow->alertXmlEditText("MessageEstate", LLStringUtil::format_map_t(),
2580 NULL, NULL, 2575 NULL, NULL,
2581 onMessageCommit, userdata); 2576 onMessageCommit, userdata);
2582} 2577}
2583 2578
2584// static 2579// static
2585void LLPanelEstateInfo::onMessageCommit(S32 option, const LLString& text, void* userdata) 2580void LLPanelEstateInfo::onMessageCommit(S32 option, const std::string& text, void* userdata)
2586{ 2581{
2587 if(option != 0) return; 2582 if(option != 0) return;
2588 if(text.empty()) return; 2583 if(text.empty()) return;
@@ -2683,7 +2678,7 @@ BOOL LLPanelEstateCovenant::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop
2683 EDragAndDropType cargo_type, 2678 EDragAndDropType cargo_type,
2684 void* cargo_data, 2679 void* cargo_data,
2685 EAcceptance* accept, 2680 EAcceptance* accept,
2686 LLString& tooltip_msg) 2681 std::string& tooltip_msg)
2687{ 2682{
2688 LLInventoryItem* item = (LLInventoryItem*)cargo_data; 2683 LLInventoryItem* item = (LLInventoryItem*)cargo_data;
2689 2684
@@ -2809,7 +2804,7 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
2809 2804
2810 if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) 2805 if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) )
2811 { 2806 {
2812 if( !panelp->mEditor->importBuffer( buffer ) ) 2807 if( !panelp->mEditor->importBuffer( buffer, file_length+1 ) )
2813 { 2808 {
2814 llwarns << "Problem importing estate covenant." << llendl; 2809 llwarns << "Problem importing estate covenant." << llendl;
2815 gViewerWindow->alertXml("ProblemImportingEstateCovenant"); 2810 gViewerWindow->alertXml("ProblemImportingEstateCovenant");
@@ -2972,22 +2967,24 @@ bool LLDispatchEstateUpdateInfo::operator()(
2972 // NOTE: LLDispatcher extracts strings with an extra \0 at the 2967 // NOTE: LLDispatcher extracts strings with an extra \0 at the
2973 // end. If we pass the std::string direct to the UI/renderer 2968 // end. If we pass the std::string direct to the UI/renderer
2974 // it draws with a weird character at the end of the string. 2969 // it draws with a weird character at the end of the string.
2975 std::string estate_name = strings[0].c_str(); 2970 std::string estate_name = strings[0].c_str(); // preserve c_str() call!
2976 panel->setEstateName(estate_name); 2971 panel->setEstateName(estate_name);
2977 2972
2973#if ELAR_ENABLED
2978 if (strings.size() > 9) 2974 if (strings.size() > 9)
2979 { 2975 {
2980 std::string abuse_email = strings[9].c_str(); 2976 std::string abuse_email = strings[9].c_str(); // preserve c_str() call!
2981 panel->setAbuseEmailAddress(abuse_email); 2977 panel->setAbuseEmailAddress(abuse_email);
2982 } 2978 }
2983 else 2979 else
2980#endif
2984 { 2981 {
2985 panel->setAbuseEmailAddress("@ Old Server @"); 2982 panel->setAbuseEmailAddress(panel->getString("email_unsupported"));
2986 } 2983 }
2987 2984
2988 LLViewerRegion* regionp = gAgent.getRegion(); 2985 LLViewerRegion* regionp = gAgent.getRegion();
2989 2986
2990 LLUUID owner_id(strings[1].c_str()); 2987 LLUUID owner_id(strings[1]);
2991 regionp->setOwner(owner_id); 2988 regionp->setOwner(owner_id);
2992 // Update estate owner name in UI 2989 // Update estate owner name in UI
2993 const BOOL is_group = FALSE; 2990 const BOOL is_group = FALSE;
@@ -3105,7 +3102,7 @@ bool LLDispatchSetEstateAccess::operator()(
3105 allowed_agent_name_list->addNameItem(id); 3102 allowed_agent_name_list->addNameItem(id);
3106 } 3103 }
3107 panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE); 3104 panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE);
3108 allowed_agent_name_list->sortByColumn(0, TRUE); 3105 allowed_agent_name_list->sortByColumnIndex(0, TRUE);
3109 } 3106 }
3110 } 3107 }
3111 3108
@@ -3129,7 +3126,7 @@ bool LLDispatchSetEstateAccess::operator()(
3129 allowed_group_name_list->addGroupNameItem(id); 3126 allowed_group_name_list->addGroupNameItem(id);
3130 } 3127 }
3131 panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE); 3128 panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE);
3132 allowed_group_name_list->sortByColumn(0, TRUE); 3129 allowed_group_name_list->sortByColumnIndex(0, TRUE);
3133 } 3130 }
3134 } 3131 }
3135 3132
@@ -3161,7 +3158,7 @@ bool LLDispatchSetEstateAccess::operator()(
3161 banned_agent_name_list->addNameItem(id); 3158 banned_agent_name_list->addNameItem(id);
3162 } 3159 }
3163 panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE); 3160 panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE);
3164 banned_agent_name_list->sortByColumn(0, TRUE); 3161 banned_agent_name_list->sortByColumnIndex(0, TRUE);
3165 } 3162 }
3166 } 3163 }
3167 3164
@@ -3188,7 +3185,7 @@ bool LLDispatchSetEstateAccess::operator()(
3188 estate_manager_name_list->addNameItem(id); 3185 estate_manager_name_list->addNameItem(id);
3189 } 3186 }
3190 panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE); 3187 panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE);
3191 estate_manager_name_list->sortByColumn(0, TRUE); 3188 estate_manager_name_list->sortByColumnIndex(0, TRUE);
3192 } 3189 }
3193 } 3190 }
3194 3191