Merge branch 'DRTVWR-513-maint' of https://bitbucket.org/lindenlab/viewer

master
Ansariel 2020-06-25 11:44:06 +02:00
commit 80803b9ae9
5 changed files with 91 additions and 65 deletions

View File

@ -1347,41 +1347,24 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
}
else // IM_TASK_INVENTORY_OFFERED
{
if (offline == IM_OFFLINE && session_id.isNull() && aux_id.notNull() && binary_bucket_size > sizeof(S8)* 5)
if (sizeof(S8) != binary_bucket_size)
{
// cap received offline message
std::string str_bucket = ll_safe_string((char*)binary_bucket, binary_bucket_size);
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep("|", "", boost::keep_empty_tokens);
tokenizer tokens(str_bucket, sep);
tokenizer::iterator iter = tokens.begin();
info->mType = (LLAssetType::EType)(atoi((*(iter++)).c_str()));
// Note There is more elements in 'tokens' ...
info->mObjectID = LLUUID::null;
info->mFromObject = TRUE;
}
else
{
if (sizeof(S8) != binary_bucket_size)
{
LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL;
delete info;
break;
}
info->mType = (LLAssetType::EType) binary_bucket[0];
info->mObjectID = LLUUID::null;
info->mFromObject = TRUE;
LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL;
delete info;
break;
}
info->mType = (LLAssetType::EType) binary_bucket[0];
info->mObjectID = LLUUID::null;
info->mFromObject = TRUE;
}
info->mIM = dialog;
info->mFromID = from_id;
info->mFromGroup = from_group;
info->mTransactionID = session_id;
info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType));
info->mTransactionID = session_id.notNull() ? session_id : aux_id;
info->mFromName = name;
info->mDesc = message;
info->mHost = sender;
@ -2232,7 +2215,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
return;
}
if (gAgent.getRegion() == NULL)
if (!gAgent.getRegion())
{
LL_WARNS("Messaging") << "Region null while attempting to load messages." << LL_ENDL;
return;
@ -2240,8 +2223,8 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL;
std::vector<U8> data;
S32 binary_bucket_size = 0;
// std::vector<U8> data;
// S32 binary_bucket_size = 0;
LLHost sender = gAgent.getRegionHost();
LLSD::array_iterator i = messages.beginArray();
@ -2250,38 +2233,47 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
{
const LLSD &message_data(*i);
LLVector3 position(message_data["local_x"].asReal(), message_data["local_y"].asReal(), message_data["local_z"].asReal());
data = message_data["binary_bucket"].asBinary();
binary_bucket_size = data.size(); // message_data["count"] always 0
U32 parent_estate_id = message_data.has("parent_estate_id") ? message_data["parent_estate_id"].asInteger() : 1; // 1 - IMMainland
// Todo: once dirtsim-369 releases, remove one of the int/str options
BOOL from_group;
if (message_data["from_group"].isInteger())
/* RIDER: Many fields in this message are using a '_' rather than the standard '-'. This
* should be changed but would require tight coordination with the simulator.
*/
LLVector3 position;
if (message_data.has("position"))
{
from_group = message_data["from_group"].asInteger();
position.setValue(message_data["position"]);
}
else
{
from_group = message_data["from_group"].asString() == "Y";
position.set(message_data["local_x"].asReal(), message_data["local_y"].asReal(), message_data["local_z"].asReal());
}
LLIMProcessing::processNewMessage(message_data["from_agent_id"].asUUID(),
from_group,
std::vector<U8> bin_bucket;
if (message_data.has("binary_bucket"))
{
bin_bucket = message_data["binary_bucket"].asBinary();
}
else
{
bin_bucket.push_back(0);
}
LLIMProcessing::processNewMessage(
message_data["from_agent_id"].asUUID(),
message_data["from_group"].asBoolean(),
message_data["to_agent_id"].asUUID(),
IM_OFFLINE,
(EInstantMessage)message_data["dialog"].asInteger(),
LLUUID::null, // session id, since there is none we can only use frienship/group invite caps
message_data["timestamp"].asInteger(),
message_data["from_agent_name"].asString(),
message_data["message"].asString(),
parent_estate_id,
static_cast<U8>(message_data["offline"].asInteger()),
static_cast<EInstantMessage>(message_data["dialog"].asInteger()),
message_data["transaction-id"].asUUID(),
static_cast<U32>(message_data["timestamp"].asInteger()),
message_data["from_name"].asString(),
(message_data.has("message")) ? message_data["message"].asString() : std::string(),
static_cast<U32>((message_data.has("parent_estate_id")) ? message_data["parent_estate_id"].asInteger() : 1), // 1 - IMMainland
message_data["region_id"].asUUID(),
position,
&data[0],
binary_bucket_size,
bin_bucket.data(),
bin_bucket.size(),
sender,
message_data["asset_id"].asUUID()); // not necessarily an asset
message_data["asset_id"].asUUID());
}
}

View File

@ -577,7 +577,7 @@ void LLPreviewTexture::onFileLoadedForSaveTGA(BOOL success,
// <FS:Ansariel> Undo MAINT-2897 and use our own texture format selection
//const U32 ext_length = 3;
//std::string extension = self->mSaveFileName.substr( self->mSaveFileName.length() - ext_length);
//LLStringUtil::toLower(extension);
//// We only support saving in PNG or TGA format
//LLPointer<LLImageFormatted> image;
//if(extension == "png")

View File

@ -322,34 +322,35 @@ bool LLResourceUploadInfo::findAssetTypeOfExtension(const std::string& exten, LL
bool LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(const std::string& exten, LLAssetType::EType& asset_type, U32& codec, bool bulk_upload)
{
bool succ = false;
codec = LLImageBase::getCodecFromExtension(exten);
std::string exten_lc(exten);
LLStringUtil::toLower(exten_lc);
codec = LLImageBase::getCodecFromExtension(exten_lc);
if (codec != IMG_CODEC_INVALID)
{
asset_type = LLAssetType::AT_TEXTURE;
succ = true;
}
else if (exten == "wav")
else if (exten_lc == "wav")
{
asset_type = LLAssetType::AT_SOUND;
succ = true;
}
else if (exten == "anim")
else if (exten_lc == "anim")
{
asset_type = LLAssetType::AT_ANIMATION;
succ = true;
}
else if (!bulk_upload && (exten == "bvh"))
else if (!bulk_upload && (exten_lc == "bvh"))
{
asset_type = LLAssetType::AT_ANIMATION;
succ = true;
}
else if (exten == "ogg")
else if (exten_lc == "ogg")
{
asset_type = LLAssetType::AT_SOUND;
succ = true;
}
else if (exten == "j2k")
else if (exten_lc == "j2k")
{
asset_type = LLAssetType::AT_TEXTURE;
succ = true;

View File

@ -845,6 +845,7 @@ class LLAdvancedCheckHUDInfo : public view_listener_t
};
// <FS:Ansariel> Keep this for menu check item
//////////////
// FLYING //
//////////////
@ -856,6 +857,7 @@ class LLAdvancedAgentFlyingInfo : public view_listener_t
return gAgent.getFlying();
}
};
// </FS:Ansariel>
///////////////////////
@ -4567,6 +4569,35 @@ bool enable_sitdown_self()
// return show_sitdown_self() && !gAgentAvatarp->isEditingAppearance() && !gAgent.getFlying();
}
class LLSelfToggleSitStand : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
if (isAgentAvatarValid())
{
if (gAgentAvatarp->isSitting())
{
gAgent.standUp();
}
else
{
gAgent.sitDown();
}
}
return true;
}
};
bool enable_sit_stand()
{
return enable_sitdown_self() || enable_standup_self();
}
bool enable_fly_land()
{
return gAgent.getFlying() || LLAgent::enableFlying();
}
// Force sit -KC
class FSSelfForceSit : public view_listener_t
{
@ -11332,7 +11363,8 @@ void initialize_menus()
// Agent
commit.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying));
enable.add("Agent.enableFlying", boost::bind(&LLAgent::enableFlying));
enable.add("Agent.enableFlyLand", boost::bind(&enable_fly_land));
enable.add("Agent.enableFlying", boost::bind(&LLAgent::enableFlying)); // <FS:Ansariel> Keep this
commit.add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
commit.add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
commit.add("Agent.ToggleMicrophone", boost::bind(&LLAgent::toggleMicrophone, _2));
@ -11388,9 +11420,9 @@ void initialize_menus()
view_listener_t::addMenu(new LLViewResetCameraAngles(), "View.ResetCameraAngles");
// </FS:Zi>
// <FS:Ansariel> Keep this for menu check item
// Me > Movement
view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying");
//Communicate Nearby chat
// <FS:Ansariel> [FS Communication UI]
//view_listener_t::addMenu(new LLCommunicateNearbyChat(), "Communicate.NearbyChat");
@ -11692,11 +11724,15 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdminOnSaveState(), "Admin.OnSaveState");
// Self context menu
view_listener_t::addMenu(new LLSelfToggleSitStand(), "Self.ToggleSitStand");
enable.add("Self.EnableSitStand", boost::bind(&enable_sit_stand));
// <FS:Ansariel> Keep this for menu check item
view_listener_t::addMenu(new LLSelfStandUp(), "Self.StandUp");
enable.add("Self.EnableStandUp", boost::bind(&enable_standup_self));
view_listener_t::addMenu(new LLSelfSitDown(), "Self.SitDown");
enable.add("Self.EnableSitDown", boost::bind(&enable_sitdown_self));
enable.add("Self.ShowSitDown", boost::bind(&show_sitdown_self));
// </FS:Ansariel>
view_listener_t::addMenu(new FSSelfForceSit(), "Self.ForceSit"); //KC
enable.add("Self.EnableForceSit", boost::bind(&enable_forcesit_self)); //KC
view_listener_t::addMenu(new FSSelfCheckForceSit(), "Self.getForceSit"); //KC

View File

@ -227,16 +227,13 @@
parameter="2" />
</menu_item_check>
<menu_item_separator
layout="topleft" name="Impostor seperator"/>
<menu_item_call
enabled="false"
label="Block Particle Owner"
name="Mute Particle">
<menu_item_call.on_click
function="Particle.Mute" />
<menu_item_call.on_enable
<menu_item_call.on_visible
function="EnableMuteParticle" />
</menu_item_call>
</context_menu>