Merge remote-tracking branch 'Liru/master'

This commit is contained in:
Damian Zhaoying
2014-09-13 14:46:59 -03:00
24 changed files with 1030 additions and 755 deletions

View File

@@ -182,9 +182,6 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
}
mIsBuilt = FALSE;
mNumCollisionVolumes = 0;
mCollisionVolumes = NULL;
}
// virtual
@@ -294,7 +291,7 @@ LLAvatarAppearance::~LLAvatarAppearance()
mJointMap.clear();
clearSkeleton();
deleteAndClearArray(mCollisionVolumes);
clearCollisionVolumes();
std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer());
mPolyMeshes.clear();
@@ -575,12 +572,12 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
}
else // collision volume
{
if (volume_num >= (S32)mNumCollisionVolumes)
if (volume_num >= (S32)mCollisionVolumes.size())
{
llwarns << "Too many bones" << llendl;
return FALSE;
}
joint = (&mCollisionVolumes[volume_num]);
joint = (mCollisionVolumes[volume_num]);
joint->setName( info->mName );
}
@@ -1250,12 +1247,12 @@ LLVector3 LLAvatarAppearance::getVolumePos(S32 joint_index, LLVector3& volume_of
return LLVector3::zero;
}
if (joint_index > mNumCollisionVolumes)
if (joint_index > (S32)mCollisionVolumes.size())
{
return LLVector3::zero;
}
return mCollisionVolumes[joint_index].getVolumePos(volume_offset);
return mCollisionVolumes[joint_index]->getVolumePos(volume_offset);
}
//-----------------------------------------------------------------------------
@@ -1266,12 +1263,12 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id)
//SNOW-488: As mNumCollisionVolumes is a S32 and we are casting from a U32 to a S32
//to compare we also need to be sure of the wrap around case producing (S32) <0
//or in terms of the U32 an out of bounds index in the array.
if ((S32)volume_id > mNumCollisionVolumes || (S32)volume_id<0)
if ((S32)volume_id > (S32)mCollisionVolumes.size() || (S32)volume_id<0)
{
return NULL;
}
return &mCollisionVolumes[volume_id];
return mCollisionVolumes[volume_id];
}
//-----------------------------------------------------------------------------
@@ -1279,9 +1276,9 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id)
//-----------------------------------------------------------------------------
S32 LLAvatarAppearance::getCollisionVolumeID(std::string &name)
{
for (S32 i = 0; i < mNumCollisionVolumes; i++)
for (S32 i = 0; i < (S32)mCollisionVolumes.size(); i++)
{
if (mCollisionVolumes[i].getName() == name)
if (mCollisionVolumes[i]->getName() == name)
{
return i;
}
@@ -1530,21 +1527,34 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
return mBakedTextureDatas[baked_index].mTexLayerSet;
}
void LLAvatarAppearance::clearCollisionVolumes()
{
std::for_each(mCollisionVolumes.begin(), mCollisionVolumes.end(),
DeletePointer());
mCollisionVolumes.clear();
}
//-----------------------------------------------------------------------------
// allocateCollisionVolumes()
//-----------------------------------------------------------------------------
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
{
deleteAndClearArray(mCollisionVolumes);
mNumCollisionVolumes = 0;
mCollisionVolumes.reserve(num);
mCollisionVolumes = new LLAvatarJointCollisionVolume[num];
if (!mCollisionVolumes)
LLAvatarJointCollisionVolume* cv;
for (U32 i = 0; i < num; ++i)
{
return FALSE;
cv = new LLAvatarJointCollisionVolume();
if (cv)
{
mCollisionVolumes.push_back(cv);
}
else
{
clearCollisionVolumes();
return false;
}
}
mNumCollisionVolumes = num;
return TRUE;
}

View File

@@ -337,9 +337,9 @@ protected:
// Collision volumes
//--------------------------------------------------------------------
public:
S32 mNumCollisionVolumes;
LLAvatarJointCollisionVolume* mCollisionVolumes;
std::vector<LLAvatarJointCollisionVolume*> mCollisionVolumes;
protected:
void clearCollisionVolumes();
BOOL allocateCollisionVolumes(U32 num);
/** Physics

View File

@@ -647,11 +647,11 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++)
{
LLPolyVolumeMorphInfo *volume_info = &(*iter);
for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++)
for (S32 i = 0; i < (S32)avatarp->mCollisionVolumes.size(); i++)
{
if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName)
if (avatarp->mCollisionVolumes[i]->getName() == volume_info->mName)
{
mVolumeMorphs.push_back(LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i],
mVolumeMorphs.push_back(LLPolyVolumeMorph(avatarp->mCollisionVolumes[i],
volume_info->mScale,
volume_info->mPos));
break;

View File

@@ -206,6 +206,7 @@ namespace
return "Unknown";
}
#if LL_LINUX
std::string compute_CPUFamilyName(const char* cpu_vendor, int composed_family)
{
const char* intel_string = "GenuineIntel";
@@ -221,6 +222,7 @@ namespace
return "Unknown";
}
#else
std::string compute_CPUFamilyName(const char* cpu_vendor, int family, int ext_family)
{
const char* intel_string = "GenuineIntel";
@@ -239,6 +241,7 @@ namespace
}
return "Unknown";
}
#endif
} // end unnamed namespace

View File

@@ -905,7 +905,6 @@ AIHTTPTimeoutPolicy const* AIHTTPTimeoutPolicy::getTimeoutPolicyByName(std::stri
#define P2(n, b) AIHTTPTimeoutPolicy n##_timeout(#n, b)
// Policy name Policy
P(assetUploadResponder);
P(assetReportHandler);
P(avatarPickerResponder);
P(authHandler);
@@ -952,7 +951,6 @@ P2(meshPhysicsShapeResponder, connect_30s);
P2(meshSkinInfoResponder, connect_30s);
P(mimeDiscoveryResponder);
P(moderationResponder);
P(newAgentInventoryVariablePriceResponder);
P(objectCostResponder);
P(physicsFlagsResponder);
P(productInfoRequestResponder);

View File

@@ -7735,6 +7735,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RadarAlertShowDist</key>
<map>
<key>Comment</key>
<string>Show distance in radar announcements.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RadarAlertSim</key>
<map>
<key>Comment</key>

View File

@@ -37,6 +37,7 @@
#include "llagent.h"
#include "llcompilequeue.h"
#include "llfloaterbuycurrency.h"
#include "statemachine/aifilepicker.h"
#include "llinventorydefines.h"
#include "llinventoryobserver.h"
#include "llinventorypanel.h"
@@ -66,8 +67,6 @@
#include "llsdutil.h"
#include "llvfs.h"
#include "statemachine/aifilepicker.h"
// When uploading multiple files, don't display any of them when uploading more than this number.
static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5;
@@ -190,9 +189,10 @@ void on_new_single_inventory_upload_complete(
LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data,
const LLUUID& vfile_id,
LLAssetType::EType asset_type)
: mPostData(post_data),
mVFileID(vfile_id),
mAssetType(asset_type)
:
mPostData(post_data),
mVFileID(vfile_id),
mAssetType(asset_type)
{
if (!gVFS->getExists(vfile_id, asset_type))
{
@@ -207,9 +207,10 @@ LLAssetUploadResponder::LLAssetUploadResponder(
const LLSD &post_data,
const std::string& file_name,
LLAssetType::EType asset_type)
: mPostData(post_data),
mFileName(file_name),
mAssetType(asset_type)
:
mPostData(post_data),
mFileName(file_name),
mAssetType(asset_type)
{
}
@@ -223,7 +224,7 @@ LLAssetUploadResponder::~LLAssetUploadResponder()
}
// virtual
void LLAssetUploadResponder::httpFailure(void)
void LLAssetUploadResponder::httpFailure()
{
llinfos << "LLAssetUploadResponder::error " << mStatus
<< " reason: " << mReason << llendl;
@@ -248,15 +249,21 @@ void LLAssetUploadResponder::httpFailure(void)
}
//virtual
void LLAssetUploadResponder::httpSuccess(void)
void LLAssetUploadResponder::httpSuccess()
{
const LLSD& content = getContent();
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl;
std::string state = mContent["state"];
const std::string& state = content["state"].asString();
if (state == "upload")
{
uploadUpload(mContent);
uploadUpload(content);
}
else if (state == "complete")
{
@@ -264,20 +271,20 @@ void LLAssetUploadResponder::httpSuccess(void)
if (mFileName.empty())
{
// rename the file in the VFS to the actual asset id
// llinfos << "Changing uploaded asset UUID to " << mContent["new_asset"].asUUID() << llendl;
gVFS->renameFile(mVFileID, mAssetType, mContent["new_asset"].asUUID(), mAssetType);
// LL_INFOS() << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << LL_ENDL;
gVFS->renameFile(mVFileID, mAssetType, content["new_asset"].asUUID(), mAssetType);
}
uploadComplete(mContent);
uploadComplete(content);
}
else
{
uploadFailure(mContent);
uploadFailure(content);
}
}
void LLAssetUploadResponder::uploadUpload(const LLSD& content)
{
std::string uploader = content["uploader"];
const std::string& uploader = content["uploader"].asString();
if (mFileName.empty())
{
LLHTTPClient::postFile(uploader, mVFileID, mAssetType, this);
@@ -293,7 +300,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content)
// remove the "Uploading..." message
LLUploadDialog::modalUploadFinished();
std::string reason = content["state"];
const std::string& reason = content["state"].asString();
// deal with L$ errors
if (reason == "insufficient funds")
{
@@ -316,10 +323,8 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content)
LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(
const LLSD& post_data,
const LLUUID& vfile_id,
LLAssetType::EType asset_type,
void (*callback)(bool, void*),
void* user_data)
: LLAssetUploadResponder(post_data, vfile_id, asset_type), mCallBack(callback), mUserData(user_data)
LLAssetType::EType asset_type)
: LLAssetUploadResponder(post_data, vfile_id, asset_type)
{
}
@@ -327,17 +332,13 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(
const LLSD& post_data,
const std::string& file_name,
LLAssetType::EType asset_type)
: LLAssetUploadResponder(post_data, file_name, asset_type), mCallBack(NULL), mUserData(NULL)
: LLAssetUploadResponder(post_data, file_name, asset_type)
{
}
// virtual
void LLNewAgentInventoryResponder::httpFailure(void)
void LLNewAgentInventoryResponder::httpFailure()
{
if (mCallBack)
{
(*mCallBack)(false, mUserData);
}
LLAssetUploadResponder::httpFailure();
//LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE);
}
@@ -346,10 +347,6 @@ void LLNewAgentInventoryResponder::httpFailure(void)
//virtual
void LLNewAgentInventoryResponder::uploadFailure(const LLSD& content)
{
if (mCallBack)
{
(*mCallBack)(false, mUserData);
}
LLAssetUploadResponder::uploadFailure(content);
//LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], FALSE);
@@ -360,14 +357,9 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
{
lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl;
if (mCallBack)
{
(*mCallBack)(true, mUserData);
}
//std::ostringstream llsdxml;
//LLSDSerialize::toXML(content, llsdxml);
//llinfos << "upload complete content:\n " << llsdxml.str() << llendl;
//LL_INFOS() << "upload complete content:\n " << llsdxml.str() << LL_ENDL;
LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString());
LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString());
@@ -456,57 +448,6 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
*/
}
LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data,
const LLUUID& vfile_id,
LLAssetType::EType asset_type,
LLBakedUploadData * baked_upload_data) :
LLAssetUploadResponder(post_data, vfile_id, asset_type),
mBakedUploadData(baked_upload_data)
{
}
LLSendTexLayerResponder::~LLSendTexLayerResponder()
{
// mBakedUploadData is normally deleted by calls to LLViewerTexLayerSetBuffer::onTextureUploadComplete() below
if (mBakedUploadData)
{ // ...but delete it in the case where uploadComplete() is never called
delete mBakedUploadData;
mBakedUploadData = NULL;
}
}
// Baked texture upload completed
void LLSendTexLayerResponder::uploadComplete(const LLSD& content)
{
LLUUID item_id = mPostData["item_id"];
std::string result = content["state"];
LLUUID new_id = content["new_asset"];
llinfos << "result: " << result << " new_id: " << new_id << llendl;
if (result == "complete"
&& mBakedUploadData != NULL)
{ // Invoke
LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, 0, LL_EXSTAT_NONE);
mBakedUploadData = NULL; // deleted in onTextureUploadComplete()
}
else
{ // Invoke the original callback with an error result
LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, -1, LL_EXSTAT_NONE);
mBakedUploadData = NULL; // deleted in onTextureUploadComplete()
}
}
void LLSendTexLayerResponder::httpFailure(void)
{
llinfos << "status: " << mStatus << " reason: " << mReason << llendl;
// Invoke the original callback with an error result
LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID(), (void*) mBakedUploadData, -1, LL_EXSTAT_NONE);
mBakedUploadData = NULL; // deleted in onTextureUploadComplete()
}
LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder(
const LLSD& post_data,
const LLUUID& vfile_id,
@@ -533,7 +474,7 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content)
if(!item)
{
llwarns << "Inventory item for " << mVFileID
<< " is no longer in agent inventory." << llendl;
<< " is no longer in agent inventory." << LL_ENDL;
return;
}
@@ -544,7 +485,7 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content)
gInventory.notifyObservers();
llinfos << "Inventory item " << item->getName() << " saved into "
<< content["new_asset"].asString() << llendl;
<< content["new_asset"].asString() << LL_ENDL;
LLInventoryType::EType inventory_type = new_item->getInventoryType();
switch(inventory_type)
@@ -605,6 +546,7 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content)
{
previewp->onUpdateSucceeded();
}
break;
}
case LLInventoryType::IT_WEARABLE:
@@ -650,8 +592,7 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content)
case LLAssetType::AT_NOTECARD:
{
// Update the UI with the new asset.
LLPreviewNotecard* nc;
nc = (LLPreviewNotecard*)LLPreview::find(item_id);
LLPreviewNotecard* nc = (LLPreviewNotecard*)LLPreview::find(item_id);
if (nc)
{
// *HACK: we have to delete the asset in the VFS so
@@ -674,8 +615,7 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content)
{
if (mQueueId.notNull())
{
LLFloaterCompileQueue* queue =
(LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId);
LLFloaterCompileQueue* queue = (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId);
if (NULL != queue)
{
queue->removeItemByItemID(item_id);
@@ -724,7 +664,7 @@ public:
{
llwarns
<< "LLAssetUploadResponder called with nonexistant "
<< "vfile_id " << vfile_id << llendl;
<< "vfile_id " << vfile_id << LL_ENDL;
mVFileID.setNull();
mAssetType = LLAssetType::AT_NONE;
}
@@ -1020,17 +960,15 @@ LLNewAgentInventoryVariablePriceResponder::~LLNewAgentInventoryVariablePriceResp
delete mImpl;
}
void LLNewAgentInventoryVariablePriceResponder::httpFailure(void)
void LLNewAgentInventoryVariablePriceResponder::httpFailure()
{
lldebugs
<< "LLNewAgentInventoryVariablePrice::error " << mStatus
<< " reason: " << mReason << llendl;
const LLSD& content = getContent();
LL_WARNS("Upload") << dumpResponse() << LL_ENDL;
if ( mContent.has("error") )
{
static const std::string _ERROR = "error";
mImpl->onTransportError(mContent[_ERROR]);
if ( content.has(_ERROR) )
{
mImpl->onTransportError(content[_ERROR]);
}
else
{
@@ -1038,8 +976,14 @@ void LLNewAgentInventoryVariablePriceResponder::httpFailure(void)
}
}
void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void)
void LLNewAgentInventoryVariablePriceResponder::httpSuccess()
{
const LLSD& content = getContent();
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
// Parse out application level errors and the appropriate
// responses for them
static const std::string _ERROR = "error";
@@ -1053,13 +997,14 @@ void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void)
static const std::string _RSVP = "rsvp";
// Check for application level errors
if (mContent.has(_ERROR))
if ( content.has(_ERROR) )
{
onApplicationLevelError(mContent[_ERROR]);
LL_WARNS("Upload") << dumpResponse() << LL_ENDL;
onApplicationLevelError(content[_ERROR]);
return;
}
std::string state = mContent[_STATE];
std::string state = content[_STATE];
LLAssetType::EType asset_type = mImpl->getAssetType();
if (_COMPLETE == state)
@@ -1068,11 +1013,11 @@ void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void)
if (mImpl->getFilename().empty())
{
// rename the file in the VFS to the actual asset id
// llinfos << "Changing uploaded asset UUID to " << mContent["new_asset"].asUUID() << llendl;
// LL_INFOS() << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << LL_ENDL;
gVFS->renameFile(
mImpl->getVFileID(),
asset_type,
mContent["new_asset"].asUUID(),
content["new_asset"].asUUID(),
asset_type);
}
@@ -1083,8 +1028,8 @@ void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void)
mImpl->getFolderID(),
mImpl->getItemName(),
mImpl->getItemDescription(),
mContent,
mContent[_UPLOAD_PRICE].asInteger());
content,
content[_UPLOAD_PRICE].asInteger());
// TODO* Add bulk (serial) uploading or add
// a super class of this that does so
@@ -1092,12 +1037,13 @@ void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void)
else if ( _CONFIRM_UPLOAD == state )
{
showConfirmationDialog(
mContent[_UPLOAD_PRICE].asInteger(),
mContent[_RESOURCE_COST].asInteger(),
mContent[_RSVP].asString());
content[_UPLOAD_PRICE].asInteger(),
content[_RESOURCE_COST].asInteger(),
content[_RSVP].asString());
}
else
{
LL_WARNS("Upload") << dumpResponse() << LL_ENDL;
onApplicationLevelError("");
}
}
@@ -1170,3 +1116,4 @@ void LLNewAgentInventoryVariablePriceResponder::showConfirmationDialog(
}
}

View File

@@ -36,10 +36,6 @@
#include "llhttpclient.h"
#include "llinventory.h"
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy assetUploadResponder_timeout;
extern AIHTTPTimeoutPolicy newAgentInventoryVariablePriceResponder_timeout;
void on_new_single_inventory_upload_complete(LLAssetType::EType asset_type,
LLInventoryType::EType inventory_type,
const std::string inventory_type_string,
@@ -53,6 +49,8 @@ void on_new_single_inventory_upload_complete(LLAssetType::EType asset_type,
// via capabilities
class LLAssetUploadResponder : public LLHTTPClient::ResponderWithResult
{
protected:
LOG_CLASS(LLAssetUploadResponder);
public:
LLAssetUploadResponder(const LLSD& post_data,
const LLUUID& vfile_id,
@@ -61,10 +59,12 @@ public:
const std::string& file_name,
LLAssetType::EType asset_type);
~LLAssetUploadResponder();
/*virtual*/ void httpFailure(void);
/*virtual*/ void httpSuccess(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return assetUploadResponder_timeout; }
protected:
virtual void httpFailure();
virtual void httpSuccess();
public:
virtual void uploadUpload(const LLSD& content);
virtual void uploadComplete(const LLSD& content);
virtual void uploadFailure(const LLSD& content);
@@ -76,25 +76,24 @@ protected:
std::string mFileName;
};
// TODO*: Remove this once deprecated
class LLNewAgentInventoryResponder : public LLAssetUploadResponder
{
void (*mCallBack)(bool, void*);
void* mUserData;
LOG_CLASS(LLNewAgentInventoryResponder);
public:
LLNewAgentInventoryResponder(
const LLSD& post_data,
const LLUUID& vfile_id,
LLAssetType::EType asset_type,
void (*callback)(bool, void*) = NULL,
void* user_data = NULL);
LLAssetType::EType asset_type);
LLNewAgentInventoryResponder(
const LLSD& post_data,
const std::string& file_name,
LLAssetType::EType asset_type);
/*virtual*/ void httpFailure(void);
virtual void uploadComplete(const LLSD& content);
virtual void uploadFailure(const LLSD& content);
/*virtual*/ char const* getName(void) const { return "LLNewAgentInventoryResponder"; }
/*virtual*/ char const* getName() const { return "LLNewAgentInventoryResponder"; }
protected:
virtual void httpFailure();
};
// A base class which goes through and performs some default
@@ -104,6 +103,7 @@ public:
class LLNewAgentInventoryVariablePriceResponder :
public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(LLNewAgentInventoryVariablePriceResponder);
public:
LLNewAgentInventoryVariablePriceResponder(
const LLUUID& vfile_id,
@@ -116,10 +116,11 @@ public:
const LLSD& inventory_info);
virtual ~LLNewAgentInventoryVariablePriceResponder();
/*virtual*/ void httpFailure(void);
/*virtual*/ void httpSuccess(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return newAgentInventoryVariablePriceResponder_timeout; }
private:
/* virtual */ void httpFailure();
/* virtual */ void httpSuccess();
public:
virtual void onApplicationLevelError(
const LLSD& error);
virtual void showConfirmationDialog(
@@ -132,25 +133,6 @@ private:
Impl* mImpl;
};
struct LLBakedUploadData;
class LLSendTexLayerResponder : public LLAssetUploadResponder
{
LOG_CLASS(LLSendTexLayerResponder);
public:
LLSendTexLayerResponder(const LLSD& post_data,
const LLUUID& vfile_id,
LLAssetType::EType asset_type,
LLBakedUploadData * baked_upload_data);
~LLSendTexLayerResponder();
/*virtual*/ void uploadComplete(const LLSD& content);
/*virtual*/ void httpFailure(void);
/*virtual*/ char const* getName(void) const { return "LLSendTexLayerResponder"; }
LLBakedUploadData * mBakedUploadData;
};
class LLUpdateAgentInventoryResponder : public LLAssetUploadResponder
{
public:
@@ -161,7 +143,7 @@ public:
const std::string& file_name,
LLAssetType::EType asset_type);
virtual void uploadComplete(const LLSD& content);
/*virtual*/ char const* getName(void) const { return "LLUpdateAgentInventoryResponder"; }
/*virtual*/ char const* getName() const { return "LLUpdateAgentInventoryResponder"; }
};
class LLUpdateTaskInventoryResponder : public LLAssetUploadResponder
@@ -179,7 +161,7 @@ public:
LLAssetType::EType asset_type);
virtual void uploadComplete(const LLSD& content);
/*virtual*/ char const* getName(void) const { return "LLUpdateTaskInventoryResponder"; }
/*virtual*/ char const* getName() const { return "LLUpdateTaskInventoryResponder"; }
private:
LLUUID mQueueId;

View File

@@ -68,7 +68,7 @@ extern U32 gFrameCount;
namespace
{
void chat_avatar_status(const std::string& name, const LLUUID& key, ERadarStatType type, bool entering)
void chat_avatar_status(const std::string& name, const LLUUID& key, ERadarStatType type, bool entering, const F32& dist)
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) return; // RLVa:LF Don't announce people are around when blind, that cheats the system.
static LLCachedControl<bool> radar_chat_alerts(gSavedSettings, "RadarChatAlerts");
@@ -96,6 +96,11 @@ namespace
if (args.find("[RANGE]") != args.end())
chat.mText = self->getString("template", args);
else if (chat.mText.empty()) return;
if (entering) // Note: If we decide to make this for leaving as well, change this check to dist != F32_MIN
{
static const LLCachedControl<bool> radar_show_dist("RadarAlertShowDist");
if (radar_show_dist) chat.mText += llformat(" (%.2fm)", dist);
}
chat.mFromName = name;
chat.mURL = llformat("secondlife:///app/agent/%s/about",key.asString().c_str());
chat.mSourceType = CHAT_SOURCE_SYSTEM;
@@ -160,7 +165,7 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
static const LLCachedControl<U32> sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays");
if ((U32)mAge < sAvatarAgeAlertDays)
{
chat_avatar_status(mName, mID, STAT_TYPE_AGE, mStats[STAT_TYPE_AGE] = true);
chat_avatar_status(mName, mID, STAT_TYPE_AGE, mStats[STAT_TYPE_AGE] = true, (mPosition - gAgent.getPositionGlobal()).magVec());
}
}
// If one wanted more information that gets displayed on profiles to be displayed, here would be the place to do it.
@@ -168,14 +173,18 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
}
}
void LLAvatarListEntry::setPosition(const LLVector3d& position, bool this_sim, bool drawn, bool chatrange, bool shoutrange)
void LLAvatarListEntry::setPosition(const LLVector3d& position, const F32& dist, bool drawn)
{
mPosition = position;
mFrame = gFrameCount;
if (this_sim != mStats[STAT_TYPE_SIM]) chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim);
if (drawn != mStats[STAT_TYPE_DRAW]) chat_avatar_status(mName, mID, STAT_TYPE_DRAW, mStats[STAT_TYPE_DRAW] = drawn);
if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange);
if (chatrange != mStats[STAT_TYPE_CHATRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange);
bool here(dist != F32_MIN); // F32_MIN only if dead
bool this_sim(here && (gAgent.getRegion()->pointInRegionGlobal(position) || !(LLWorld::getInstance()->positionRegionValidGlobal(position))));
if (this_sim != mStats[STAT_TYPE_SIM]) chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim, dist);
if (drawn != mStats[STAT_TYPE_DRAW]) chat_avatar_status(mName, mID, STAT_TYPE_DRAW, mStats[STAT_TYPE_DRAW] = drawn, dist);
bool shoutrange(here && dist < LFSimFeatureHandler::getInstance()->shoutRange());
if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange, dist);
bool chatrange(here && dist < LFSimFeatureHandler::getInstance()->sayRange());
if (chatrange != mStats[STAT_TYPE_CHATRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange, dist);
mUpdateTimer.start();
}
@@ -553,8 +562,7 @@ void LLFloaterAvatarList::updateAvatarList()
}
// Announce position
F32 dist((position - mypos).magVec());
entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position) || !(LLWorld::getInstance()->positionRegionValidGlobal(position)), avatarp, dist < LFSimFeatureHandler::getInstance()->sayRange(), dist < LFSimFeatureHandler::getInstance()->shoutRange());
entry->setPosition(position, (position - mypos).magVec(), avatarp);
// Mark as typing if they are typing
if (avatarp && avatarp->isTyping()) entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING);
@@ -621,7 +629,7 @@ void LLFloaterAvatarList::expireAvatarList()
}
else
{
entry->setPosition(entry->getPosition(), false, false, false, false); // Dead and gone
entry->setPosition(entry->getPosition(), F32_MIN, false); // Dead and gone
it = mAvatars.erase(it);
}
}
@@ -700,151 +708,171 @@ void LLFloaterAvatarList::refreshAvatarList()
LLScrollListItem::Params element;
element.value = av_id;
LLScrollListCell::Params mark;
mark.column = "marked";
mark.type = "text";
if (entry->isMarked())
static const LLCachedControl<bool> hide_mark("RadarColumnMarkHidden");
if (!hide_mark)
{
mark.value = "X";
mark.color = LLColor4::blue;
mark.font_style = "BOLD";
}
LLScrollListCell::Params name;
name.column = "avatar_name";
name.type = "text";
name.value = entry->getName();
if (entry->isFocused())
{
name.font_style = "BOLD";
}
//<edit> custom colors for certain types of avatars!
//Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB
//name.color = gColors.getColor( "MapAvatar" );
LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition());
LLUUID estate_owner = LLUUID::null;
if (parent_estate && parent_estate->isAlive())
{
estate_owner = parent_estate->getOwner();
LLScrollListCell::Params mark;
mark.column = "marked";
mark.type = "text";
if (entry->isMarked())
{
mark.value = "X";
mark.color = LLColor4::blue;
mark.font_style = "BOLD";
}
element.columns.add(mark);
}
static const LLCachedControl<LLColor4> unselected_color(gColors, "ScrollUnselectedColor", LLColor4(0.f, 0.f, 0.f, 0.8f));
static LLCachedControl<LLColor4> sDefaultListText(gColors, "DefaultListText");
static LLCachedControl<LLColor4> sRadarTextChatRange(gColors, "RadarTextChatRange");
static LLCachedControl<LLColor4> sRadarTextShoutRange(gColors, "RadarTextShoutRange");
static LLCachedControl<LLColor4> sRadarTextDrawDist(gColors, "RadarTextDrawDist");
static LLCachedControl<LLColor4> sRadarTextYoung(gColors, "RadarTextYoung");
static const LLCachedControl<LLColor4> sDefaultListText(gColors, "DefaultListText");
static const LLCachedControl<LLColor4> ascent_muted_color("AscentMutedColor", LLColor4(0.7f,0.7f,0.7f,1.f));
LLColor4 color = sDefaultListText;
//Lindens are always more Linden than your friend, make that take precedence
if (mm_getMarkerColor(av_id, color)) {}
else if (LLMuteList::getInstance()->isLinden(av_id))
// Name never hidden
{
static const LLCachedControl<LLColor4> ascent_linden_color("AscentLindenColor", LLColor4(0.f,0.f,1.f,1.f));
color = ascent_linden_color;
LLScrollListCell::Params name;
name.column = "avatar_name";
name.type = "text";
name.value = entry->getName();
if (entry->isFocused())
{
name.font_style = "BOLD";
}
//<edit> custom colors for certain types of avatars!
//Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB
//name.color = gColors.getColor( "MapAvatar" );
LLUUID estate_owner = LLUUID::null;
if (LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition()))
if (parent_estate->isAlive())
estate_owner = parent_estate->getOwner();
//Lindens are always more Linden than your friend, make that take precedence
if (mm_getMarkerColor(av_id, color)) {}
else if (LLMuteList::getInstance()->isLinden(av_id))
{
static const LLCachedControl<LLColor4> ascent_linden_color("AscentLindenColor", LLColor4(0.f,0.f,1.f,1.f));
color = ascent_linden_color;
}
//check if they are an estate owner at their current position
else if (estate_owner.notNull() && av_id == estate_owner)
{
static const LLCachedControl<LLColor4> ascent_estate_owner_color("AscentEstateOwnerColor", LLColor4(1.f,0.6f,1.f,1.f));
color = ascent_estate_owner_color;
}
//without these dots, SL would suck.
else if (LLAvatarActions::isFriend(av_id))
{
static const LLCachedControl<LLColor4> ascent_friend_color("AscentFriendColor", LLColor4(1.f,1.f,0.f,1.f));
color = ascent_friend_color;
}
//big fat jerkface who is probably a jerk, display them as such.
else if (LLMuteList::getInstance()->isMuted(av_id))
{
color = ascent_muted_color;
}
name.color = color*0.5f + unselected_color*0.5f;
element.columns.add(name);
}
//check if they are an estate owner at their current position
else if (estate_owner.notNull() && av_id == estate_owner)
{
static const LLCachedControl<LLColor4> ascent_estate_owner_color("AscentEstateOwnerColor", LLColor4(1.f,0.6f,1.f,1.f));
color = ascent_estate_owner_color;
}
//without these dots, SL would suck.
else if (LLAvatarActions::isFriend(av_id))
{
static const LLCachedControl<LLColor4> ascent_friend_color("AscentFriendColor", LLColor4(1.f,1.f,0.f,1.f));
color = ascent_friend_color;
}
//big fat jerkface who is probably a jerk, display them as such.
else if (LLMuteList::getInstance()->isMuted(av_id))
{
color = ascent_muted_color;
}
name.color = color*0.5f + unselected_color*0.5f;
char temp[32];
color = sDefaultListText;
LLScrollListCell::Params dist;
dist.column = "distance";
dist.type = "text";
if (UnknownAltitude)
// Distance never hidden
{
strcpy(temp, "?");
if (entry->mStats[STAT_TYPE_DRAW])
color = sDefaultListText;
LLScrollListCell::Params dist;
dist.column = "distance";
dist.type = "text";
static const LLCachedControl<LLColor4> sRadarTextDrawDist(gColors, "RadarTextDrawDist");
if (UnknownAltitude)
{
color = sRadarTextDrawDist;
}
}
else
{
if (distance <= LFSimFeatureHandler::getInstance()->shoutRange())
{
snprintf(temp, sizeof(temp), "%.1f", distance);
color = (distance > LFSimFeatureHandler::getInstance()->sayRange()) ? sRadarTextShoutRange : sRadarTextChatRange;
strcpy(temp, "?");
if (entry->mStats[STAT_TYPE_DRAW])
{
color = sRadarTextDrawDist;
}
}
else
{
if (entry->mStats[STAT_TYPE_DRAW]) color = sRadarTextDrawDist;
snprintf(temp, sizeof(temp), "%d", (S32)distance);
if (distance <= LFSimFeatureHandler::getInstance()->shoutRange())
{
static const LLCachedControl<LLColor4> sRadarTextChatRange(gColors, "RadarTextChatRange");
static const LLCachedControl<LLColor4> sRadarTextShoutRange(gColors, "RadarTextShoutRange");
snprintf(temp, sizeof(temp), "%.1f", distance);
color = (distance > LFSimFeatureHandler::getInstance()->sayRange()) ? sRadarTextShoutRange : sRadarTextChatRange;
}
else
{
if (entry->mStats[STAT_TYPE_DRAW]) color = sRadarTextDrawDist;
snprintf(temp, sizeof(temp), "%d", (S32)distance);
}
}
dist.value = temp;
dist.color = color * 0.7f + unselected_color * 0.3f; // Liru: Blend testing!
//dist.color = color;
element.columns.add(dist);
}
dist.value = temp;
dist.color = color * 0.7f + unselected_color * 0.3f; // Liru: Blend testing!
//dist.color = color;
LLScrollListCell::Params pos;
position -= simpos;
static const LLCachedControl<bool> hide_pos("RadarColumnPositionHidden");
if (!hide_pos)
{
LLScrollListCell::Params pos;
position -= simpos;
S32 x(position.mdV[VX]);
S32 y(position.mdV[VY]);
if (x >= 0 && x <= width && y >= 0 && y <= width)
{
snprintf(temp, sizeof(temp), "%d, %d", x, y);
S32 x(position.mdV[VX]);
S32 y(position.mdV[VY]);
if (x >= 0 && x <= width && y >= 0 && y <= width)
{
snprintf(temp, sizeof(temp), "%d, %d", x, y);
}
else
{
temp[0] = '\0';
if (y < 0)
{
strcat(temp, "S");
}
else if (y > width)
{
strcat(temp, "N");
}
if (x < 0)
{
strcat(temp, "W");
}
else if (x > width)
{
strcat(temp, "E");
}
}
pos.column = "position";
pos.type = "text";
pos.value = temp;
element.columns.add(pos);
}
else
{
temp[0] = '\0';
if (y < 0)
{
strcat(temp, "S");
}
else if (y > width)
{
strcat(temp, "N");
}
if (x < 0)
{
strcat(temp, "W");
}
else if (x > width)
{
strcat(temp, "E");
}
}
pos.column = "position";
pos.type = "text";
pos.value = temp;
LLScrollListCell::Params alt;
alt.column = "altitude";
alt.type = "text";
if (UnknownAltitude)
static const LLCachedControl<bool> hide_alt("RadarColumnAltitudeHidden");
if (!hide_alt)
{
strcpy(temp, "?");
LLScrollListCell::Params alt;
alt.column = "altitude";
alt.type = "text";
if (UnknownAltitude)
{
strcpy(temp, "?");
}
else
{
snprintf(temp, sizeof(temp), "%d", (S32)position.mdV[VZ]);
}
alt.value = temp;
element.columns.add(alt);
}
else
{
snprintf(temp, sizeof(temp), "%d", (S32)position.mdV[VZ]);
}
alt.value = temp;
LLScrollListCell::Params act;
static const LLCachedControl<bool> hide_act("RadarColumnActivityHidden");
if (!hide_act)
{
LLScrollListCell::Params act;
act.column = "activity";
act.type = "icon";
switch(entry->getActivity())
@@ -880,12 +908,13 @@ void LLFloaterAvatarList::refreshAvatarList()
default:
break;
}
element.columns.add(act);
}
LLScrollListCell::Params voice;
static const LLCachedControl<bool> hide_voice("RadarColumnVoiceHidden");
if (!hide_voice)
{
LLScrollListCell::Params voice;
voice.column("voice");
voice.type("icon");
// transplant from llparticipantlist.cpp, update accordingly.
@@ -914,71 +943,78 @@ void LLFloaterAvatarList::refreshAvatarList()
voice.color(speakerp->mStatus > LLSpeaker::STATUS_VOICE_ACTIVE ? LLColor4::transparent : speakerp->mDotColor);
}
}
element.columns.add(voice);
}
LLScrollListCell::Params agep;
agep.column = "age";
agep.type = "text";
color = sDefaultListText;
std::string age = boost::lexical_cast<std::string>(entry->mAge);
if (entry->mAge > -1)
static const LLCachedControl<bool> hide_age("RadarColumnAgeHidden");
if (!hide_age)
{
static const LLCachedControl<U32> sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays");
if ((U32)entry->mAge < sAvatarAgeAlertDays)
color = sRadarTextYoung;
}
else
{
age = "?";
}
agep.value = age;
agep.color = color;
int dur = difftime(time(NULL), entry->getTime());
int hours = dur / 3600;
int mins = (dur % 3600) / 60;
int secs = (dur % 3600) % 60;
LLScrollListCell::Params time;
time.column = "time";
time.type = "text";
time.value = llformat("%d:%02d:%02d", hours, mins, secs);
LLScrollListCell::Params viewer;
viewer.column = "client";
viewer.type = "text";
static const LLCachedControl<LLColor4> avatar_name_color(gColors, "AvatarNameColor",LLColor4(0.98f, 0.69f, 0.36f, 1.f));
color = avatar_name_color;
if (LLVOAvatar* avatarp = gObjectList.findAvatar(av_id))
{
std::string client = SHClientTagMgr::instance().getClientName(avatarp, false);
if (client.empty())
LLScrollListCell::Params agep;
agep.column = "age";
agep.type = "text";
color = sDefaultListText;
std::string age = boost::lexical_cast<std::string>(entry->mAge);
if (entry->mAge > -1)
{
color = unselected_color;
client = "?";
static const LLCachedControl<U32> sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays");
if ((U32)entry->mAge < sAvatarAgeAlertDays)
{
static const LLCachedControl<LLColor4> sRadarTextYoung(gColors, "RadarTextYoung");
color = sRadarTextYoung;
}
}
else SHClientTagMgr::instance().getClientColor(avatarp, false, color);
viewer.value = client.c_str();
else
{
age = "?";
}
agep.value = age;
agep.color = color;
element.columns.add(agep);
}
else
{
viewer.value = getString("Out Of Range");
}
//Blend to make the color show up better
viewer.color = color *.5f + unselected_color * .5f;
// Add individual column cell params to the item param
element.columns.add(mark);
element.columns.add(name);
element.columns.add(dist);
element.columns.add(pos);
element.columns.add(alt);
if (!hide_act) element.columns.add(act);
if (!hide_voice) element.columns.add(voice);
element.columns.add(agep);
element.columns.add(time);
element.columns.add(viewer);
static const LLCachedControl<bool> hide_time("RadarColumnTimeHidden");
if (!hide_time)
{
int dur = difftime(time(NULL), entry->getTime());
int hours = dur / 3600;
int mins = (dur % 3600) / 60;
int secs = (dur % 3600) % 60;
LLScrollListCell::Params time;
time.column = "time";
time.type = "text";
time.value = llformat("%d:%02d:%02d", hours, mins, secs);
element.columns.add(time);
}
static const LLCachedControl<bool> hide_client("RadarColumnClientHidden");
if (!hide_client)
{
LLScrollListCell::Params viewer;
viewer.column = "client";
viewer.type = "text";
static const LLCachedControl<LLColor4> avatar_name_color(gColors, "AvatarNameColor",LLColor4(0.98f, 0.69f, 0.36f, 1.f));
color = avatar_name_color;
if (LLVOAvatar* avatarp = gObjectList.findAvatar(av_id))
{
std::string client = SHClientTagMgr::instance().getClientName(avatarp, false);
if (client.empty())
{
color = unselected_color;
client = "?";
}
else SHClientTagMgr::instance().getClientColor(avatarp, false, color);
viewer.value = client.c_str();
}
else
{
viewer.value = getString("Out Of Range");
}
//Blend to make the color show up better
viewer.color = color *.5f + unselected_color * .5f;
element.columns.add(viewer);
}
// Add to list
mAvatarList->addRow(element);

View File

@@ -80,7 +80,7 @@ enum ACTIVITY_TYPE
* Update world position.
* Affects age.
*/
void setPosition(const LLVector3d& position, bool this_sim, bool drawn, bool chatrange, bool shoutrange);
void setPosition(const LLVector3d& position, const F32& dist, bool drawn);
const LLVector3d& getPosition() const { return mPosition; }

View File

@@ -1426,7 +1426,7 @@ void LLSnapshotLivePreview::saveTexture()
LLAssetStorage::LLStoreAssetCallback callback = &LLSnapshotLivePreview::saveTextureDone;
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
saveTextureUserData* user_data = new saveTextureUserData(this, sSnapshotIndex, gSavedSettings.getBOOL("TemporaryUpload"));
if (!upload_new_resource(tid, // tid
if (upload_new_resource(tid, // tid
LLAssetType::AT_TEXTURE,
"Snapshot : " + pos_string,
"Taken by " + who_took_it + " at " + pos_string,
@@ -1437,7 +1437,11 @@ void LLSnapshotLivePreview::saveTexture()
LLFloaterPerms::getGroupPerms("Uploads"), // that is more permissive than other uploads
LLFloaterPerms::getEveryonePerms("Uploads"),
"Snapshot : " + pos_string,
callback, expected_upload_cost, user_data, &LLSnapshotLivePreview::saveTextureDone2))
callback, expected_upload_cost, user_data))
{
saveTextureDone2(true, user_data);
}
else
{
// Something went wrong.
delete user_data;

View File

@@ -101,7 +101,6 @@ void LLMediaFilter::filterAudioUrl(const std::string& url)
{
if (url.empty())
{
gAudiop->startInternetStream(url);
return;
}
if (url == mCurrentAudioURL) return;

View File

@@ -5201,7 +5201,9 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
{
if (node->mInventorySerial != inv_serial)
{
node->getObject()->dirtyInventory();
if (LLViewerObject* object = node->getObject())
if (object->getInventorySerial() != inv_serial) // Singu Note: the serial number in the object may be correct.
object->dirtyInventory();
}
// save texture data as soon as we get texture perms first time

View File

@@ -1177,8 +1177,7 @@ bool upload_new_resource(
const std::string& display_name,
LLAssetStorage::LLStoreAssetCallback callback,
S32 expected_upload_cost,
void *userdata,
void (*callback2)(bool, void*))
void *userdata)
{
if(gDisconnected)
{
@@ -1230,9 +1229,7 @@ bool upload_new_resource(
new LLNewAgentInventoryResponder(
body,
uuid,
asset_type,
callback2,
userdata));
asset_type));
}
else
{
@@ -1294,17 +1291,16 @@ bool upload_new_resource(
LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid)
{
LLAssetID uuid;
if (gDisconnected)
{
uuid.setNull();
}
else
{
uuid = tid.makeAssetID(gAgent.getSecureSessionID());
LLAssetID rv;
rv.setNull();
return rv;
}
LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID());
return uuid;
}

View File

@@ -78,8 +78,7 @@ bool upload_new_resource(const LLTransactionID &tid,
const std::string& display_name,
LLAssetStorage::LLStoreAssetCallback callback,
S32 expected_upload_cost,
void *userdata,
void (*callback2)(bool, void*) = NULL);
void *userdata);
// The default callback functions, called when 'callback' == NULL (for normal and temporary uploads).
// user_data must be a LLResourceData allocated with new (or NULL).

File diff suppressed because it is too large Load Diff

View File

@@ -30,10 +30,22 @@
#ifndef LL_LLVIEWEROBJECTBACKUP_H
#define LL_LLVIEWEROBJECTBACKUP_H
#include <deque>
#include <string>
#include <vector>
#include "boost/unordered_map.hpp"
#include "boost/unordered_set.hpp"
#include "llfloater.h"
#include "statemachine/aifilepicker.h"
#include "lluuid.h"
#include "llviewerinventory.h"
#include "llviewerobject.h"
class LLSelectNode;
class LLViewerObject;
enum export_states {
EXPORT_INIT,
@@ -43,24 +55,27 @@ enum export_states {
EXPORT_TEXTURES,
EXPORT_LLSD,
EXPORT_DONE,
EXPORT_FAILED
EXPORT_FAILED,
EXPORT_ABORTED
};
class LLObjectBackup : public LLFloater
class LLObjectBackup : public LLFloater,
public LLFloaterSingleton<LLObjectBackup>
{
friend class LLUISingleton<LLObjectBackup, VisibilityPolicy<LLFloater> >;
protected:
LOG_CLASS(LLObjectBackup);
public:
virtual ~LLObjectBackup();
///////////////////////////////////////////////////////////////////////////
// LLFloater interface
// Floater stuff
virtual void show(bool exporting);
virtual void onClose(bool app_quitting);
/*virtual*/ ~LLObjectBackup();
/*virtual*/ void onClose(bool app_quitting);
// Static accessor
static LLObjectBackup* getInstance();
static bool instanceExists() { return sInstance != NULL; }
// Export idle callback
static void exportWorker(void *userdata);
///////////////////////////////////////////////////////////////////////////
// Public interface for invoking the object backup feature
// Import entry point
void importObject(bool upload = false);
@@ -70,47 +85,44 @@ public:
void exportObject();
void exportObject_continued(AIFilePicker* filepicker);
///////////////////////////////////////////////////////////////////////////
// Public methods used in callbacks, workers and responders
// Update map from texture worker
void updateMap(LLUUID uploaded_asset);
// Move to next texture upload
// Move to next texture upload, called by the agent inventory responder
void uploadNextAsset();
// Folder public geter
std::string getfolder() { return mFolder; }
// Export idle callback
static void exportWorker(void *userdata);
// Prim updated callback
void primUpdate(LLViewerObject* object);
// Prim updated callback, called in llviewerobjectlist.cpp
static void primUpdate(LLViewerObject* object);
// New prim call back
bool newPrim(LLViewerObject* pobject);
// New prim call back, called in llviewerobjectlist.cpp
static void newPrim(LLViewerObject* object);
static const U32 TEXTURE_OK = 0x00;
static const U32 TEXTURE_BAD_PERM = 0x01;
static const U32 TEXTURE_MISSING = 0x02;
static const U32 TEXTURE_BAD_ENCODING = 0x04;
static const U32 TEXTURE_IS_NULL = 0x08;
static const U32 TEXTURE_SAVED_FAILED = 0x10;
// Folder public getter, used by the texture cache responder
std::string getFolder() { return mFolder; }
// Set when the region supports the extra physics flags
bool mGotExtraPhysics;
// Are we ready to check for next texture?
bool mCheckNextTexture;
// Export state machine
enum export_states mExportState;
// Export result flags for textures.
U32 mNonExportedTextures;
static void setDefaultTextures();
// Is exporting these objects allowed
bool validatePerms(const LLPermissions* item_permissions);
// Permissions checking
static bool validatePerms(const LLPermissions* item_permissions);
static bool validateTexturePerms(const LLUUID& asset_id);
static bool validateNode(LLSelectNode* node);
private:
LLObjectBackup();
// Open only via the importObject() and exportObject() methods defined
// above.
LLObjectBackup(const LLSD&);
void showFloater(bool exporting);
static bool confirmCloseCallback(const LLSD& notification,
const LLSD& response);
// Update the floater with status numbers
void updateImportNumbers();
@@ -133,7 +145,7 @@ private:
void exportNextTexture();
// Apply LLSD to object
void xmlToPrim(LLSD prim_llsd, LLViewerObject* pobject);
void xmlToPrim(LLSD prim_llsd, LLViewerObject* object);
// Rez a prim at a given position
void rezAgentOffset(LLVector3 offset);
@@ -141,9 +153,28 @@ private:
// Get an offset from the agent based on rotation and current pos
LLVector3 offsetAgent(LLVector3 offset);
private:
static LLObjectBackup* sInstance;
public:
// Public static constants, used in callbacks, workers and responders
static const U32 TEXTURE_OK = 0x00;
static const U32 TEXTURE_BAD_PERM = 0x01;
static const U32 TEXTURE_MISSING = 0x02;
static const U32 TEXTURE_BAD_ENCODING = 0x04;
static const U32 TEXTURE_IS_NULL = 0x08;
static const U32 TEXTURE_SAVED_FAILED = 0x10;
// Export state machine
enum export_states mExportState;
// Export result flags for textures.
U32 mNonExportedTextures;
// Set when the region supports the extra physics flags
bool mGotExtraPhysics;
// Are we ready to check for next texture?
bool mCheckNextTexture;
private:
// Are we active flag
bool mRunning;
@@ -156,7 +187,7 @@ private:
U32 mPrims;
U32 mCurPrim;
// No prims rezed
// Number of rezzed prims
U32 mRezCount;
// Root pos and rotation and central root pos for link set
@@ -168,31 +199,39 @@ private:
// Agent inital pos and rot when starting import
LLVector3 mAgentPos;
LLQuaternion mAgentRot;
// Rebase map
boost::unordered_map<LLUUID, LLUUID> mAssetMap;
LLUUID mCurrentAsset;
LLUUID mExpectingUpdate;
// Working llsd iterators for objects and linksets
LLSD::map_const_iterator mPrimImportIter;
LLSD::array_const_iterator mGroupPrimImportIter;
// File and folder name control
std::string mFileName;
std::string mFolder;
// Export texture list
typedef boost::unordered_set<LLUUID> textures_set_t;
textures_set_t mTexturesList;
textures_set_t mBadPermsTexturesList;
// Rebase map
boost::unordered_map<LLUUID, LLUUID> mAssetMap;
// Import object tracking
std::vector<LLViewerObject*> mToSelect;
std::vector<LLViewerObject*>::iterator mProcessIter;
// File and folder name control
std::string mFileName;
std::string mFolder;
// Working LLSD holders
LLUUID mCurrentAsset;
LLUUID mExpectingUpdate;
LLSD mLLSD;
LLSD mThisGroup;
// Working llsd itterators for objects and linksets
LLSD::map_const_iterator mPrimImportIter;
LLSD::array_const_iterator mGroupPrimImportIter;
};
#endif
extern LLUUID LL_TEXTURE_PLYWOOD;
extern LLUUID LL_TEXTURE_BLANK;
extern LLUUID LL_TEXTURE_INVISIBLE;
extern LLUUID LL_TEXTURE_TRANSPARENT;
extern LLUUID LL_TEXTURE_MEDIA;
#endif // LL_LLVIEWEROBJECTBACKUP_H

View File

@@ -272,7 +272,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
}
else
{
LLObjectBackup::getInstance()->primUpdate(objectp);
LLObjectBackup::primUpdate(objectp);
}
@@ -310,7 +310,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
gViewerWindow->getWindow()->decBusyCount();
gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW );
LLObjectBackup::getInstance()->newPrim(objectp);
LLObjectBackup::newPrim(objectp);
}
}
@@ -1216,6 +1216,17 @@ void LLViewerObjectList::fetchPhysicsFlags()
}
}
bool LLViewerObjectList::gotObjectPhysicsFlags(LLViewerObject* objectp)
{
// This will insert objectp in mStalePhysicsFlags if needed:
objectp->getPhysicsShapeType();
// Data has been retrieved if the object is not in either of the
// two lists:
const LLUUID& id = objectp->getID();
return mPendingPhysicsFlags.count(id) == 0 &&
mStalePhysicsFlags.count(id) == 0;
}
void LLViewerObjectList::clearDebugText()
{
for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)

View File

@@ -99,6 +99,8 @@ public:
void fetchObjectCosts();
void fetchPhysicsFlags();
bool gotObjectPhysicsFlags(LLViewerObject* objectp);
void updateObjectCost(LLViewerObject* object);
void updateObjectCost(const LLUUID& object_id, F32 object_cost, F32 link_cost, F32 physics_cost, F32 link_physics_cost);
void onObjectCostFetchFailure(const LLUUID& object_id);

View File

@@ -361,6 +361,51 @@ BOOL LLViewerTexLayerSetBuffer::requestUpdateImmediate()
return result;
}
class LLSendTexLayerResponder : public LLAssetUploadResponder
{
LOG_CLASS(LLSendTexLayerResponder);
public:
LLSendTexLayerResponder(const LLSD& post_data, const LLUUID& vfile_id, LLAssetType::EType asset_type, LLBakedUploadData * baked_upload_data)
: LLAssetUploadResponder(post_data, vfile_id, asset_type)
, mBakedUploadData(baked_upload_data)
{}
~LLSendTexLayerResponder()
{
// mBakedUploadData is normally deleted by calls to LLViewerTexLayerSetBuffer::onTextureUploadComplete() below
if (mBakedUploadData)
{ // ...but delete it in the case where uploadComplete() is never called
delete mBakedUploadData;
mBakedUploadData = NULL;
}
}
// Baked texture upload completed
/*virtual*/ void uploadComplete(const LLSD& content)
{
const std::string& result = content["state"];
const LLUUID& new_id = content["new_asset"];
llinfos << "result: " << result << " new_id: " << new_id << llendl;
LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, (result == "complete" && mBakedUploadData) ? 0 : -1, LL_EXSTAT_NONE);
mBakedUploadData = NULL; // deleted in onTextureUploadComplete()
}
/*virtual*/ void httpFailure()
{
llinfos << dumpResponse() << llendl;
// Invoke the original callback with an error result
LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID::null, (void*) mBakedUploadData, -1, LL_EXSTAT_NONE);
mBakedUploadData = NULL; // deleted in onTextureUploadComplete()
}
/*virtual*/ char const* getName() const { return "LLSendTexLayerResponder"; }
private:
LLBakedUploadData* mBakedUploadData;
};
// Create the baked texture, send it out to the server, then wait for it to come
// back so we can switch to using it.
void LLViewerTexLayerSetBuffer::doUpload()

View File

@@ -1799,10 +1799,10 @@ void LLVOAvatar::renderCollisionVolumes()
{
std::ostringstream ostr;
LLGLDepthTest gls_depth(GL_FALSE);
for (S32 i = 0; i < mNumCollisionVolumes; i++)
for (S32 i = 0; i < (S32)mCollisionVolumes.size(); i++)
{
mCollisionVolumes[i].renderCollision();
ostr << mCollisionVolumes[i].getName() << ", ";
mCollisionVolumes[i]->renderCollision();
ostr << mCollisionVolumes[i]->getName() << ", ";
}
if (mNameText.notNull())
@@ -1920,11 +1920,11 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
if (lineSegmentBoundingBox(start, end))
{
for (S32 i = 0; i < mNumCollisionVolumes; ++i)
for (S32 i = 0; i < (S32)mCollisionVolumes.size(); ++i)
{
mCollisionVolumes[i].updateWorldMatrix();
mCollisionVolumes[i]->updateWorldMatrix();
const LLMatrix4a& mat = mCollisionVolumes[i].getXform()->getWorldMatrix();
const LLMatrix4a& mat = mCollisionVolumes[i]->getXform()->getWorldMatrix();
LLMatrix4a inverse = mat;
inverse.invert();
LLMatrix4a norm_mat = inverse;

View File

@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false"
rect_control="FloaterObjectBackuptRect"
height="80" width="200" name="Import" title="Import progress" mouse_opaque="true">
<text height="30" left="10" name="name_label" top="-20"> Progress </text>
<floater name="Object Backup" title="Progress" rect_control="FloaterObjectBackuptRect"
can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false"
height="80" width="200" mouse_opaque="true">
<text height="30" left="10" name="name_label" top="-20">
Progress
</text>
<string name="export">
Object export
</string>
<string name="import">
Object import
</string>
</floater>

View File

@@ -119,6 +119,10 @@
<on_check control="RadarAlertAge"/>
</menu_item_check>
<menu_item_separator/>
<menu_item_check label="Include distance in alerts" name="Include distance in alerts">
<on_click function="ToggleControl" userdata="RadarAlertShowDist"/>
<on_check control="RadarAlertShowDist"/>
</menu_item_check>
<menu_item_check label="Announce even when closed" name="Announce even when closed">
<on_click function="ToggleControl" userdata="RadarKeepOpen"/>
<on_check control="RadarKeepOpen"/>

View File

@@ -5938,11 +5938,25 @@ A login URI is required to retrieve the grid info.
Builds with extended hollow or extended hole size do not render properly on other viewers. Please keep this option checked, if you want your builds looking properly in other viewers.
</notification>
<notification
icon="alertmodal.tga"
name="ImportFailed"
type="alertmodal">
Bad XML file. Import aborted.
</notification>
<notification
icon="notifytip.tga"
name="ExportAborted"
type="notifytip">
The Object was deselected before the export could occur. Export aborted.
</notification>
<notification
icon="alertmodal.tga"
name="ExportFailed"
type="alertmodal">
None of the selected objects are exportable. Export aborted.
Bad permissions for the exported object. Export aborted.
</notification>
<notification
@@ -5959,6 +5973,23 @@ Object exported. Some textures could not be saved due to: [REASON]
Export successful.
</notification>
<notification
icon="alertmodal.tga"
name="ConfirmAbortBackup"
type="alertmodal">
Are you sure you want to abort the current object backup operation?
<form name="form">
<button
index="0"
name="Yes"
text="Yes"/>
<button
index="1"
name="No"
text="No"/>
</form>
</notification>
<notification
icon="notifytip.tga"
name="SystemMessageTip"