Merged in RLVa. Viewer broken!

This commit is contained in:
Siana Gearz
2010-11-07 05:05:47 +01:00
parent ae4a9521af
commit 740b570168
94 changed files with 11249 additions and 503 deletions

View File

@@ -143,12 +143,21 @@
#include "llviewernetwork.h"
// </edit>
// [RLVa:KB]
#include "rlvhandler.h"
// [/RLVa:KB]
#include <boost/tokenizer.hpp>
#if LL_WINDOWS // For Windows specific error handler
#include "llwindebug.h" // For the invalid message handler
#endif
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
#include "llfloateravatarinfo.h"
extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp
// [/RLVa:KB]
//
// Constants
//
@@ -1105,8 +1114,17 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
std::string first_name, last_name;
if (gCacheName->getName(mFromID, first_name, last_name))
{
from_string = std::string("An object named '") + mFromName + "' owned by " + first_name + " " + last_name;
chatHistory_string = mFromName + " owned by " + first_name + " " + last_name;
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
std::string full_name = first_name + " " + last_name;
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(mFromID)) )
{
full_name = RlvStrings::getAnonym(full_name);
}
from_string = std::string("An object named '") + mFromName + "' owned by " + full_name;
chatHistory_string = mFromName + " owned by " + full_name;
// [/RLVa:KB]
//from_string = std::string("An object named '") + mFromName + "' owned by " + first_name + " " + last_name;
//chatHistory_string = mFromName + " owned by " + first_name + " " + last_name;
}
else
{
@@ -1125,6 +1143,21 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
switch(button)
{
case IOR_ACCEPT:
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.2a
// Only change the inventory offer's destination folder to the shared root if:
// - the user has enabled the feature
// - the inventory offer came from a script (and specifies a folder)
// - the name starts with the prefix [mDesc format (quotes are part of the string): "[OBJECTNAME] ( http://slurl.com/... )"]
if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) &&
(IM_TASK_INVENTORY_OFFERED == mIM) && (LLAssetType::AT_CATEGORY == mType) && (mDesc.find(RLV_PUTINV_PREFIX) == 1) )
{
LLViewerInventoryCategory* pRlvRoot = gRlvHandler.getSharedRoot();
if (pRlvRoot)
{
mFolderID = pRlvRoot->getUUID();
}
}
// [/RLVa:KB]
// ACCEPT. The math for the dialog works, because the accept
// for inventory_offered, task_inventory_offer or
// group_notice_inventory is 1 greater than the offer integer value.
@@ -1154,6 +1187,23 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// This is an offer from an agent. In this case, the back
// end has already copied the items into your inventory,
// so we can fetch it out of our inventory.
// [RLVa:KB] - Checked: 2010-01-01 (RLVa-1.1.0l) | Added: RLVa-1.1.0l
#ifdef RLV_EXTENSION_GIVETORLV_A2A
if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) &&
(LLAssetType::AT_CATEGORY == mType) && (mDesc.find(RLV_PUTINV_PREFIX) == 0) )
{
RlvGiveToRLVAgentOffer* pOffer = new RlvGiveToRLVAgentOffer();
LLInventoryFetchComboObserver::folder_ref_t folders;
folders.push_back(mObjectID);
pOffer->fetchDescendents(folders);
if (pOffer->isEverythingComplete())
pOffer->done();
else
gInventory.addObserver(pOffer);
}
#endif // RLV_EXTENSION_GIVETORLV_A2A
// [/RLVa:KB]
LLInventoryFetchObserver::item_ref_t items;
items.push_back(mObjectID);
LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string);
@@ -1290,6 +1340,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
if(indx >= 0)
{
LLStringUtil::truncate(msg, indx);
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a
// TODO-RLVa: needs revisiting when LL saves open notifications to disk to accept them on the next relog
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
{
gRlvHandler.filterLocation(info->mDesc);
}
// [/RLVa:KB]
}
LLSD args;
@@ -1332,6 +1389,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
std::string first_name, last_name;
if (gCacheName->getName(info->mFromID, first_name, last_name))
{
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) )
{
first_name = RlvStrings::getAnonym(first_name.append(" ").append(last_name));
last_name.clear();
}
// [/RLVa:KB]
args["FIRST"] = first_name;
args["LAST"] = last_name;
name_found = TRUE;
@@ -1351,6 +1415,12 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
}
else
{
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) )
{
args["NAME"] = RlvStrings::getAnonym(info->mFromName);
}
// [/RLVa:KB]
p.name = "UserGiveItem";
}
@@ -1427,6 +1497,7 @@ bool goto_url_callback(const LLSD& notification, const LLSD& response)
}
static LLNotificationFunctorRegistration goto_url_callback_reg("GotoURL", goto_url_callback);
void process_improved_im(LLMessageSystem *msg, void **user_data)
{
if (gNoRender)
@@ -1476,9 +1547,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat);
BOOL is_linden = LLMuteList::getInstance()->isLinden(name);
BOOL is_owned_by_me = FALSE;
LLUUID computed_session_id = LLIMMgr::computeSessionID(dialog,from_id);
chat.mMuted = is_muted && !is_linden;
chat.mFromID = from_id;
chat.mFromName = name;
@@ -1501,12 +1572,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
message_offset = 3;
}
if(dialog == IM_TYPING_START
|| dialog == IM_NOTHING_SPECIAL
|| dialog == IM_TYPING_STOP
|| dialog == IM_BUSY_AUTO_RESPONSE)
if( dialog == IM_TYPING_START
|| dialog == IM_NOTHING_SPECIAL
|| dialog == IM_TYPING_STOP
|| dialog == IM_BUSY_AUTO_RESPONSE)
{
if(session_id != computed_session_id)
{
session_id = computed_session_id;
@@ -1738,7 +1808,20 @@ if(dialog == IM_TYPING_START
// do nothing -- don't distract newbies in
// Prelude with global IMs
}
else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM)
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) )
{
rlvSendBusyMessage(from_id, RlvStrings::getVersion(), session_id);
// We won't receive a typing stop message, so do that manually (see comment at the end of LLFloaterIMPanel::sendMsg)
LLPointer<LLIMInfo> im_info = new LLIMInfo(gMessageSystem);
gIMMgr->processIMTypingStop(im_info);
}
// [/RLVa:KB]
// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM)
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, from_id))) )
// [/RLVa:KB]
{
// return a standard "busy" message, but only do it to online IM
// (i.e. not other auto responses and not store-and-forward IM)
@@ -1783,7 +1866,18 @@ if(dialog == IM_TYPING_START
true);
// pretend this is chat generated by self, so it does not show up on screen
chat.mText = std::string("IM: ") + name + separator_string + message.substr(message_offset);
std::string prepend_msg;
if (gAgent.isInGroup(session_id)&& gSavedSettings.getBOOL("OptionShowGroupNameInChatIM"))
{
prepend_msg = "[";
prepend_msg += std::string((char*)binary_bucket);
prepend_msg += "] ";
}
else
{
prepend_msg = std::string("IM: ");
}
chat.mText = prepend_msg + name + separator_string + saved + message.substr(message_offset);
LLFloaterChat::addChat( chat, TRUE, TRUE );
}
else if (from_id.isNull())
@@ -1795,6 +1889,21 @@ if(dialog == IM_TYPING_START
}
else if (to_id.isNull())
{
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
// Filter region messages that weren't sent by a Linden
if ( (rlv_handler_t::isEnabled()) && (LLMuteList::getInstance()) &&
(!LLMuteList::getInstance()->isLinden(name)) && (from_id != gAgent.getID()) )
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
gRlvHandler.filterLocation(message);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
name = RlvStrings::getAnonym(name);
gRlvHandler.filterNames(message);
}
}
// [/RLVa:KB]
// Message to everyone from GOD
args["NAME"] = name;
args["MESSAGE"] = message;
@@ -1810,6 +1919,15 @@ if(dialog == IM_TYPING_START
else
{
// standard message, not from system
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) )
{
if (!is_muted)
rlvSendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM_REMOTE), session_id);
message = message.substr(0, message_offset) + RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM);
}
// [/RLVa:KB]
std::string saved;
if(offline == IM_OFFLINE)
{
@@ -2027,6 +2145,13 @@ if(dialog == IM_TYPING_START
bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0];
info->mType = (LLAssetType::EType) bucketp->asset_type;
info->mObjectID = bucketp->object_id;
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) )
{
name = RlvStrings::getAnonym(name);
}
// [/RLVa:KB]
}
else
{
@@ -2064,6 +2189,20 @@ if(dialog == IM_TYPING_START
}
else
{
// [RLVa:KB] - Version: 1.23.4 | Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
if ( (rlv_handler_t::isEnabled()) &&
(
((IM_TASK_INVENTORY_OFFERED == dialog) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 1))
#ifdef RLV_EXTENSION_GIVETORLV_A2A
|| ((IM_INVENTORY_OFFERED == dialog) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 0))
#endif // RLV_EXTENSION_GIVETORLV_A2A
) &&
(gRlvHandler.getSharedRoot()) )
{
RlvNotifications::warnGiveToRLV();
}
// [/RLVa:KB]
inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED);
}
}
@@ -2071,13 +2210,23 @@ if(dialog == IM_TYPING_START
case IM_INVENTORY_ACCEPTED:
{
args["NAME"] = name;
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
(gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id));
args["NAME"] = (!fRlvObfuscate) ? name : RlvStrings::getAnonym(name);
// [/RLVa:KB]
//args["NAME"] = name;
LLNotifications::instance().add("InventoryAccepted", args);
break;
}
case IM_INVENTORY_DECLINED:
{
args["NAME"] = name;
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
(gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id));
args["NAME"] = (!fRlvObfuscate) ? name : RlvStrings::getAnonym(name);
// [/RLVa:KB]
//args["NAME"] = name;
LLNotifications::instance().add("InventoryDeclined", args);
break;
}
@@ -2113,6 +2262,22 @@ if(dialog == IM_TYPING_START
return;
}
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) )
{
if (gAgent.isInGroup(session_id))
{
if (!gRlvHandler.isException(RLV_BHVR_RECVIM, session_id))
return;
}
else
{
if ( (from_id != gAgent.getID()) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) )
message = message.substr(0, message_offset) + RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM);
}
}
// [/RLVa:KB]
// standard message, not from system
std::string saved;
if(offline == IM_OFFLINE)
@@ -2137,18 +2302,7 @@ if(dialog == IM_TYPING_START
position,
true);
std::string prepend_msg;
if (gAgent.isInGroup(session_id)&& gSavedSettings.getBOOL("OptionShowGroupNameInChatIM"))
{
prepend_msg = "[";
prepend_msg += std::string((char*)binary_bucket);
prepend_msg += "] ";
}
else
{
prepend_msg = std::string("IM: ");
}
chat.mText = prepend_msg + name + separator_string + saved + message.substr(message_offset);
chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset);
LLFloaterChat::addChat(chat, TRUE, is_this_agent);
}
break;
@@ -2207,6 +2361,16 @@ if(dialog == IM_TYPING_START
return;
}
{
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
// TODO-RLVa: what actually generates this?
if (rlv_handler_t::isEnabled())
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
gRlvHandler.filterLocation(message);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
gRlvHandler.filterNames(message);
}
// [/RLVa:KB]
// Construct a viewer alert for this message.
args["NAME"] = name;
args["MESSAGE"] = message;
@@ -2239,6 +2403,27 @@ if(dialog == IM_TYPING_START
}
else
{
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-07 (RLVa-1.0.0d)
if (rlv_handler_t::isEnabled())
{
// Disallow if: 1) @tplure=n restricted (sender isn't an exception), or 2) @unsit=n restricted and currently sitting
LLVOAvatar* pAvatar = gAgent.getAvatarObject();
if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) ||
( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (pAvatar) && (pAvatar->mIsSitting) ) )
{
rlvSendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE));
return;
}
// Censor teleport message if: 1) @revcim=n restricted (sender isn't an exception), or 2) @showloc=n restricted
if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) ||
(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
{
message = RlvStrings::getString(RLV_STRING_HIDDEN);
}
}
// [/RLVa:KB]
LLSD args;
// *TODO:translate -> [FIRST] [LAST] (maybe)
args["NAME"] = name;
@@ -2247,65 +2432,79 @@ if(dialog == IM_TYPING_START
payload["from_id"] = from_id;
payload["lure_id"] = session_id;
payload["godlike"] = FALSE;
LLNotifications::instance().add("TeleportOffered", args, payload);
// <edit>
if(binary_bucket_size)
//LLNotifications::instance().add("TeleportOffered", args, payload);
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b
if ( (rlv_handler_t::isEnabled()) &&
((gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)) || (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id))) )
{
char* dest = new char[binary_bucket_size];
strncpy(dest, (char*)binary_bucket, binary_bucket_size-1); /* Flawfinder: ignore */
dest[binary_bucket_size-1] = '\0';
llinfos << "IM_LURE_USER binary_bucket " << dest << llendl;
std::string str(dest);
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep("|","",boost::keep_empty_tokens);
tokenizer tokens(str, sep);
tokenizer::iterator iter = tokens.begin();
std::string global_x_str(*iter++);
std::string global_y_str(*iter++);
std::string x_str(*iter++);
std::string y_str(*iter++);
std::string z_str(*iter++);
// skip what I think must be LookAt
if(iter != tokens.end())
iter++; // x
if(iter != tokens.end())
iter++; // y
if(iter != tokens.end())
iter++; // z
std::string mat_str("");
if(iter != tokens.end())
mat_str.assign(*iter++);
mat_str = utf8str_trim(mat_str);
llinfos << "IM_LURE_USER tokenized " << global_x_str << "|" << global_y_str << "|" << x_str << "|" << y_str << "|" << z_str << "|" << mat_str << llendl;
std::istringstream gxstr(global_x_str);
int global_x;
gxstr >> global_x;
std::istringstream gystr(global_y_str);
int global_y;
gystr >> global_y;
std::istringstream xstr(x_str);
int x;
xstr >> x;
std::istringstream ystr(y_str);
int y;
ystr >> y;
std::istringstream zstr(z_str);
int z;
zstr >> z;
llinfos << "IM_LURE_USER parsed " << global_x << "|" << global_y << "|" << x << "|" << y << "|" << z << "|" << mat_str << llendl;
gAgent.showLureDestination(name, global_x, global_y, x, y, z, mat_str);
gRlvHandler.setCanCancelTp(false);
LLNotifications::instance().forceResponse(LLNotification::Params("TeleportOffered").payload(payload), 0);
}
// </edit>
else
{
LLNotifications::instance().add("TeleportOffered", args, payload);
// <edit>
if(binary_bucket_size)
{
char* dest = new char[binary_bucket_size];
strncpy(dest, (char*)binary_bucket, binary_bucket_size-1); /* Flawfinder: ignore */
dest[binary_bucket_size-1] = '\0';
llinfos << "IM_LURE_USER binary_bucket " << dest << llendl;
std::string str(dest);
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep("|","",boost::keep_empty_tokens);
tokenizer tokens(str, sep);
tokenizer::iterator iter = tokens.begin();
std::string global_x_str(*iter++);
std::string global_y_str(*iter++);
std::string x_str(*iter++);
std::string y_str(*iter++);
std::string z_str(*iter++);
// skip what I think must be LookAt
if(iter != tokens.end())
iter++; // x
if(iter != tokens.end())
iter++; // y
if(iter != tokens.end())
iter++; // z
std::string mat_str("");
if(iter != tokens.end())
mat_str.assign(*iter++);
mat_str = utf8str_trim(mat_str);
llinfos << "IM_LURE_USER tokenized " << global_x_str << "|" << global_y_str << "|" << x_str << "|" << y_str << "|" << z_str << "|" << mat_str << llendl;
std::istringstream gxstr(global_x_str);
int global_x;
gxstr >> global_x;
std::istringstream gystr(global_y_str);
int global_y;
gystr >> global_y;
std::istringstream xstr(x_str);
int x;
xstr >> x;
std::istringstream ystr(y_str);
int y;
ystr >> y;
std::istringstream zstr(z_str);
int z;
zstr >> z;
llinfos << "IM_LURE_USER parsed " << global_x << "|" << global_y << "|" << x << "|" << y << "|" << z << "|" << mat_str << llendl;
gAgent.showLureDestination(name, global_x, global_y, x, y, z, mat_str);
}
// </edit>
}
// [/RLVa:KB]
//LLNotifications::instance().add("TeleportOffered", args, payload);
}
}
break;
@@ -2410,6 +2609,7 @@ if(dialog == IM_TYPING_START
}
}
void busy_message (LLMessageSystem* msg, LLUUID from_id)
{
if (gAgent.getBusy())
@@ -2675,9 +2875,16 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
chat.mPosAgent = chatter->getPositionAgent();
// Make swirly things only for talking objects. (not script debug messages, though)
if (chat.mSourceType == CHAT_SOURCE_OBJECT
&& chat.mChatType != CHAT_TYPE_DEBUG_MSG
&& gSavedSettings.getBOOL("EffectScriptChatParticles") )
// if (chat.mSourceType == CHAT_SOURCE_OBJECT
// && chat.mChatType != CHAT_TYPE_DEBUG_MSG
// && gSavedSettings.getBOOL("EffectScriptChatParticles") )
// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-10 (RLVa-1.0.0g)
// Don't show swirly things for llOwnerSay() chat here because we handle those further down
// RELEASE-RLVa: if this code changes, remember to change the code down below as well
if ( (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) &&
(gSavedSettings.getBOOL("EffectScriptChatParticles")) &&
((!rlv_handler_t::isEnabled()) || (CHAT_TYPE_OWNER != chat.mChatType)) )
// [/RLVa:KB]
{
LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
psc->setSourceObject(chatter);
@@ -2740,6 +2947,51 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
color.setVec(1.f,1.f,1.f,1.f);
msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg);
// [RLVa:KB] - Checked: 2009-10-06 (RLVa-1.0.4d) | Modified: RLVa-1.0.4d
if ( (rlv_handler_t::isEnabled()) &&
(CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) )
{
// NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment)
BOOL is_attachment = (chatter) ? chatter->isAttachment() : FALSE;
// Filtering "rules":
// avatar => filter all avie text (unless it's this avie or they're an exemption)
// objects => filter everything except attachments this avie owns
if ( ( (CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID()) ) ||
( (CHAT_SOURCE_OBJECT == chat.mSourceType) && ((!is_owned_by_me) || (!is_attachment)) ) )
{
if (!rlvIsEmote(mesg))
{
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id)) )
gRlvHandler.filterChat(mesg, false);
}
else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id)) )
{
mesg = "/me ...";
}
}
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
// Filtering "rules":
// avatar => filter only their name (unless it's this avie)
// other => filter everything except attachments this avie owns but then we still do filter their text
if (CHAT_SOURCE_AGENT == chat.mSourceType)
{
if (chat.mFromID != gAgent.getID())
from_name = RlvStrings::getAnonym(from_name);
}
else
{
if ( (!is_owned_by_me) || (!is_attachment) )
gRlvHandler.filterNames(from_name);
gRlvHandler.filterNames(mesg);
}
chat.mRlvNamesFiltered = true;
}
}
// [/RLVa:KB]
BOOL ircstyle = FALSE;
// Look for IRC-style emotes here so chatbubbles work
@@ -2802,8 +3054,94 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
case CHAT_TYPE_WHISPER:
verb = " " + LLTrans::getString("whisper") + " ";
break;
case CHAT_TYPE_DEBUG_MSG:
case CHAT_TYPE_OWNER:
// [RLVa:KB] - Checked: 2009-11-25 (RLVa-1.1.0f) | Modified: RLVa-1.1.0f
// TODO-RLVa: [2009-11-25] this could really use some rewriting
if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) && (CHAT_TYPE_OWNER == chat.mChatType) )
{
mesg.erase(0, 1);
LLStringUtil::toLower(mesg);
std::string strExecuted, strFailed, strRetained, *pstr;
boost_tokenizer tokens(mesg, boost::char_separator<char>(",", "", boost::drop_empty_tokens));
for (boost_tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken)
{
std::string strCmd = *itToken;
ERlvCmdRet eRet = gRlvHandler.processCommand(from_id, strCmd, true);
if (RlvSettings::getDebug())
{
if ( RLV_RET_SUCCESS == (eRet & RLV_RET_SUCCESS) )
pstr = &strExecuted;
else if ( RLV_RET_FAILED == (eRet & RLV_RET_FAILED) )
pstr = &strFailed;
else if (RLV_RET_RETAINED == eRet)
pstr = &strRetained;
else
{
RLV_ASSERT(false);
pstr = &strFailed;
}
const char* pstrSuffix = RlvStrings::getStringFromReturnCode(eRet);
if (pstrSuffix)
strCmd.append(" (").append(pstrSuffix).append(")");
if (!pstr->empty())
pstr->push_back(',');
pstr->append(strCmd);
}
}
if (!RlvSettings::getDebug())
return;
// Silly people want comprehensive debug messages, blah :p
if ( (!strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty()) )
{
verb = " executes: @";
mesg = strExecuted;
}
else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) )
{
verb = " failed: @";
mesg = strFailed;
}
else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) )
{
verb = " retained: @";
mesg = strRetained;
}
else
{
verb = ": @";
if (!strExecuted.empty())
mesg += "\n - executed: @" + strExecuted;
if (!strFailed.empty())
mesg += "\n - failed: @" + strFailed;
if (!strRetained.empty())
mesg += "\n - retained: @" + strRetained;
}
break;
}
// [/RLVa:KB]
// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-10 (RLVa-1.0.0g)
// Copy/paste from above
if ( (chatter) && (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) &&
(gSavedSettings.getBOOL("EffectScriptChatParticles")) )
{
LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
psc->setSourceObject(chatter);
psc->setColor(color);
//We set the particles to be owned by the object's owner,
//just in case they should be muted by the mute list
psc->setOwnerUUID(owner_id);
LLViewerPartSim::getInstance()->addPartSource(psc);
}
// [/RLVa:KB]
case CHAT_TYPE_DEBUG_MSG:
case CHAT_TYPE_NORMAL:
verb = ": ";
break;
@@ -2877,7 +3215,10 @@ void process_teleport_start(LLMessageSystem *msg, void**)
LL_DEBUGS("Messaging") << "Got TeleportStart with TeleportFlags=" << teleport_flags << ". gTeleportDisplay: " << gTeleportDisplay << ", gAgent.mTeleportState: " << gAgent.getTeleportState() << LL_ENDL;
if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
//if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b
if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) )
// [/RLVa:KB]
{
gViewerWindow->setProgressCancelButtonVisible(FALSE);
}
@@ -2913,7 +3254,10 @@ void process_teleport_progress(LLMessageSystem* msg, void**)
}
U32 teleport_flags = 0x0;
msg->getU32("Info", "TeleportFlags", teleport_flags);
if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
//if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b
if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) )
// [/RLVa:KB]
{
gViewerWindow->setProgressCancelButtonVisible(FALSE);
}
@@ -3266,7 +3610,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
// know what you look like.
gAgent.sendAgentSetAppearance();
if (avatarp)
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
if ( (avatarp) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
// [/RLVa:KB]
// if (avatarp)
{
// Chat the "back" SLURL. (DEV-4907)
LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL());
@@ -5012,7 +5359,13 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
if (viewregion)
{
// got the region, so include the region and 3d coordinates of the object
notice.setArg("[REGIONNAME]", viewregion->getName());
notice.setArg("[REGIONNAME]", viewregion->getName());
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
{
notice.setArg("[REGIONNAME]", RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
}
// [/RLVa:KB]
std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]);
notice.setArg("[REGIONPOS]", formatpos);
@@ -5224,8 +5577,32 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
payload["object_name"] = object_name;
payload["owner_name"] = owner_name;
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e
S32 rlvQuestionsOther = questions;
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTPERMISSION)) )
{
LLViewerObject* pObj = gObjectList.findObject(taskid);
if (pObj)
{
// if (pObj->permYouOwner())
// {
// PERMISSION_TAKE_CONTROLS and PERMISSION_ATTACH are only auto-granted to objects this avie owns
rlvQuestionsOther &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] |
LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]);
// }
}
}
if ( (!caution) && (!rlvQuestionsOther) )
{
LLNotifications::instance().forceResponse(
LLNotification::Params("ScriptQuestion").substitutions(args).payload(payload), 0/*YES*/);
}
else if (gSavedSettings.getBOOL("PermissionsCautionEnabled"))
// [/RLVa:KB]
// check whether cautions are even enabled or not
if (gSavedSettings.getBOOL("PermissionsCautionEnabled"))
//if (gSavedSettings.getBOOL("PermissionsCautionEnabled"))
{
// display the caution permissions prompt
LLNotifications::instance().add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload);
@@ -5571,6 +5948,21 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response)
if(0 == option)
{
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
{
for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
it != notification["payload"]["ids"].endArray(); ++it)
{
if (!gRlvHandler.isException(RLV_BHVR_SENDIM, it->asUUID()))
{
text = RlvStrings::getString(RLV_STRING_HIDDEN);
break;
}
}
}
// [/RLVa:KB]
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_StartLure);
msg->nextBlockFast(_PREHASH_AgentData);
@@ -5603,13 +5995,29 @@ void handle_lure(const LLUUID& invitee)
void handle_lure(LLDynamicArray<LLUUID>& ids)
{
LLSD edit_args;
edit_args["REGION"] = gAgent.getRegion()->getName();
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a)
edit_args["REGION"] =
(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN);
// [/RLVa:KB]
//edit_args["REGION"] = gAgent.getRegion()->getName();
LLSD payload;
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
it != ids.end();
++it)
{
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a
// Only allow offering teleports if everyone is a @tplure exception or able to map this avie under @showloc=n
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
{
const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it);
if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it, RLV_CHECK_PERMISSIVE)) &&
((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) )
{
return;
}
}
// [/RLVa:KB]
payload["ids"].append(*it);
}
if (gAgent.isGodlike())