Merge branch 'master' of git@github.com:singularity-viewer/SingularityViewer.git

This commit is contained in:
Shyotl
2014-09-07 15:46:05 -05:00
235 changed files with 2743 additions and 2127 deletions

View File

@@ -307,8 +307,10 @@ public:
virtual ~StaticRegistrar() {}
StaticRegistrar(ref_const_key_t key, ref_const_value_t value)
{
if(!singleton_t::instance().mStaticScope)
mStaticScope = new ScopedRegistrar();
if (singleton_t::instance().exists(key))
{
llerrs << "Duplicate registry entry under key \"" << key << "\"" << llendl;
}
singleton_t::instance().mStaticScope->add(key, value);
}
};
@@ -338,7 +340,7 @@ protected:
virtual void initSingleton()
{
//mStaticScope = new ScopedRegistrar();
mStaticScope = new ScopedRegistrar();
}
virtual ~LLRegistrySingleton()

View File

@@ -28,5 +28,5 @@
#include "llsingleton.h"
std::map<std::string, void *> * LLSingletonRegistry::sSingletonMap = NULL;
std::map<std::string, void*>* LLSingletonRegistry::sSingletonMap = NULL;

View File

@@ -33,34 +33,25 @@
/// @brief A global registry of all singletons to prevent duplicate allocations
/// across shared library boundaries
class LL_COMMON_API LLSingletonRegistry {
private:
typedef std::map<std::string, void *> TypeMap;
static TypeMap * sSingletonMap;
class LL_COMMON_API LLSingletonRegistry
{
typedef std::map<std::string, void *> TypeMap;
static TypeMap* sSingletonMap;
static void checkInit()
{
if(sSingletonMap == NULL)
{
sSingletonMap = new TypeMap();
}
}
public:
template<typename T> static void * & get()
{
std::string name(typeid(T).name());
if (!sSingletonMap) sSingletonMap = new TypeMap();
public:
template<typename T> static void * & get()
{
std::string name(typeid(T).name());
// the first entry of the pair returned by insert will be either the existing
// iterator matching our key, or the newly inserted NULL initialized entry
// see "Insert element" in http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html
TypeMap::iterator result =
sSingletonMap->insert(std::make_pair(name, (void*)NULL)).first;
checkInit();
// the first entry of the pair returned by insert will be either the existing
// iterator matching our key, or the newly inserted NULL initialized entry
// see "Insert element" in http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html
TypeMap::iterator result =
sSingletonMap->insert(std::make_pair(name, (void*)NULL)).first;
return result->second;
}
return result->second;
}
};
// LLSingleton implements the getInstance() method part of the Singleton
@@ -90,7 +81,7 @@ class LL_COMMON_API LLSingletonRegistry {
template <typename DERIVED_TYPE>
class LLSingleton : private boost::noncopyable
{
private:
typedef enum e_init_state
{
@@ -100,34 +91,46 @@ private:
INITIALIZED,
DELETED
} EInitState;
// stores pointer to singleton instance
// and tracks initialization state of singleton
struct SingletonInstanceData
{
EInitState mInitState;
DERIVED_TYPE* mSingletonInstance;
SingletonInstanceData()
: mSingletonInstance(NULL),
mInitState(UNINITIALIZED)
{}
~SingletonInstanceData()
static DERIVED_TYPE* constructSingleton()
{
return new DERIVED_TYPE();
}
struct SingletonData;
// stores pointer to singleton instance
struct SingletonLifetimeManager
{
SingletonLifetimeManager()
{
if (mInitState != DELETED)
construct();
}
static void construct()
{
SingletonData& sData(getData());
sData.mInitState = CONSTRUCTING;
sData.mInstance = constructSingleton();
sData.mInitState = INITIALIZING;
}
~SingletonLifetimeManager()
{
SingletonData& sData(getData());
if (sData.mInitState != DELETED)
{
deleteSingleton();
}
}
};
public:
virtual ~LLSingleton()
{
SingletonInstanceData& data = getData();
data.mSingletonInstance = NULL;
data.mInitState = DELETED;
SingletonData& sData(getData());
sData.mInstance = NULL;
sData.mInitState = DELETED;
}
/**
@@ -152,37 +155,66 @@ public:
*/
static void deleteSingleton()
{
DERIVED_TYPE* instance = getData().mSingletonInstance;
getData().mInitState = DELETED;
getData().mSingletonInstance = NULL;
delete instance;
SingletonData& sData(getData());
delete sData.mInstance;
sData.mInstance = NULL;
sData.mInitState = DELETED;
}
static SingletonInstanceData& getData()
static SingletonData& getData()
{
// this is static to cache the lookup results
static void * & registry = LLSingletonRegistry::get<DERIVED_TYPE>();
// *TODO - look into making this threadsafe
if(NULL == registry)
if (!registry)
{
static SingletonInstanceData data;
static SingletonData data;
registry = &data;
}
return *static_cast<SingletonInstanceData *>(registry);
return *static_cast<SingletonData *>(registry);
}
static DERIVED_TYPE* getInstance()
{
SingletonInstanceData& data = getData();
static SingletonLifetimeManager sLifeTimeMgr;
SingletonData& sData(getData());
if (data.mInitState != INITIALIZED)
switch (sData.mInitState)
{
createInstance(data);
case UNINITIALIZED:
// should never be uninitialized at this point
llassert(false);
return NULL;
case CONSTRUCTING:
llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << LL_ENDL;
return NULL;
case INITIALIZING:
// go ahead and flag ourselves as initialized so we can be reentrant during initialization
sData.mInitState = INITIALIZED;
// initialize singleton after constructing it so that it can reference other singletons which in turn depend on it,
// thus breaking cyclic dependencies
sData.mInstance->initSingleton();
return sData.mInstance;
case INITIALIZED:
return sData.mInstance;
case DELETED:
llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << LL_ENDL;
SingletonLifetimeManager::construct();
// same as first time construction
sData.mInitState = INITIALIZED;
sData.mInstance->initSingleton();
return sData.mInstance;
}
return data.mSingletonInstance;
return NULL;
}
static DERIVED_TYPE* getIfExists()
{
SingletonData& sData(getData());
return sData.mInstance;
}
// Reference version of getInstance()
@@ -191,51 +223,34 @@ public:
{
return *getInstance();
}
// Has this singleton been created uet?
// Use this to avoid accessing singletons before the can safely be constructed
static bool instanceExists()
{
return getData().mInitState == INITIALIZED;
SingletonData& sData(getData());
return sData.mInitState == INITIALIZED;
}
// Has this singleton already been deleted?
// Use this to avoid accessing singletons from a static object's destructor
static bool destroyed()
{
return getData().mInitState == DELETED;
SingletonData& sData(getData());
return sData.mInitState == DELETED;
}
private:
static void createInstance(SingletonInstanceData& data);
virtual void initSingleton() {}
struct SingletonData
{
// explicitly has a default constructor so that member variables are zero initialized in BSS
// and only changed by singleton logic, not constructor running during startup
EInitState mInitState;
DERIVED_TYPE* mInstance;
};
};
// Moved this here cause it's too big to be inlined --Aleric.
template<typename DERIVED_TYPE>
void LLSingleton<DERIVED_TYPE>::createInstance(SingletonInstanceData& data)
{
if (data.mInitState == CONSTRUCTING)
{
llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << llendl;
}
if (data.mInitState == DELETED)
{
llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl;
}
if (data.mInitState == INITIALIZING)
{
llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from initSingleton(), using half-initialized object" << llendl;
return;
}
data.mInitState = CONSTRUCTING;
data.mSingletonInstance = new DERIVED_TYPE();
data.mInitState = INITIALIZING;
data.mSingletonInstance->initSingleton();
data.mInitState = INITIALIZED;
}
#endif

View File

@@ -905,12 +905,8 @@ AIHTTPTimeoutPolicy const* AIHTTPTimeoutPolicy::getTimeoutPolicyByName(std::stri
#define P2(n, b) AIHTTPTimeoutPolicy n##_timeout(#n, b)
// Policy name Policy
//P(accountingCostResponder);
P(agentStateResponder);
P(appearanceChangeMetricsResponder);
P(assetUploadResponder);
P(assetReportHandler);
P(asyncConsoleResponder);
P(avatarPickerResponder);
P(authHandler);
P(avatarNameResponder);
@@ -918,15 +914,11 @@ P2(baseCapabilitiesComplete, transfer_18s_connect_5s);
P(blockingLLSDPost);
P(blockingLLSDGet);
P(blockingRawGet);
P(charactersResponder);
P(checkAgentAppearanceServiceResponder);
P(classifiedStatsResponder);
P(consoleResponder);
P(createInventoryCategoryResponder);
P(emeraldDicDownloader);
P(environmentApplyResponder);
P(environmentRequestResponder);
P(estateChangeInfoResponder);
P2(eventPollResponder, reply_60s);
P(fetchInventoryResponder);
P(fetchScriptLimitsAttachmentInfoResponder);
@@ -960,12 +952,8 @@ P2(meshPhysicsShapeResponder, connect_30s);
P2(meshSkinInfoResponder, connect_30s);
P(mimeDiscoveryResponder);
P(moderationResponder);
P(navMeshRebakeResponder);
P(navMeshResponder);
P(navMeshStatusResponder);
P(newAgentInventoryVariablePriceResponder);
P(objectCostResponder);
P(objectLinksetsResponder);
P(physicsFlagsResponder);
P(productInfoRequestResponder);
P(regionResponder);
@@ -977,7 +965,6 @@ P(setDisplayNameResponder);
P2(simulatorFeaturesReceived, transfer_22s_connect_10s);
P(startConferenceChatResponder);
P2(startGroupVoteResponder, transfer_300s);
P(terrainLinksetsResponder);
P(translationReceiver);
P(uploadModelPremissionsResponder);
P(userReportResponder);

View File

@@ -28,6 +28,7 @@
#define LL_LLKEYBOARD_H
#include <map>
#include <boost/function.hpp>
#include "string_table.h"
#include "lltimer.h"
@@ -40,7 +41,7 @@ enum EKeystate
KEYSTATE_UP
};
typedef void (*LLKeyFunc)(EKeystate keystate);
typedef boost::function<void(EKeystate keystate)> LLKeyFunc;
enum EKeyboardInsertMode
{

View File

@@ -124,6 +124,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>AlchemyRainbowEffects</key>
<map>
<key>Comment</key>
<string>Makes agent effects rainbows!</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>AlchemyRegionRestartShake</key>
<map>
<key>Comment</key>

View File

@@ -162,7 +162,7 @@ void HBFloaterGroupTitles::onActivate(void* userdata)
void update_titles_list(HBFloaterGroupTitles* self)
{
S32 i;
S32 count = gAgent.mGroups.count();
S32 count = gAgent.mGroups.size();
LLUUID id;
LLUUID highlight_id = LLUUID::null;
LLUUID current_group_id = gAgent.getGroupID();
@@ -178,7 +178,7 @@ void update_titles_list(HBFloaterGroupTitles* self)
for (i = 0; i < count; ++i)
{
group_datap = &gAgent.mGroups.get(i);
group_datap = &gAgent.mGroups[i];
id = group_datap->mID;
if (self->mFirstUse)
{

View File

@@ -20,7 +20,6 @@
#include "lfsimfeaturehandler.h"
#include "llagent.h"
#include "llenvmanager.h"
#include "llviewerregion.h"
#include "hippogridmanager.h"
@@ -33,7 +32,7 @@ LFSimFeatureHandler::LFSimFeatureHandler()
, mWhisperRange(10)
{
if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features
LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this));
gAgent.addRegionChangedCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this));
}
ExportPolicy LFSimFeatureHandler::exportPolicy() const

View File

@@ -103,6 +103,7 @@
#include "lluictrlfactory.h" //For LLUICtrlFactory::getLayeredXMLNode
#include "hippolimits.h" // for getMaxAgentGroups
// [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a)
#include "rlvactions.h"
#include "rlvhandler.h"
@@ -246,6 +247,7 @@ protected:
private:
};
//--------------------------------------------------------------------
// Statics
//
@@ -272,11 +274,10 @@ void LLAgentFriendObserver::changed(U32 mask)
}
}
// static
void LLAgent::parcelChangedCallback()
void LLAgent::setCanEditParcel() // called via mParcelChangedSignal
{
bool can_edit = LLToolMgr::getInstance()->canEdit();
gAgent.mCanEditParcel = can_edit;
}
@@ -435,6 +436,8 @@ LLAgent::LLAgent() :
mControlsTakenCount[i] = 0;
mControlsTakenPassedOnCount[i] = 0;
}
addParcelChangedCallback(&setCanEditParcel);
}
// Requires gSavedSettings to be initialized.
@@ -444,10 +447,10 @@ LLAgent::LLAgent() :
void LLAgent::init()
{
// *Note: this is where LLViewerCamera::getInstance() used to be constructed.
setFlying( gSavedSettings.getBOOL("FlyingAtExit") );
// LLDebugVarMessageBox::show("Camera Lag", &CAMERA_FOCUS_HALF_LIFE, 0.5f, 0.01f);
*mEffectColor = gSavedSettings.getColor4("EffectColor");
@@ -458,8 +461,6 @@ void LLAgent::init()
mLastKnownRequestMaturity = mLastKnownResponseMaturity;
mIsDoSendMaturityPreferenceToServer = true;
LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback));
if (!mTeleportFinishedSlot.connected())
{
mTeleportFinishedSlot = LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(boost::bind(&LLAgent::handleTeleportFinished, this));
@@ -706,8 +707,7 @@ BOOL LLAgent::canFly()
// <edit>
static const LLCachedControl<bool> ascent_fly_always_enabled("AscentFlyAlwaysEnabled",false);
if(ascent_fly_always_enabled)
return TRUE;
if(ascent_fly_always_enabled) return TRUE;
// </edit>
LLViewerRegion* regionp = getRegion();
@@ -759,10 +759,7 @@ void LLAgent::setFlying(BOOL fly)
if (fly)
{
// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.0d) | Modified: RLVa-1.0.0c
if (gRlvHandler.hasBehaviour(RLV_BHVR_FLY))
{
return;
}
if (gRlvHandler.hasBehaviour(RLV_BHVR_FLY)) return;
// [/RLVa:KB]
BOOL was_flying = getFlying();
@@ -858,22 +855,30 @@ void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id)
}
}
void LLAgent::changeParcels()
{
LL_DEBUGS("AgentLocation") << "Calling ParcelChanged callbacks" << LL_ENDL;
// Notify anything that wants to know about parcel changes
mParcelChangedSignal();
}
boost::signals2::connection LLAgent::addParcelChangedCallback(parcel_changed_callback_t cb)
{
return mParcelChangedSignal.connect(cb);
}
//-----------------------------------------------------------------------------
// setRegion()
//-----------------------------------------------------------------------------
void LLAgent::setRegion(LLViewerRegion *regionp)
{
bool teleport = true;
llassert(regionp);
if (mRegionp != regionp)
{
// std::string host_name;
// host_name = regionp->getHost().getHostName();
std::string ip = regionp->getHost().getString();
llinfos << "Moving agent into region: " << regionp->getName()
<< " located at " << ip << llendl;
LL_INFOS("AgentLocation") << "Moving agent into region: " << regionp->getName()
<< " located at " << ip << LL_ENDL;
if (mRegionp)
{
// NaCl - Antispam Registry
@@ -905,9 +910,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
{
gSky.mVOGroundp->setRegion(regionp);
}
// Notify windlight managers
teleport = (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE);
}
else
{
@@ -929,6 +931,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
// Pass new region along to metrics components that care about this level of detail.
LLAppViewer::metricsUpdateRegion(regionp->getHandle());
}
mRegionp = regionp;
// Must shift hole-covering water object locations because local
@@ -943,33 +946,18 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
LLSelectMgr::getInstance()->updateSelectionCenter();
if (teleport)
{
LLEnvManagerNew::instance().onTeleport();
}
else
{
LLEnvManagerNew::instance().onRegionCrossing();
}
// If the newly entered region is using server bakes, and our
// current appearance is non-baked, request appearance update from
// server.
if (mRegionp->capabilitiesReceived())
{
handleServerBakeRegionTransition(mRegionp->getRegionID());
}
else
{
// Need to handle via callback after caps arrive.
mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition,this,_1));
}
LL_DEBUGS("AgentLocation") << "Calling RegionChanged callbacks" << LL_ENDL;
mRegionChangedSignal();
}
//-----------------------------------------------------------------------------
// getRegion()
//-----------------------------------------------------------------------------
LLViewerRegion *LLAgent::getRegion() const
{
return mRegionp;
}
const LLHost& LLAgent::getRegionHost() const
{
@@ -983,6 +971,16 @@ const LLHost& LLAgent::getRegionHost() const
}
}
boost::signals2::connection LLAgent::addRegionChangedCallback(const region_changed_signal_t::slot_type& cb)
{
return mRegionChangedSignal.connect(cb);
}
void LLAgent::removeRegionChangedCallback(boost::signals2::connection callback)
{
mRegionChangedSignal.disconnect(callback);
}
//-----------------------------------------------------------------------------
// inPrelude()
//-----------------------------------------------------------------------------
@@ -1906,12 +1904,6 @@ std::ostream& operator<<(std::ostream &s, const LLAgent &agent)
return s;
}
// ------------------- Beginning of legacy LLCamera hack ----------------------
// This section is included for legacy LLCamera support until
// it is no longer needed. Some legacy code must exist in
// non-legacy functions, and is labeled with "// legacy" comments.
// TRUE if your own avatar needs to be rendered. Usually only
// in third person and build.
//-----------------------------------------------------------------------------
@@ -1950,8 +1942,8 @@ void LLAgent::startTyping()
if (mChatTimer.getElapsedTimeF32() < 2.f)
{
LLVOAvatar* chatter = gObjectList.findAvatar(mLastChatterID);
if (chatter)
LLViewerObject* chatter = gObjectList.findObject(mLastChatterID);
if (chatter && chatter->isAvatar())
{
gAgentCamera.setLookAt(LOOKAT_TARGET_RESPOND, chatter, LLVector3::zero);
}
@@ -1961,7 +1953,8 @@ void LLAgent::startTyping()
{
sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_START);
}
gChatBar->sendChatFromViewer("", CHAT_TYPE_START, FALSE);
gChatBar->
sendChatFromViewer("", CHAT_TYPE_START, FALSE);
}
//-----------------------------------------------------------------------------
@@ -1973,7 +1966,8 @@ void LLAgent::stopTyping()
{
clearRenderState(AGENT_STATE_TYPING);
sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_STOP);
gChatBar->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
gChatBar->
sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
}
}
@@ -2068,6 +2062,7 @@ void LLAgent::endAnimationUpdateUI()
mViewsPushed = FALSE;
}
gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR);
if( gMorphView )
{
@@ -2223,13 +2218,6 @@ void LLAgent::endAnimationUpdateUI()
LLToolMgr::getInstance()->setCurrentToolset(gFaceEditToolset);
LLFloaterMap::getInstance()->pushVisible(FALSE);
/*
LLView *view;
for (view = gFloaterView->getFirstChild(); view; view = gFloaterView->getNextChild())
{
view->pushVisible(FALSE);
}
*/
if( gMorphView )
{
@@ -2567,28 +2555,30 @@ int LLAgent::convertTextToMaturity(char text)
return LLAgentAccess::convertTextToMaturity(text);
}
extern AIHTTPTimeoutPolicy maturityPreferences_timeout;
class LLMaturityPreferencesResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(LLMaturityPreferencesResponder);
public:
LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity);
virtual ~LLMaturityPreferencesResponder();
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
protected:
virtual void httpSuccess();
virtual void httpFailure();
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return maturityPreferences_timeout; }
/*virtual*/ char const* getName(void) const { return "LLMaturityPreferencesResponder"; }
protected:
private:
U8 parseMaturityFromServerResponse(const LLSD &pContent);
U8 parseMaturityFromServerResponse(const LLSD &pContent) const;
LLAgent *mAgent;
U8 mPreferredMaturity;
U8 mPreviousMaturity;
};
LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity) :
LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity)
:
mAgent(pAgent),
mPreferredMaturity(pPreferredMaturity),
mPreviousMaturity(pPreviousMaturity)
@@ -2599,75 +2589,49 @@ LLMaturityPreferencesResponder::~LLMaturityPreferencesResponder()
{
}
void LLMaturityPreferencesResponder::httpSuccess(void)
void LLMaturityPreferencesResponder::httpSuccess()
{
U8 actualMaturity = parseMaturityFromServerResponse(mContent);
U8 actualMaturity = parseMaturityFromServerResponse(getContent());
if (actualMaturity != mPreferredMaturity)
{
llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity)
<< "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '"
<< LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast<U32>(actualMaturity) << ", llsd:"
<< mContent << "]" << llendl;
llwarns << "while attempting to change maturity preference from '"
<< LLViewerRegion::accessToString(mPreviousMaturity)
<< "' to '" << LLViewerRegion::accessToString(mPreferredMaturity)
<< "', the server responded with '"
<< LLViewerRegion::accessToString(actualMaturity)
<< "' [value:" << static_cast<U32>(actualMaturity)
<< "], " << dumpResponse() << llendl;
}
mAgent->handlePreferredMaturityResult(actualMaturity);
}
void LLMaturityPreferencesResponder::httpFailure(void)
void LLMaturityPreferencesResponder::httpFailure()
{
llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity)
<< "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error because '"
<< mReason << "' [status:" << mStatus << "]" << llendl;
llwarns << "while attempting to change maturity preference from '"
<< LLViewerRegion::accessToString(mPreviousMaturity)
<< "' to '" << LLViewerRegion::accessToString(mPreferredMaturity)
<< "', " << dumpResponse() << llendl;
mAgent->handlePreferredMaturityError();
}
U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent)
U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) const
{
// stinson 05/24/2012 Pathfinding regions have re-defined the response behavior. In the old server code,
// if you attempted to change the preferred maturity to the same value, the response content would be an
// undefined LLSD block. In the new server code with pathfinding, the response content should always be
// defined. Thus, the check for isUndefined() can be replaced with an assert after pathfinding is merged
// into server trunk and fully deployed.
U8 maturity = SIM_ACCESS_MIN;
if (pContent.isUndefined())
llassert(pContent.isDefined());
llassert(pContent.isMap());
llassert(pContent.has("access_prefs"));
llassert(pContent.get("access_prefs").isMap());
llassert(pContent.get("access_prefs").has("max"));
llassert(pContent.get("access_prefs").get("max").isString());
if (pContent.isDefined() && pContent.isMap() && pContent.has("access_prefs")
&& pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max")
&& pContent.get("access_prefs").get("max").isString())
{
maturity = mPreferredMaturity;
}
else
{
llassert(!pContent.isUndefined());
llassert(pContent.isMap());
if (!pContent.isUndefined() && pContent.isMap())
{
// stinson 05/24/2012 Pathfinding regions have re-defined the response syntax. The if statement catches
// the new syntax, and the else statement catches the old syntax. After pathfinding is merged into
// server trunk and fully deployed, we can remove the else statement.
if (pContent.has("access_prefs"))
{
llassert(pContent.has("access_prefs"));
llassert(pContent.get("access_prefs").isMap());
llassert(pContent.get("access_prefs").has("max"));
llassert(pContent.get("access_prefs").get("max").isString());
if (pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max") &&
pContent.get("access_prefs").get("max").isString())
{
LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString();
LLStringUtil::trim(actualPreference);
maturity = LLViewerRegion::shortStringToAccess(actualPreference);
}
}
else if (pContent.has("max"))
{
llassert(pContent.get("max").isString());
if (pContent.get("max").isString())
{
LLSD::String actualPreference = pContent.get("max").asString();
LLStringUtil::trim(actualPreference);
maturity = LLViewerRegion::shortStringToAccess(actualPreference);
}
}
}
LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString();
LLStringUtil::trim(actualPreference);
maturity = LLViewerRegion::shortStringToAccess(actualPreference);
}
return maturity;
@@ -2802,7 +2766,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
mLastKnownRequestMaturity = pPreferredMaturity;
// Create a response handler
boost::intrusive_ptr<LLMaturityPreferencesResponder> responderPtr = new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity);
boost::intrusive_ptr<LLHTTPClient::ResponderWithResult> responderPtr = boost::intrusive_ptr<LLHTTPClient::ResponderWithResult>(new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity));
// If we don't have a region, report it as an error
if (getRegion() == NULL)
@@ -2817,7 +2781,8 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
// If the capability is not defined, report it as an error
if (url.empty())
{
responderPtr->failureResult(0U, "capability 'UpdateAgentInformation' is not defined for region", LLSD());
responderPtr->failureResult(0U,
"capability 'UpdateAgentInformation' is not defined for region", LLSD());
}
else
{
@@ -2881,12 +2846,11 @@ void LLAgent::handleMaturity(const LLSD &pNewValue)
sendMaturityPreferenceToServer(static_cast<U8>(pNewValue.asInteger()));
}
//----------------------------------------------------------------------------
void LLAgent::buildFullname(std::string& name) const
{
if (isAgentAvatarValid())
{
name = gAgentAvatarp->getFullname();
}
if (isAgentAvatarValid()) name = gAgentAvatarp->getFullname();
}
void LLAgent::buildFullnameAndTitle(std::string& name) const
@@ -2912,10 +2876,10 @@ BOOL LLAgent::isInGroup(const LLUUID& group_id, BOOL ignore_god_mode /* FALSE */
if (!ignore_god_mode && isGodlike())
return true;
S32 count = mGroups.count();
for(S32 i = 0; i < count; ++i)
U32 count = mGroups.size();
for(U32 i = 0; i < count; ++i)
{
if(mGroups.get(i).mID == group_id)
if(mGroups[i].mID == group_id)
{
return TRUE;
}
@@ -2932,12 +2896,12 @@ BOOL LLAgent::hasPowerInGroup(const LLUUID& group_id, U64 power) const
// GP_NO_POWERS can also mean no power is enough to grant an ability.
if (GP_NO_POWERS == power) return FALSE;
S32 count = mGroups.count();
for(S32 i = 0; i < count; ++i)
U32 count = mGroups.size();
for(U32 i = 0; i < count; ++i)
{
if(mGroups.get(i).mID == group_id)
if(mGroups[i].mID == group_id)
{
return (BOOL)((mGroups.get(i).mPowers & power) > 0);
return (BOOL)((mGroups[i].mPowers & power) > 0);
}
}
return FALSE;
@@ -2953,12 +2917,12 @@ U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const
if (isGodlike())
return GP_ALL_POWERS;
S32 count = mGroups.count();
for(S32 i = 0; i < count; ++i)
U32 count = mGroups.size();
for(U32 i = 0; i < count; ++i)
{
if(mGroups.get(i).mID == group_id)
if(mGroups[i].mID == group_id)
{
return (mGroups.get(i).mPowers);
return (mGroups[i].mPowers);
}
}
@@ -2967,12 +2931,12 @@ U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const
BOOL LLAgent::getGroupData(const LLUUID& group_id, LLGroupData& data) const
{
S32 count = mGroups.count();
S32 count = mGroups.size();
for(S32 i = 0; i < count; ++i)
{
if(mGroups.get(i).mID == group_id)
if(mGroups[i].mID == group_id)
{
data = mGroups.get(i);
data = mGroups[i];
return TRUE;
}
}
@@ -2981,12 +2945,12 @@ BOOL LLAgent::getGroupData(const LLUUID& group_id, LLGroupData& data) const
S32 LLAgent::getGroupContribution(const LLUUID& group_id) const
{
S32 count = mGroups.count();
S32 count = mGroups.size();
for(S32 i = 0; i < count; ++i)
{
if(mGroups.get(i).mID == group_id)
if(mGroups[i].mID == group_id)
{
S32 contribution = mGroups.get(i).mContribution;
S32 contribution = mGroups[i].mContribution;
return contribution;
}
}
@@ -2995,12 +2959,12 @@ S32 LLAgent::getGroupContribution(const LLUUID& group_id) const
BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution)
{
S32 count = mGroups.count();
S32 count = mGroups.size();
for(S32 i = 0; i < count; ++i)
{
if(mGroups.get(i).mID == group_id)
if(mGroups[i].mID == group_id)
{
mGroups.get(i).mContribution = contribution;
mGroups[i].mContribution = contribution;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SetGroupContribution");
msg->nextBlock("AgentData");
@@ -3018,14 +2982,13 @@ BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution)
BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile)
{
S32 count = mGroups.count();
S32 count = mGroups.size();
for(S32 i = 0; i < count; ++i)
{
LLGroupData &group = mGroups.get(i);
if(group.mID == group_id)
if(mGroups[i].mID == group_id)
{
group.mAcceptNotices = accept_notices;
group.mListInProfile = list_in_profile;
mGroups[i].mAcceptNotices = accept_notices;
mGroups[i].mListInProfile = list_in_profile;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SetGroupAcceptNotices");
msg->nextBlock("AgentData");
@@ -3038,7 +3001,7 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
msg->addBOOL("ListInProfile", list_in_profile);
sendReliableMessage();
update_group_floaters(group.mID);
update_group_floaters(mGroups[i].mID);
return TRUE;
}
@@ -3046,6 +3009,10 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
return FALSE;
}
BOOL LLAgent::canJoinGroups() const
{
return (S32)mGroups.size() < gHippoLimits->getMaxAgentGroups();
}
LLQuaternion LLAgent::getHeadRotation()
{
@@ -3173,7 +3140,7 @@ void LLAgent::sendRevokePermissions(const LLUUID & target, U32 permissions)
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_ObjectID, target); // Must be in the region
msg->addU32Fast(_PREHASH_ObjectPermissions, permissions);
msg->addS32Fast(_PREHASH_ObjectPermissions, (S32) permissions);
sendReliableMessage();
}
@@ -3312,9 +3279,19 @@ void LLAgent::getName(std::string& name)
}
}
const LLColor4 &LLAgent::getEffectColor()
const LLColor4 LLAgent::getEffectColor()
{
return *mEffectColor;
LLColor4 effect_color = *mEffectColor;
//<alchemy> Rainbow Particle Effects
static LLCachedControl<bool> AlchemyRainbowEffects(gSavedSettings, "AlchemyRainbowEffects");
if(AlchemyRainbowEffects)
{
LLColor3 rainbow;
rainbow.setHSL(fmodf((F32)LLFrameTimer::getElapsedSeconds()/4.f, 1.f), 1.f, 0.5f);
effect_color.set(rainbow, 1.0f);
}
return effect_color;
}
void LLAgent::setEffectColor(const LLColor4 &color)
@@ -3364,6 +3341,7 @@ BOOL LLAgent::downGrabbed() const
void update_group_floaters(const LLUUID& group_id)
{
LLGroupActions::refresh(group_id);
// update avatar info
@@ -3394,10 +3372,10 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
// Remove the group if it already exists remove it and add the new data to pick up changes.
LLGroupData gd;
gd.mID = group_id;
S32 index = gAgent.mGroups.find(gd);
if (index != -1)
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd);
if (found_it != gAgent.mGroups.end())
{
gAgent.mGroups.remove(index);
gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id)
{
gAgent.mGroupID.setNull();
@@ -3434,8 +3412,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
!input.has("body") )
{
//what to do with badly formed message?
response->statusUnknownError(400);
response->result(LLSD("Invalid message parameters"));
response->extendedResult(HTTP_BAD_REQUEST, "", LLSD("Invalid message parameters"));
}
LLSD body = input["body"];
@@ -3473,10 +3450,10 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
// and add the new data to pick up changes.
LLGroupData gd;
gd.mID = group_id;
S32 index = gAgent.mGroups.find(gd);
if (index != -1)
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd);
if (found_it != gAgent.mGroups.end())
{
gAgent.mGroups.remove(index);
gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id)
{
gAgent.mGroupID.setNull();
@@ -3507,8 +3484,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
else
{
//what to do with badly formed message?
response->statusUnknownError(400);
response->result(LLSD("Invalid message parameters"));
response->extendedResult(HTTP_BAD_REQUEST, "", LLSD("Invalid message parameters"));
}
}
};
@@ -3532,7 +3508,6 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
S32 count = msg->getNumberOfBlocksFast(_PREHASH_GroupData);
LLGroupData group;
S32 index = -1;
bool need_floater_update = false;
for(S32 i = 0; i < count; ++i)
{
@@ -3547,12 +3522,12 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
{
need_floater_update = true;
// Remove the group if it already exists remove it and add the new data to pick up changes.
index = gAgent.mGroups.find(group);
if (index != -1)
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group);
if (found_it != gAgent.mGroups.end())
{
gAgent.mGroups.remove(index);
gAgent.mGroups.erase(found_it);
}
gAgent.mGroups.put(group);
gAgent.mGroups.push_back(group);
}
if (need_floater_update)
{
@@ -3591,7 +3566,6 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
{
LLGroupData group;
S32 index = -1;
bool need_floater_update = false;
group.mID = (*iter_group)["GroupID"].asUUID();
@@ -3608,12 +3582,12 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
{
need_floater_update = true;
// Remove the group if it already exists remove it and add the new data to pick up changes.
index = gAgent.mGroups.find(group);
if (index != -1)
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group);
if (found_it != gAgent.mGroups.end())
{
gAgent.mGroups.remove(index);
gAgent.mGroups.erase(found_it);
}
gAgent.mGroups.put(group);
gAgent.mGroups.push_back(group);
}
if (need_floater_update)
{
@@ -3692,12 +3666,9 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **)
total_count++;
}
}
// Any control taken? If so, might be first time.
if (total_count > 0)
{
LLFirstUse::useOverrideKeys();
}
if (total_count > 0) LLFirstUse::useOverrideKeys();
}
else
{
@@ -3813,7 +3784,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
return;
}
if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
if (gAgentAvatarp->isEditingAppearance())
{
// ignore baked textures when in customize mode
return;

View File

@@ -36,7 +36,6 @@
#include <set>
#include "indra_constants.h"
#include "llevent.h" // LLObservable base class
#include "llagentconstants.h"
#include "llagentdata.h" // gAgentID, gAgentSessionID
@@ -72,9 +71,12 @@ class LLSLURL;
class LLSimInfo;
class LLTeleportRequest;
typedef std::vector<LLViewerObject*> llvo_vec_t;
typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr;
//--------------------------------------------------------------------
// Types
//--------------------------------------------------------------------
enum EAnimRequest
{
ANIM_REQUEST_START,
@@ -213,7 +215,7 @@ public:
//--------------------------------------------------------------------
public:
const LLCoordFrame& getFrameAgent() const { return mFrameAgent; }
void initOriginGlobal(const LLVector3d &origin_global); // Only to be used in ONE place! - djs 08/07/02
void initOriginGlobal(const LLVector3d &origin_global); // Only to be used in ONE place
void resetAxes();
void resetAxes(const LLVector3 &look_at); // Makes reasonable left and up
// The following three get*Axis functions return direction avatar is looking, not camera.
@@ -238,15 +240,52 @@ private:
U64 mHomeRegionHandle;
LLVector3 mHomePosRegion;
//--------------------------------------------------------------------
// Parcel
//--------------------------------------------------------------------
public:
void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary
// Register a boost callback to be called when the agent changes parcels
typedef boost::function<void()> parcel_changed_callback_t;
boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t);
private:
typedef boost::signals2::signal<void()> parcel_changed_signal_t;
parcel_changed_signal_t mParcelChangedSignal;
//--------------------------------------------------------------------
// Region
//--------------------------------------------------------------------
public:
void setRegion(LLViewerRegion *regionp);
LLViewerRegion *getRegion() const { return mRegionp; }
LLViewerRegion *getRegion() const;
const LLHost& getRegionHost() const;
BOOL inPrelude();
/**
* Register a boost callback to be called when the agent changes regions
* Note that if you need to access a capability for the region, you may need to wait
* for the capabilities to be received, since in some cases your region changed
* callback will be called before the capabilities have been received. Your callback
* may need to look something like:
*
* LLViewerRegion* region = gAgent.getRegion();
* if (region->capabilitiesReceived())
* {
* useCapability(region);
* }
* else // Need to handle via callback after caps arrive.
* {
* region->setCapabilitiesReceivedCallback(boost::bind(&useCapability,region,_1));
* // you may or may not want to remove that callback
* }
*/
typedef boost::signals2::signal<void()> region_changed_signal_t;
boost::signals2::connection addRegionChangedCallback(const region_changed_signal_t::slot_type& cb);
void removeRegionChangedCallback(boost::signals2::connection callback);
// <edit>
struct SHLureRequest
{
@@ -260,9 +299,10 @@ public:
void showLureDestination(const std::string fromname, U64& handle, U32 x, U32 y, U32 z);
void onFoundLureDestination(LLSimInfo *siminfo = NULL);
// </edit>
private:
LLViewerRegion *mRegionp;
region_changed_signal_t mRegionChangedSignal;
//--------------------------------------------------------------------
// History
@@ -274,6 +314,7 @@ public:
const LLVector3d &getLastPositionGlobal() const { return mLastPositionGlobal; }
void setLastPositionGlobal(const LLVector3d &pos) { mLastPositionGlobal = pos; }
private:
std::set<U64> mRegionsVisited; // Stat - what distinct regions has the avatar been to?
F64 mDistanceTraveled; // Stat - how far has the avatar moved?
@@ -654,6 +695,7 @@ private:
void handleTeleportFinished();
void handleTeleportFailed();
public:
void handleServerBakeRegionTransition(const LLUUID& region_id);
//--------------------------------------------------------------------
@@ -682,9 +724,10 @@ private:
public:
bool canEditParcel() const { return mCanEditParcel; }
private:
static void setCanEditParcel();
bool mCanEditParcel;
static void parcelChangedCallback();
/********************************************************************************
** **
@@ -807,7 +850,7 @@ private:
// HUD
//--------------------------------------------------------------------
public:
const LLColor4 &getEffectColor();
const LLColor4 getEffectColor();
void setEffectColor(const LLColor4 &color);
private:
LLColor4 *mEffectColor;
@@ -831,6 +874,7 @@ public:
BOOL setGroupContribution(const LLUUID& group_id, S32 contribution);
BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile);
const std::string &getGroupName() const { return mGroupName; }
BOOL canJoinGroups() const;
private:
std::string mGroupName;
LLUUID mGroupID;
@@ -845,7 +889,7 @@ protected:
// Only used for building titles.
BOOL isGroupMember() const { return !mGroupID.isNull(); }
public:
LLDynamicArray<LLGroupData> mGroups;
std::vector<LLGroupData> mGroups;
//--------------------------------------------------------------------
// Group Title

View File

@@ -113,7 +113,7 @@ public:
};
// support for secondlife:///app/appearance SLapps
/*class LLAppearanceHandler : public LLCommandHandler
class LLAppearanceHandler : public LLCommandHandler
{
public:
// requests will be throttled from a non-trusted browser
@@ -121,6 +121,7 @@ public:
bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
{
/* Singu Note: Nopenopenope.
// support secondlife:///app/appearance/show, but for now we just
// make all secondlife:///app/appearance SLapps behave this way
if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAppearance"))
@@ -128,13 +129,14 @@ public:
LLNotificationsUtil::add("NoAppearance", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
return true;
}
*/
LLFloaterSidePanelContainer::showPanel("appearance", LLSD());
LLFloaterCustomize::getInstance()->open();
return true;
}
};
LLAppearanceHandler gAppearanceHandler;*/
LLAppearanceHandler gAppearanceHandler;
LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string& name)
@@ -147,11 +149,11 @@ LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string
item_array,
LLInventoryModel::EXCLUDE_TRASH,
has_name);
if (0 == cat_array.count())
if (0 == cat_array.size())
return LLUUID();
else
{
LLViewerInventoryCategory *cat = cat_array.get(0);
LLViewerInventoryCategory *cat = cat_array.at(0);
if (cat)
return cat->getUUID();
else
@@ -215,11 +217,10 @@ public:
// Request or re-request operation for specified item.
void addItem(const LLUUID& item_id)
{
LL_DEBUGS("Avatar") << "item_id " << item_id << llendl;
LL_DEBUGS("Avatar") << "item_id " << item_id << LL_ENDL;
if (!requestOperation(item_id))
{
LL_DEBUGS("Avatar") << "item_id " << item_id << " requestOperation false, skipping" << llendl;
LL_DEBUGS("Avatar") << "item_id " << item_id << " requestOperation false, skipping" << LL_ENDL;
return;
}
@@ -249,7 +250,7 @@ public:
}
mPendingRequests--;
F32 elapsed = timestamp.getElapsedTimeF32();
LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << elapsed << " seconds" << llendl;
LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << elapsed << " seconds" << LL_ENDL;
if (mWaitTimes.find(src_id) == mWaitTimes.end())
{
// No longer waiting for this item - either serviced
@@ -353,16 +354,16 @@ public:
void reportStats()
{
LL_DEBUGS("Avatar") << "Phase: " << mTrackingPhase << llendl;
LL_DEBUGS("Avatar") << "mFailCount: " << mFailCount << llendl;
LL_DEBUGS("Avatar") << "mRetryCount: " << mRetryCount << llendl;
LL_DEBUGS("Avatar") << "Times: n " << mTimeStats.getCount() << " min " << mTimeStats.getMinValue() << " max " << mTimeStats.getMaxValue() << llendl;
LL_DEBUGS("Avatar") << "Mean " << mTimeStats.getMean() << " stddev " << mTimeStats.getStdDev() << llendl;
LL_DEBUGS("Avatar") << "Phase: " << mTrackingPhase << LL_ENDL;
LL_DEBUGS("Avatar") << "mFailCount: " << mFailCount << LL_ENDL;
LL_DEBUGS("Avatar") << "mRetryCount: " << mRetryCount << LL_ENDL;
LL_DEBUGS("Avatar") << "Times: n " << mTimeStats.getCount() << " min " << mTimeStats.getMinValue() << " max " << mTimeStats.getMaxValue() << LL_ENDL;
LL_DEBUGS("Avatar") << "Mean " << mTimeStats.getMean() << " stddev " << mTimeStats.getStdDev() << LL_ENDL;
}
virtual ~LLCallAfterInventoryBatchMgr()
{
LL_DEBUGS("Avatar") << "deleting" << llendl;
LL_DEBUGS("Avatar") << "deleting" << LL_ENDL;
}
protected:
@@ -395,16 +396,22 @@ public:
LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries)
{
addItems(src_items);
sInstanceCount++;
}
~LLCallAfterInventoryCopyMgr()
{
sInstanceCount--;
}
virtual bool requestOperation(const LLUUID& item_id)
{
LLViewerInventoryItem *item = gInventory.getItem(item_id);
llassert(item);
LL_DEBUGS("Avatar") << "copying item " << item_id << llendl;
LL_DEBUGS("Avatar") << "copying item " << item_id << LL_ENDL;
if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate"))
{
LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl;
LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << LL_ENDL;
return true;
}
copy_inventory_item(
@@ -417,8 +424,15 @@ public:
);
return true;
}
static S32 getInstanceCount() { return sInstanceCount; }
private:
static S32 sInstanceCount;
};
S32 LLCallAfterInventoryCopyMgr::sInstanceCount = 0;
class LLCallAfterInventoryLinkMgr: public LLCallAfterInventoryBatchMgr
{
public:
@@ -2635,6 +2649,11 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool
category->getUUID(), copy, append));
}
S32 LLAppearanceMgr::getActiveCopyOperations() const
{
return LLCallAfterInventoryCopyMgr::getInstanceCount();
}
void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append)
{
LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL;
@@ -2733,6 +2752,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego
LLAppearanceMgr::changeOutfit(TRUE, category->getUUID(), append);
}
// FIXME do we really want to search entire inventory for matching name?
void LLAppearanceMgr::wearOutfitByName(const std::string& name)
{
LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL;
@@ -2747,10 +2767,10 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name)
has_name);
bool copy_items = false;
LLInventoryCategory* cat = NULL;
if (cat_array.count() > 0)
if (cat_array.size() > 0)
{
// Just wear the first one that matches
cat = cat_array.get(0);
cat = cat_array.at(0);
}
else
{
@@ -2759,9 +2779,9 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name)
item_array,
LLInventoryModel::EXCLUDE_TRASH,
has_name);
if(cat_array.count() > 0)
if(cat_array.size() > 0)
{
cat = cat_array.get(0);
cat = cat_array.at(0);
copy_items = true;
}
}
@@ -2775,8 +2795,6 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name)
llwarns << "Couldn't find outfit " <<name<< " in wearOutfitByName()"
<< llendl;
}
//dec_busy_count();
}
bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventoryItem *b)
@@ -2875,10 +2893,10 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update
LLInventoryModel::EXCLUDE_TRASH);
bool linked_already = false;
U32 count = 0;
for (S32 i=0; i<item_array.count(); i++)
for (U32 i=0; i<item_array.size(); i++)
{
// Are these links to the same object?
const LLViewerInventoryItem* inv_item = item_array.get(i).get();
const LLViewerInventoryItem* inv_item = item_array.at(i).get();
const LLWearableType::EType wearable_type = inv_item->getWearableType();
const bool is_body_part = (wearable_type == LLWearableType::WT_SHAPE)
@@ -2958,18 +2976,24 @@ LLInventoryModel::item_array_t LLAppearanceMgr::findCOFItemLinks(const LLUUID& i
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
for (S32 i=0; i<item_array.count(); i++)
for (U32 i=0; i<item_array.size(); i++)
{
const LLViewerInventoryItem* inv_item = item_array.get(i).get();
const LLViewerInventoryItem* inv_item = item_array.at(i).get();
if (inv_item->getLinkedUUID() == vitem->getLinkedUUID())
{
result.put(item_array.get(i));
result.push_back(item_array.at(i));
}
}
}
return result;
}
bool LLAppearanceMgr::isLinkedInCOF(const LLUUID& item_id)
{
LLInventoryModel::item_array_t links = LLAppearanceMgr::instance().findCOFItemLinks(item_id);
return links.size() > 0;
}
void LLAppearanceMgr::removeAllClothesFromAvatar()
{
// Fetch worn clothes (i.e. the ones in COF).
@@ -3035,27 +3059,13 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id)
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
for (S32 i=0; i<item_array.count(); i++)
for (U32 i=0; i<item_array.size(); i++)
{
// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8)
const LLViewerInventoryItem* item = item_array.get(i).get();
const LLInventoryItem* item = item_array.at(i).get();
if (item->getIsLinkType() && item->getLinkedUUID() == item_id)
{
#if 0 // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
// NOTE-RLVa: debug-only, can be removed down the line
if (rlv_handler_t::isEnabled())
{
RLV_ASSERT(rlvPredCanRemoveItem(item));
}
#endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
gInventory.purgeObject(item->getUUID());
}
// [/RLVa:KB]
// const LLInventoryItem* item = item_array.get(i).get();
// if (item->getIsLinkType() && item->getLinkedUUID() == item_id)
// {
// gInventory.purgeObject(item->getUUID());
// }
}
}
@@ -3072,16 +3082,6 @@ void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type)
const LLViewerInventoryItem* item = *it;
if (item->getIsLinkType()) // we must operate on links only
{
// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8)
#if 0 // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
// NOTE-RLVa: debug-only, can be removed down the line
if (rlv_handler_t::isEnabled())
{
RLV_ASSERT(rlvPredCanRemoveItem(item));
}
#endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
// [/RLVa:KB]
gInventory.purgeObject(item->getUUID());
}
}
@@ -3091,7 +3091,7 @@ bool sort_by_linked_uuid(const LLViewerInventoryItem* item1, const LLViewerInven
{
if (!item1 || !item2)
{
llwarning("item1, item2 cannot be null, something is very wrong", 0);
llwarns << "item1, item2 cannot be null, something is very wrong" << llendl;
return true;
}
@@ -3133,8 +3133,9 @@ void LLAppearanceMgr::updateIsDirty()
gInventory.collectDescendentsIf(base_outfit, outfit_cats, outfit_items,
LLInventoryModel::EXCLUDE_TRASH, collector);
if(outfit_items.count() != cof_items.count())
if(outfit_items.size() != cof_items.size())
{
LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.size() << " cof " << cof_items.size() << LL_ENDL;
// Current outfit folder should have one more item than the outfit folder.
// this one item is the link back to the outfit folder itself.
mOutfitIsDirty = true;
@@ -3147,18 +3148,37 @@ void LLAppearanceMgr::updateIsDirty()
for (U32 i = 0; i < cof_items.size(); ++i)
{
LLViewerInventoryItem *item1 = cof_items.get(i);
LLViewerInventoryItem *item2 = outfit_items.get(i);
LLViewerInventoryItem *item1 = cof_items.at(i);
LLViewerInventoryItem *item2 = outfit_items.at(i);
if (item1->getLinkedUUID() != item2->getLinkedUUID() ||
item1->getName() != item2->getName() ||
item1->getActualDescription() != item2->getActualDescription())
{
if (item1->getLinkedUUID() != item2->getLinkedUUID())
{
LL_DEBUGS("Avatar") << "link id different " << LL_ENDL;
}
else
{
if (item1->getName() != item2->getName())
{
LL_DEBUGS("Avatar") << "name different " << item1->getName() << " " << item2->getName() << LL_ENDL;
}
if (item1->getActualDescription() != item2->getActualDescription())
{
LL_DEBUGS("Avatar") << "desc different " << item1->getActualDescription()
<< " " << item2->getActualDescription()
<< " names " << item1->getName() << " " << item2->getName() << LL_ENDL;
}
}
mOutfitIsDirty = true;
return;
}
}
}
llassert(!mOutfitIsDirty);
LL_DEBUGS("Avatar") << "clean" << LL_ENDL;
}
// *HACK: Must match name in Library or agent inventory
@@ -3240,23 +3260,6 @@ void LLAppearanceMgr::copyLibraryGestures()
}
}
void LLAppearanceMgr::autopopulateOutfits()
{
// If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account)
// then auto-populate outfits from the library into the My Outfits folder.
LL_INFOS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL;
static bool check_populate_my_outfits = true;
if (check_populate_my_outfits &&
(LLInventoryModel::getIsFirstTimeInViewer2()
|| gSavedSettings.getBOOL("MyOutfitsAutofill")))
{
gAgentWearables.populateMyOutfitsFolder();
}
check_populate_my_outfits = false;
}
// Handler for anything that's deferred until avatar de-clouds.
void LLAppearanceMgr::onFirstFullyVisible()
{
@@ -3264,10 +3267,6 @@ void LLAppearanceMgr::onFirstFullyVisible()
gAgentAvatarp->reportAvatarRezTime();
gAgentAvatarp->debugAvatarVisible();
// The auto-populate is failing at the point of generating outfits
// folders, so don't do the library copy until that is resolved.
// autopopulateOutfits();
// If this is the first time we've ever logged in,
// then copy default gestures from the library.
if (gAgent.isFirstLogin()) {
@@ -3293,6 +3292,7 @@ bool LLAppearanceMgr::updateBaseOutfit()
llassert(!isOutfitLocked());
return false;
}
setOutfitLocked(true);
gAgentWearables.notifyLoadingStarted();
@@ -3319,12 +3319,12 @@ void LLAppearanceMgr::divvyWearablesByType(const LLInventoryModel::item_array_t&
items_by_type.resize(LLWearableType::WT_COUNT);
if (items.empty()) return;
for (S32 i=0; i<items.count(); i++)
for (U32 i=0; i<items.size(); i++)
{
LLViewerInventoryItem *item = items.get(i);
LLViewerInventoryItem *item = items.at(i);
if (!item)
{
LL_WARNS("Appearance") << "NULL item found" << llendl;
LL_WARNS("Appearance") << "NULL item found" << LL_ENDL;
continue;
}
// Ignore non-wearables.
@@ -3357,12 +3357,6 @@ struct WearablesOrderComparator
bool operator()(const LLInventoryItem* item1, const LLInventoryItem* item2)
{
if (!item1 || !item2)
{
llwarning("either item1 or item2 is NULL", 0);
return true;
}
const std::string& desc1 = item1->getActualDescription();
const std::string& desc2 = item2->getActualDescription();
@@ -3376,8 +3370,10 @@ struct WearablesOrderComparator
//items with ordering information but not for the associated wearables type
if (!item1_valid && item2_valid)
return false;
else if (item1_valid && !item2_valid)
return true;
return true;
return item1->getName() < item2->getName();
}
U32 mControlSize;
@@ -3408,7 +3404,6 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base
bool inventory_changed = false;
for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++)
{
U32 size = items_by_type[type].size();
if (!size) continue;
@@ -3428,7 +3423,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base
item->setComplete(TRUE);
item->updateServer(FALSE);
gInventory.updateItem(item);
inventory_changed = true;
}
}
@@ -3496,31 +3491,16 @@ class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::ResponderWithR
{
public:
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return requestAgentUpdateAppearance_timeout; }
RequestAgentUpdateAppearanceResponder()
{
mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10);
}
RequestAgentUpdateAppearanceResponder();
virtual ~RequestAgentUpdateAppearanceResponder()
{
}
virtual ~RequestAgentUpdateAppearanceResponder();
protected:
// Successful completion.
/* virtual */ void httpSuccess(void)
{
LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(mContent) << LL_ENDL;
if (mContent["success"].asBoolean())
{
LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
}
else
{
onFailure(200);
}
}
/* virtual */ void httpSuccess();
// Error
/*virtual*/ void httpFailure(void)
/*virtual*/ void httpFailure()
{
llwarns << "appearance update request failed, " << dumpResponse() << llendl;
onFailure(mStatus);
@@ -3548,6 +3528,15 @@ public:
/*virtual*/ char const* getName(void) const { return "RequestAgentUpdateAppearanceResponder"; }
};
RequestAgentUpdateAppearanceResponder::RequestAgentUpdateAppearanceResponder()
{
mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10);
}
RequestAgentUpdateAppearanceResponder::~RequestAgentUpdateAppearanceResponder()
{
}
void LLAppearanceMgr::requestServerAppearanceUpdate(LLHTTPClient::ResponderPtr responder_ptr)
{
if (gAgentAvatarp->isEditingAppearance())
@@ -3638,6 +3627,41 @@ void scroll_to_folder(const LLUUID& folder_id)
}
}
/* virtual */ void RequestAgentUpdateAppearanceResponder::httpSuccess()
{
const LLSD& content = getContent();
if (!content.isMap())
{
failureResult(400, "Malformed response contents", content);
return;
}
if (content["success"].asBoolean())
{
LL_DEBUGS("Avatar") << "succeeded" << LL_ENDL;
static LLCachedControl<bool> debug_ava_appr_msg(gSavedSettings, "DebugAvatarAppearanceMessage");
if (debug_ava_appr_msg)
{
dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content);
}
//onSuccess();
}
else
{
failureResult(400, "Non-success response", content);
}
}
std::string LLAppearanceMgr::getAppearanceServiceURL() const
{
if (gSavedSettings.getString("AgentAppearanceServiceURL").empty())
{
return mAppearanceServiceURL;
}
return gSavedSettings.getString("AgentAppearanceServiceURL"); // Singu TODO: Use "DebugAvatarAppearanceServiceURLOverride"
}
class LLBoostFuncInventoryCallbackFireOnce : public LLBoostFuncInventoryCallback
{
public:

View File

@@ -78,6 +78,8 @@ public:
LLInventoryModel::item_array_t& items_to_kill);
void enforceItemRestrictions();
S32 getActiveCopyOperations() const;
// Copy all items and the src category itself.
void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id,
LLPointer<LLInventoryCallback> cb);
@@ -153,6 +155,7 @@ public:
// Find COF entries referencing the given item.
LLInventoryModel::item_array_t findCOFItemLinks(const LLUUID& item_id);
bool isLinkedInCOF(const LLUUID& item_id);
// Remove COF entries
void removeCOFItemLinks(const LLUUID& item_id);
@@ -213,6 +216,13 @@ public:
void requestServerAppearanceUpdate(LLHTTPClient::ResponderPtr responder_ptr = NULL);
void setAppearanceServiceURL(const std::string& url) { mAppearanceServiceURL = url; }
std::string getAppearanceServiceURL() const;
private:
std::string mAppearanceServiceURL;
protected:
LLAppearanceMgr();
~LLAppearanceMgr();
@@ -255,7 +265,7 @@ private:
*/
bool mOutfitLocked;
std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
boost::scoped_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-3.0.0a) | Modified: Catznip-2.1.2e
public:

View File

@@ -881,9 +881,6 @@ bool LLAppViewer::init()
gGLManager.getGLInfo(gDebugInfo);
gGLManager.printGLInfoString();
//load key settings
bind_keyboard_functions();
// Load Default bindings
load_default_bindings(gSavedSettings.getBOOL("LiruUseZQSDKeys"));

View File

@@ -105,9 +105,11 @@ void LLEnvPrefs::setUseDayCycle(const std::string& name)
}
//=============================================================================
LLEnvManagerNew::LLEnvManagerNew()
LLEnvManagerNew::LLEnvManagerNew():
mInterpNextChangeMessage(true),
mCurRegionUUID(LLUUID::null),
mLastReceivedID(LLUUID::null)
{
mInterpNextChangeMessage = true;
// Set default environment settings.
mUserPrefs.mUseRegionSettings = true;
@@ -115,6 +117,9 @@ LLEnvManagerNew::LLEnvManagerNew()
mUserPrefs.mWaterPresetName = "Default";
mUserPrefs.mSkyPresetName = "Default";
mUserPrefs.mDayCycleName = "Default";
LL_DEBUGS("Windlight")<<LL_ENDL;
gAgent.addRegionChangedCallback(boost::bind(&LLEnvManagerNew::onRegionChange, this));
}
bool LLEnvManagerNew::getUseRegionSettings() const
@@ -313,6 +318,11 @@ void LLEnvManagerNew::loadUserPrefs()
mUserPrefs.mUseRegionSettings = gSavedSettings.getBOOL("UseEnvironmentFromRegion");
mUserPrefs.mUseDayCycle = gSavedSettings.getBOOL("UseDayCycle");
if (mUserPrefs.mUseRegionSettings)
{
requestRegionSettings();
}
}
void LLEnvManagerNew::saveUserPrefs()
@@ -411,6 +421,7 @@ void LLEnvManagerNew::dumpPresets()
void LLEnvManagerNew::requestRegionSettings()
{
LL_DEBUGS("Windlight") << LL_ENDL;
LLEnvironmentRequest::initiate();
}
@@ -435,11 +446,6 @@ boost::signals2::connection LLEnvManagerNew::setRegionSettingsChangeCallback(con
return mRegionSettingsChangeSignal.connect(cb);
}
boost::signals2::connection LLEnvManagerNew::setRegionChangeCallback(const region_change_signal_t::slot_type& cb)
{
return mRegionChangeSignal.connect(cb);
}
boost::signals2::connection LLEnvManagerNew::setRegionSettingsAppliedCallback(const region_settings_applied_signal_t::slot_type& cb)
{
return mRegionSettingsAppliedSignal.connect(cb);
@@ -470,25 +476,13 @@ const std::string LLEnvManagerNew::getScopeString(LLEnvKey::EScope scope)
}
}
void LLEnvManagerNew::onRegionCrossing()
{
LL_DEBUGS("Windlight") << "Crossed region" << LL_ENDL;
onRegionChange(true);
}
void LLEnvManagerNew::onTeleport()
{
LL_DEBUGS("Windlight") << "Teleported" << LL_ENDL;
onRegionChange(false);
}
void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content)
{
// If the message was valid, grab the UUID from it and save it for next outbound update message.
mLastReceivedID = content[0]["messageID"].asUUID();
// Refresh cached region settings.
LL_DEBUGS("Windlight") << "Caching region environment settings: " << content << LL_ENDL;
LL_DEBUGS("Windlight") << "Received region environment settings: " << content << LL_ENDL;
F32 sun_hour = 0; // *TODO
LLEnvironmentSettings new_settings(content[1], content[2], content[3], sun_hour);
mCachedRegionPrefs = new_settings;
@@ -613,6 +607,7 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
void LLEnvManagerNew::updateManagersFromPrefs(bool interpolate)
{
LL_DEBUGS("Windlight")<<LL_ENDL;
// [RLVa:KB] - Checked: 2011-09-04 (RLVa-1.4.1a) | Added: RLVa-1.4.1a
if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV))
{
@@ -676,30 +671,37 @@ bool LLEnvManagerNew::useDefaultWater()
}
void LLEnvManagerNew::onRegionChange(bool interpolate)
void LLEnvManagerNew::onRegionChange()
{
// Avoid duplicating region setting requests
// by checking whether the region is actually changing.
LLViewerRegion* regionp = gAgent.getRegion();
LLUUID region_uuid = regionp ? regionp->getRegionID() : LLUUID::null;
if (region_uuid == mCurRegionUUID)
if (region_uuid != mCurRegionUUID)
{
return;
// Clear locally modified region settings.
mNewRegionPrefs.clear();
// *TODO: clear environment settings of the previous region?
// Request environment settings of the new region.
mCurRegionUUID = region_uuid;
// for region crossings, interpolate the change; for teleports, don't
mInterpNextChangeMessage = (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE);
LL_DEBUGS("Windlight") << (mInterpNextChangeMessage ? "Crossed" : "Teleported")
<< " to new region: " << region_uuid
<< LL_ENDL;
requestRegionSettings();
}
else
{
LL_DEBUGS("Windlight") << "disregarding region change; interp: "
<< (mInterpNextChangeMessage ? "true" : "false")
<< " regionp: " << regionp
<< " old: " << mCurRegionUUID
<< " new: " << region_uuid
<< LL_ENDL;
}
// Clear locally modified region settings.
mNewRegionPrefs.clear();
// *TODO: clear environment settings of the previous region?
// Request environment settings of the new region.
LL_DEBUGS("Windlight") << "New viewer region: " << region_uuid << LL_ENDL;
mCurRegionUUID = region_uuid;
mInterpNextChangeMessage = interpolate;
requestRegionSettings();
// Let interested parties know agent region has been changed.
mRegionChangeSignal();
}
// Aurora-sim windlight refresh
@@ -729,7 +731,7 @@ class WindLightRefresh : public LLHTTPNode
llinfos << "Windlight Refresh, interpolate:" << env->mInterpNextChangeMessage << llendl;
env->requestRegionSettings();
env->mRegionChangeSignal();
env->onRegionChange();
}
};

View File

@@ -2,31 +2,25 @@
* @file llenvmanager.h
* @brief Declaration of classes managing WindLight and water settings.
*
* $LicenseInfo:firstyear=2009&license=viewergpl$
*
* Copyright (c) 2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2011, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -39,7 +33,6 @@
class LLWLParamManager;
class LLWaterParamManager;
class LLWLAnimator;
class WindLightRefresh;
// generic key
struct LLEnvKey
@@ -173,7 +166,6 @@ class LLEnvManagerNew : public LLSingleton<LLEnvManagerNew>
public:
typedef boost::signals2::signal<void()> prefs_change_signal_t;
typedef boost::signals2::signal<void()> region_settings_change_signal_t;
typedef boost::signals2::signal<void()> region_change_signal_t;
typedef boost::signals2::signal<void(bool)> region_settings_applied_signal_t;
LLEnvManagerNew();
@@ -229,15 +221,12 @@ public:
bool sendRegionSettings(const LLEnvironmentSettings& new_settings);
boost::signals2::connection setPreferencesChangeCallback(const prefs_change_signal_t::slot_type& cb);
boost::signals2::connection setRegionSettingsChangeCallback(const region_settings_change_signal_t::slot_type& cb);
boost::signals2::connection setRegionChangeCallback(const region_change_signal_t::slot_type& cb);
boost::signals2::connection setRegionSettingsAppliedCallback(const region_settings_applied_signal_t::slot_type& cb);
static bool canEditRegionSettings(); /// @return true if we have access to editing region environment
static const std::string getScopeString(LLEnvKey::EScope scope);
// Public callbacks.
void onRegionCrossing();
void onTeleport();
void onRegionSettingsResponse(const LLSD& content);
void onRegionSettingsApplyResponse(bool ok);
@@ -261,7 +250,7 @@ private:
bool useDefaultSky();
bool useDefaultWater();
void onRegionChange(bool interpolate);
void onRegionChange();
/// Emitted when user environment preferences change.
prefs_change_signal_t mUsePrefsChangeSignal;
@@ -269,9 +258,6 @@ private:
/// Emitted when region environment settings update comes.
region_settings_change_signal_t mRegionSettingsChangeSignal;
/// Emitted when agent region changes. Move to LLAgent?
region_change_signal_t mRegionChangeSignal;
/// Emitted when agent region changes. Move to LLAgent?
region_settings_applied_signal_t mRegionSettingsAppliedSignal;

View File

@@ -38,9 +38,6 @@
#include "llfloaterregioninfo.h" // for invoice id
#include "llviewerregion.h"
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy estateChangeInfoResponder_timeout;
LLEstateInfoModel::LLEstateInfoModel()
: mID(0)
, mFlags(0)
@@ -68,12 +65,12 @@ void LLEstateInfoModel::sendEstateInfo()
}
}
bool LLEstateInfoModel::getUseFixedSun() const { return mFlags & REGION_FLAGS_SUN_FIXED; }
bool LLEstateInfoModel::getIsExternallyVisible() const { return mFlags & REGION_FLAGS_EXTERNALLY_VISIBLE; }
bool LLEstateInfoModel::getAllowDirectTeleport() const { return mFlags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT; }
bool LLEstateInfoModel::getDenyAnonymous() const { return mFlags & REGION_FLAGS_DENY_ANONYMOUS; }
bool LLEstateInfoModel::getDenyAgeUnverified() const { return mFlags & REGION_FLAGS_DENY_AGEUNVERIFIED; }
bool LLEstateInfoModel::getAllowVoiceChat() const { return mFlags & REGION_FLAGS_ALLOW_VOICE; }
bool LLEstateInfoModel::getUseFixedSun() const { return getFlag(REGION_FLAGS_SUN_FIXED); }
bool LLEstateInfoModel::getIsExternallyVisible() const { return getFlag(REGION_FLAGS_EXTERNALLY_VISIBLE); }
bool LLEstateInfoModel::getAllowDirectTeleport() const { return getFlag(REGION_FLAGS_ALLOW_DIRECT_TELEPORT); }
bool LLEstateInfoModel::getDenyAnonymous() const { return getFlag(REGION_FLAGS_DENY_ANONYMOUS); }
bool LLEstateInfoModel::getDenyAgeUnverified() const { return getFlag(REGION_FLAGS_DENY_AGEUNVERIFIED); }
bool LLEstateInfoModel::getAllowVoiceChat() const { return getFlag(REGION_FLAGS_ALLOW_VOICE); }
void LLEstateInfoModel::setUseFixedSun(bool val) { setFlag(REGION_FLAGS_SUN_FIXED, val); }
void LLEstateInfoModel::setIsExternallyVisible(bool val) { setFlag(REGION_FLAGS_EXTERNALLY_VISIBLE, val); }
@@ -118,19 +115,18 @@ class LLEstateChangeInfoResponder : public LLHTTPClient::ResponderWithResult
public:
// if we get a normal response, handle it here
/*virtual*/ void httpSuccess(void)
virtual void httpSuccess()
{
llinfos << "Committed estate info" << llendl;
LLEstateInfoModel::instance().notifyCommit();
}
// if we get an error response
/*virtual*/ void httpFailure(void)
virtual void httpFailure()
{
llwarns << "Failed to commit estate info (" << mStatus << "): " << mReason << llendl;
llwarns << "Failed to commit estate info [status:" << mStatus << "]: " << mReason << llendl;
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLEstateChangeInfoResponder"; }
};
@@ -205,18 +201,6 @@ void LLEstateInfoModel::commitEstateInfoDataserver()
gAgent.sendMessage();
}
void LLEstateInfoModel::setFlag(U32 flag, bool val)
{
if (val)
{
mFlags |= flag;
}
else
{
mFlags &= ~flag;
}
}
std::string LLEstateInfoModel::getInfoDump()
{
LLSD dump;

View File

@@ -86,19 +86,38 @@ protected:
private:
bool commitEstateInfoCaps();
void commitEstateInfoDataserver();
U32 getFlags() const { return mFlags; }
void setFlag(U32 flag, bool val);
inline bool getFlag(U64 flag) const;
inline void setFlag(U64 flag, bool val);
U64 getFlags() const { return mFlags; }
std::string getInfoDump();
// estate info
std::string mName; /// estate name
LLUUID mOwnerID; /// estate owner id
U32 mID; /// estate id
U32 mFlags; /// estate flags
U64 mFlags; /// estate flags
F32 mSunHour; /// estate sun hour
update_signal_t mUpdateSignal; /// emitted when we receive update from sim
update_signal_t mCommitSignal; /// emitted when our update gets applied to sim
};
inline bool LLEstateInfoModel::getFlag(U64 flag) const
{
return ((mFlags & flag) != 0);
}
inline void LLEstateInfoModel::setFlag(U64 flag, bool val)
{
if (val)
{
mFlags |= flag;
}
else
{
mFlags &= ~flag;
}
}
#endif // LL_LLESTATEINFOMODEL_H

View File

@@ -54,7 +54,6 @@
#include "hippogridmanager.h"
#include "lfsimfeaturehandler.h"
#include "llenvmanager.h"
#include "llnotificationsutil.h"
#include "llviewerregion.h"
@@ -279,7 +278,7 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name)
LLPanelDirMarket* marketp = static_cast<LLPanelDirMarket*>(container->getPanelByName(market_panel));
container->removeTabPanel(marketp); // Until we get a MarketPlace URL, tab is removed.
marketp->handleRegionChange(container);
LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLPanelDirMarket::handleRegionChange, marketp, container));
gAgent.addRegionChangedCallback(boost::bind(&LLPanelDirMarket::handleRegionChange, marketp, container));
}
container->setCommitCallback(boost::bind(&LLFloaterDirectory::onTabChanged,_2));
}
@@ -455,13 +454,13 @@ void LLFloaterDirectory::requestClassifieds()
void LLFloaterDirectory::searchInAll(const std::string& search_text)
{
start();
LLPanelDirFindAllInterface::search(sInstance->mFindAllPanel, search_text);
performQueryOn2("classified_panel", search_text);
performQueryOn2("events_panel", search_text);
performQueryOn2("groups_panel", search_text);
performQueryOn2("people_panel", search_text);
performQueryOn2("places_panel", search_text);
sInstance->open();
}
void LLFloaterDirectory::showFindAll(const std::string& search_text)
@@ -583,7 +582,7 @@ void LLFloaterDirectory::focusCurrentPanel()
}
// static
void LLFloaterDirectory::showPanel(const std::string& tabname)
void LLFloaterDirectory::start()
{
// This function gets called when web browser clicks are processed,
// so we don't delete the existing panel, which would delete the
@@ -593,6 +592,12 @@ void LLFloaterDirectory::showPanel(const std::string& tabname)
sInstance = new LLFloaterDirectory("directory");
}
sInstance->open(); /*Flawfinder: ignore*/
}
// static
void LLFloaterDirectory::showPanel(const std::string& tabname)
{
start();
sInstance->childShowTab("Directory Tabs", tabname);
sInstance->focusCurrentPanel();
}

View File

@@ -94,6 +94,7 @@ public:
private:
static void performQueryOn(const std::string& name, const std::string& search_text);
static void performQueryOn2(const std::string& name, const std::string& search_text);
static void start();
static void showPanel(const std::string& tabname);
/*virtual*/ void onClose(bool app_quitting);
void focusCurrentPanel();

View File

@@ -185,7 +185,7 @@ LLPanelGroups::~LLPanelGroups()
// clear the group list, and get a fresh set of info.
void LLPanelGroups::reset()
{
getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count()));
getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size()));
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups()));
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID());
@@ -194,7 +194,7 @@ void LLPanelGroups::reset()
BOOL LLPanelGroups::postBuild()
{
getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count()));
getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size()));
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",gHippoLimits->getMaxAgentGroups()));
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("group list");
@@ -231,7 +231,7 @@ BOOL LLPanelGroups::postBuild()
void LLPanelGroups::enableButtons()
{
getChildView("Create")->setEnabled(gAgent.mGroups.count() < gHippoLimits->getMaxAgentGroups());
getChildView("Create")->setEnabled(gAgent.canJoinGroups());
LLScrollListCtrl* group_list = getChild<LLScrollListCtrl>("group list");
if (!group_list) return;
LLUUID group_id;
@@ -368,7 +368,7 @@ LLSD create_group_element(const LLGroupData *group_datap, const LLUUID &active_g
void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask)
{
S32 count = gAgent.mGroups.count();
S32 count = gAgent.mGroups.size();
LLUUID id;
LLCtrlListInterface *group_list = ctrl->getListInterface();
if (!group_list) return;
@@ -381,7 +381,7 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow
for(S32 i = 0; i < count; ++i)
{
LLSD element = create_group_element(&gAgent.mGroups.get(i), highlight_id, powers_mask);
LLSD element = create_group_element(&gAgent.mGroups[i], highlight_id, powers_mask);
if(element.size())
group_list->addElement(element, ADD_SORTED);
}

View File

@@ -165,19 +165,39 @@ LLParcel* LLFloaterLand::getCurrentSelectedParcel()
//static
LLPanelLandObjects* LLFloaterLand::getCurrentPanelLandObjects()
{
return LLFloaterLand::getInstance()->mPanelObjects;
LLFloaterLand* land_instance = LLFloaterLand::getInstance();
if (land_instance)
{
return land_instance->mPanelObjects;
}
else
{
return NULL;
}
}
//static
LLPanelLandCovenant* LLFloaterLand::getCurrentPanelLandCovenant()
{
return LLFloaterLand::getInstance()->mPanelCovenant;
LLFloaterLand* land_instance = LLFloaterLand::getInstance();
if (land_instance)
{
return land_instance->mPanelCovenant;
}
else
{
return NULL;
}
}
// static
void LLFloaterLand::refreshAll()
{
LLFloaterLand::getInstance()->refresh();
LLFloaterLand* land_instance = LLFloaterLand::getInstance();
if (land_instance)
{
land_instance->refresh();
}
}
void LLFloaterLand::onOpen()
@@ -763,6 +783,7 @@ void LLPanelLandGeneral::refresh()
BOOL use_pass = parcel->getOwnerID()!= gAgent.getID() && parcel->getParcelFlag(PF_USE_PASS_LIST) && !LLViewerParcelMgr::getInstance()->isCollisionBanned();;
mBtnBuyPass->setEnabled(use_pass);
}
}
@@ -857,11 +878,13 @@ void LLPanelLandGeneral::onClickProfile()
if (parcel->getIsGroupOwned())
{
LLGroupActions::show(parcel->getGroupID());
const LLUUID& group_id = parcel->getGroupID();
LLGroupActions::show(group_id);
}
else
{
LLAvatarActions::showProfile(parcel->getOwnerID());
const LLUUID& avatar_id = parcel->getOwnerID();
LLAvatarActions::showProfile(avatar_id);
}
}
@@ -1538,7 +1561,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
BOOL is_group_owned;
S32 object_count;
U32 most_recent_time = 0;
BOOL is_online = 0;
BOOL is_online;
std::string object_count_str;
//BOOL b_need_refresh = FALSE;
@@ -1553,7 +1576,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
std::vector<LLUUID> avatar_ids;
std::vector<LLVector3d> positions;
LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, F32_MAX);
for(S32 i = 0; i < rows; ++i)
{
msg->getUUIDFast(_PREHASH_Data, _PREHASH_OwnerID, owner_id, i);
@@ -2834,11 +2857,12 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
void LLPanelLandAccess::onClickAddAccess()
{
LLFloater* root_floater = gFloaterView->getParentFloater(this);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1));
if (picker)
{
gFloaterView->getParentFloater(this)->addDependentFloater(picker);
root_floater->addDependentFloater(picker);
}
}
@@ -2882,11 +2906,12 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data)
void LLPanelLandAccess::onClickAddBanned()
{
LLFloater* root_floater = gFloaterView->getParentFloater(this);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1));
if (picker)
{
gFloaterView->getParentFloater(this)->addDependentFloater(picker);
root_floater->addDependentFloater(picker);
}
}
@@ -3064,15 +3089,15 @@ void LLFloaterLand::open()
// Ideally we could just use LLViewerParcelMgr::isParcelOwnedByAgent(), but that has that sneaky exemption
// for fake god like (aka View Admin Options)
const LLUUID& idOwner = pParcel->getOwnerID();
if ( (idOwner != gAgent.getID()) )
if (idOwner != gAgentID)
{
// *sighs* LLAgent::hasPowerInGroup() has it too so copy/paste from there
S32 count = gAgent.mGroups.count(); bool fShow = false;
S32 count = gAgent.mGroups.size(); bool fShow = false;
for (S32 i = 0; i < count; ++i)
{
if (gAgent.mGroups.get(i).mID == idOwner)
if (gAgent.mGroups[i].mID == idOwner)
{
fShow |= ((gAgent.mGroups.get(i).mPowers & GP_LAND_RETURN) > 0);
fShow |= ((gAgent.mGroups[i].mPowers & GP_LAND_RETURN) > 0);
break;
}
}

View File

@@ -100,27 +100,26 @@ BOOL LLFloaterLandHoldings::postBuild()
childSetAction("Teleport", onClickTeleport, this);
childSetAction("Show on Map", onClickMap, this);
LLScrollListCtrl *grant_list = getChild<LLScrollListCtrl>("grant list");
// Grant list
LLScrollListCtrl *grant_list = getChild<LLScrollListCtrl>("grant list");
grant_list->setDoubleClickCallback(boost::bind(LLGroupActions::show, boost::bind(&LLScrollListCtrl::getCurrentID, grant_list)));
LLCtrlListInterface *list = grant_list->getListInterface();
if (!list) return TRUE;
S32 count = gAgent.mGroups.count();
S32 count = gAgent.mGroups.size();
for(S32 i = 0; i < count; ++i)
{
LLUUID id(gAgent.mGroups.get(i).mID);
LLUUID id(gAgent.mGroups.at(i).mID);
LLSD element;
element["id"] = id;
element["columns"][0]["column"] = "group";
element["columns"][0]["value"] = gAgent.mGroups.get(i).mName;
element["columns"][0]["value"] = gAgent.mGroups.at(i).mName;
element["columns"][0]["font"] = "SANSSERIF";
LLUIString areastr = getString("area_string");
areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.get(i).mContribution));
areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.at(i).mContribution));
element["columns"][1]["column"] = "area";
element["columns"][1]["value"] = areastr;
element["columns"][1]["font"] = "SANSSERIF";
@@ -128,6 +127,8 @@ BOOL LLFloaterLandHoldings::postBuild()
list->addElement(element, ADD_SORTED);
}
center();
return TRUE;
}
@@ -157,8 +158,8 @@ void LLFloaterLandHoldings::refresh()
enable_btns = TRUE;
}
childSetEnabled("Teleport", enable_btns);
childSetEnabled("Show on Map", enable_btns);
getChildView("Teleport")->setEnabled(enable_btns);
getChildView("Show on Map")->setEnabled(enable_btns);
refreshAggregates();
}
@@ -291,15 +292,16 @@ void LLFloaterLandHoldings::buttonCore(S32 which)
F64 global_z = gAgent.getPositionGlobal().mdV[VZ];
LLVector3d pos_global(global_x, global_y, global_z);
LLFloaterWorldMap* floater_world_map = gFloaterWorldMap;
switch(which)
{
case 0:
gAgent.teleportViaLocation(pos_global);
gFloaterWorldMap->trackLocation(pos_global);
if(floater_world_map) floater_world_map->trackLocation(pos_global);
break;
case 1:
gFloaterWorldMap->trackLocation(pos_global);
if(floater_world_map) floater_world_map->trackLocation(pos_global);
LLFloaterWorldMap::show(true);
break;
default:
@@ -329,7 +331,7 @@ void LLFloaterLandHoldings::refreshAggregates()
S32 current_area = gStatusBar->getSquareMetersCommitted();
S32 available_area = gStatusBar->getSquareMetersLeft();
childSetTextArg("allowed_text", "[AREA]", llformat("%d",allowed_area));
childSetTextArg("current_text", "[AREA]", llformat("%d",current_area));
childSetTextArg("available_text", "[AREA]", llformat("%d",available_area));
getChild<LLUICtrl>("allowed_text")->setTextArg("[AREA]", llformat("%d",allowed_area));
getChild<LLUICtrl>("current_text")->setTextArg("[AREA]", llformat("%d",current_area));
getChild<LLUICtrl>("available_text")->setTextArg("[AREA]", llformat("%d",available_area));
}

View File

@@ -41,7 +41,6 @@
#include "llavatarnamecache.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llenvmanager.h"
#include "llfloater.h"
#include "llfontgl.h"
#include "llnotifications.h"
@@ -84,7 +83,7 @@ void LLFloaterPathfindingObjects::onOpen(/*const LLSD &pKey*/)
if (!mRegionBoundaryCrossingSlot.connected())
{
mRegionBoundaryCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLFloaterPathfindingObjects::onRegionBoundaryCrossed, this));
mRegionBoundaryCrossingSlot = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterPathfindingObjects::onRegionBoundaryCrossed, this));
}
if (!mGodLevelChangeSlot.connected())
@@ -384,19 +383,31 @@ void LLFloaterPathfindingObjects::buildObjectsScrollList(const LLPathfindingObje
void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjectPtr pObjectPtr, const LLSD &pScrollListItemData)
{
LLSD rowParams;
rowParams["id"] = pObjectPtr->getUUID();
LLScrollListCell::Params cellParams;
//cellParams.font = LLFontGL::getFontSansSerif();
LLScrollListItem::Params rowParams;
rowParams.value = pObjectPtr->getUUID().asString();
llassert(pScrollListItemData.isArray());
S32 idx = 0;
for (LLSD::array_const_iterator cellIter = pScrollListItemData.beginArray();
cellIter != pScrollListItemData.endArray(); ++cellIter)
{
rowParams["columns"][idx] = *cellIter;
idx++;
const LLSD &cellElement = *cellIter;
llassert(cellElement.has("column"));
llassert(cellElement.get("column").isString());
cellParams.column = cellElement.get("column").asString();
llassert(cellElement.has("value"));
llassert(cellElement.get("value").isString());
cellParams.value = cellElement.get("value").asString();
rowParams.columns.add(cellParams);
}
LLScrollListItem *scrollListItem = mObjectsScrollList->addElement(rowParams);
LLScrollListItem *scrollListItem = mObjectsScrollList->addRow(rowParams);
if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName())
{
mMissingNameObjectsScrollListItems.insert(std::make_pair(pObjectPtr->getUUID().asString(), scrollListItem));

View File

@@ -37,10 +37,6 @@
#include "llviewerregion.h"
#include "lluictrlfactory.h"
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy asyncConsoleResponder_timeout;
extern AIHTTPTimeoutPolicy consoleResponder_timeout;
// Two versions of the sim console API are supported.
//
// SimConsole capability (deprecated):
@@ -81,7 +77,6 @@ namespace
{
public:
/*virtual*/ void httpFailure(void) { sConsoleReplySignal(UNABLE_TO_SEND_COMMAND); }
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return asyncConsoleResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "AsyncConsoleResponder"; }
};
@@ -111,7 +106,6 @@ namespace
}
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return consoleResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "ConsoleResponder"; }
LLTextEditor * mOutput;

View File

@@ -61,6 +61,7 @@
#include "llfloatergodtools.h" // for send_sim_wide_deletes()
#include "llfloatertopobjects.h" // added to fix SL-32336
#include "llfloatergroups.h"
#include "llfloaterregiondebugconsole.h"
#include "llfloatertelehub.h"
#include "llinventorymodel.h"
#include "lllineeditor.h"
@@ -94,9 +95,6 @@
const S32 TERRAIN_TEXTURE_COUNT = 4;
const S32 CORNER_COUNT = 4;
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy estateChangeInfoResponder_timeout;
///----------------------------------------------------------------------------
/// Local class declaration
///----------------------------------------------------------------------------
@@ -252,7 +250,7 @@ BOOL LLFloaterRegionInfo::postBuild()
&processEstateOwnerRequest);
// Request region info when agent region changes.
LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterRegionInfo::requestRegionInfo, this));
gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionInfo::requestRegionInfo, this));
return TRUE;
}
@@ -269,6 +267,7 @@ void LLFloaterRegionInfo::onOpen()
refreshFromRegion(gAgent.getRegion());
requestRegionInfo();
requestMeshRezInfo();
LLFloater::onOpen();
}
@@ -650,9 +649,10 @@ void LLPanelRegionInfo::initCtrl(const std::string& name)
getChild<LLUICtrl>(name)->setCommitCallback(boost::bind(&LLPanelRegionInfo::onChangeAnything, this));
}
// Singu TODO: Make this a callback registrar function instead.
void LLPanelRegionInfo::initHelpBtn(const std::string& name, const std::string& xml_alert)
{
childSetAction(name, boost::bind(&LLPanelRegionInfo::onClickHelp, this, xml_alert));
getChild<LLButton>(name)->setCommitCallback(boost::bind(&LLPanelRegionInfo::onClickHelp, this, xml_alert));
}
void LLPanelRegionInfo::onClickHelp(const std::string& xml_alert)
@@ -857,6 +857,46 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L
return false;
}
class ConsoleRequestResponder : public LLHTTPClient::ResponderIgnoreBody
{
LOG_CLASS(ConsoleRequestResponder);
protected:
/*virtual*/
void httpFailure()
{
llwarns << "error requesting mesh_rez_enabled " << dumpResponse() << llendl;
}
/*virtual*/ const char* getName() const { return "ConsoleRequestResponder"; }
};
// called if this request times out.
class ConsoleUpdateResponder : public LLHTTPClient::ResponderIgnoreBody
{
LOG_CLASS(ConsoleUpdateResponder);
protected:
/* virtual */
void httpFailure()
{
llwarns << "error updating mesh enabled region setting " << dumpResponse() << llendl;
}
};
void LLFloaterRegionInfo::requestMeshRezInfo()
{
std::string sim_console_url = gAgent.getRegion()->getCapability("SimConsoleAsync");
if (!sim_console_url.empty())
{
std::string request_str = "get mesh_rez_enabled";
LLHTTPClient::post(
sim_console_url,
LLSD(request_str),
new ConsoleRequestResponder);
}
}
// setregioninfo
// strings[0] = 'Y' - block terraform, 'N' - not
// strings[1] = 'Y' - block fly, 'N' - not
@@ -969,6 +1009,7 @@ BOOL LLPanelRegionDebugInfo::postBuild()
childSetAction("top_scripts_btn", onClickTopScripts, this);
childSetAction("restart_btn", onClickRestart, this);
childSetAction("cancel_restart_btn", onClickCancelRestart, this);
childSetAction("region_debug_console_btn", onClickDebugConsole, this);
return TRUE;
}
@@ -990,6 +1031,7 @@ bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region)
getChildView("top_scripts_btn")->setEnabled(allow_modify);
getChildView("restart_btn")->setEnabled(allow_modify);
getChildView("cancel_restart_btn")->setEnabled(allow_modify);
getChildView("region_debug_console_btn")->setEnabled(allow_modify);
return LLPanelRegionInfo::refreshFromRegion(region);
}
@@ -1145,6 +1187,11 @@ void LLPanelRegionDebugInfo::onClickCancelRestart(void* data)
self->sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings);
}
// static
void LLPanelRegionDebugInfo::onClickDebugConsole(void* data)
{
LLFloaterRegionDebugConsole::getInstance()->open();
}
BOOL LLPanelRegionTerrainInfo::validateTextureSizes()
{
@@ -1162,7 +1209,7 @@ BOOL LLPanelRegionTerrainInfo::validateTextureSizes()
S32 width = img->getFullWidth();
S32 height = img->getFullHeight();
//llinfos << "texture detail " << i << " is " << width << "x" << height << "x" << components << llendl;
//LL_INFOS() << "texture detail " << i << " is " << width << "x" << height << "x" << components << LL_ENDL;
if (components != 3)
{
@@ -1173,7 +1220,7 @@ BOOL LLPanelRegionTerrainInfo::validateTextureSizes()
return FALSE;
}
if (width > 1024 || height > 1024)
if (width > 1024 || height > 1024) // <alchemy/>
{
LLSD args;
@@ -1590,7 +1637,7 @@ void LLPanelEstateInfo::onClickKickUser()
void LLPanelEstateInfo::onKickUserCommit(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names)
{
if (names.empty() || ids.empty()) return;
//check to make sure there is one valid user and id
if( ids[0].isNull() )
{
@@ -1794,7 +1841,7 @@ void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, LLEstateAccessChan
LLSD args;
args["NUM_ADDED"] = llformat("%d",ids.size());
args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
args["LIST_TYPE"] = "Allowed Residents";
args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeAllowedAgents");
args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS);
LLNotificationsUtil::add("MaxAgentOnRegionBatch", args);
delete change_info;
@@ -1810,7 +1857,7 @@ void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, LLEstateAccessChan
LLSD args;
args["NUM_ADDED"] = llformat("%d",ids.size());
args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
args["LIST_TYPE"] = "Banned Residents";
args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeBannedAgents");
args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS);
LLNotificationsUtil::add("MaxAgentOnRegionBatch", args);
delete change_info;
@@ -2337,16 +2384,18 @@ void LLPanelEstateInfo::getEstateOwner()
class LLEstateChangeInfoResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(LLEstateChangeInfoResponder);
public:
LLEstateChangeInfoResponder(LLPanelEstateInfo* panel)
{
mpPanel = panel->getHandle();
}
protected:
// if we get a normal response, handle it here
/*virtual*/ void httpSuccess(void)
virtual void httpSuccess()
{
LL_INFOS("Windlight") << "Successfully committed estate info" << llendl;
LL_INFOS("Windlight") << "Successfully committed estate info" << LL_ENDL;
// refresh the panel from the database
LLPanelEstateInfo* panel = dynamic_cast<LLPanelEstateInfo*>(mpPanel.get());
@@ -2355,13 +2404,11 @@ public:
}
// if we get an error response
/*virtual*/ void httpFailure(void)
virtual void httpFailure()
{
llinfos << "LLEstateChangeInfoResponder::error [status:"
<< mStatus << "]: " << mReason << llendl;
LL_WARNS("Windlight") << dumpResponse() << LL_ENDL;
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLEstateChangeInfoResponder"; }
private:
@@ -2931,9 +2978,10 @@ bool LLDispatchSetEstateAccess::operator()(
}
std::string msg = llformat("Banned residents: (%d, max %d)",
totalBannedAgents,
ESTATE_MAX_ACCESS_IDS);
LLStringUtil::format_map_t args;
args["[BANNEDAGENTS]"] = llformat("%d", totalBannedAgents);
args["[MAXBANNED]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS);
std::string msg = LLTrans::getString("RegionInfoBannedResidents", args);
panel->getChild<LLUICtrl>("ban_resident_label")->setValue(LLSD(msg));
if (banned_agent_name_list)
@@ -2953,9 +3001,10 @@ bool LLDispatchSetEstateAccess::operator()(
if (access_flags & ESTATE_ACCESS_MANAGERS)
{
std::string msg = llformat("Estate Managers: (%d, max %d)",
num_estate_managers,
ESTATE_MAX_MANAGERS);
LLStringUtil::format_map_t args;
args["[ESTATEMANAGERS]"] = llformat("%d", num_estate_managers);
args["[MAXMANAGERS]"] = llformat("%d", ESTATE_MAX_MANAGERS);
std::string msg = LLTrans::getString("RegionInfoEstateManagers", args);
panel->getChild<LLUICtrl>("estate_manager_label")->setValue(LLSD(msg));
LLNameListCtrl* estate_manager_name_list =
@@ -3586,12 +3635,9 @@ void LLFloaterRegionInfo::open()
// We'll allow access to the estate tools for estate managers (and for the sim owner)
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
{
LLViewerRegion* pRegion = gAgent.getRegion();
if (!pRegion)
return;
const LLViewerRegion* region(gAgent.getRegion());
// Should be able to call LLRegion::canManageEstate() but then we can fake god like
if ( (!pRegion->isEstateManager()) && (pRegion->getOwner() != gAgent.getID()) )
if (!(region && region->isEstateManager() && region->getOwner() == gAgentID))
return;
}

View File

@@ -95,11 +95,15 @@ public:
virtual void refresh();
void requestRegionInfo();
void requestMeshRezInfo();
private:
protected:
LLFloaterRegionInfo(const LLSD& seed);
~LLFloaterRegionInfo();
protected:
void onTabSelected(const LLSD& param);
void refreshFromRegion(LLViewerRegion* region);
@@ -211,6 +215,7 @@ protected:
static void onClickRestart(void* data);
bool callbackRestart(const LLSD& notification, const LLSD& response);
static void onClickCancelRestart(void* data);
static void onClickDebugConsole(void* data);
private:
LLUUID mTargetAvatar;
@@ -229,6 +234,7 @@ public:
virtual BOOL postBuild(); // LLPanel
virtual bool refreshFromRegion(LLViewerRegion* region); // refresh local settings from region update from simulator
void setEnvControls(bool available); // Whether environment settings are available for this region
BOOL validateTextureSizes();

View File

@@ -31,7 +31,6 @@
#include "lluictrlfactory.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llenvmanager.h"
#include "llviewercontrol.h"
#include "llviewerwindow.h"
@@ -103,31 +102,49 @@ LLFloaterRegionRestarting::LLFloaterRegionRestarting(const LLSD& key) :
{
//buildFromFile("floater_region_restarting.xml");
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_restarting.xml");
LLStringUtil::format_map_t args;
args["[NAME]"] = key["NAME"].asString();
getChild<LLTextBox>("region_name")->setValue(getString("RegionName", args));
mRestartSeconds = getChild<LLTextBox>("restart_seconds");
mName = key["NAME"].asString(); // <alchemy/>
center();
refresh();
mRegionChangedConnection = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterRegionRestarting::close, this, false));
if (mSeconds <= 20) emergency_teleport(); // <singu/> For emergency teleports
}
LLFloaterRegionRestarting::~LLFloaterRegionRestarting()
{
if (sShakeState != SHAKE_DONE && sShakeState != SHAKE_START) // Finish shake if needed
{
gAgentCamera.resetView(TRUE, TRUE);
sShakeState = SHAKE_DONE;
}
mRegionChangedConnection.disconnect();
}
BOOL LLFloaterRegionRestarting::postBuild()
{
mRegionChangedConnection = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionRestarting::regionChange, this));
if (mSeconds <= 20) emergency_teleport(); // <singu/> For emergency teleports
LLStringUtil::format_map_t args;
std::string text;
args["[NAME]"] = mName;
text = getString("RegionName", args);
LLTextBox* textbox = getChild<LLTextBox>("region_name");
textbox->setValue(text);
mRestartSeconds = getChild<LLTextBox>("restart_seconds");
setBackgroundColor(gColors.getColor("NotifyCautionBoxColor"));
sShakeState = SHAKE_START;
refresh();
return TRUE;
}
void LLFloaterRegionRestarting::regionChange()
{
close();
}
BOOL LLFloaterRegionRestarting::tick()
{
refresh();
@@ -150,9 +167,9 @@ void LLFloaterRegionRestarting::draw()
{
LLFloater::draw();
static const LLCachedControl<bool> alchemyRegionShake(gSavedSettings, "AlchemyRegionRestartShake", true);
if (!alchemyRegionShake || isMinimized()) // If we're minimized, leave the user alone
return;
static const LLCachedControl<bool> alchemyRegionShake(gSavedSettings, "AlchemyRegionRestartShake", true);
if (!alchemyRegionShake || isMinimized()) // If we're minimized, leave the user alone
return;
const F32 SHAKE_INTERVAL = 0.025f;
const F32 SHAKE_TOTAL_DURATION = 1.8f; // the length of the default alert tone for this
@@ -213,16 +230,6 @@ void LLFloaterRegionRestarting::draw()
}
}
void LLFloaterRegionRestarting::onClose(bool app_quitting)
{
if (sShakeState != SHAKE_DONE && sShakeState != SHAKE_START) // Finish shake if needed
{
gAgentCamera.resetView(TRUE, TRUE);
sShakeState = SHAKE_DONE;
}
LLFloater::onClose(app_quitting);
}
void LLFloaterRegionRestarting::updateTime(const U32& time)
{
mSeconds = time;

View File

@@ -45,10 +45,11 @@ private:
virtual BOOL tick();
virtual void refresh();
virtual void draw();
virtual void onClose(bool app_quitting);
virtual void regionChange();
class LLTextBox* mRestartSeconds;
U32 mSeconds;
std::string mName;
U32 mShakeIterations;
F32 mShakeMagnitude;
LLTimer mShakeTimer;

View File

@@ -40,7 +40,6 @@
#include "llpanelgroup.h"
#include "llviewermessage.h"
#include "groupchatlistener.h"
#include "hippolimits.h" // for getMaxAgentGroups
// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.3.0)
#include "llslurl.h"
#include "rlvactions.h"
@@ -239,7 +238,7 @@ void LLGroupActions::startCall(const LLUUID& group_id)
// static
void LLGroupActions::join(const LLUUID& group_id)
{
if (gAgent.mGroups.count() >= gHippoLimits->getMaxAgentGroups()) //!gAgent.canJoinGroups()
if (!gAgent.canJoinGroups())
{
LLNotificationsUtil::add("JoinedTooManyGroups");
return;

View File

@@ -54,6 +54,8 @@ LLMenuOptionPathfindingRebakeNavmesh::LLMenuOptionPathfindingRebakeNavmesh()
LLMenuOptionPathfindingRebakeNavmesh::~LLMenuOptionPathfindingRebakeNavmesh()
{
if (mIsInitialized)
{
if (mRebakeNavMeshMode == kRebakeNavMesh_RequestSent)
{
LL_WARNS("navmeshRebaking") << "During destruction of the LLMenuOptionPathfindingRebakeNavmesh "
@@ -61,9 +63,6 @@ LLMenuOptionPathfindingRebakeNavmesh::~LLMenuOptionPathfindingRebakeNavmesh()
<< "to be received. This could contribute to a crash on exit." << LL_ENDL;
}
llassert(!mIsInitialized);
if (mIsInitialized)
{
quit();
}
}
@@ -80,7 +79,7 @@ void LLMenuOptionPathfindingRebakeNavmesh::initialize()
if ( !mRegionCrossingSlot.connected() )
{
mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLMenuOptionPathfindingRebakeNavmesh::handleRegionBoundaryCrossed, this));
mRegionCrossingSlot = gAgent.addRegionChangedCallback(boost::bind(&LLMenuOptionPathfindingRebakeNavmesh::handleRegionBoundaryCrossed, this));
}
if (!mAgentStateSlot.connected())
@@ -93,8 +92,7 @@ void LLMenuOptionPathfindingRebakeNavmesh::initialize()
void LLMenuOptionPathfindingRebakeNavmesh::quit()
{
llassert(mIsInitialized);
if (mIsInitialized)
if (mIsInitialized) // Quitting from the login screen leaves this uninitialized
{
if (mNavMeshSlot.connected())
{
@@ -174,51 +172,60 @@ void LLMenuOptionPathfindingRebakeNavmesh::handleAgentState(BOOL pCanRebakeRegio
void LLMenuOptionPathfindingRebakeNavmesh::handleRebakeNavMeshResponse(bool pResponseStatus)
{
llassert(mIsInitialized);
if (getMode() == kRebakeNavMesh_RequestSent)
if (mIsInitialized)
{
setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default);
}
if (getMode() == kRebakeNavMesh_RequestSent)
{
setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default);
}
if (!pResponseStatus)
{
LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh");
if (!pResponseStatus)
{
LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh");
}
}
}
void LLMenuOptionPathfindingRebakeNavmesh::handleNavMeshStatus(const LLPathfindingNavMeshStatus &pNavMeshStatus)
{
llassert(mIsInitialized);
ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default;
if (pNavMeshStatus.isValid())
if (mIsInitialized)
{
switch (pNavMeshStatus.getStatus())
ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default;
if (pNavMeshStatus.isValid())
{
case LLPathfindingNavMeshStatus::kPending :
case LLPathfindingNavMeshStatus::kRepending :
rebakeNavMeshMode = kRebakeNavMesh_Available;
break;
case LLPathfindingNavMeshStatus::kBuilding :
rebakeNavMeshMode = kRebakeNavMesh_InProgress;
break;
case LLPathfindingNavMeshStatus::kComplete :
rebakeNavMeshMode = kRebakeNavMesh_NotAvailable;
break;
default :
rebakeNavMeshMode = kRebakeNavMesh_Default;
llassert(0);
break;
switch (pNavMeshStatus.getStatus())
{
case LLPathfindingNavMeshStatus::kPending :
case LLPathfindingNavMeshStatus::kRepending :
rebakeNavMeshMode = kRebakeNavMesh_Available;
break;
case LLPathfindingNavMeshStatus::kBuilding :
rebakeNavMeshMode = kRebakeNavMesh_InProgress;
break;
case LLPathfindingNavMeshStatus::kComplete :
rebakeNavMeshMode = kRebakeNavMesh_NotAvailable;
break;
default:
rebakeNavMeshMode = kRebakeNavMesh_Default;
llassert(0);
break;
}
}
}
setMode(rebakeNavMeshMode);
setMode(rebakeNavMeshMode);
}
}
void LLMenuOptionPathfindingRebakeNavmesh::handleRegionBoundaryCrossed()
{
llassert(mIsInitialized);
createNavMeshStatusListenerForCurrentRegion();
mCanRebakeRegion = FALSE;
LLPathfindingManager::getInstance()->requestGetAgentState();
if (mIsInitialized)
{
createNavMeshStatusListenerForCurrentRegion();
mCanRebakeRegion = FALSE;
LLPathfindingManager::getInstance()->requestGetAgentState();
}
}
void LLMenuOptionPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrentRegion()
@@ -235,3 +242,4 @@ void LLMenuOptionPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrent
LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true);
}
}

View File

@@ -65,7 +65,6 @@
#include "lluistring.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llenvmanager.h"
namespace
{
@@ -235,7 +234,7 @@ LLMuteList::LLMuteList() :
gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList);
checkNewRegion();
LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLMuteList::checkNewRegion, this));
gAgent.addRegionChangedCallback(boost::bind(&LLMuteList::checkNewRegion, this));
}
//-----------------------------------------------------------------------------

View File

@@ -1631,12 +1631,12 @@ void LLPanelAvatar::resetGroupList()
group_list->deleteAllItems();
S32 count = gAgent.mGroups.count();
S32 count = gAgent.mGroups.size();
LLUUID id;
for(S32 i = 0; i < count; ++i)
{
LLGroupData group_data = gAgent.mGroups.get(i);
LLGroupData group_data = gAgent.mGroups[i];
id = group_data.mID;
std::string group_string;
/* Show group title? DUMMY_POWER for Don Grep

View File

@@ -56,15 +56,6 @@
#include "llviewerregion.h"
#include "llweb.h"
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy navMeshStatusResponder_timeout;
extern AIHTTPTimeoutPolicy navMeshResponder_timeout;
extern AIHTTPTimeoutPolicy agentStateResponder_timeout;
extern AIHTTPTimeoutPolicy navMeshRebakeResponder_timeout;
extern AIHTTPTimeoutPolicy objectLinksetsResponder_timeout;
extern AIHTTPTimeoutPolicy terrainLinksetsResponder_timeout;
extern AIHTTPTimeoutPolicy charactersResponder_timeout;
#define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc"
#define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus"
@@ -112,19 +103,18 @@ LLHTTPRegistration<LLAgentStateChangeNode> gHTTPRegistrationAgentStateChangeNode
class NavMeshStatusResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(NavMeshStatusResponder);
public:
NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly);
NavMeshStatusResponder(LLViewerRegion *pRegion, bool pIsGetStatusOnly);
virtual ~NavMeshStatusResponder();
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshStatusResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "NavMeshStatusResponder"; }
protected:
virtual void httpSuccess();
virtual void httpFailure();
private:
std::string mCapabilityURL;
LLViewerRegion *mRegion;
LLUUID mRegionUUID;
bool mIsGetStatusOnly;
@@ -136,19 +126,18 @@ private:
class NavMeshResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(NavMeshResponder);
public:
NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr);
NavMeshResponder(U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr);
virtual ~NavMeshResponder();
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "NavMeshResponder"; }
protected:
virtual void httpSuccess();
virtual void httpFailure();
private:
std::string mCapabilityURL;
U32 mNavMeshVersion;
LLPathfindingNavMeshPtr mNavMeshPtr;
};
@@ -159,19 +148,16 @@ private:
class AgentStateResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(AgentStateResponder);
public:
AgentStateResponder(const std::string &pCapabilityURL);
AgentStateResponder();
virtual ~AgentStateResponder();
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return agentStateResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "AgentStateResponder"; }
protected:
private:
std::string mCapabilityURL;
virtual void httpSuccess();
virtual void httpFailure();
};
@@ -180,19 +166,18 @@ private:
//---------------------------------------------------------------------------
class NavMeshRebakeResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(NavMeshRebakeResponder);
public:
NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback);
NavMeshRebakeResponder(LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback);
virtual ~NavMeshRebakeResponder();
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshRebakeResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "NavMeshRebakeResponder"; }
protected:
virtual void httpSuccess();
virtual void httpFailure();
private:
std::string mCapabilityURL;
LLPathfindingManager::rebake_navmesh_callback_t mRebakeNavMeshCallback;
};
@@ -207,9 +192,9 @@ public:
virtual ~LinksetsResponder();
void handleObjectLinksetsResult(const LLSD &pContent);
void handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL);
void handleObjectLinksetsError();
void handleTerrainLinksetsResult(const LLSD &pContent);
void handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL);
void handleTerrainLinksetsError();
protected:
@@ -241,19 +226,18 @@ typedef boost::shared_ptr<LinksetsResponder> LinksetsResponderPtr;
//---------------------------------------------------------------------------
class ObjectLinksetsResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(ObjectLinksetsResponder);
public:
ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr);
ObjectLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr);
virtual ~ObjectLinksetsResponder();
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return objectLinksetsResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "ObjectLinksetsResponder"; }
protected:
virtual void httpSuccess();
virtual void httpFailure();
private:
std::string mCapabilityURL;
LinksetsResponderPtr mLinksetsResponsderPtr;
};
@@ -262,19 +246,18 @@ private:
//---------------------------------------------------------------------------
class TerrainLinksetsResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(TerrainLinksetsResponder);
public:
TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr);
TerrainLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr);
virtual ~TerrainLinksetsResponder();
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return terrainLinksetsResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "TerrainLinksetsResponder"; }
protected:
virtual void httpSuccess();
virtual void httpFailure();
private:
std::string mCapabilityURL;
LinksetsResponderPtr mLinksetsResponsderPtr;
};
@@ -283,19 +266,18 @@ private:
//---------------------------------------------------------------------------
class CharactersResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(TerrainLinksetsResponder);
public:
CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback);
CharactersResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback);
virtual ~CharactersResponder();
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return charactersResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "CharactersResponder"; }
protected:
virtual void httpSuccess();
virtual void httpFailure();
private:
std::string mCapabilityURL;
LLPathfindingManager::request_id_t mRequestId;
LLPathfindingManager::object_request_callback_t mCharactersCallback;
};
@@ -382,7 +364,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, b
std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion);
llassert(!navMeshStatusURL.empty());
navMeshPtr->handleNavMeshCheckVersion();
LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion, pIsGetStatusOnly);
LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(pRegion, pIsGetStatusOnly);
LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder);
}
}
@@ -416,12 +398,12 @@ void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_re
bool doRequestTerrain = isAllowViewTerrainProperties();
LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain));
LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr);
LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(linksetsResponderPtr);
LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder);
if (doRequestTerrain)
{
LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(linksetsResponderPtr);
LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder);
}
}
@@ -465,13 +447,13 @@ void LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, const LLP
if (!objectPostData.isUndefined())
{
LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr);
LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(linksetsResponderPtr);
LLHTTPClient::put(objectLinksetsURL, objectPostData, objectLinksetsResponder);
}
if (!terrainPostData.isUndefined())
{
LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(linksetsResponderPtr);
LLHTTPClient::put(terrainLinksetsURL, terrainPostData, terrainLinksetsResponder);
}
}
@@ -504,7 +486,7 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_
{
pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr);
LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback);
LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(pRequestId, pCharactersCallback);
LLHTTPClient::get(charactersURL, charactersResponder);
}
}
@@ -537,7 +519,7 @@ void LLPathfindingManager::requestGetAgentState()
{
std::string agentStateURL = getAgentStateURLForRegion(currentRegion);
llassert(!agentStateURL.empty());
LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL);
LLHTTPClient::ResponderPtr responder = new AgentStateResponder();
LLHTTPClient::get(agentStateURL, responder);
}
}
@@ -561,7 +543,7 @@ void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebak
llassert(!navMeshStatusURL.empty());
LLSD postData;
postData["command"] = "rebuild";
LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(navMeshStatusURL, pRebakeNavMeshCallback);
LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(pRebakeNavMeshCallback);
LLHTTPClient::post(navMeshStatusURL, postData, responder);
}
}
@@ -583,7 +565,7 @@ void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPt
else
{
navMeshPtr->handleNavMeshStart(pNavMeshStatus);
LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshStatus.getVersion(), navMeshPtr);
LLHTTPClient::ResponderPtr responder = new NavMeshResponder(pNavMeshStatus.getVersion(), navMeshPtr);
LLSD postData;
LLHTTPClient::post(navMeshURL, postData, responder);
@@ -797,8 +779,8 @@ void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, c
// NavMeshStatusResponder
//---------------------------------------------------------------------------
NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly) :
mCapabilityURL(pCapabilityURL),
NavMeshStatusResponder::NavMeshStatusResponder(LLViewerRegion *pRegion, bool pIsGetStatusOnly)
:
mRegion(pRegion),
mRegionUUID(),
mIsGetStatusOnly(pIsGetStatusOnly)
@@ -813,15 +795,15 @@ NavMeshStatusResponder::~NavMeshStatusResponder()
{
}
void NavMeshStatusResponder::httpSuccess(void)
void NavMeshStatusResponder::httpSuccess()
{
LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, mContent);
LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, getContent());
LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly);
}
void NavMeshStatusResponder::httpFailure(void)
void NavMeshStatusResponder::httpFailure()
{
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl;
llwarns << dumpResponse() << llendl;
LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID);
LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly);
}
@@ -830,8 +812,8 @@ void NavMeshStatusResponder::httpFailure(void)
// NavMeshResponder
//---------------------------------------------------------------------------
NavMeshResponder::NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr) :
mCapabilityURL(pCapabilityURL),
NavMeshResponder::NavMeshResponder(U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr)
:
mNavMeshVersion(pNavMeshVersion),
mNavMeshPtr(pNavMeshPtr)
{
@@ -841,21 +823,22 @@ NavMeshResponder::~NavMeshResponder()
{
}
void NavMeshResponder::httpSuccess(void)
void NavMeshResponder::httpSuccess()
{
mNavMeshPtr->handleNavMeshResult(mContent, mNavMeshVersion);
mNavMeshPtr->handleNavMeshResult(getContent(), mNavMeshVersion);
}
void NavMeshResponder::httpFailure(void)
void NavMeshResponder::httpFailure()
{
mNavMeshPtr->handleNavMeshError(mStatus, mReason, mCapabilityURL, mNavMeshVersion);
llwarns << dumpResponse() << llendl;
mNavMeshPtr->handleNavMeshError(mNavMeshVersion);
}
//---------------------------------------------------------------------------
// AgentStateResponder
//---------------------------------------------------------------------------
AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL) : mCapabilityURL(pCapabilityURL)
AgentStateResponder::AgentStateResponder()
{
}
@@ -863,17 +846,18 @@ AgentStateResponder::~AgentStateResponder()
{
}
void AgentStateResponder::httpSuccess(void)
void AgentStateResponder::httpSuccess()
{
llassert(mContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD));
llassert(mContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean());
BOOL canRebakeRegion = mContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean();
const LLSD& pContent = getContent();
llassert(pContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD));
llassert(pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean());
BOOL canRebakeRegion = pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean();
LLPathfindingManager::getInstance()->handleAgentState(canRebakeRegion);
}
void AgentStateResponder::httpFailure(void)
void AgentStateResponder::httpFailure()
{
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl;
llwarns << dumpResponse() << llendl;
LLPathfindingManager::getInstance()->handleAgentState(FALSE);
}
@@ -881,8 +865,8 @@ void AgentStateResponder::httpFailure(void)
//---------------------------------------------------------------------------
// navmesh rebake responder
//---------------------------------------------------------------------------
NavMeshRebakeResponder::NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback) :
mCapabilityURL(pCapabilityURL),
NavMeshRebakeResponder::NavMeshRebakeResponder(LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback)
:
mRebakeNavMeshCallback(pRebakeNavMeshCallback)
{
}
@@ -891,14 +875,14 @@ NavMeshRebakeResponder::~NavMeshRebakeResponder()
{
}
void NavMeshRebakeResponder::httpSuccess(void)
void NavMeshRebakeResponder::httpSuccess()
{
mRebakeNavMeshCallback(true);
}
void NavMeshRebakeResponder::httpFailure(void)
void NavMeshRebakeResponder::httpFailure()
{
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl;
llwarns << dumpResponse() << llendl;
mRebakeNavMeshCallback(false);
}
@@ -931,9 +915,9 @@ void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent)
}
}
void LinksetsResponder::handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL)
void LinksetsResponder::handleObjectLinksetsError()
{
llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
llwarns << "LinksetsResponder object linksets error" << llendl;
mObjectMessagingState = kReceivedError;
if (mTerrainMessagingState != kWaiting)
{
@@ -952,8 +936,9 @@ void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent)
}
}
void LinksetsResponder::handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL)
void LinksetsResponder::handleTerrainLinksetsError()
{
llwarns << "LinksetsResponder terrain linksets error" << llendl;
mTerrainMessagingState = kReceivedError;
if (mObjectMessagingState != kWaiting)
{
@@ -987,8 +972,8 @@ void LinksetsResponder::sendCallback()
// ObjectLinksetsResponder
//---------------------------------------------------------------------------
ObjectLinksetsResponder::ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) :
mCapabilityURL(pCapabilityURL),
ObjectLinksetsResponder::ObjectLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr)
:
mLinksetsResponsderPtr(pLinksetsResponsderPtr)
{
}
@@ -997,22 +982,23 @@ ObjectLinksetsResponder::~ObjectLinksetsResponder()
{
}
void ObjectLinksetsResponder::httpSuccess(void)
void ObjectLinksetsResponder::httpSuccess()
{
mLinksetsResponsderPtr->handleObjectLinksetsResult(mContent);
mLinksetsResponsderPtr->handleObjectLinksetsResult(getContent());
}
void ObjectLinksetsResponder::httpFailure(void)
void ObjectLinksetsResponder::httpFailure()
{
mLinksetsResponsderPtr->handleObjectLinksetsError(mStatus, mReason, mCapabilityURL);
llwarns << dumpResponse() << llendl;
mLinksetsResponsderPtr->handleObjectLinksetsError();
}
//---------------------------------------------------------------------------
// TerrainLinksetsResponder
//---------------------------------------------------------------------------
TerrainLinksetsResponder::TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) :
mCapabilityURL(pCapabilityURL),
TerrainLinksetsResponder::TerrainLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr)
:
mLinksetsResponsderPtr(pLinksetsResponsderPtr)
{
}
@@ -1021,22 +1007,23 @@ TerrainLinksetsResponder::~TerrainLinksetsResponder()
{
}
void TerrainLinksetsResponder::httpSuccess(void)
void TerrainLinksetsResponder::httpSuccess()
{
mLinksetsResponsderPtr->handleTerrainLinksetsResult(mContent);
mLinksetsResponsderPtr->handleTerrainLinksetsResult(getContent());
}
void TerrainLinksetsResponder::httpFailure(void)
void TerrainLinksetsResponder::httpFailure()
{
mLinksetsResponsderPtr->handleTerrainLinksetsError(mStatus, mReason, mCapabilityURL);
llwarns << dumpResponse() << llendl;
mLinksetsResponsderPtr->handleTerrainLinksetsError();
}
//---------------------------------------------------------------------------
// CharactersResponder
//---------------------------------------------------------------------------
CharactersResponder::CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback) :
mCapabilityURL(pCapabilityURL),
CharactersResponder::CharactersResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback)
:
mRequestId(pRequestId),
mCharactersCallback(pCharactersCallback)
{
@@ -1046,15 +1033,15 @@ CharactersResponder::~CharactersResponder()
{
}
void CharactersResponder::httpSuccess(void)
void CharactersResponder::httpSuccess()
{
LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(mContent));
LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(getContent()));
mCharactersCallback(mRequestId, LLPathfindingManager::kRequestCompleted, characterListPtr);
}
void CharactersResponder::httpFailure(void)
void CharactersResponder::httpFailure()
{
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl;
llwarns << dumpResponse() << llendl;
LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList());
mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr);

View File

@@ -184,9 +184,8 @@ void LLPathfindingNavMesh::handleNavMeshError()
setRequestStatus(kNavMeshRequestError);
}
void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion)
void LLPathfindingNavMesh::handleNavMeshError(U32 pNavMeshVersion)
{
llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
if (mNavMeshStatus.getVersion() == pNavMeshVersion)
{
handleNavMeshError();

View File

@@ -74,7 +74,7 @@ public:
void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion);
void handleNavMeshNotEnabled();
void handleNavMeshError();
void handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion);
void handleNavMeshError(U32 pNavMeshVersion);
protected:

View File

@@ -38,7 +38,6 @@
#include "llagent.h"
#include "llbutton.h"
#include "llcommandhandler.h"
#include "llenvmanager.h"
#include "llfloaterbuycurrency.h"
#include "llfloaterchat.h"
#include "llfloaterinventory.h"
@@ -235,7 +234,7 @@ mIsNavMeshDirty(false)
LLButton* buybtn = getChild<LLButton>("buycurrency");
buybtn->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLStatusBar::createNavMeshStatusListenerForCurrentRegion, this));
mRegionCrossingSlot = gAgent.addRegionChangedCallback(boost::bind(&LLStatusBar::createNavMeshStatusListenerForCurrentRegion, this));
createNavMeshStatusListenerForCurrentRegion();
// Adding Net Stat Graph

View File

@@ -45,7 +45,6 @@
#include "lltoolfocus.h"
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "lllslconstants.h"
//
// Constants
@@ -59,6 +58,11 @@ const S32 NUDGE_FRAMES = 2;
const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed
const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed
struct LLKeyboardActionRegistry
: public LLRegistrySingleton<std::string, boost::function<void (EKeystate keystate)>, LLKeyboardActionRegistry>
{
};
LLViewerKeyboard gViewerKeyboard;
void agent_jump( EKeystate s )
@@ -66,6 +70,7 @@ void agent_jump( EKeystate s )
if( KEYSTATE_UP == s ) return;
F32 time = gKeyboard->getCurKeyElapsedTime();
S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount());
if( time < FLY_TIME
|| frame_count <= FLY_FRAMES
|| gAgent.upGrabbed()
@@ -81,9 +86,9 @@ void agent_jump( EKeystate s )
}
void agent_toggle_down( EKeystate s )
{
if(KEYSTATE_UP == s) return;
if(KEYSTATE_DOWN == s && !gAgent.getFlying() && gSavedSettings.getBOOL("SGShiftCrouchToggle"))
if (KEYSTATE_UP == s) return;
if (KEYSTATE_DOWN == s && !gAgent.getFlying() && gSavedSettings.getBOOL("SGShiftCrouchToggle"))
{
gAgent.toggleCrouch();
}
@@ -242,7 +247,7 @@ void agent_toggle_fly( EKeystate s )
// Only catch the edge
if (KEYSTATE_DOWN == s )
{
gAgent.toggleFlying();
LLAgent::toggleFlying();
}
}
@@ -252,7 +257,7 @@ F32 get_orbit_rate()
if( time < NUDGE_TIME )
{
F32 rate = ORBIT_NUDGE_RATE + time * (1 - ORBIT_NUDGE_RATE)/ NUDGE_TIME;
//llinfos << rate << llendl;
//LL_INFOS() << rate << LL_ENDL;
return rate;
}
else
@@ -517,6 +522,11 @@ void stop_moving( EKeystate s )
void start_chat( EKeystate s )
{
if (LLAppViewer::instance()->quitRequested())
{
return; // can't talk, gotta go, kthxbye!
}
// start chat
gChatBar->startChat(NULL);
}
@@ -540,53 +550,51 @@ void start_gesture( EKeystate s )
}
}
void bind_keyboard_functions()
{
gViewerKeyboard.bindNamedFunction("jump", agent_jump);
gViewerKeyboard.bindNamedFunction("push_down", agent_push_down);
gViewerKeyboard.bindNamedFunction("push_forward", agent_push_forward);
gViewerKeyboard.bindNamedFunction("push_backward", agent_push_backward);
gViewerKeyboard.bindNamedFunction("look_up", agent_look_up);
gViewerKeyboard.bindNamedFunction("look_down", agent_look_down);
gViewerKeyboard.bindNamedFunction("toggle_down", agent_toggle_down);
gViewerKeyboard.bindNamedFunction("toggle_fly", agent_toggle_fly);
gViewerKeyboard.bindNamedFunction("turn_left", agent_turn_left);
gViewerKeyboard.bindNamedFunction("turn_right", agent_turn_right);
gViewerKeyboard.bindNamedFunction("slide_left", agent_slide_left);
gViewerKeyboard.bindNamedFunction("slide_right", agent_slide_right);
gViewerKeyboard.bindNamedFunction("spin_around_ccw", camera_spin_around_ccw);
gViewerKeyboard.bindNamedFunction("spin_around_cw", camera_spin_around_cw);
gViewerKeyboard.bindNamedFunction("spin_around_ccw_sitting", camera_spin_around_ccw_sitting);
gViewerKeyboard.bindNamedFunction("spin_around_cw_sitting", camera_spin_around_cw_sitting);
gViewerKeyboard.bindNamedFunction("spin_over", camera_spin_over);
gViewerKeyboard.bindNamedFunction("spin_under", camera_spin_under);
gViewerKeyboard.bindNamedFunction("spin_over_sitting", camera_spin_over_sitting);
gViewerKeyboard.bindNamedFunction("spin_under_sitting", camera_spin_under_sitting);
gViewerKeyboard.bindNamedFunction("move_forward", camera_move_forward);
gViewerKeyboard.bindNamedFunction("move_backward", camera_move_backward);
gViewerKeyboard.bindNamedFunction("move_forward_sitting", camera_move_forward_sitting);
gViewerKeyboard.bindNamedFunction("move_backward_sitting", camera_move_backward_sitting);
gViewerKeyboard.bindNamedFunction("pan_up", camera_pan_up);
gViewerKeyboard.bindNamedFunction("pan_down", camera_pan_down);
gViewerKeyboard.bindNamedFunction("pan_left", camera_pan_left);
gViewerKeyboard.bindNamedFunction("pan_right", camera_pan_right);
gViewerKeyboard.bindNamedFunction("pan_in", camera_pan_in);
gViewerKeyboard.bindNamedFunction("pan_out", camera_pan_out);
gViewerKeyboard.bindNamedFunction("move_forward_fast", camera_move_forward_fast);
gViewerKeyboard.bindNamedFunction("move_backward_fast", camera_move_backward_fast);
gViewerKeyboard.bindNamedFunction("edit_avatar_spin_ccw", edit_avatar_spin_ccw);
gViewerKeyboard.bindNamedFunction("edit_avatar_spin_cw", edit_avatar_spin_cw);
gViewerKeyboard.bindNamedFunction("edit_avatar_spin_over", edit_avatar_spin_over);
gViewerKeyboard.bindNamedFunction("edit_avatar_spin_under", edit_avatar_spin_under);
gViewerKeyboard.bindNamedFunction("edit_avatar_move_forward", edit_avatar_move_forward);
gViewerKeyboard.bindNamedFunction("edit_avatar_move_backward", edit_avatar_move_backward);
gViewerKeyboard.bindNamedFunction("stop_moving", stop_moving);
gViewerKeyboard.bindNamedFunction("start_chat", start_chat);
gViewerKeyboard.bindNamedFunction("start_gesture", start_gesture);
}
#define REGISTER_KEYBOARD_ACTION(KEY, ACTION) LLREGISTER_STATIC(LLKeyboardActionRegistry, KEY, ACTION);
REGISTER_KEYBOARD_ACTION("jump", agent_jump);
REGISTER_KEYBOARD_ACTION("push_down", agent_push_down);
REGISTER_KEYBOARD_ACTION("push_forward", agent_push_forward);
REGISTER_KEYBOARD_ACTION("push_backward", agent_push_backward);
REGISTER_KEYBOARD_ACTION("look_up", agent_look_up);
REGISTER_KEYBOARD_ACTION("look_down", agent_look_down);
REGISTER_KEYBOARD_ACTION("toggle_down", agent_toggle_down);
REGISTER_KEYBOARD_ACTION("toggle_fly", agent_toggle_fly);
REGISTER_KEYBOARD_ACTION("turn_left", agent_turn_left);
REGISTER_KEYBOARD_ACTION("turn_right", agent_turn_right);
REGISTER_KEYBOARD_ACTION("slide_left", agent_slide_left);
REGISTER_KEYBOARD_ACTION("slide_right", agent_slide_right);
REGISTER_KEYBOARD_ACTION("spin_around_ccw", camera_spin_around_ccw);
REGISTER_KEYBOARD_ACTION("spin_around_cw", camera_spin_around_cw);
REGISTER_KEYBOARD_ACTION("spin_around_ccw_sitting", camera_spin_around_ccw_sitting);
REGISTER_KEYBOARD_ACTION("spin_around_cw_sitting", camera_spin_around_cw_sitting);
REGISTER_KEYBOARD_ACTION("spin_over", camera_spin_over);
REGISTER_KEYBOARD_ACTION("spin_under", camera_spin_under);
REGISTER_KEYBOARD_ACTION("spin_over_sitting", camera_spin_over_sitting);
REGISTER_KEYBOARD_ACTION("spin_under_sitting", camera_spin_under_sitting);
REGISTER_KEYBOARD_ACTION("move_forward", camera_move_forward);
REGISTER_KEYBOARD_ACTION("move_backward", camera_move_backward);
REGISTER_KEYBOARD_ACTION("move_forward_sitting", camera_move_forward_sitting);
REGISTER_KEYBOARD_ACTION("move_backward_sitting", camera_move_backward_sitting);
REGISTER_KEYBOARD_ACTION("pan_up", camera_pan_up);
REGISTER_KEYBOARD_ACTION("pan_down", camera_pan_down);
REGISTER_KEYBOARD_ACTION("pan_left", camera_pan_left);
REGISTER_KEYBOARD_ACTION("pan_right", camera_pan_right);
REGISTER_KEYBOARD_ACTION("pan_in", camera_pan_in);
REGISTER_KEYBOARD_ACTION("pan_out", camera_pan_out);
REGISTER_KEYBOARD_ACTION("move_forward_fast", camera_move_forward_fast);
REGISTER_KEYBOARD_ACTION("move_backward_fast", camera_move_backward_fast);
REGISTER_KEYBOARD_ACTION("edit_avatar_spin_ccw", edit_avatar_spin_ccw);
REGISTER_KEYBOARD_ACTION("edit_avatar_spin_cw", edit_avatar_spin_cw);
REGISTER_KEYBOARD_ACTION("edit_avatar_spin_over", edit_avatar_spin_over);
REGISTER_KEYBOARD_ACTION("edit_avatar_spin_under", edit_avatar_spin_under);
REGISTER_KEYBOARD_ACTION("edit_avatar_move_forward", edit_avatar_move_forward);
REGISTER_KEYBOARD_ACTION("edit_avatar_move_backward", edit_avatar_move_backward);
REGISTER_KEYBOARD_ACTION("stop_moving", stop_moving);
REGISTER_KEYBOARD_ACTION("start_chat", start_chat);
REGISTER_KEYBOARD_ACTION("start_gesture", start_gesture);
#undef REGISTER_KEYBOARD_ACTION
LLViewerKeyboard::LLViewerKeyboard() :
mNamedFunctionCount(0)
LLViewerKeyboard::LLViewerKeyboard()
{
for (S32 i = 0; i < MODE_COUNT; i++)
{
@@ -604,16 +612,6 @@ LLViewerKeyboard::LLViewerKeyboard() :
}
}
void LLViewerKeyboard::bindNamedFunction(const std::string& name, LLKeyFunc func)
{
S32 i = mNamedFunctionCount;
mNamedFunctions[i].mName = name;
mNamedFunctions[i].mFunction = func;
mNamedFunctionCount++;
}
BOOL LLViewerKeyboard::modeFromString(const std::string& string, S32 *mode)
{
if (string == "FIRST_PERSON")
@@ -667,17 +665,21 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL
return FALSE;
}
lldebugst(LLERR_USER_INPUT) << "keydown -" << translated_key << "-" << llendl;
LL_DEBUGS("UserInput") << "keydown -" << translated_key << "-" << LL_ENDL;
// skip skipped keys
if(mKeysSkippedByUI.find(translated_key) != mKeysSkippedByUI.end())
{
mKeyHandledByUI[translated_key] = FALSE;
LL_INFOS("Keyboard Handling") << "Key wasn't handled by UI!" << LL_ENDL;
}
else
{
// it is sufficient to set this value once per call to handlekey
// without clearing it, as it is only used in the subsequent call to scanKey
mKeyHandledByUI[translated_key] = gViewerWindow->handleKey(translated_key, translated_mask);
// mKeyHandledByUI is not what you think ... this indicates whether the UI has handled this keypress yet (any keypress)
// NOT whether some UI shortcut wishes to handle the keypress
}
return mKeyHandledByUI[translated_key];
}
@@ -686,8 +688,9 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL
BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, const std::string& function_name)
{
S32 i,index;
void (*function)(EKeystate keystate) = NULL;
S32 index;
typedef boost::function<void(EKeystate)> function_t;
function_t function = NULL;
std::string name;
// Allow remapping of F2-F12
@@ -710,13 +713,11 @@ BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, c
}
// Not remapped, look for a function
for (i = 0; i < mNamedFunctionCount; i++)
function_t* result = LLKeyboardActionRegistry::getValue(function_name);
if (result)
{
if (function_name == mNamedFunctions[i].mName)
{
function = mNamedFunctions[i].mFunction;
name = mNamedFunctions[i].mName;
}
function = *result;
}
if (!function)
@@ -740,13 +741,12 @@ BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, c
if (mode >= MODE_COUNT)
{
llerror("LLKeyboard::bindKey() - unknown mode passed", mode);
llerrs << "LLKeyboard::bindKey() - unknown mode passed" << mode << llendl;
return FALSE;
}
mBindings[mode][index].mKey = key;
mBindings[mode][index].mMask = mask;
// mBindings[mode][index].mName = name;
mBindings[mode][index].mFunction = function;
if (index == mBindingCount[mode])
@@ -911,18 +911,18 @@ void LLViewerKeyboard::scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_lev
if (key_down && !repeat)
{
// ...key went down this frame, call function
(*binding[i].mFunction)( KEYSTATE_DOWN );
binding[i].mFunction( KEYSTATE_DOWN );
}
else if (key_up)
{
// ...key went down this frame, call function
(*binding[i].mFunction)( KEYSTATE_UP );
binding[i].mFunction( KEYSTATE_UP );
}
else if (key_level)
{
// ...key held down from previous frame
// Not windows, just call the function.
(*binding[i].mFunction)( KEYSTATE_LEVEL );
binding[i].mFunction( KEYSTATE_LEVEL );
}//if
}//if
}//for

View File

@@ -61,7 +61,6 @@ typedef enum e_keyboard_mode
void bind_keyboard_functions();
class LLViewerKeyboard
{
public:
@@ -69,10 +68,8 @@ public:
BOOL handleKey(KEY key, MASK mask, BOOL repeated);
void bindNamedFunction(const std::string& name, LLKeyFunc func);
S32 loadBindings(const std::string& filename); // returns number bound, 0 on error
void unloadBindings();
void unloadBindings();
EKeyboardMode getMode();
BOOL modeFromString(const std::string& string, S32 *mode); // False on failure
@@ -80,8 +77,6 @@ public:
void scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level);
protected:
BOOL bindKey(const S32 mode, const KEY key, const MASK mask, const std::string& function_name);
S32 mNamedFunctionCount;
LLNamedFunction mNamedFunctions[MAX_NAMED_FUNCTIONS];
// Hold all the ugly stuff torn out to make LLKeyboard non-viewer-specific here
S32 mBindingCount[MODE_COUNT];
@@ -95,4 +90,5 @@ protected:
extern LLViewerKeyboard gViewerKeyboard;
void agent_push_forward(EKeystate s);
#endif // LL_LLVIEWERKEYBOARD_H

View File

@@ -755,7 +755,7 @@ void init_menus()
ins = gMenuBarView->getChildView("insert_admin", true, false);
ins->setVisible(false);*/
LLEnvManagerNew::instance().setRegionChangeCallback(&region_change);
gAgent.addRegionChangedCallback(&region_change);
}

View File

@@ -657,13 +657,14 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
LLNotificationsUtil::add("JoinGroup", args, notification["payload"]);
return false;
}
if(option == 0 && !group_id.isNull())
{
// check for promotion or demotion.
S32 max_groups = gHippoLimits->getMaxAgentGroups();
if(gAgent.isInGroup(group_id)) ++max_groups;
if(gAgent.mGroups.count() < max_groups)
if((S32)gAgent.mGroups.size() < max_groups)
{
accept_invite = true;
}

View File

@@ -358,6 +358,10 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
// Create the object lists
initStats();
initPartitions();
// If the newly entered region is using server bakes, and our
// current appearance is non-baked, request appearance update from
// server.
setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition, &gAgent, _1)); // Singu TODO: LLAvatarRenderInfoAccountant
}
void LLViewerRegion::initPartitions()

View File

@@ -111,7 +111,6 @@
#include "llsdutil.h"
#include "llfloaterexploreanimations.h"
#include "aihttptimeoutpolicy.h"
#include "aixmllindengenepool.h"
#include "aifile.h"
@@ -5033,7 +5032,7 @@ void LLVOAvatar::bakedTextureOriginCounts(S32 &sb_count, // server-bake, has ori
std::string LLVOAvatar::bakedTextureOriginInfo()
{
std::string result;
std::set<LLUUID> baked_ids;
collectBakedTextureUUIDs(baked_ids);
for (std::set<LLUUID>::const_iterator it = baked_ids.begin(); it != baked_ids.end(); ++it)
@@ -5048,11 +5047,17 @@ std::string LLVOAvatar::bakedTextureOriginInfo()
{
has_host = true;
}
if (has_url && !has_host) result += "u"; // server-bake texture with url
else if (has_host && !has_url) result += "h"; // old-style texture on sim
else if (has_host && has_url) result += "?"; // both origins?
else if (!has_host && !has_url) result += "n"; // no origin?
S32 discard = imagep->getDiscardLevel();
if (has_url && !has_host) result += discard ? "u" : "U"; // server-bake texture with url
else if (has_host && !has_url) result += discard ? "h" : "H"; // old-style texture on sim
else if (has_host && has_url) result += discard ? "x" : "X"; // both origins?
else if (!has_host && !has_url) result += discard ? "n" : "N"; // no origin?
if (discard != 0)
{
result += llformat("(%d/%d)",discard,imagep->getDesiredDiscardLevel());
}
}
return result;
}
@@ -5177,7 +5182,7 @@ void LLVOAvatar::updateTextures()
BOOL render_avatar = TRUE;
if (mIsDummy || gNoRender)
if (mIsDummy)
{
return;
}
@@ -5197,6 +5202,7 @@ void LLVOAvatar::updateTextures()
}
std::vector<bool> layer_baked;
// GL NOT ACTIVE HERE - *TODO
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
layer_baked.push_back(isTextureDefined(mBakedTextureDatas[i].mTextureIndex));
@@ -5401,7 +5407,7 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid)
std::string url = "";
if (isUsingServerBakes())
{
const std::string& appearance_service_url = gSavedSettings.getString("AgentAppearanceServiceURL");
const std::string& appearance_service_url = LLAppearanceMgr::instance().getAppearanceServiceURL();
if (appearance_service_url.empty())
{
// Probably a server-side issue if we get here:
@@ -5488,8 +5494,6 @@ const LLUUID& LLVOAvatar::getStepSound() const
//-----------------------------------------------------------------------------
void LLVOAvatar::processAnimationStateChanges()
{
if (gNoRender) return;
if ( isAnyAnimationSignaled(AGENT_WALK_ANIMS, NUM_AGENT_WALK_ANIMS) )
{
startMotion(ANIM_AGENT_WALK_ADJUST);
@@ -5518,7 +5522,7 @@ void LLVOAvatar::processAnimationStateChanges()
}
// clear all current animations
BOOL const AOEnabled = gSavedSettings.getBOOL("AOEnabled"); // Singu note: put this outside the loop.
const bool AOEnabled(gSavedSettings.getBOOL("AOEnabled")); // <singu/>
AnimIterator anim_it;
for (anim_it = mPlayingAnimations.begin(); anim_it != mPlayingAnimations.end();)
{
@@ -5527,14 +5531,8 @@ void LLVOAvatar::processAnimationStateChanges()
// playing, but not signaled, so stop
if (found_anim == mSignaledAnimations.end())
{
if (AOEnabled && isSelf())
{
if (LLFloaterAO::stopMotion(anim_it->first, FALSE)) // if the AO replaced this anim serverside then stop it serverside
{
// return TRUE; //no local stop needed
}
}
LLFloaterAO::stopMotion(anim_it->first, FALSE); // if the AO replaced this anim serverside then stop it serverside
processSingleAnimationStateChange(anim_it->first, FALSE);
// <edit>
@@ -5877,29 +5875,6 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name )
return jointp;
}
//-----------------------------------------------------------------------------
// resetSpecificJointPosition
//-----------------------------------------------------------------------------
void LLVOAvatar::resetSpecificJointPosition( const std::string& name )
{
LLJoint* pJoint = mRoot->findJoint( name );
if ( pJoint && pJoint->doesJointNeedToBeReset() )
{
pJoint->restoreOldXform();
pJoint->setId( LLUUID::null );
//If we're reseting the pelvis position make sure not to apply offset
if ( name == "mPelvis" )
{
mHasPelvisOffset = false;
}
}
else
{
llinfos<<"Did not find "<< name.c_str()<<llendl;
}
}
//-----------------------------------------------------------------------------
// resetJointPositionsToDefault
//-----------------------------------------------------------------------------
@@ -5908,20 +5883,27 @@ void LLVOAvatar::resetJointPositionsToDefault( void )
//Subsequent joints are relative to pelvis
avatar_joint_list_t::iterator iter = mSkeleton.begin();
avatar_joint_list_t::iterator end = mSkeleton.end();
LLJoint* pJointPelvis = getJoint("mPelvis");
for (; iter != end; ++iter)
{
LLJoint* pJoint = (*iter);
if ( pJoint->doesJointNeedToBeReset() )
//Reset joints except for pelvis
if ( pJoint && pJoint != pJointPelvis && pJoint->doesJointNeedToBeReset() )
{
pJoint->setId( LLUUID::null );
//restore joints to default positions, however skip over the pelvis
// *TODO: How does this pointer check skip over pelvis?
if ( pJoint )
{
pJoint->restoreOldXform();
}
pJoint->restoreOldXform();
}
else
if ( pJoint && pJoint == pJointPelvis && pJoint->doesJointNeedToBeReset() )
{
pJoint->setId( LLUUID::null );
pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) );
//pJoint->setJointResetFlag( false ); // Singu TODO
}
}
//make sure we don't apply the joint offset
mHasPelvisOffset = false;
mPelvisFixup = mLastPelvisFixup;
@@ -5977,7 +5959,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age
LLVector3d z_vec(0.0f, 0.0f, 1.0f);
LLVector3d p0_global, p1_global;
if (gNoRender || mIsDummy)
if (mIsDummy)
{
outNorm.setVec(z_vec);
out_pos_agent = in_pos_agent;
@@ -6136,11 +6118,6 @@ BOOL LLVOAvatar::loadSkeletonNode ()
//-----------------------------------------------------------------------------
void LLVOAvatar::updateVisualParams()
{
if (gNoRender)
{
return;
}
setSex( (getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE );
LLCharacter::updateVisualParams();
@@ -6155,7 +6132,6 @@ void LLVOAvatar::updateVisualParams()
dirtyMesh();
updateHeadOffset();
}
//-----------------------------------------------------------------------------
// isActive()
//-----------------------------------------------------------------------------
@@ -6214,7 +6190,6 @@ BOOL LLVOAvatar::updateJointLODs()
F32 avatar_num_factor = clamp_rescale((F32)sNumVisibleAvatars, 8, 25, 1.f, avatar_num_min_factor);
F32 area_scale = 0.16f;
{
if (isSelf())
{
if(gAgentCamera.cameraCustomizeAvatar() || gAgentCamera.cameraMouselook())
@@ -6249,7 +6224,6 @@ BOOL LLVOAvatar::updateJointLODs()
dirtyMesh(2);
return TRUE;
}
}
return FALSE;
}
@@ -6378,19 +6352,18 @@ void LLVOAvatar::addChild(LLViewerObject *childp)
LLViewerObject::addChild(childp);
if (childp->mDrawable)
{
if(isSelf())
if (!attachObject(childp))
{
LL_INFOS("Attachment") << childp->getID() << " ("<<childp->getAttachmentPointName()<<") attached." << llendl;
llassert(std::find(mPendingAttachment.begin(), mPendingAttachment.end(), childp) == mPendingAttachment.end());
llwarns << "addChild() failed for "
<< childp->getID()
<< " item " << childp->getAttachmentItemID()
<< llendl;
// MAINT-3312 backout
// mPendingAttachment.push_back(childp);
}
attachObject(childp);
}
else
{
if(isSelf())
{
LL_INFOS("Attachment") << childp->getID() << " ("<<childp->getAttachmentPointName()<<") pending." << llendl;
}
mPendingAttachment.push_back(childp);
}
}
@@ -6519,17 +6492,22 @@ void LLVOAvatar::lazyAttach()
for (U32 i = 0; i < mPendingAttachment.size(); i++)
{
if (mPendingAttachment[i]->mDrawable)
LLPointer<LLViewerObject> cur_attachment = mPendingAttachment[i];
if (cur_attachment->mDrawable)
{
if(isSelf())
{
LL_INFOS("Attachment") << mPendingAttachment[i]->getID() << " ("<<mPendingAttachment[i]->getAttachmentPointName()<<") done pending. attached." << llendl;
if(!attachObject(cur_attachment))
{ // Drop it
llwarns << "attachObject() failed for "
<< cur_attachment->getID()
<< " item " << cur_attachment->getAttachmentItemID()
<< llendl;
// MAINT-3312 backout
//still_pending.push_back(cur_attachment);
}
attachObject(mPendingAttachment[i]);
}
else
{
still_pending.push_back(mPendingAttachment[i]);
still_pending.push_back(cur_attachment);
}
}
@@ -6538,6 +6516,7 @@ void LLVOAvatar::lazyAttach()
void LLVOAvatar::resetHUDAttachments()
{
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -6612,6 +6591,7 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
{
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -6623,6 +6603,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
vector_replace_with_last(mAttachedObjectsVector,std::make_pair(viewer_object,attachment));
cleanupAttachedMesh( viewer_object );
attachment->removeObject(viewer_object);
lldebugs << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << llendl;
return TRUE;
@@ -7037,9 +7018,12 @@ void LLVOAvatar::clearPhases()
void LLVOAvatar::startPhase(const std::string& phase_name)
{
F32 elapsed;
bool completed;
if (getPhases().getPhaseValues(phase_name, elapsed, completed))
F32 elapsed = 0.0;
bool completed = false;
bool found = getPhases().getPhaseValues(phase_name, elapsed, completed);
//LL_DEBUGS("Avatar") << avString() << " phase state " << phase_name
// << " found " << found << " elapsed " << elapsed << " completed " << completed << LL_ENDL;
if (found)
{
if (!completed)
{
@@ -7053,8 +7037,8 @@ void LLVOAvatar::startPhase(const std::string& phase_name)
void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)
{
F32 elapsed;
bool completed;
F32 elapsed = 0.0;
bool completed = false;
if (getPhases().getPhaseValues(phase_name, elapsed, completed))
{
if (!completed)
@@ -7240,8 +7224,8 @@ BOOL LLVOAvatar::isFullyLoaded() const
bool LLVOAvatar::isTooComplex() const
{
static const LLCachedControl<S32> render_avatar_complexity_limit("RenderAvatarComplexityLimit",0);
if (render_avatar_complexity_limit > 0 && mVisualComplexity >= render_avatar_complexity_limit)
static LLCachedControl<S32> ava_complexity_limit(gSavedSettings, "RenderAvatarComplexityLimit");
if (ava_complexity_limit > 0 && mVisualComplexity >= ava_complexity_limit)
{
return true;
}
@@ -7262,7 +7246,8 @@ LLMotion* LLVOAvatar::findMotion(const LLUUID& id) const
// colorized if using deferred rendering.
void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
{
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
static LLCachedControl<bool> debug_avatar_comp_baked(gSavedSettings, "DebugAvatarCompositeBaked");
if (debug_avatar_comp_baked)
{
avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();
avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end();
@@ -7278,6 +7263,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
}
}
}
//-----------------------------------------------------------------------------
// updateMeshTextures()
// Uses the current TE values to set the meshes' and layersets' textures.
@@ -7592,7 +7578,6 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com
}
}
// returns TRUE if morph masks are present and not valid for a given baked texture, FALSE otherwise
BOOL LLVOAvatar::morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIndex index)
{
@@ -7775,7 +7760,7 @@ LLBBox LLVOAvatar::getHUDBBox() const
//-----------------------------------------------------------------------------
void LLVOAvatar::onFirstTEMessageReceived()
{
LL_INFOS("Avatar") << avString() << LL_ENDL;
LL_DEBUGS("Avatar") << avString() << LL_ENDL;
if( !mFirstTEMessageReceived )
{
mFirstTEMessageReceived = TRUE;
@@ -8017,13 +8002,13 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32
{
appearance_version = contents.mParamAppearanceVersion;
}
if (contents.mAppearanceVersion >= 0)
else if (contents.mAppearanceVersion > 0)
{
appearance_version = contents.mAppearanceVersion;
}
if (appearance_version < 0) // still not set, go with 0.
else // still not set, go with 1.
{
appearance_version = 0;
appearance_version = 1;
}
LL_DEBUGS("Avatar") << "appearance version info - field " << contents.mAppearanceVersion
<< " param: " << contents.mParamAppearanceVersion
@@ -8061,6 +8046,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
llwarns << "bad appearance version info, discarding" << llendl;
return;
}
S32 this_update_cof_version = contents.mCOFVersion;
S32 last_update_request_cof_version = LLAppearanceMgr::instance().mLastUpdateRequestCOFVersion;
@@ -8108,6 +8094,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
return;
}
// SUNSHINE CLEANUP - is this case OK now?
S32 num_params = contents.mParamWeights.size();
if (num_params <= 1)
{
@@ -8132,9 +8119,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
&& mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT
&& baked_index != BAKED_SKIRT)
{
LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL;
setTEImage(mBakedTextureDatas[baked_index].mTextureIndex,
LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE));
}
else
{
LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using texture id "
<< getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << LL_ENDL;
}
}
// runway - was
@@ -8162,6 +8155,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
LL_DEBUGS("Avatar") << avString() << " handle visual params, num_params " << num_params << LL_ENDL;
BOOL params_changed = FALSE;
BOOL interp_params = FALSE;
S32 params_changed_count = 0;
for( S32 i = 0; i < num_params; i++ )
{
@@ -8176,8 +8170,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
if (is_first_appearance_message || (param->getWeight() != newWeight))
{
params_changed = TRUE;
params_changed_count++;
if(is_first_appearance_message)
{
//LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << LL_ENDL;
param->setWeight(newWeight, FALSE);
}
else
@@ -8193,6 +8190,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << LL_ENDL;
}
LL_DEBUGS("Avatar") << "Changed " << params_changed_count << " params" << LL_ENDL;
if (params_changed)
{
if (interp_params)
@@ -8242,35 +8240,36 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
}
updateMeshTextures();
//if (enable_verbose_dumps) dumpArchetypeXML(dump_prefix + "process_end");
}
// static
void LLVOAvatar::getAnimLabels( LLDynamicArray<std::string>* labels )
void LLVOAvatar::getAnimLabels( std::vector<std::string>* labels )
{
S32 i;
labels->reserve(gUserAnimStatesCount);
for( i = 0; i < gUserAnimStatesCount; i++ )
{
labels->put( LLAnimStateLabels::getStateLabel( gUserAnimStates[i].mName ) );
labels->push_back( LLAnimStateLabels::getStateLabel( gUserAnimStates[i].mName ) );
}
// Special case to trigger away (AFK) state
labels->put( "Away From Keyboard" );
labels->push_back( "Away From Keyboard" );
}
// static
void LLVOAvatar::getAnimNames( LLDynamicArray<std::string>* names )
void LLVOAvatar::getAnimNames( std::vector<std::string>* names )
{
S32 i;
names->reserve(gUserAnimStatesCount);
for( i = 0; i < gUserAnimStatesCount; i++ )
{
names->put( std::string(gUserAnimStates[i].mName) );
names->push_back( std::string(gUserAnimStates[i].mName) );
}
// Special case to trigger away (AFK) state
names->put( "enter_away_from_keyboard_state" );
names->push_back( "enter_away_from_keyboard_state" );
}
// static
@@ -8423,7 +8422,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 );
if (id == image_baked->getID())
{
LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL;
//LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL;
mBakedTextureDatas[i].mIsLoaded = true;
mBakedTextureDatas[i].mLastTextureID = id;
mBakedTextureDatas[i].mIsUsed = true;
@@ -8496,6 +8495,15 @@ std::string get_sequential_numbered_file_name(const std::string& prefix,
return outfilename;
}
void dump_sequential_xml(const std::string outprefix, const LLSD& content)
{
std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml");
std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
std::ofstream ofs(fullpath.c_str(), std::ios_base::out);
ofs << LLSDOStreamer<LLSDXMLFormatter>(content, LLSDFormatter::OPTIONS_PRETTY);
LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL;
}
void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_wearables )
{
std::string outprefix(prefix);

View File

@@ -250,7 +250,6 @@ public:
virtual LLJoint* getJoint(const std::string &name);
void resetJointPositionsToDefault( void );
void resetSpecificJointPosition( const std::string& name );
/*virtual*/ const LLUUID& getID() const;
/*virtual*/ void addDebugText(const std::string& text);
@@ -916,11 +915,11 @@ private:
**/
public:
/*virtual*/ std::string getFullname() const; // Returns "FirstName LastName"
std::string getFullname() const; // Returns "FirstName LastName"
std::string avString() const; // Frequently used string in log messages "Avatar '<full name'"
protected:
static void getAnimLabels(LLDynamicArray<std::string>* labels);
static void getAnimNames(LLDynamicArray<std::string>* names);
static void getAnimLabels(std::vector<std::string>* labels);
static void getAnimNames(std::vector<std::string>* names);
private:
std::string mNameString; // UTF-8 title + name + status
std::string mTitle;
@@ -1074,8 +1073,10 @@ private:
// </edit>
}; // LLVOAvatar
extern const F32 SELF_ADDITIONAL_PRI;
extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL;
void dump_sequential_xml(const std::string outprefix, const LLSD& content);
#endif // LL_VOAVATAR_H

View File

@@ -620,12 +620,21 @@ void LLVOAvatarSelf::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
// virtual
LLJoint *LLVOAvatarSelf::getJoint(const std::string &name)
{
if (mScreenp)
// <alchemy> - findJoint Opt
LLJoint* jointp = LLVOAvatar::getJoint(name);
if (!jointp && mScreenp)
{
LLJoint* jointp = mScreenp->findJoint(name);
if (jointp) return jointp;
jointp = mScreenp->findJoint(name);
}
return LLVOAvatar::getJoint(name);
return jointp;
// <alchemy>
//if (mScreenp)
//{
// LLJoint* jointp = mScreenp->findJoint(name);
// if (jointp) return jointp;
//}
//return LLVOAvatar::getJoint(name);
}
// virtual
BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake )
@@ -663,14 +672,6 @@ BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight
return FALSE;
}
#if 0
// FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables.
if (isUsingServerBakes() && !isUsingLocalAppearance())
{
return FALSE;
}
#endif
if (param->getCrossWearable())
{
LLWearableType::EType type = (LLWearableType::EType)param->getWearableType();
@@ -741,50 +742,9 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id)
}
//virtual
U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
U32 block_num,
const EObjectUpdateType update_type,
LLDataPacker *dp)
U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, const EObjectUpdateType update_type, LLDataPacker *dp)
{
U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp);
#if 0
// DRANO - it's not clear this does anything useful. If we wait
// until an appearance message has been received, we already have
// the texture ids. If we don't wait, we don't yet know where to
// look for baked textures, because we haven't received the
// appearance version data from the appearance message. This looks
// like an old optimization that's incompatible with server-side
// texture baking.
// FIXME DRANO - skipping in the case of !mFirstAppearanceMessageReceived prevents us from trying to
// load textures before we know where they come from (ie, from baking service or not);
// unknown impact on performance.
if (mInitialBakesLoaded == false && retval == 0x0 && mFirstAppearanceMessageReceived)
{
// call update textures to force the images to be created
updateMeshTextures();
// unpack the texture UUIDs to the texture slots
retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, (S32) block_num);
// need to trigger a few operations to get the avatar to use the new bakes
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
const LLAvatarAppearanceDefines::ETextureIndex te = mBakedTextureDatas[i].mTextureIndex;
LLUUID texture_id = getTEImage(te)->getID();
setNewBakedTexture(te, texture_id);
mInitialBakeIDs[i] = texture_id;
}
onFirstTEMessageReceived();
mInitialBakesLoaded = true;
}
#endif
return retval;
return LLVOAvatar::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp);
}
void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index)
@@ -824,7 +784,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures()
if (!tex || tex->isMissingAsset())
{
LLViewerTexture *imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR);
if (imagep)
if (imagep && imagep != tex)
{
setTEImage(te, imagep);
removed = TRUE;
@@ -863,9 +823,9 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp)
// Diagnostic info
//LLVector3d pos_from_new_region = getPositionGlobal();
//llinfos << "pos_from_old_region is " << global_pos_from_old_region
//LL_INFOS() << "pos_from_old_region is " << global_pos_from_old_region
// << " while pos_from_new_region is " << pos_from_new_region
// << llendl;
// << LL_ENDL;
}
if (!regionp || (regionp->getHandle() != mLastRegionHandle))
@@ -971,7 +931,6 @@ void LLVOAvatarSelf::idleUpdateTractorBeam()
mBeam->setPositionGlobal(pick.mPosGlobal);
}
}
if (mBeamTimer.getElapsedTimeF32() > 0.25f)
{
@@ -988,7 +947,7 @@ void LLVOAvatarSelf::idleUpdateTractorBeam()
// virtual
void LLVOAvatarSelf::restoreMeshData()
{
//llinfos << "Restoring" << llendl;
//LL_INFOS() << "Restoring" << LL_ENDL;
mMeshValid = TRUE;
updateJointLODs();
updateAttachmentVisibility(gAgentCamera.getCameraMode());
@@ -1069,13 +1028,13 @@ void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_re
}
}
}
// Physics type has no associated baked textures, but change of params needs to be sent to
// other avatars.
if (type == LLWearableType::WT_PHYSICS)
{
gAgent.sendAgentSetAppearance();
}
{
gAgent.sendAgentSetAppearance();
}
}
//-----------------------------------------------------------------------------
@@ -1492,7 +1451,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye
//-----------------------------------------------------------------------------
BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const
{
const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel");
static LLCachedControl<U32> desired_tex_discard_level(gSavedSettings, "TextureDiscardLevel");
// const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels.
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
@@ -1527,7 +1486,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset
BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const
{
const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel");
static LLCachedControl<U32> desired_tex_discard_level(gSavedSettings, "TextureDiscardLevel");
// const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
@@ -1669,7 +1628,7 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_r
{
return;
}
// llinfos << "LLVOAvatar::invalidComposite() " << layerset->getBodyRegionName() << llendl;
// LL_INFOS() << "LLVOAvatar::invalidComposite() " << layerset->getBodyRegionName() << LL_ENDL;
layer_set->requestUpdate();
layer_set->invalidateMorphMasks();
@@ -2101,7 +2060,10 @@ BOOL LLVOAvatarSelf::getIsCloud() const
/*static*/
void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
{
gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
if (gAgentAvatarp.notNull())
{
gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
}
}
void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
@@ -2214,7 +2176,7 @@ void LLVOAvatarSelf::dumpAllTextures() const
if (!layerset_buffer) continue;
vd_text += verboseDebugDumpLocalTextureDataInfo(layerset);
}
LL_DEBUGS("Avatar") << vd_text << llendl;
LL_DEBUGS("Avatar") << vd_text << LL_ENDL;
}
const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const
@@ -2285,28 +2247,9 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const
return text;
}
#if 0
// Dump avatar metrics data.
LLSD LLVOAvatarSelf::metricsData()
{
// runway - add region info
LLSD result;
result["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus());
result["timers"]["debug_existence"] = mDebugExistenceTimer.getElapsedTimeF32();
result["timers"]["ruth_debug"] = mRuthDebugTimer.getElapsedTimeF32();
result["timers"]["ruth"] = mRuthTimer.getElapsedTimeF32();
result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32();
result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32();
result["startup"] = LLStartUp::getPhases().dumpPhases();
return result;
}
#endif
extern AIHTTPTimeoutPolicy appearanceChangeMetricsResponder_timeout;
class ViewerAppearanceChangeMetricsResponder: public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(ViewerAppearanceChangeMetricsResponder);
public:
ViewerAppearanceChangeMetricsResponder( S32 expected_sequence,
volatile const S32 & live_sequence,
@@ -2317,7 +2260,8 @@ public:
{
}
/*virtual*/ void httpSuccess(void)
private:
/* virtual */ void httpSuccess()
{
LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
if (mLiveSequence == mExpectedSequence)
@@ -2325,11 +2269,12 @@ public:
mReportingStarted = true;
}
}
/*virtual*/ void httpFailure(void)
/* virtual */ void httpFailure()
{
LL_WARNS("Avatar") << "Failed " << mStatus << " reason " << mReason << LL_ENDL;
// if we add retry, this should be removed from the httpFailure case
LL_WARNS("Avatar") << dumpResponse() << LL_ENDL;
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return appearanceChangeMetricsResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "AppearanceChangeMetricsResponder"; }
private:
S32 mExpectedSequence;
@@ -2481,19 +2426,14 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics()
}
}
extern AIHTTPTimeoutPolicy checkAgentAppearanceServiceResponder_timeout;
class CheckAgentAppearanceServiceResponder: public LLHTTPClient::ResponderHeadersOnly
{
public:
CheckAgentAppearanceServiceResponder()
{
}
virtual ~CheckAgentAppearanceServiceResponder()
{
}
CheckAgentAppearanceServiceResponder() {}
/*virtual*/ void completedHeaders(void)
virtual ~CheckAgentAppearanceServiceResponder() {}
/*virtual*/ void completedHeaders()
{
if (isGoodStatus(mStatus))
{
@@ -2509,16 +2449,6 @@ public:
}
}
// Error
/*virtual*//* void httpFailure(void)
{
if (isAgentAvatarValid())
{
LL_DEBUGS("Avatar") << "failed, will rebake" << llendl;
forceAppearanceUpdate();
}
} */
static void forceAppearanceUpdate()
{
// Trying to rebake immediately after crossing region boundary
@@ -2527,7 +2457,6 @@ public:
doAfterInterval(force_bake_all_textures, 5.0);
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return checkAgentAppearanceServiceResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "CheckAgentAppearanceServiceResponder"; }
};

View File

@@ -1750,9 +1750,9 @@ ERlvCmdRet RlvHandler::onForceGroup(const RlvCommand& rlvCmd) const
}
else
{
for (S32 idxGroup = 0, cntGroup = gAgent.mGroups.count(); (idxGroup < cntGroup) && (idGroup.isNull()); idxGroup++)
if (boost::iequals(gAgent.mGroups.get(idxGroup).mName, rlvCmd.getOption()))
idGroup = gAgent.mGroups.get(idxGroup).mID;
for (S32 idxGroup = 0, cntGroup = gAgent.mGroups.size(); (idxGroup < cntGroup) && (idGroup.isNull()); idxGroup++)
if (boost::iequals(gAgent.mGroups[idxGroup].mName, rlvCmd.getOption()))
idGroup = gAgent.mGroups[idxGroup].mID;
fValid = (idGroup.notNull()) || ("none" == rlvCmd.getOption());
}

View File

@@ -488,12 +488,12 @@ bool RlvUIEnabler::canViewParcelProperties()
const LLUUID& idOwner = pParcel->getOwnerID();
if ( (idOwner != gAgent.getID()) )
{
S32 count = gAgent.mGroups.count();
S32 count = gAgent.mGroups.size();
for (S32 i = 0; i < count; ++i)
{
if (gAgent.mGroups.get(i).mID == idOwner)
if (gAgent.mGroups[i].mID == idOwner)
{
fShow = ((gAgent.mGroups.get(i).mPowers & GP_LAND_RETURN) > 0);
fShow = ((gAgent.mGroups[i].mPowers & GP_LAND_RETURN) > 0);
break;
}
}

View File

@@ -0,0 +1,14 @@
<llsd>
<map>
<key>skin_name</key>
<string>Dark Green</string>
<key>author_name</key>
<string>JB Kraft, modified by SLB Wirefly</string>
<key>additional_author_names</key>
<string>Linden Lab</string>
<key>skin_info</key>
<string></string>
<key>folder_name</key>
<string>darkgreen</string>
</map>
</llsd>

View File

@@ -183,12 +183,6 @@
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>
<AvatarListTextDistOver value="128, 0, 0, 128"/>
<AvatarListTextAgeYoung value="255, 0, 0, 255"/>
<AvatarListTextAgeNormal value="0, 0, 0, 255"/>
<!-- Alert box colors -->
<AlertBoxColor value="62, 62, 62, 255"/>

View File

@@ -150,8 +150,6 @@
<RadarTextChatRange value="255, 66, 66, 128"/>
<RadarTextShoutRange value="255, 255, 66, 128"/>
<RadarTextDrawDist value="66, 153, 66, 128"/>
<AvatarListTextAgeYoung value="255, 0, 0, 255"/>
<AvatarListTextAgeNormal value="0, 0, 0, 255"/>
<!-- SPEAKERS -->
<SpeakersInactive value="76, 76, 76, 255"/>

View File

@@ -184,11 +184,6 @@
<InventoryBackgroundColor value="0, 0, 0, 180"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>
<AvatarListTextDistOver value="128, 0, 0, 128"/>
<AvatarListTextAgeYoung value="255, 0, 0, 255"/>
<AvatarListTextAgeNormal value="0, 0, 0, 255"/>
<!-- Alert box colors -->
<AlertBoxColor value="0, 0, 0, 245"/>

View File

@@ -0,0 +1,201 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings version = "101">
<!-- WINDOWS -->
<TitleBarFocusColor value="255, 255, 255, 30" /> <!-- Focused window title bar highlight, no equivalent for unfocused windows -->
<FloaterFocusBorderColor value="0, 0, 0, 80"/>
<FloaterUnfocusBorderColor value="0, 0, 0, 80"/>
<FocusBackgroundColor value="62, 62, 62, 255"/> <!-- Background color of focused floaters -->
<DefaultBackgroundColor value="62, 62, 62, 140"/> <!-- Background color for unfocused floaters -->
<ColorDropShadow value="0, 0, 0, 200"/> <!-- The drop shadow behind windows and menus -->
<DefaultHighlightDark value="26, 26, 26, 255"/>
<DefaultHighlightLight value="132, 132, 132, 255"/>
<DefaultShadowDark value="26, 26, 26, 255"/>
<DefaultShadowLight value="0, 0, 0, 255"/>
<!-- LABELS -->
<LabelDisabledColor value="147, 169, 213, 77"/>
<LabelSelectedColor value="255, 255, 255, 255"/>
<LabelSelectedDisabledColor value="116, 116, 116, 128"/>
<LabelTextColor value="200, 200, 200, 255"/>
<!-- LOGIN -->
<LoginProgressBarBgColor value="255, 255, 255, 255" />
<LoginProgressBarFgColor value="255, 255, 255, 255" />
<LoginProgressBoxBorderColor value="0, 30, 60, 0" />
<LoginProgressBoxCenterColor value="0, 0, 0, 200" />
<LoginProgressBoxShadowColor value="0, 0, 0, 200" />
<LoginProgressBoxTextColor value="255, 255, 255, 255"/>
<!-- BUTTONS -->
<ButtonLabelColor value="22, 220, 22, 255"/> <!-- Text labels for buttons, like the "OK" text -->
<ButtonLabelSelectedColor value="22, 220, 220, 255"/>
<ButtonLabelDisabledColor value="147, 169, 213, 200"/>
<ButtonLabelSelectedDisabledColor value="164, 190, 237, 200"/>
<ButtonSelectedBgColor value="62, 62, 62, 255"/>
<ButtonSelectedColor value="255, 255, 255, 255"/>
<ButtonUnselectedBgColor value="62, 62, 62, 255"/>
<ButtonUnselectedFgColor value="255, 255, 255, 255"/>
<ButtonBorderColor value="238, 156, 0, 255"/>
<ButtonFlashBgColor value="255, 190, 62, 127" />
<ButtonColor value="255, 255, 255, 255"/> <!-- Blended with button art, usually left as opaque white -->
<ButtonImageColor value="255, 255, 255, 255"/> <!-- Blended with button art, usually left as opaque white -->
<!-- SLIDERS -->
<SliderDisabledThumbColor value="0, 0, 0, 255" />
<SliderThumbCenterColor value="200, 200, 200, 255"/>
<SliderThumbOutlineColor value="255, 255, 255, 255"/>
<SliderTrackColor value="255, 255, 255, 255"/>
<!-- TEXTFIELDS -->
<TextBgFocusColor value="200, 209, 204, 255"/> <!-- Text field background when receiving input (focused) -->
<TextBgReadOnlyColor value="62, 62, 62, 160"/> <!-- Text field background when read-only -->
<TextBgWriteableColor value="200, 209, 204, 230"/> <!-- Text field background when not receiving input (unfocused) -->
<TextCursorColor value="0, 0, 0, 255"/>
<TextFgColor value="0, 0, 0, 255"/>
<TextFgReadOnlyColor value="255, 255, 255, 200"/>
<TextFgTentativeColor value="0, 0, 0, 128"/>
<TextEmbeddedItemReadOnlyColor value="58, 147, 242, 255"/> <!-- i.e. About Land name that you don't own -->
<TextEmbeddedItemColor value="0, 0, 128, 255"/>
<TextDefaultColor value="0, 20, 0, 255"/>
<!-- LISTBOXES -->
<ScrollBgReadOnlyColor value="200, 209, 204, 255"/>
<ScrollBgWriteableColor value="200, 209, 204, 255"/>
<ScrollBGStripeColor value="100, 100, 100, 40"/>
<ScrollDisabledColor value="128, 128, 128, 204"/>
<ScrollSelectedBGColor value="100, 100, 100, 150"/>
<ScrollSelectedFGColor value="0, 0, 0, 204"/> <!-- Text color -->
<ScrollUnselectedColor value="0, 0, 0, 204"/> <!-- Text color -->
<ScrollHighlightedColor value="183, 184, 188, 128"/> <!-- Hover color -->
<ScrollbarThumbColor value="100, 100, 100, 255"/>
<ScrollbarTrackColor value="153, 154, 158, 255"/>
<!-- MENUS -->
<MenuBarBgColor value="62, 62, 62, 255"/>
<MenuBarGodBgColor value="62, 128, 62, 255"/>
<MenuNonProductionBgColor value="128, 60, 60, 255"/>
<MenuNonProductionGodBgColor value="0,128,0,255"/>
<MenuDefaultBgColor value="0, 0, 0, 255"/>
<MenuItemDisabledColor value="133, 133, 164, 128"/> <!-- Menu text color; also text color for pie menus and treeviews (like Inventory) -->
<MenuItemEnabledColor value="255, 255, 255, 255"/> <!-- Menu text color; also text color for pie menus and treeviews (like Inventory) -->
<MenuItemHighlightBgColor value="183, 184, 188, 100"/>
<MenuItemHighlightFgColor value="255, 255, 255, 255"/> <!-- Highlighted menu text color; also treeview node selection highlight -->
<MenuPopupBgColor value="0, 0, 0, 255"/>
<!-- PIE MENUS -->
<PieMenuBgColor value="62, 62, 62, 150"/>
<PieMenuLineColor value="0, 0, 0, 128"/>
<PieMenuSelectedColor value="183, 184, 188, 77"/>
<!-- TOOLTIPS -->
<ToolTipBgColor value="183, 184, 188, 200"/>
<ToolTipBorderColor value="171, 212, 245, 255"/>
<ToolTipTextColor value="0, 0, 0, 255"/>
<!-- NOTIFICATION POP-UPS -->
<NotifyBoxColor value="66, 66, 66, 255"/>
<NotifyTextColor value="200, 200, 200, 255"/>
<NotifyCautionBoxColor value="254, 209, 118, 255"/> <!-- the background color of caution permissions prompts -->
<NotifyCautionWarnColor value="0, 0, 0, 255"/> <!-- the foreground color of the special title text in caution permissions prompts -->
<GroupNotifyBoxColor value="70, 170, 255, 255"/>
<GroupNotifyTextColor value="0, 0, 0 255" />
<!-- CHAT AND IM HISTORY TEXTBOX COLORS -->
<ChatHistoryBgColor value="30, 30, 30, 200" />
<ChatHistoryTextColor value="255, 255, 255, 255" />
<IMHistoryBgColor value="30, 30, 30, 200" />
<IMHistoryTextColor value="255, 255, 255, 255" />
<!-- IN-WORLD SELECTION -->
<SilhouetteParentColor value="255, 255, 0, 255"/>
<SilhouetteChildColor value="32, 106, 196, 255"/>
<HighlightParentColor value="171, 212, 245, 255"/>
<HighlightChildColor value="171, 212, 245, 255"/>
<HighlightInspectColor value="255, 0, 255, 255"/>
<!-- EDIT MODE GRID -->
<GridFocusPointColor value="255, 255, 255, 128"/>
<GridlineColor value="255, 255, 255, 255"/>
<GridlineBGColor value="235, 235, 255, 200"/>
<GridlineShadowColor value="0, 0, 0, 80"/>
<!-- PROPERTY LINES -->
<PropertyColorAvail value="0, 0, 0, 0"/>
<PropertyColorGroup value="0, 184, 184, 102"/>
<PropertyColorOther value="255, 0, 0, 102"/>
<PropertyColorSelf value="0, 255, 0, 102"/>
<PropertyColorForSale value="255, 128, 0, 102"/>
<PropertyColorAuction value="128, 0, 255, 102"/> <!-- Match the color on the world map -->
<!-- Icon Enable/Disable -->
<IconEnabledColor value="255, 255, 255, 255"/>
<IconDisabledColor value="147, 169, 213, 200"/>
<!-- MAP -->
<MapAvatar value="0, 255, 0, 255" />
<MapFriend value="255, 255, 0, 255" />
<MapLinden value="0, 0, 255, 255" />
<MapMuted value="110, 110, 110, 255" />
<!-- MINI-MAP -->
<NetMapBackgroundColor value="0, 0, 0, 77" />
<NetMapYouOwnAboveWater value="0, 255, 255, 255" />
<NetMapYouOwnBelowWater value="0, 200, 200, 255" />
<NetMapGroupOwnAboveWater value="255, 0, 255, 255" />
<NetMapGroupOwnBelowWater value="200, 0, 200, 255" />
<NetMapOtherOwnAboveWater value="60, 60, 60, 255" />
<NetMapOtherOwnBelowWater value="30, 30, 30, 255" />
<NetMapThisRegion value="255, 255, 255, 255" />
<NetMapLiveRegion value="204, 204, 204, 255" />
<NetMapDeadRegion value="255, 128, 128, 255" />
<NetMapFrustum value="255, 255, 255, 20" />
<NetMapFrustumRotating value="255, 255, 255, 51" />
<!-- HELP WINDOW -->
<HelpBgColor value="200, 209, 204, 255"/>
<HelpFgColor value="0, 0, 0, 255"/>
<HelpScrollTrackColor value="183, 184, 188, 255"/>
<HelpScrollThumbColor value="80, 96, 124, 255"/>
<HelpScrollHighlightColor value="115, 132, 155, 255"/>
<HelpScrollShadowColor value="0, 0, 0, 255"/>
<!-- MISC -->
<AvatarNameColor value="251, 175, 93, 255"/> <!-- Text color of avatar nametags -->
<FocusColor value="238, 156, 0, 255"/> <!-- Color of the glow around UI controls with keyboard focus -->
<FloaterButtonImageColor value="156, 239, 0, 255"/> <!-- The floater buttons (like the close box) are white images that receive this color. -->
<ButtonCautionImageColor value="255, 255, 255, 255"/> <!-- Match the caution dialog buttons to the default -->
<MapAutopilotColor value="255, 128, 0, 255"/>
<ContextSilhouetteColor value="239, 156, 0, 255"/> <!-- For "context" highlighting, i.e. pie menu -->
<ScriptBgReadOnlyColor value="100, 100, 100, 255"/>
<ParcelTextColor value="0, 200, 100, 200" /> <!-- Parcel name on menu bar, normal state -->
<ParcelHoverColor value="0, 200, 100, 255" /> <!-- Parcel name on menu bar, hover state -->
<TimeTextColor value="255, 255, 255, 255" /> <!-- SL Time on menu bar -->
<BalanceTextColor value="0, 255, 0, 255"/> <!-- Linden dollar balance on menu bar -->
<HealthTextColor value="255, 255, 255, 255"/> <!-- Damage meter text on menu bar -->
<GroupOverTierColor value="110, 15, 15, 255" /> <!-- Warning text in Group Info window -->
<FilterBackgroundColor value="0, 0, 20, 255"/> <!-- Matching region of Inventory search text -->
<FilterTextColor value="255, 200, 70, 255"/>
<InventoryItemSuffixColor value="200, 200, 200, 255"/>
<InventorySearchStatusColor value="0, 0, 0, 255" />
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/>
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<!-- Alert box colors -->
<AlertBoxColor value="62, 62, 62, 255"/>
<AlertTextColor value="147, 169, 213, 255"/>
<AlertCautionBoxColor value="96, 96, 0, 255"/> <!-- Background color of caution alerts -->
<AlertCautionTextColor value="0, 0, 0, 255"/> <!-- Foreground color of the special title text in caution alerts -->
<!-- Multi sliders, as in the sky animation setting -->
<MultiSliderDisabledThumbColor value="0, 0, 0, 255"/>
<MultiSliderThumbCenterColor value="183, 184, 188, 255"/>
<MultiSliderThumbOutlineColor value="0, 0, 0, 255"/>
<MultiSliderTrackColor value="30, 30, 30, 255"/>
<MultiSliderThumbCenterSelectedColor value="255, 50, 50, 255"/>
<MultiSliderTriangleColor value="255, 255, 50, 255"/>
</settings>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Some files were not shown because too many files have changed in this diff Show More