diff --git a/etc/message.xml b/etc/message.xml index 7b133ab205..7450696923 100644 --- a/etc/message.xml +++ b/etc/message.xml @@ -378,6 +378,23 @@ true + + OpenRegionInfo + + flavor + llsd + trusted-sender + true + + + WindLightRefresh + + flavor + llsd + trusted-sender + true + + ParcelVoiceInfo flavor diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 50923ba6f9..840c2ec116 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -136,6 +136,7 @@ set(viewer_SOURCE_FILES lggbeamscolors.cpp lggcontactsets.cpp lggcontactsetsfloater.cpp + llpanelopenregionsettings.cpp llaccountingcostmanager.cpp llagent.cpp diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index 832c74d78b..70b53c2a05 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -1391,6 +1391,13 @@ bool LLGridManager::isInOpenSim() return mIsInOpenSim; } +// Aurora Sim +bool LLGridManager::isInAuroraSim() +{ + return mIsInAuroraSim; +} +// Aurora Sim + void LLGridManager::saveGridList() { // filter out just those which are not hardcoded anyway diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index eef7cb8efb..6e43f93213 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -92,6 +92,12 @@ #include "llagentui.h" #include "llmeshrepository.h" +// Aurora Sim - Region Settings Console +#include "llviewernetwork.h" +#include "llworld.h" +#include "llstartup.h" +// Aurora Sim - Region Settings Console + const S32 TERRAIN_TEXTURE_COUNT = 4; const S32 CORNER_COUNT = 4; @@ -199,6 +205,18 @@ BOOL LLFloaterRegionInfo::postBuild() panel->buildFromFile("panel_region_general.xml"); mTab->addTabPanel(panel); +// Aurora Sim - Region Settings Console + // We only use this panel on Aurora-based sims + std::string url = gAgent.getRegion()->getCapability("DispatchOpenRegionSettings"); + if (!url.empty()) + { + panel = new LLPanelRegionOpenSettingsInfo; + mInfoPanels.push_back(panel); + panel->buildFromFile("panel_region_open_region_settings.xml"); + mTab->addTabPanel(panel); + } +// Aurora Sim - Region Settings Console + panel = new LLPanelRegionTerrainInfo; mInfoPanels.push_back(panel); panel->buildFromFile("panel_region_terrain.xml"); @@ -451,6 +469,18 @@ LLPanelRegionTerrainInfo* LLFloaterRegionInfo::getPanelRegionTerrain() return panel; } +// Aurora Sim - Region Settings Console +// static +LLPanelRegionOpenSettingsInfo* LLFloaterRegionInfo::getPanelOpenSettings() +{ + LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); + if (!floater) return NULL; + LLTabContainer* tab = floater->getChild("region_panels"); + LLPanelRegionOpenSettingsInfo* panel = (LLPanelRegionOpenSettingsInfo*)tab->getChild("RegionSettings"); + return panel; +} +// Aurora Sim - Region Settings Console + void LLFloaterRegionInfo::onTabSelected(const LLSD& param) { LLPanel* active_panel = getChild(param.asString()); @@ -878,6 +908,127 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() return TRUE; } +// Aurora Sim - Region Settings Panel +///////////////////////////////////////////////////////////////////////////// +// LLPanelRegionOpenSettingsInfo +///////////////////////////////////////////////////////////////////////////// +bool LLPanelRegionOpenSettingsInfo::refreshFromRegion(LLViewerRegion* region) +{ + // Data gets filled in by hippo manager + BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); + + LLWorld *regionlimits = LLWorld::getInstance(); + + childSetValue("draw_distance", LLSD(regionlimits->getDrawDistance())); + childSetValue("force_draw_distance", LLSD(regionlimits->getLockedDrawDistance())); + childSetValue("allow_minimap", LLSD(regionlimits->getAllowMinimap())); + childSetValue("allow_physical_prims", LLSD(regionlimits->getAllowPhysicalPrims())); + childSetValue("max_drag_distance", LLSD(regionlimits->getMaxDragDistance())); + childSetValue("min_hole_size", LLSD(regionlimits->getRegionMinHoleSize())); + childSetValue("max_hollow_size", LLSD(regionlimits->getRegionMaxHollowSize())); + childSetValue("max_inventory_items_transfer", LLSD(regionlimits->getMaxInventoryItemsTransfer())); + childSetValue("max_link_count", LLSD((LLSD::Integer)regionlimits->getMaxLinkedPrims())); + childSetValue("max_link_count_phys", LLSD(regionlimits->getMaxPhysLinkedPrims())); + childSetValue("max_phys_prim_scale", LLSD(regionlimits->getMaxPhysPrimScale())); + childSetValue("max_prim_scale", LLSD(regionlimits->getRegionMaxPrimScale())); + childSetValue("min_prim_scale", LLSD(regionlimits->getRegionMinPrimScale())); + childSetValue("render_water", LLSD(regionlimits->getAllowRenderWater())); + childSetValue("show_tags", LLSD(regionlimits->getAllowRenderName())); + childSetValue("max_groups", LLSD(gMaxAgentGroups)); + childSetValue("allow_parcel_windlight", LLSD(regionlimits->getAllowParcelWindLight())); + childSetValue("enable_teen_mode", LLSD(regionlimits->getEnableTeenMode())); + childSetValue("enforce_max_build", LLSD(regionlimits->getEnforceMaxBuild())); + childSetValue("terrain_detail_scale", LLSD(regionlimits->getTerrainDetailScale())); + + setCtrlsEnabled(allow_modify); + + return LLPanelRegionInfo::refreshFromRegion(region); +} + +BOOL LLPanelRegionOpenSettingsInfo::postBuild() +{ + // Enable the "Apply" button if something is changed. JC + initCtrl("draw_distance"); + initCtrl("force_draw_distance"); + initCtrl("max_drag_distance"); + initCtrl("max_prim_scale"); + initCtrl("min_prim_scale"); + initCtrl("max_phys_prim_scale"); + initCtrl("max_hollow_size"); + initCtrl("min_hole_size"); + initCtrl("max_link_count"); + initCtrl("max_link_count_phys"); + initCtrl("max_inventory_items_transfer"); + initCtrl("max_groups"); + initCtrl("render_water"); + initCtrl("allow_minimap"); + initCtrl("allow_physical_prims"); + initCtrl("enable_teen_mode"); + initCtrl("show_tags"); + initCtrl("allow_parcel_windlight"); + initCtrl("terrain_detail_scale"); + + childSetAction("force_draw_distance_help", onClickHelp, new std::string("HelpForceDrawDistance")); + childSetAction("max_inventory_items_transfer_help", onClickHelp, new std::string("HelpMaxInventoryItemsTransfer")); + childSetAction("max_groups_help", onClickHelp, new std::string("HelpMaxGroups")); + childSetAction("render_water_help", onClickHelp, new std::string("HelpRenderWater")); + childSetAction("allow_minimap_help", onClickHelp, new std::string("HelpAllowMinimap")); + childSetAction("allow_physical_prims_help", onClickHelp, new std::string("HelpAllowPhysicalPrims")); + childSetAction("enable_teen_mode_help", onClickHelp, new std::string("HelpEnableTeenMode")); + childSetAction("show_tags_help", onClickHelp, new std::string("HelpShowTags")); + childSetAction("allow_parcel_windlight_help", onClickHelp, new std::string("HelpAllowParcelWindLight")); + + childSetAction("apply_ors_btn", onClickOrs, this); + + refreshFromRegion(gAgent.getRegion()); + + return LLPanelRegionInfo::postBuild(); +} + +void LLPanelRegionOpenSettingsInfo::onClickHelp(void* data) +{ + std::string* xml_alert = (std::string*)data; + LLNotifications::instance().add(*xml_alert); +} + +void LLPanelRegionOpenSettingsInfo::onClickOrs(void* userdata) +{ + LLPanelRegionOpenSettingsInfo* self; + self = (LLPanelRegionOpenSettingsInfo*)userdata; + + llinfos << "LLPanelRegionOpenSettingsInfo::onClickOrs()" << llendl; + + LLSD body; + std::string url = gAgent.getRegion()->getCapability("DispatchOpenRegionSettings"); + if (!url.empty()) + { + body["draw_distance"] = (LLSD::Integer)self->childGetValue("draw_distance"); + body["force_draw_distance"] = (LLSD::Boolean)self->childGetValue("force_draw_distance"); + body["allow_minimap"] = (LLSD::Boolean)self->childGetValue("allow_minimap"); + body["allow_physical_prims"] = (LLSD::Boolean)self->childGetValue("allow_physical_prims"); + body["max_drag_distance"] = (LLSD::Real)self->childGetValue("max_drag_distance"); + body["min_hole_size"] = (LLSD::Real)self->childGetValue("min_hole_size"); + body["max_hollow_size"] = (LLSD::Real)self->childGetValue("max_hollow_size"); + body["max_inventory_items_transfer"] = (LLSD::Integer)self->childGetValue("max_inventory_items_transfer"); + body["max_link_count"] = (LLSD::Real)self->childGetValue("max_link_count"); + body["max_link_count_phys"] = (LLSD::Real)self->childGetValue("max_link_count_phys"); + body["max_phys_prim_scale"] = (LLSD::Real)self->childGetValue("max_phys_prim_scale"); + body["max_prim_scale"] = (LLSD::Real)self->childGetValue("max_prim_scale"); + body["min_prim_scale"] = (LLSD::Real)self->childGetValue("min_prim_scale"); + body["render_water"] = (LLSD::Boolean)self->childGetValue("render_water"); + body["terrain_detail_scale"] = (LLSD::Real)self->childGetValue("terrain_detail_scale"); + body["show_tags"] = (LLSD::Real)self->childGetValue("show_tags"); + body["max_groups"] = (LLSD::Real)self->childGetValue("max_groups"); + body["allow_parcel_windlight"] = (LLSD::Boolean)self->childGetValue("allow_parcel_windlight"); + body["enable_teen_mode"] = (LLSD::Boolean)self->childGetValue("enable_teen_mode"); + body["enforce_max_build"] = (LLSD::Boolean)self->childGetValue("enforce_max_build"); + + LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); + //llinfos << "data: " << LLSDXMLStreamer(body) << llendl; + } +} +// Aurora Sim - Region Settings Console + ///////////////////////////////////////////////////////////////////////////// // LLPanelRegionDebugInfo ///////////////////////////////////////////////////////////////////////////// @@ -1233,11 +1384,20 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() // ======================================= // Assemble and send texturedetail message - // Make sure user hasn't chosen wacky textures. + // Make sure user hasn't chosen wacky textures unless we're on Aurora-sim. +// Aurora Sim - Region Settings Console +#ifdef HAS_OPENSIM_SUPPORT + if (!validateTextureSizes() && !LLGridManager::getInstance()->isInAuroraSim()) + { + return FALSE; + } +#else if (!validateTextureSizes()) { return FALSE; } +#endif +// Aurora Sim - Region Settings Console LLTextureCtrl* texture_ctrl; std::string id_str; diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 43112a0a24..502e9e0678 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -56,6 +56,9 @@ class LLTextBox; class LLVFS; class LLPanelRegionGeneralInfo; +// Aurora Sim - Region Settings Panel +class LLPanelRegionOpenSettingsInfo; +// Aurora Sim - Region Settings Panel class LLPanelRegionDebugInfo; class LLPanelRegionTerrainInfo; class LLPanelEstateInfo; @@ -90,6 +93,9 @@ public: static LLPanelEstateInfo* getPanelEstate(); static LLPanelEstateCovenant* getPanelCovenant(); static LLPanelRegionTerrainInfo* getPanelRegionTerrain(); +// Aurora Sim - Region Settings Panel + static LLPanelRegionOpenSettingsInfo* getPanelOpenSettings(); +// Aurora Sim - Region Settings Panel // from LLPanel virtual void refresh(); @@ -160,6 +166,26 @@ protected: // Actual panels start here ///////////////////////////////////////////////////////////////////////////// +// Aurora Sim - Region Settings Panel +class LLPanelRegionOpenSettingsInfo : public LLPanelRegionInfo +{ +public: + LLPanelRegionOpenSettingsInfo() + : LLPanelRegionInfo() {} + ~LLPanelRegionOpenSettingsInfo() {} + + virtual bool refreshFromRegion(LLViewerRegion* region); + + // LLPanel + virtual BOOL postBuild(); + +protected: + static void onClickOrs(void* userdata); + static void onClickHelp(void* data); +}; +///////////////////////////////////////////////////////////////////////////// +// Aurora Sim - Region Settings Panel + class LLPanelRegionGeneralInfo : public LLPanelRegionInfo { diff --git a/indra/newview/llpanelopenregionsettings.cpp b/indra/newview/llpanelopenregionsettings.cpp new file mode 100644 index 0000000000..15ec12a54e --- /dev/null +++ b/indra/newview/llpanelopenregionsettings.cpp @@ -0,0 +1,208 @@ +/* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * @file llpanelopenregionsettings.cpp + * @brief Handler for OpenRegionInfo event queue message. + * Copyright (C) 2011, Patrick Sapinski, Matthew Beardmore + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llhttpnode.h" +#include "llviewercontrol.h" +#include "llagent.h" +#include "llsurface.h" +#include "llviewerregion.h" +#include "llviewerobject.h" +#include "llfloaterregioninfo.h" +#include "llworld.h" +#include "llagentcamera.h" +#include "llfloaterworldmap.h" +#include "llstartup.h" +#include "lldrawpoolterrain.h" +#include "llvlcomposition.h" + +//DEBUG includes +#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string + +class OpenRegionInfoUpdate : public LLHTTPNode +{ + /*virtual*/ void post( + LLHTTPNode::ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + BOOL time_UTCDST = FALSE; + + if (!input || !context || !input.isMap() || !input.has("body")) + { + llinfos << "malformed OpenRegionInfo update!" << llendl; + return; + } + + std::string dump = input["body"].asString(); + llwarns << dump << llendl; + + LLWorld * regionlimits = LLWorld::getInstance(); + + LLSD body = input["body"]; + //llinfos << "data: " << LLSDNotationStreamer(body) << llendl; + //llinfos << "data: " << LLSDXMLStreamer(body) << llendl; + + //set the default limits/settings for this simulator type, as limits from our + //previous region may not exist in this one + regionlimits->refreshLimits(); + + if ( body.has("AllowMinimap") ) + { + regionlimits->setAllowMinimap(body["AllowMinimap"].asInteger() == 1); + } + if ( body.has("AllowPhysicalPrims") ) + { + regionlimits->setAllowPhysicalPrims(body["AllowPhysicalPrims"].asInteger() == 1); + } + if ( gSavedSettings.getBOOL("OpenregionsettingsEnableDrawdistance") ) + { + if ( body.has("DrawDistance") ) + { + F32 draw_distance = body["DrawDistance"].asReal(); + if (draw_distance > 0) + { + gAgentCamera.mDrawDistance = draw_distance; + LLWorld::getInstance()->setLandFarClip(draw_distance); + } + regionlimits->setDrawDistance(body["DrawDistance"].asReal()); + } + if ( body.has("ForceDrawDistance") ) + { + regionlimits->setLockedDrawDistance(body["ForceDrawDistance"].asInteger() == 1 ? TRUE : FALSE); + } + } + if ( body.has("LSLFunctions") ) + { + //IMPLEMENT ME + } + if ( body.has("TerrainDetailScale") ) + { + //gAgent.getRegion()->getComposition()->setScaleParams(body["TerrainDetailScale"].asReal(), body["TerrainDetailScale"].asReal()); + + regionlimits->setTerrainDetailScale(body["TerrainDetailScale"].asReal()); + gSavedSettings.setF32("RenderTerrainScale", body["TerrainDetailScale"].asReal()); + LLDrawPoolTerrain::sDetailScale = 1.f/body["TerrainDetailScale"].asReal(); + } + if ( body.has("MaxDragDistance") ) + { + regionlimits->setMaxDragDistance(body["MaxDragDistance"].asReal()); + } + if ( body.has("MinHoleSize") ) + { + regionlimits->setRegionMinHoleSize(body["MinHoleSize"].asReal()); + } + if ( body.has("MaxHollowSize") ) + { + regionlimits->setRegionMaxHollowSize(body["MaxHollowSize"].asReal()); + } + if ( body.has("MaxInventoryItemsTransfer") ) + { + regionlimits->setMaxInventoryItemsTransfer(body["MaxInventoryItemsTransfer"].asReal()); + } + if ( body.has("MaxLinkCount") ) + { + regionlimits->setMaxLinkedPrims(body["MaxLinkCount"].asInteger()); + } + if ( body.has("MaxLinkCountPhys") ) + { + regionlimits->setMaxPhysLinkedPrims(body["MaxLinkCountPhys"].asInteger()); + } + if ( body.has("MaxPos") ) + { + regionlimits->setMaxPrimXPos(body["MaxPosX"].asReal()); + regionlimits->setMaxPrimYPos(body["MaxPosY"].asReal()); + regionlimits->setMaxPrimZPos(body["MaxPosZ"].asReal()); + } + if ( body.has("MinPos") ) + { + regionlimits->setMinPrimXPos(body["MinPosX"].asReal()); + regionlimits->setMinPrimYPos(body["MinPosY"].asReal()); + regionlimits->setMinPrimZPos(body["MinPosZ"].asReal()); + } + if ( body.has("MaxPrimScale") ) + { + regionlimits->setRegionMaxPrimScale(body["MaxPrimScale"].asReal()); + regionlimits->setRegionMaxPrimScaleNoMesh(body["MaxPrimScale"].asReal()); + } + if ( body.has("MaxPhysPrimScale") ) + { + regionlimits->setMaxPhysPrimScale(body["MaxPhysPrimScale"].asReal()); + } + if ( body.has("MinPrimScale") ) + { + regionlimits->setRegionMinPrimScale(body["MinPrimScale"].asReal()); + } + if ( body.has("OffsetOfUTCDST") ) + { + time_UTCDST = body["OffsetOfUTCDST"].asInteger() == 1 ? TRUE : FALSE; + } + if ( body.has("OffsetOfUTC") ) + { + gUTCOffset = body["OffsetOfUTC"].asInteger(); + if(time_UTCDST) gUTCOffset++; + } + if ( body.has("RenderWater") ) + { + regionlimits->setAllowRenderWater(body["RenderWater"].asInteger() == 1 ? TRUE : FALSE); + } + if ( body.has("SayDistance") ) + { + regionlimits->setSayDistance(body["SayDistance"].asReal()); + } + if ( body.has("ShoutDistance") ) + { + regionlimits->setShoutDistance(body["ShoutDistance"].asReal()); + } + if ( body.has("WhisperDistance") ) + { + regionlimits->setWhisperDistance(body["WhisperDistance"].asReal()); + } + if ( body.has("ToggleTeenMode") ) + { + regionlimits->setEnableTeenMode(body["ToggleTeenMode"].asInteger() == 1 ? TRUE : FALSE); + } + if ( body.has("ShowTags") ) + { + regionlimits->setAllowRenderName(body["ShowTags"].asReal()); + } + if ( body.has("EnforceMaxBuild") ) + { + regionlimits->setEnforceMaxBuild(body["EnforceMaxBuild"].asInteger() == 1 ? TRUE : FALSE); + } + if ( body.has("MaxGroups") ) + { + gMaxAgentGroups = body["MaxGroups"].asInteger(); + } + if ( body.has("AllowParcelWindLight") ) + { + regionlimits->setAllowParcelWindLight(body["AllowParcelWindLight"].asInteger() == 1); + } + + regionlimits->updateLimits(); + } +}; + +LLHTTPRegistration +gHTTPRegistrationOpenRegionInfoUpdate( + "/message/OpenRegionInfo"); \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_region_open_region_settings.xml b/indra/newview/skins/default/xui/en/panel_region_open_region_settings.xml new file mode 100644 index 0000000000..6e9304ddb8 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_open_region_settings.xml @@ -0,0 +1,77 @@ + + + + +