Refactor OpenSimExtras to use lfsimfeaturehandler with permission from Liru Færs
parent
838df4ca9c
commit
01855fabc7
|
|
@ -184,6 +184,7 @@ set(viewer_SOURCE_FILES
|
|||
lggbeamscolors.cpp
|
||||
lggcontactsets.cpp
|
||||
lggcontactsetsfloater.cpp
|
||||
lfsimfeaturehandler.cpp
|
||||
llpanelopenregionsettings.cpp
|
||||
|
||||
llaccountingcostmanager.cpp
|
||||
|
|
@ -877,6 +878,7 @@ set(viewer_HEADER_FILES
|
|||
lggbeamscolors.h
|
||||
lggcontactsets.h
|
||||
lggcontactsetsfloater.h
|
||||
lfsimfeaturehandler.h
|
||||
|
||||
llaccountingcostmanager.h
|
||||
llagent.h
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@
|
|||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "fsexportperms.h"
|
||||
#include "lfsimfeaturehandler.h"
|
||||
#include "llagent.h"
|
||||
#include "llinventoryfunctions.h"
|
||||
#include "llmeshrepository.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llvovolume.h"
|
||||
#include "llworld.h"
|
||||
|
||||
|
|
@ -61,25 +61,17 @@ bool FSExportPermsCheck::canExportNode(LLSelectNode* node)
|
|||
#ifdef OPENSIM
|
||||
else if (LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (region && region->regionSupportsExport() == LLViewerRegion::EXPORT_ALLOWED)
|
||||
switch (LFSimFeatureHandler::instance().exportPolicy())
|
||||
{
|
||||
exportable = node->mPermissions->allowExportBy(gAgent.getID());
|
||||
}
|
||||
else if (region && region->regionSupportsExport() == LLViewerRegion::EXPORT_DENIED)
|
||||
{
|
||||
// Only your own creations if this is explicitly set
|
||||
exportable = (object->permYouOwner()
|
||||
&& gAgentID == node->mPermissions->getCreator());
|
||||
}
|
||||
/// TODO: Once enough grids adopt a version supporting the exports cap, get consensus
|
||||
/// on whether we should allow full perm exports anymore.
|
||||
else // LLViewerRegion::EXPORT_UNDEFINED
|
||||
{
|
||||
exportable = (object->permYouOwner()
|
||||
&& object->permModify()
|
||||
&& object->permCopy()
|
||||
&& object->permTransfer());
|
||||
case EXPORT_ALLOWED:
|
||||
exportable = node->mPermissions->allowExportBy(gAgent.getID());
|
||||
/// TODO: Once enough grids adopt a version supporting exports, get consensus
|
||||
/// on whether we should allow full perm exports anymore.
|
||||
case EXPORT_UNDEFINED:
|
||||
exportable = (object->permYouOwner() && object->permModify() && object->permCopy() && object->permTransfer());
|
||||
case EXPORT_DENIED:
|
||||
default:
|
||||
exportable = (object->permYouOwner() && gAgentID == node->mPermissions->getCreator());
|
||||
}
|
||||
}
|
||||
#endif // OPENSIM
|
||||
|
|
@ -144,25 +136,19 @@ bool FSExportPermsCheck::canExportNode(LLSelectNode* node)
|
|||
for (S32 i = 0; i < items.count(); ++i)
|
||||
{
|
||||
const LLPermissions perms = items[i]->getPermissions();
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (!region)
|
||||
switch (LFSimFeatureHandler::instance().exportPolicy())
|
||||
{
|
||||
LL_WARNS("export") << "No region found to check export caps!" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
if (region->regionSupportsExport() == LLViewerRegion::EXPORT_ALLOWED)
|
||||
{
|
||||
exportable = (perms.getMaskOwner() & PERM_EXPORT) == PERM_EXPORT;
|
||||
}
|
||||
else if (region->regionSupportsExport() == LLViewerRegion::EXPORT_DENIED)
|
||||
{
|
||||
exportable = perms.getCreator() == gAgentID;
|
||||
}
|
||||
/// TODO: Once enough grids adopt a version supporting the exports cap, get consensus
|
||||
/// on whether we should allow full perm exports anymore.
|
||||
else
|
||||
{
|
||||
exportable = (perms.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
|
||||
case EXPORT_ALLOWED:
|
||||
exportable = (perms.getMaskOwner() & PERM_EXPORT) == PERM_EXPORT;
|
||||
break;
|
||||
/// TODO: Once enough grids adopt a version supporting exports, get consensus
|
||||
/// on whether we should allow full perm exports anymore.
|
||||
case EXPORT_UNDEFINED:
|
||||
exportable = (perms.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
|
||||
break;
|
||||
case EXPORT_DENIED:
|
||||
default:
|
||||
exportable = perms.getCreator() == gAgentID;
|
||||
}
|
||||
if (!exportable)
|
||||
LL_INFOS("export") << "Sculpt map has failed permissions check." << LL_ENDL;
|
||||
|
|
@ -213,21 +199,20 @@ bool FSExportPermsCheck::canExportAsset(LLUUID asset_id, std::string* name, std:
|
|||
#ifdef OPENSIM
|
||||
if (LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (!region) return false;
|
||||
if (region->regionSupportsExport() == LLViewerRegion::EXPORT_ALLOWED)
|
||||
switch (LFSimFeatureHandler::instance().exportPolicy())
|
||||
{
|
||||
exportable = (perms.getMaskOwner() & PERM_EXPORT) == PERM_EXPORT;
|
||||
}
|
||||
else if (region->regionSupportsExport() == LLViewerRegion::EXPORT_DENIED)
|
||||
{
|
||||
exportable = perms.getCreator() == gAgentID;
|
||||
}
|
||||
/// TODO: Once enough grids adopt a version supporting the exports cap, get consensus
|
||||
/// on whether we should allow full perm exports anymore.
|
||||
else
|
||||
{
|
||||
exportable = (perms.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
|
||||
case EXPORT_ALLOWED:
|
||||
exportable = (perms.getMaskOwner() & PERM_EXPORT) == PERM_EXPORT;
|
||||
break;
|
||||
/// TODO: Once enough grids adopt a version supporting exports, get consensus
|
||||
/// on whether we should allow full perm exports anymore.
|
||||
case EXPORT_UNDEFINED:
|
||||
exportable = (perms.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
|
||||
break;
|
||||
case EXPORT_DENIED:
|
||||
default:
|
||||
exportable = perms.getCreator() == gAgentID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "fsfloaterexport.h"
|
||||
|
||||
#include "lfsimfeaturehandler.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentconstants.h"
|
||||
#include "llagentdata.h"
|
||||
|
|
@ -734,20 +735,20 @@ void FSFloaterObjectExport::inventoryChanged(LLViewerObject* object, LLInventory
|
|||
#ifdef OPENSIM
|
||||
if (LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (region && region->regionSupportsExport() == LLViewerRegion::EXPORT_ALLOWED)
|
||||
switch (LFSimFeatureHandler::instance().exportPolicy())
|
||||
{
|
||||
exportable = (perms.getMaskOwner() & PERM_EXPORT) == PERM_EXPORT;
|
||||
}
|
||||
else if (region && region->regionSupportsExport() == LLViewerRegion::EXPORT_DENIED)
|
||||
{
|
||||
exportable = perms.getCreator() == gAgentID;
|
||||
}
|
||||
/// TODO: Once enough grids adopt a version supporting the exports cap, get consensus
|
||||
/// on whether we should allow full perm exports anymore.
|
||||
else
|
||||
{
|
||||
exportable = ((perms.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED);
|
||||
case EXPORT_ALLOWED:
|
||||
exportable = (perms.getMaskOwner() & PERM_EXPORT) == PERM_EXPORT;
|
||||
break;
|
||||
/// TODO: Once enough grids adopt a version supporting exports, get consensus
|
||||
/// on whether we should allow full perm exports anymore.
|
||||
case EXPORT_UNDEFINED:
|
||||
exportable = (perms.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
|
||||
break;
|
||||
case EXPORT_DENIED:
|
||||
default:
|
||||
exportable = perms.getCreator() == gAgentID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "fsfloatersearch.h"
|
||||
#include "lfsimfeaturehandler.h"
|
||||
#include "llagent.h"
|
||||
#include "llavatarname.h"
|
||||
#include "llavatarnamecache.h"
|
||||
|
|
@ -2916,7 +2917,7 @@ void FSPanelSearchWeb::loadURL(const FSFloaterSearch::SearchQuery &p)
|
|||
}
|
||||
else if(LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
std::string os_search_url = gAgent.getRegion()->getSearchServerURL();
|
||||
std::string os_search_url = LFSimFeatureHandler::instance().searchURL();
|
||||
if (!os_search_url.empty())
|
||||
url = os_search_url;
|
||||
else if (LLLoginInstance::getInstance()->hasResponse("search"))
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "fscommon.h"
|
||||
#include "fslslbridge.h"
|
||||
#include "lggcontactsets.h"
|
||||
#include "lfsimfeaturehandler.h"
|
||||
#include "llagent.h"
|
||||
#include "llavataractions.h"
|
||||
#include "llavatarconstants.h" // for range constants
|
||||
|
|
@ -146,8 +147,8 @@ void FSRadar::updateRadarList()
|
|||
LLWorld* world = LLWorld::getInstance();
|
||||
LLMuteList* mutelist = LLMuteList::getInstance();
|
||||
|
||||
static const F32 chat_range_say = world->getSayDistance();
|
||||
static const F32 chat_range_shout = world->getShoutDistance();
|
||||
static const F32 chat_range_say = LFSimFeatureHandler::getInstance()->sayRange();
|
||||
static const F32 chat_range_shout = LFSimFeatureHandler::getInstance()->shoutRange();
|
||||
|
||||
static const std::string str_chat_entering = LLTrans::getString("entering_chat_range");
|
||||
static const std::string str_chat_leaving = LLTrans::getString("leaving_chat_range");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,110 @@
|
|||
/* Copyright (C) 2013 Liru Færs
|
||||
*
|
||||
* 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; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* 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 */
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "lfsimfeaturehandler.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llenvmanager.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewerregion.h"
|
||||
|
||||
LFSimFeatureHandler::LFSimFeatureHandler()
|
||||
: mSupportsExport(false)
|
||||
, mSayRange(20)
|
||||
, mShoutRange(100)
|
||||
, mWhisperRange(10)
|
||||
{
|
||||
if (!LLGridManager::getInstance()->isInSecondLife()) // Remove this line if we ever handle SecondLife sim features
|
||||
LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this));
|
||||
}
|
||||
|
||||
ExportSupport LFSimFeatureHandler::exportPolicy() const
|
||||
{
|
||||
return LLGridManager::getInstance()->isInSecondLife() ? EXPORT_UNDEFINED : (mSupportsExport ? EXPORT_ALLOWED : EXPORT_DENIED);
|
||||
}
|
||||
|
||||
void LFSimFeatureHandler::handleRegionChange()
|
||||
{
|
||||
if (LLViewerRegion* region = gAgent.getRegion())
|
||||
{
|
||||
if (region->capabilitiesReceived())
|
||||
{
|
||||
setSupportedFeatures();
|
||||
}
|
||||
else
|
||||
{
|
||||
region->setCapabilitiesReceivedCallback(boost::bind(&LFSimFeatureHandler::setSupportedFeatures, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LFSimFeatureHandler::setSupportedFeatures()
|
||||
{
|
||||
if (LLViewerRegion* region = gAgent.getRegion())
|
||||
{
|
||||
LLSD info;
|
||||
region->getSimulatorFeatures(info);
|
||||
if (info.has("OpenSimExtras")) // OpenSim specific sim features
|
||||
{
|
||||
// For definition of OpenSimExtras please see
|
||||
// http://opensimulator.org/wiki/SimulatorFeatures_Extras
|
||||
const LLSD& extras(info["OpenSimExtras"]);
|
||||
mSupportsExport = extras.has("ExportSupported") ? extras["ExportSupported"].asBoolean() : false;
|
||||
mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : "";
|
||||
mSearchURL = extras.has("search-server-url") ? extras["search-server-url"].asString() : "";
|
||||
mSayRange = extras.has("say-range") ? extras["say-range"].asInteger() : 20;
|
||||
mShoutRange = extras.has("shout-range") ? extras["shout-range"].asInteger() : 100;
|
||||
mWhisperRange = extras.has("whisper-range") ? extras["whisper-range"].asInteger() : 10;
|
||||
}
|
||||
else // OpenSim specifics are unsupported reset all to default
|
||||
{
|
||||
mSupportsExport = false;
|
||||
mMapServerURL = "";
|
||||
mSearchURL = "";
|
||||
mSayRange = 20;
|
||||
mShoutRange = 100;
|
||||
mWhisperRange = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setSupportsExportCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
{
|
||||
return mSupportsExport.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
{
|
||||
return mSearchURL.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
{
|
||||
return mSayRange.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
{
|
||||
return mShoutRange.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
{
|
||||
return mWhisperRange.connect(slot);
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/* Copyright (C) 2013 Liru Færs
|
||||
*
|
||||
* 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; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* 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 */
|
||||
|
||||
#ifndef LFSIMFEATUREHANDLER_H
|
||||
#define LFSIMFEATUREHANDLER_H
|
||||
|
||||
#include "llsingleton.h"
|
||||
#include "llpermissions.h" // ExportPolicy
|
||||
|
||||
template<typename Type, typename Signal = boost::signals2::signal<void()> >
|
||||
class SignaledType
|
||||
{
|
||||
public:
|
||||
SignaledType() : mValue() {}
|
||||
SignaledType(Type b) : mValue(b) {}
|
||||
|
||||
boost::signals2::connection connect(const typename Signal::slot_type& slot) { return mSignal.connect(slot); }
|
||||
|
||||
SignaledType& operator =(Type val)
|
||||
{
|
||||
if (val != mValue)
|
||||
{
|
||||
mValue = val;
|
||||
mSignal();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
operator Type() const { return mValue; }
|
||||
|
||||
private:
|
||||
Signal mSignal;
|
||||
Type mValue;
|
||||
};
|
||||
|
||||
typedef enum e_export_support
|
||||
{
|
||||
EXPORT_UNDEFINED = 0,
|
||||
EXPORT_ALLOWED,
|
||||
EXPORT_DENIED
|
||||
} ExportSupport;
|
||||
|
||||
class LFSimFeatureHandler : public LLSingleton<LFSimFeatureHandler>
|
||||
{
|
||||
protected:
|
||||
friend class LLSingleton<LFSimFeatureHandler>;
|
||||
LFSimFeatureHandler();
|
||||
|
||||
public:
|
||||
void handleRegionChange();
|
||||
void setSupportedFeatures();
|
||||
|
||||
// Connection setters
|
||||
boost::signals2::connection setSupportsExportCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setSearchURLCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setSayRangeCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setShoutRangeCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setWhisperRangeCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
|
||||
// Accessors
|
||||
bool simSupportsExport() const { return mSupportsExport; }
|
||||
std::string mapServerURL() const { return mMapServerURL; }
|
||||
std::string searchURL() const { return mSearchURL; }
|
||||
U32 sayRange() const { return mSayRange; }
|
||||
U32 shoutRange() const { return mShoutRange; }
|
||||
U32 whisperRange() const { return mWhisperRange; }
|
||||
ExportSupport exportPolicy() const;
|
||||
|
||||
private:
|
||||
// SignaledTypes
|
||||
SignaledType<bool> mSupportsExport;
|
||||
std::string mMapServerURL;
|
||||
SignaledType<std::string> mSearchURL;
|
||||
SignaledType<U32> mSayRange;
|
||||
SignaledType<U32> mShoutRange;
|
||||
SignaledType<U32> mWhisperRange;
|
||||
};
|
||||
|
||||
#endif //LFSIMFEATUREHANDLER_H
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
#include "llnotificationsutil.h"
|
||||
#include "llvoiceclient.h"
|
||||
|
||||
#include "llworld.h" // <FS:CR> Aurora Sim
|
||||
#include "lfsimfeaturehandler.h" // <FS:CR> Opensim
|
||||
|
||||
bool LLAvatarListItem::sStaticInitialized = false;
|
||||
S32 LLAvatarListItem::sLeftPadding = 0;
|
||||
|
|
@ -475,15 +475,15 @@ void LLAvatarListItem::setRange(F32 distance)
|
|||
// Get default style params
|
||||
LLStyle::Params rangeHighlight = LLStyle::Params();
|
||||
|
||||
// <FS:CR> Aurora Sim
|
||||
// <FS:CR> Opensim
|
||||
//if (mUseRangeColors && mDistance > CHAT_NORMAL_RADIUS)
|
||||
if (mUseRangeColors && mDistance > LLWorld::getInstance()->getSayDistance())
|
||||
// </FS:CR> Aurora Sim
|
||||
if (mUseRangeColors && mDistance > LFSimFeatureHandler::getInstance()->sayRange())
|
||||
// </FS:CR> Opensim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
// <FS:CR> Opensim
|
||||
//if (mDistance < CHAT_SHOUT_RADIUS)
|
||||
if (mDistance < LLWorld::getInstance()->getShoutDistance())
|
||||
// </FS:CR> Aurora Sim
|
||||
if (mDistance < LFSimFeatureHandler::getInstance()->shoutRange())
|
||||
// </FS:CR> Opensim
|
||||
{
|
||||
rangeHighlight.color = mShoutRangeColor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#include "llweb.h"
|
||||
|
||||
#include "llviewernetwork.h"// </FS:AW opensim search support>
|
||||
#include "llviewerregion.h" // <FS:CR> Opensim search support
|
||||
#include "lfsimfeaturehandler.h" // <FS:CR> Opensim search support
|
||||
|
||||
// support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps
|
||||
class LLSearchHandler : public LLCommandHandler
|
||||
|
|
@ -224,7 +224,7 @@ void LLFloaterSearch::search(const SearchQuery &p)
|
|||
}
|
||||
else if(LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
std::string os_search_url = gAgent.getRegion()->getSearchServerURL();
|
||||
std::string os_search_url = LFSimFeatureHandler::instance().searchURL();
|
||||
if (!os_search_url.empty())
|
||||
url = os_search_url;
|
||||
else if (LLLoginInstance::getInstance()->hasResponse("search"))
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
#include "llmutelist.h"
|
||||
#include "lfsimfeaturehandler.h"
|
||||
|
||||
// Ansariel: For accessing the radar data
|
||||
#include "fsradar.h"
|
||||
|
|
@ -721,12 +722,12 @@ void LLNetMap::draw()
|
|||
static LLUICachedControl<bool> chat_ring("MiniMapChatRing", true);
|
||||
if(chat_ring)
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
// <FS:CR> Opensim
|
||||
//drawRing(20.0, pos_map, map_chat_ring_color);
|
||||
//drawRing(100.0, pos_map, map_shout_ring_color);
|
||||
drawRing(LLWorld::getInstance()->getSayDistance(), pos_map, map_chat_ring_color);
|
||||
drawRing(LLWorld::getInstance()->getShoutDistance(), pos_map, map_shout_ring_color);
|
||||
// </FS:CR> Aurora Sim
|
||||
drawRing(LFSimFeatureHandler::getInstance()->sayRange(), pos_map, map_chat_ring_color);
|
||||
drawRing(LFSimFeatureHandler::getInstance()->shoutRange(), pos_map, map_shout_ring_color);
|
||||
// </FS:CR> Opensim
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ class OpenRegionInfoUpdate : public LLHTTPNode
|
|||
{
|
||||
regionlimits->setAllowRenderWater(body["RenderWater"].asInteger() == 1 ? TRUE : FALSE);
|
||||
}
|
||||
#if 0 // *FIXME
|
||||
if ( body.has("SayDistance") )
|
||||
{
|
||||
regionlimits->setSayDistance(body["SayDistance"].asReal());
|
||||
|
|
@ -178,6 +179,7 @@ class OpenRegionInfoUpdate : public LLHTTPNode
|
|||
{
|
||||
regionlimits->setWhisperDistance(body["WhisperDistance"].asReal());
|
||||
}
|
||||
#endif // FIXME
|
||||
if ( body.has("ToggleTeenMode") )
|
||||
{
|
||||
regionlimits->setEnableTeenMode(body["ToggleTeenMode"].asInteger() == 1 ? TRUE : FALSE);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@
|
|||
#include "llvoavatar.h"
|
||||
#include "llworld.h"
|
||||
|
||||
#include "lfsimfeaturehandler.h" // <FS:CR> Opensim
|
||||
|
||||
extern LLControlGroup gSavedSettings;
|
||||
|
||||
const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f);
|
||||
|
|
@ -1026,10 +1028,10 @@ void LLLocalSpeakerMgr::updateSpeakerList()
|
|||
// pick up non-voice speakers in chat range
|
||||
uuid_vec_t avatar_ids;
|
||||
std::vector<LLVector3d> positions;
|
||||
// <FS:CR> Aurora Sim
|
||||
// <FS:CR> Opensim
|
||||
//LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), CHAT_NORMAL_RADIUS);
|
||||
LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), LLWorld::getInstance()->getSayDistance());
|
||||
// </FS:CR> Aurora Sim
|
||||
LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), LFSimFeatureHandler::getInstance()->sayRange());
|
||||
// </FS:CR> Opensim
|
||||
for(U32 i=0; i<avatar_ids.size(); i++)
|
||||
{
|
||||
setSpeaker(avatar_ids[i]);
|
||||
|
|
@ -1043,11 +1045,11 @@ void LLLocalSpeakerMgr::updateSpeakerList()
|
|||
if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
|
||||
{
|
||||
LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id);
|
||||
// <FS:CR> Aurora Sim
|
||||
F32 say_distance_squared = (LLWorld::getInstance()->getSayDistance() * LLWorld::getInstance()->getSayDistance());
|
||||
// <FS:CR> Opensim
|
||||
F32 say_distance_squared = (LFSimFeatureHandler::getInstance()->sayRange() * LFSimFeatureHandler::getInstance()->sayRange());
|
||||
if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > say_distance_squared)
|
||||
//if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS_SQUARED)
|
||||
// </FS:CR> Aurora Sim
|
||||
// </FS:CR> Opensim
|
||||
{
|
||||
setSpeakerNotInChannel(speakerp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "lggcontactsets.h"
|
||||
#include "rlvhandler.h"
|
||||
|
||||
#include "lfsimfeaturehandler.h" // <FS:CR> Opensim
|
||||
#include "growlmanager.h" // <FS:LO> Growl include
|
||||
|
||||
|
||||
|
|
@ -144,11 +145,11 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color, bool is_l
|
|||
{
|
||||
LLVector3 pos_agent = gAgent.getPositionAgent();
|
||||
F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent);
|
||||
// <FS:CR> Aurora Sim
|
||||
// <FS:CR> Opensim
|
||||
//F32 dist_near_chat = gAgent.getNearChatRadius();
|
||||
//if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > say_distance_squared)
|
||||
F32 dist_near_chat = LLWorld::getInstance()->getSayDistance();
|
||||
// </FS:CR> Aurora Sim
|
||||
F32 dist_near_chat = LFSimFeatureHandler::getInstance()->sayRange();
|
||||
// </FS:CR> Opensim
|
||||
if (distance_squared > dist_near_chat * dist_near_chat)
|
||||
{
|
||||
// diminish far-off chat
|
||||
|
|
@ -222,10 +223,10 @@ void LLViewerChat::getChatColor(const LLChat& chat, std::string& r_color_name, F
|
|||
{
|
||||
LLVector3 pos_agent = gAgent.getPositionAgent();
|
||||
F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent);
|
||||
// <FS:CR> Aurora som
|
||||
// <FS:CR> Opensim
|
||||
//F32 dist_near_chat = gAgent.getNearChatRadius();
|
||||
F32 dist_near_chat = LLWorld::getInstance()->getSayDistance();
|
||||
// </FS:CR> Aurora sim
|
||||
F32 dist_near_chat = LFSimFeatureHandler::getInstance()->sayRange();
|
||||
// </FS:CR> Opensim
|
||||
if (distance_squared > dist_near_chat * dist_near_chat)
|
||||
{
|
||||
// diminish far-off chat
|
||||
|
|
|
|||
|
|
@ -1826,12 +1826,6 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
|
|||
capabilityNames.append("ViewerStartAuction");
|
||||
capabilityNames.append("ViewerStats");
|
||||
|
||||
// <FS:CR> OpenSim
|
||||
#ifdef OPENSIM
|
||||
capabilityNames.append("OpenSimExtras");
|
||||
#endif // OPENSIM
|
||||
// </FS:CR>
|
||||
|
||||
// Please add new capabilities alphabetically to reduce
|
||||
// merge conflicts.
|
||||
}
|
||||
|
|
@ -2170,51 +2164,3 @@ U32 LLViewerRegion::getMaxMaterialsPerTransaction() const
|
|||
}
|
||||
return max_entries;
|
||||
}
|
||||
|
||||
|
||||
// <FS:CR> OpenSim Extras support
|
||||
LLViewerRegion::EOSExportSupport LLViewerRegion::regionSupportsExport() const
|
||||
{
|
||||
#ifndef OPENSIM
|
||||
return EXPORT_UNDEFINED; // Second Life regions never support export.
|
||||
}
|
||||
#else // OPENSIM
|
||||
EOSExportSupport export_support = EXPORT_UNDEFINED;
|
||||
if ((mSimulatorFeatures.has("OpenSimExtras"))
|
||||
&& (mSimulatorFeatures["OpenSimExtras"].has("ExportSupported")))
|
||||
{
|
||||
if (mSimulatorFeatures["OpenSimExtras"]["ExportSupported"].asBoolean())
|
||||
{
|
||||
export_support = EXPORT_ALLOWED;
|
||||
}
|
||||
else
|
||||
{
|
||||
export_support = EXPORT_DENIED;
|
||||
}
|
||||
}
|
||||
return export_support;
|
||||
}
|
||||
|
||||
// HG Maps
|
||||
std::string LLViewerRegion::getHGMapServerURL() const
|
||||
{
|
||||
std::string url = "";
|
||||
if (mSimulatorFeatures.has("OpenSimExtras") && mSimulatorFeatures["OpenSimExtras"].has("map-server-url"))
|
||||
{
|
||||
url = mSimulatorFeatures["OpenSimExtras"]["map-server-url"].asString();
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
// OS Search URL
|
||||
std::string LLViewerRegion::getSearchServerURL() const
|
||||
{
|
||||
std::string url = "";
|
||||
if (mSimulatorFeatures.has("OpenSimExtras") && mSimulatorFeatures["OpenSimExtras"].has("search-server-url"))
|
||||
{
|
||||
url = mSimulatorFeatures["OpenSimExtras"]["search-server-url"].asString();
|
||||
}
|
||||
return url;
|
||||
}
|
||||
#endif // OPENSIM
|
||||
// </FS:CR>
|
||||
|
|
|
|||
|
|
@ -319,18 +319,8 @@ public:
|
|||
|
||||
bool dynamicPathfindingEnabled() const;
|
||||
|
||||
// <FS:CR> Opensim Extras support
|
||||
typedef enum e_os_export_support
|
||||
{
|
||||
EXPORT_UNDEFINED = 0,
|
||||
EXPORT_ALLOWED,
|
||||
EXPORT_DENIED
|
||||
} EOSExportSupport;
|
||||
|
||||
EOSExportSupport regionSupportsExport() const; // ExportSupports
|
||||
// </FS:CR>
|
||||
#ifdef OPENSIM
|
||||
std::string getHGMapServerURL() const; // HG Maps
|
||||
std::string getSearchServerURL() const; // OS Search URL
|
||||
std::set<std::string> getGods() { return mGodNames; };
|
||||
#endif // OPENSIM
|
||||
// </FS:CR>
|
||||
|
|
|
|||
|
|
@ -108,16 +108,16 @@
|
|||
#include "llsdserialize.h"
|
||||
|
||||
#include "fsdata.h"
|
||||
#include "llcontrol.h"
|
||||
#include "lggcontactsets.h"
|
||||
#include "llfilepicker.h" // <FS:CR> FIRE-8893 - Dump archetype xml to user defined location
|
||||
#include "lfsimfeaturehandler.h" // <FS:CR> Opensim
|
||||
|
||||
extern F32 SPEED_ADJUST_MAX;
|
||||
extern F32 SPEED_ADJUST_MAX_SEC;
|
||||
extern F32 ANIM_SPEED_MAX;
|
||||
extern F32 ANIM_SPEED_MIN;
|
||||
|
||||
#include "llcontrol.h"
|
||||
#include "lggcontactsets.h"
|
||||
#include "llfilepicker.h" // <FS:CR> FIRE-8893 - Dump archetype xml to user defined location
|
||||
|
||||
// #define OUTPUT_BREAST_DATA
|
||||
|
||||
using namespace LLAvatarAppearanceDefines;
|
||||
|
|
@ -2749,9 +2749,9 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
|
|||
if (!firstname || !lastname) return;
|
||||
|
||||
// <FS:Ansariel> OpenSim chat distance compatibility
|
||||
static const F32 chat_range_whisper_squared = LLWorld::getInstance()->getWhisperDistance() * LLWorld::getInstance()->getWhisperDistance();
|
||||
static const F32 chat_range_say_squared = LLWorld::getInstance()->getSayDistance() * LLWorld::getInstance()->getSayDistance();
|
||||
static const F32 chat_range_shout_squared = LLWorld::getInstance()->getShoutDistance() * LLWorld::getInstance()->getShoutDistance();
|
||||
static const F32 chat_range_whisper_squared = LFSimFeatureHandler::getInstance()->whisperRange() * LFSimFeatureHandler::getInstance()->whisperRange();
|
||||
static const F32 chat_range_say_squared = LFSimFeatureHandler::getInstance()->sayRange() * LFSimFeatureHandler::getInstance()->sayRange();
|
||||
static const F32 chat_range_shout_squared = LFSimFeatureHandler::getInstance()->shoutRange() * LFSimFeatureHandler::getInstance()->shoutRange();
|
||||
// </FS:Ansariel>
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
|
||||
|
|
|
|||
|
|
@ -189,10 +189,6 @@ void LLWorld::refreshLimits()
|
|||
mEnforceMaxBuild = FALSE;
|
||||
mLockedDrawDistance = FALSE;
|
||||
|
||||
mWhisperDistance = CHAT_WHISPER_RADIUS;
|
||||
mSayDistance = CHAT_NORMAL_RADIUS;
|
||||
mShoutDistance = CHAT_SHOUT_RADIUS;
|
||||
|
||||
mDrawDistance = -1.f;
|
||||
mTerrainDetailScale = -1.f;
|
||||
|
||||
|
|
@ -233,10 +229,6 @@ void LLWorld::refreshLimits()
|
|||
mEnforceMaxBuild = FALSE;
|
||||
mLockedDrawDistance = FALSE;
|
||||
|
||||
mWhisperDistance = CHAT_WHISPER_RADIUS;
|
||||
mSayDistance = CHAT_NORMAL_RADIUS;
|
||||
mShoutDistance = CHAT_SHOUT_RADIUS;
|
||||
|
||||
mDrawDistance = -1.f;
|
||||
mTerrainDetailScale = -1.f;
|
||||
|
||||
|
|
@ -388,30 +380,6 @@ void LLWorld::setMinPrimZPos(F32 val)
|
|||
mMinPrimZPos = val;
|
||||
}
|
||||
|
||||
void LLWorld::setWhisperDistance(F32 val)
|
||||
{
|
||||
if(val <= 0.0f)
|
||||
mWhisperDistance = CHAT_WHISPER_RADIUS;
|
||||
else
|
||||
mWhisperDistance = val;
|
||||
}
|
||||
|
||||
void LLWorld::setSayDistance(F32 val)
|
||||
{
|
||||
if(val <= 0.0f)
|
||||
mSayDistance = CHAT_NORMAL_RADIUS;
|
||||
else
|
||||
mSayDistance = val;
|
||||
}
|
||||
|
||||
void LLWorld::setShoutDistance(F32 val)
|
||||
{
|
||||
if(val < 0.0f)
|
||||
mShoutDistance = CHAT_SHOUT_RADIUS;
|
||||
else
|
||||
mShoutDistance = val;
|
||||
}
|
||||
|
||||
void LLWorld::setDrawDistance(F32 val)
|
||||
{
|
||||
if(val < 0.0f)
|
||||
|
|
|
|||
|
|
@ -150,10 +150,6 @@ public:
|
|||
BOOL getEnforceMaxBuild() const { return mEnforceMaxBuild; }
|
||||
BOOL getLockedDrawDistance() const { return mLockedDrawDistance; }
|
||||
|
||||
F32 getWhisperDistance() const { return mWhisperDistance; }
|
||||
F32 getSayDistance() const { return mSayDistance; }
|
||||
F32 getShoutDistance() const { return mShoutDistance; }
|
||||
|
||||
F32 getDrawDistance() const { return mDrawDistance; }
|
||||
F32 getTerrainDetailScale() const { return mTerrainDetailScale; }
|
||||
|
||||
|
|
@ -186,10 +182,6 @@ public:
|
|||
void setEnableTeenMode(BOOL val);
|
||||
void setEnforceMaxBuild(BOOL val);
|
||||
void setLockedDrawDistance(BOOL val);
|
||||
|
||||
void setWhisperDistance(F32 val);
|
||||
void setSayDistance(F32 val);
|
||||
void setShoutDistance(F32 val);
|
||||
|
||||
void setDrawDistance(F32 val);
|
||||
void setTerrainDetailScale(F32 val);
|
||||
|
|
@ -295,10 +287,6 @@ private:
|
|||
BOOL mEnforceMaxBuild;
|
||||
BOOL mLockedDrawDistance;
|
||||
|
||||
F32 mWhisperDistance;
|
||||
F32 mSayDistance;
|
||||
F32 mShoutDistance;
|
||||
|
||||
F32 mDrawDistance;
|
||||
F32 mTerrainDetailScale;
|
||||
// <FS:CR> Aurora Sim
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
|
||||
// <FS:CR> HG maps
|
||||
#ifdef OPENSIM
|
||||
#include "lfsimfeaturehandler.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llagent.h"
|
||||
#endif // OPENSIM
|
||||
// </FS:CR>
|
||||
|
|
@ -194,11 +194,7 @@ LLPointer<LLViewerFetchedTexture> LLWorldMipmap::loadObjectsTile(U32 grid_x, U32
|
|||
std::string hg_map;
|
||||
if (LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (region)
|
||||
{
|
||||
hg_map = region->getHGMapServerURL();
|
||||
}
|
||||
hg_map = LFSimFeatureHandler::instance().mapServerURL();
|
||||
}
|
||||
std::string imageurl = hg_map.empty() ? gSavedSettings.getString("CurrentMapServerURL") : hg_map;
|
||||
imageurl.append(llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y));
|
||||
|
|
|
|||
Loading…
Reference in New Issue