| 1 |
|
/** |
| 2 |
|
* @file RRInterface.cpp |
| 3 |
|
* @author Marine Kelley |
| 4 |
|
* @brief Implementation of the RLV features |
| 5 |
|
* |
| 6 |
|
* RLV Source Code |
| 7 |
|
* The source code in this file ("Source Code") is provided by Marine Kelley |
| 8 |
|
* to you under the terms of the GNU General Public License, version 2.0 |
| 9 |
|
* ("GPL"), unless you have obtained a separate licensing agreement |
| 10 |
|
* ("Other License"), formally executed by you and Marine Kelley. Terms of |
| 11 |
|
* the GPL can be found in doc/GPL-license.txt in the distribution of the |
| 12 |
|
* original source of the Second Life Viewer, or online at |
| 13 |
|
* http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
| 14 |
|
* |
| 15 |
|
* By copying, modifying or distributing this software, you acknowledge |
| 16 |
|
* that you have read and understood your obligations described above, |
| 17 |
|
* and agree to abide by those obligations. |
| 18 |
|
* |
| 19 |
|
* ALL SOURCE CODE FROM MARINE KELLEY IS PROVIDED "AS IS." MARINE KELLEY |
| 20 |
|
* MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING |
| 21 |
|
* ITS ACCURACY, COMPLETENESS OR PERFORMANCE. |
| 22 |
|
*/ |
| 23 |
|
|
| 24 |
#include "llviewerprecompiledheaders.h" |
#include "llviewerprecompiledheaders.h" |
| 25 |
|
|
| 26 |
#include "llagent.h" |
#include "llagent.h" |
| 58 |
// Global and static variables initialization. |
// Global and static variables initialization. |
| 59 |
BOOL gRRenabled = TRUE; |
BOOL gRRenabled = TRUE; |
| 60 |
BOOL RRInterface::sRRNoSetEnv = FALSE; |
BOOL RRInterface::sRRNoSetEnv = FALSE; |
| 61 |
BOOL RRInterface::sRestrainedLifeDebug = FALSE; |
BOOL RRInterface::sRestrainedLoveDebug = FALSE; |
| 62 |
|
|
| 63 |
#if !defined(max) |
#if !defined(max) |
| 64 |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
| 238 |
|
|
| 239 |
// Calling gSavedSettings here crashes the viewer when compiled with VS2005. |
// Calling gSavedSettings here crashes the viewer when compiled with VS2005. |
| 240 |
// OK under Linux. Moved this initialization to llstartup.cpp as a consequence. |
// OK under Linux. Moved this initialization to llstartup.cpp as a consequence. |
| 241 |
// sRestrainedLifeDebug = gSavedSettings.getBOOL("RestrainedLifeDebug"); |
// sRestrainedLoveDebug = gSavedSettings.getBOOL("RestrainedLoveDebug"); |
| 242 |
} |
} |
| 243 |
|
|
| 244 |
RRInterface::~RRInterface() |
RRInterface::~RRInterface() |
| 250 |
return RR_VIEWER_NAME" viewer v"RR_VERSION" ("RR_SLV_VERSION")"; // there is no '+' between the string and the macro |
return RR_VIEWER_NAME" viewer v"RR_VERSION" ("RR_SLV_VERSION")"; // there is no '+' between the string and the macro |
| 251 |
} |
} |
| 252 |
|
|
| 253 |
|
std::string RRInterface::getVersion2 () |
| 254 |
|
{ |
| 255 |
|
return RR_VIEWER_NAME_NEW" viewer v"RR_VERSION" ("RR_SLV_VERSION")"; // there is no '+' between the string and the macro |
| 256 |
|
} |
| 257 |
|
|
| 258 |
BOOL RRInterface::isAllowed (LLUUID object_uuid, std::string action, BOOL log_it) |
BOOL RRInterface::isAllowed (LLUUID object_uuid, std::string action, BOOL log_it) |
| 259 |
{ |
{ |
| 260 |
BOOL debug = sRestrainedLifeDebug && log_it; |
BOOL debug = sRestrainedLoveDebug && log_it; |
| 261 |
if (debug) { |
if (debug) { |
| 262 |
llinfos << object_uuid.asString() << " " << action << llendl; |
llinfos << object_uuid.asString() << " " << action << llendl; |
| 263 |
} |
} |
| 354 |
|
|
| 355 |
BOOL RRInterface::add (LLUUID object_uuid, std::string action, std::string option) |
BOOL RRInterface::add (LLUUID object_uuid, std::string action, std::string option) |
| 356 |
{ |
{ |
| 357 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 358 |
llinfos << object_uuid.asString() << " " << action << " " << option << llendl; |
llinfos << object_uuid.asString() << " " << action << " " << option << llendl; |
| 359 |
} |
} |
| 360 |
|
|
| 438 |
|
|
| 439 |
BOOL RRInterface::remove (LLUUID object_uuid, std::string action, std::string option) |
BOOL RRInterface::remove (LLUUID object_uuid, std::string action, std::string option) |
| 440 |
{ |
{ |
| 441 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 442 |
llinfos << object_uuid.asString() << " " << action << " " << option << llendl; |
llinfos << object_uuid.asString() << " " << action << " " << option << llendl; |
| 443 |
} |
} |
| 444 |
|
|
| 455 |
while (it != mSpecialObjectBehaviours.end() && |
while (it != mSpecialObjectBehaviours.end() && |
| 456 |
it != mSpecialObjectBehaviours.upper_bound(object_uuid.asString())) |
it != mSpecialObjectBehaviours.upper_bound(object_uuid.asString())) |
| 457 |
{ |
{ |
| 458 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 459 |
llinfos << " checking " << it->second << llendl; |
llinfos << " checking " << it->second << llendl; |
| 460 |
} |
} |
| 461 |
if (it->second == action) { |
if (it->second == action) { |
| 462 |
mSpecialObjectBehaviours.erase(it); |
mSpecialObjectBehaviours.erase(it); |
| 463 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 464 |
llinfos << " => removed. " << llendl; |
llinfos << " => removed. " << llendl; |
| 465 |
} |
} |
| 466 |
refreshCachedVariable(action); |
refreshCachedVariable(action); |
| 484 |
|
|
| 485 |
BOOL RRInterface::clear (LLUUID object_uuid, std::string command) |
BOOL RRInterface::clear (LLUUID object_uuid, std::string command) |
| 486 |
{ |
{ |
| 487 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 488 |
llinfos << object_uuid.asString() << " / " << command << llendl; |
llinfos << object_uuid.asString() << " / " << command << llendl; |
| 489 |
} |
} |
| 490 |
|
|
| 494 |
RRMAP::iterator it; |
RRMAP::iterator it; |
| 495 |
it = mSpecialObjectBehaviours.begin (); |
it = mSpecialObjectBehaviours.begin (); |
| 496 |
while (it != mSpecialObjectBehaviours.end()) { |
while (it != mSpecialObjectBehaviours.end()) { |
| 497 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 498 |
llinfos << " checking " << it->second << llendl; |
llinfos << " checking " << it->second << llendl; |
| 499 |
} |
} |
| 500 |
if (it->first==object_uuid.asString() && (command=="" || it->second.find (command)!=-1)) { |
if (it->first==object_uuid.asString() && (command=="" || it->second.find (command)!=-1)) { |
| 501 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 502 |
llinfos << it->second << " => removed. " << llendl; |
llinfos << it->second << " => removed. " << llendl; |
| 503 |
} |
} |
| 504 |
std::string tmp = it->second; |
std::string tmp = it->second; |
| 541 |
while (it != mSpecialObjectBehaviours.end()) { |
while (it != mSpecialObjectBehaviours.end()) { |
| 542 |
uuid.set (it->first); |
uuid.set (it->first); |
| 543 |
if (all || !uuid.isNull ()) { |
if (all || !uuid.isNull ()) { |
| 544 |
// if (sRestrainedLifeDebug) { |
// if (sRestrainedLoveDebug) { |
| 545 |
// llinfos << "testing " << it->first << llendl; |
// llinfos << "testing " << it->first << llendl; |
| 546 |
// } |
// } |
| 547 |
objp = gObjectList.findObject(uuid); |
objp = gObjectList.findObject(uuid); |
| 548 |
if (!objp) { |
if (!objp) { |
| 549 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 550 |
llinfos << it->first << " not found => cleaning... " << llendl; |
llinfos << it->first << " not found => cleaning... " << llendl; |
| 551 |
} |
} |
| 552 |
clear (uuid); |
clear (uuid); |
| 556 |
it++; |
it++; |
| 557 |
} |
} |
| 558 |
} else { |
} else { |
| 559 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 560 |
llinfos << "ignoring " << it->second << llendl; |
llinfos << "ignoring " << it->second << llendl; |
| 561 |
} |
} |
| 562 |
it++; |
it++; |
| 657 |
Command cmd; |
Command cmd; |
| 658 |
cmd.uuid=uuid; |
cmd.uuid=uuid; |
| 659 |
cmd.command=command; |
cmd.command=command; |
| 660 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 661 |
llinfos << "Retaining command : " << command << llendl; |
llinfos << "Retaining command : " << command << llendl; |
| 662 |
} |
} |
| 663 |
mRetainedCommands.push_back (cmd); |
mRetainedCommands.push_back (cmd); |
| 673 |
LLStringUtil::toLower(command); |
LLStringUtil::toLower(command); |
| 674 |
if (parseCommand (command, behav, option, param)) // detach=n, recvchat=n, recvim=n, unsit=n, recvim:<uuid>=add, clear=tplure: |
if (parseCommand (command, behav, option, param)) // detach=n, recvchat=n, recvim=n, unsit=n, recvim:<uuid>=add, clear=tplure: |
| 675 |
{ |
{ |
| 676 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 677 |
llinfos << "[" << uuid.asString() << "] [" << behav << "] [" << option << "] [" << param << "]" << llendl; |
llinfos << "[" << uuid.asString() << "] [" << behav << "] [" << option << "] [" << param << "]" << llendl; |
| 678 |
} |
} |
| 679 |
if (behav=="version") return answerOnChat (param, getVersion ()); |
if (behav=="version") return answerOnChat (param, getVersion ()); |
| 680 |
|
else if (behav=="versionnew") return answerOnChat (param, getVersion2 ()); |
| 681 |
else if (behav=="versionnum") return answerOnChat (param, RR_VERSION_NUM); |
else if (behav=="versionnum") return answerOnChat (param, RR_VERSION_NUM); |
| 682 |
else if (behav=="getoutfit") return answerOnChat (param, getOutfit (option)); |
else if (behav=="getoutfit") return answerOnChat (param, getOutfit (option)); |
| 683 |
else if (behav=="getattach") return answerOnChat (param, getAttachments (option)); |
else if (behav=="getattach") return answerOnChat (param, getAttachments (option)); |
| 703 |
} |
} |
| 704 |
else // clear |
else // clear |
| 705 |
{ |
{ |
| 706 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 707 |
llinfos << uuid.asString() << " " << behav << llendl; |
llinfos << uuid.asString() << " " << behav << llendl; |
| 708 |
} |
} |
| 709 |
if (behav=="clear") clear (uuid); |
if (behav=="clear") clear (uuid); |
| 716 |
{ |
{ |
| 717 |
BOOL ok=TRUE; |
BOOL ok=TRUE; |
| 718 |
if (mRetainedCommands.size ()) { |
if (mRetainedCommands.size ()) { |
| 719 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 720 |
llinfos << "Firing commands : " << mRetainedCommands.size () << llendl; |
llinfos << "Firing commands : " << mRetainedCommands.size () << llendl; |
| 721 |
} |
} |
| 722 |
Command cmd; |
Command cmd; |
| 769 |
|
|
| 770 |
BOOL RRInterface::force (LLUUID object_uuid, std::string command, std::string option) |
BOOL RRInterface::force (LLUUID object_uuid, std::string command, std::string option) |
| 771 |
{ |
{ |
| 772 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 773 |
llinfos << command << " " << option << llendl; |
llinfos << command << " " << option << llendl; |
| 774 |
} |
} |
| 775 |
if (command=="sit") { // sit:UUID |
if (command=="sit") { // sit:UUID |
| 783 |
if (!allowed_to_sittp) add (object_uuid, "sittp", ""); |
if (!allowed_to_sittp) add (object_uuid, "sittp", ""); |
| 784 |
} |
} |
| 785 |
else if (command=="unsit") { // unsit |
else if (command=="unsit") { // unsit |
| 786 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 787 |
llinfos << "trying to unsit" << llendl; |
llinfos << "trying to unsit" << llendl; |
| 788 |
} |
} |
| 789 |
if (gAgent.getAvatarObject() && |
if (gAgent.getAvatarObject() && |
| 790 |
gAgent.getAvatarObject()->mIsSitting) { |
gAgent.getAvatarObject()->mIsSitting) { |
| 791 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 792 |
llinfos << "found avatar object" << llendl; |
llinfos << "found avatar object" << llendl; |
| 793 |
} |
} |
| 794 |
if (gAgent.mRRInterface.mContainsUnsit) { |
if (gAgent.mRRInterface.mContainsUnsit) { |
| 795 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 796 |
llinfos << "prevented from unsitting" << llendl; |
llinfos << "prevented from unsitting" << llendl; |
| 797 |
} |
} |
| 798 |
return TRUE; |
return TRUE; |
| 799 |
} |
} |
| 800 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 801 |
llinfos << "unsitting agent" << llendl; |
llinfos << "unsitting agent" << llendl; |
| 802 |
} |
} |
| 803 |
LLOverlayBar::onClickStandUp(NULL); |
LLOverlayBar::onClickStandUp(NULL); |
| 823 |
else { |
else { |
| 824 |
EWearableType type = getOutfitLayerAsType (option); |
EWearableType type = getOutfitLayerAsType (option); |
| 825 |
if (type != WT_INVALID) { |
if (type != WT_INVALID) { |
| 826 |
// clothes and hair only, not skin, eyes, or shape |
// clothes only, not skin, eyes, hair or shape |
| 827 |
if (LLWearable::typeToAssetType(type) == LLAssetType::AT_CLOTHING) { |
if (LLWearable::typeToAssetType(type) == LLAssetType::AT_CLOTHING) { |
| 828 |
gAgent.removeWearable (type); // remove by layer |
gAgent.removeWearable (type); // remove by layer |
| 829 |
} |
} |
| 918 |
|
|
| 919 |
BOOL RRInterface::answerOnChat (std::string channel, std::string msg) |
BOOL RRInterface::answerOnChat (std::string channel, std::string msg) |
| 920 |
{ |
{ |
| 921 |
if (channel == "0") return FALSE; // protection against abusive "@getstatus=0" commands |
S32 chan = (S32)atoi(channel.c_str()); |
| 922 |
if (atoi (channel.c_str()) <= 0) return FALSE; // prevent from trying to say something on a negative channel, or on a non-numerical channel |
if (chan == 0) { |
| 923 |
gChatBar->sendChatFromViewer("/"+channel+" "+msg, CHAT_TYPE_SHOUT, FALSE); |
// protection against abusive "@getstatus=0" commands, or against a non-numerical channel |
| 924 |
if (sRestrainedLifeDebug) { |
return FALSE; |
| 925 |
llinfos << "/" << channel << " " << msg << llendl; |
} |
| 926 |
|
if (msg.length() > (size_t)(chan > 0 ? 1023 : 255)) { |
| 927 |
|
llwarns << "Too large an answer: maximum is " << (chan > 0 ? "1023 characters" : "255 characters for a negative channel") << ". Aborted command." << llendl; |
| 928 |
|
return FALSE; |
| 929 |
|
} |
| 930 |
|
if (chan > 0) { |
| 931 |
|
std::ostringstream temp; |
| 932 |
|
temp << "/" << chan << " " << msg; |
| 933 |
|
gChatBar->sendChatFromViewer(temp.str(), CHAT_TYPE_SHOUT, FALSE); |
| 934 |
|
} else { |
| 935 |
|
gMessageSystem->newMessage("ScriptDialogReply"); |
| 936 |
|
gMessageSystem->nextBlock("AgentData"); |
| 937 |
|
gMessageSystem->addUUID("AgentID", gAgent.getID()); |
| 938 |
|
gMessageSystem->addUUID("SessionID", gAgent.getSessionID()); |
| 939 |
|
gMessageSystem->nextBlock("Data"); |
| 940 |
|
gMessageSystem->addUUID("ObjectID", gAgent.getID()); |
| 941 |
|
gMessageSystem->addS32("ChatChannel", chan); |
| 942 |
|
gMessageSystem->addS32("ButtonIndex", 1); |
| 943 |
|
gMessageSystem->addString("ButtonLabel", msg); |
| 944 |
|
gAgent.sendReliableMessage(); |
| 945 |
|
} |
| 946 |
|
if (sRestrainedLoveDebug) { |
| 947 |
|
llinfos << "/" << chan << " " << msg << llendl; |
| 948 |
} |
} |
| 949 |
return TRUE; |
return TRUE; |
| 950 |
} |
} |
| 1080 |
LLViewerJointAttachment* attachment = curiter->second; |
LLViewerJointAttachment* attachment = curiter->second; |
| 1081 |
name=attachment->getName (); |
name=attachment->getName (); |
| 1082 |
LLStringUtil::toLower(name); |
LLStringUtil::toLower(name); |
| 1083 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1084 |
llinfos << "trying <" << name << ">" << llendl; |
llinfos << "trying <" << name << ">" << llendl; |
| 1085 |
} |
} |
| 1086 |
if (attachpt=="" || attachpt==name) { |
if (attachpt=="" || attachpt==name) { |
| 1131 |
LLViewerJointAttachment* attachment = curiter->second; |
LLViewerJointAttachment* attachment = curiter->second; |
| 1132 |
name=attachment->getName (); |
name=attachment->getName (); |
| 1133 |
LLStringUtil::toLower(name); |
LLStringUtil::toLower(name); |
| 1134 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1135 |
llinfos << "trying <" << name << ">" << llendl; |
llinfos << "trying <" << name << ">" << llendl; |
| 1136 |
} |
} |
| 1137 |
if (attachpt=="" || attachpt==name) { |
if (attachpt=="" || attachpt==name) { |
| 1138 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1139 |
llinfos << "found => detaching" << llendl; |
llinfos << "found => detaching" << llendl; |
| 1140 |
} |
} |
| 1141 |
if (attachment->getObject()) { |
if (attachment->getObject()) { |
| 1219 |
if (attached_object) { |
if (attached_object) { |
| 1220 |
attach_point_name = avatar->getAttachedPointName (item->getUUID()); |
attach_point_name = avatar->getAttachedPointName (item->getUUID()); |
| 1221 |
if (!gAgent.mRRInterface.canDetach(attached_object)) { |
if (!gAgent.mRRInterface.canDetach(attached_object)) { |
| 1222 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1223 |
llinfos << "found a locked object : " << item->getName() << " on " << attach_point_name << llendl; |
llinfos << "found a locked object : " << item->getName() << " on " << attach_point_name << llendl; |
| 1224 |
} |
} |
| 1225 |
res.push_back (item); |
res.push_back (item); |
| 1231 |
if (gAgent.mRRInterface.contains ("remoutfit") |
if (gAgent.mRRInterface.contains ("remoutfit") |
| 1232 |
|| gAgent.mRRInterface.containsSubstr ("remoutfit:") |
|| gAgent.mRRInterface.containsSubstr ("remoutfit:") |
| 1233 |
) { |
) { |
| 1234 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1235 |
llinfos << "found a locked clothing : " << item->getName() << llendl; |
llinfos << "found a locked clothing : " << item->getName() << llendl; |
| 1236 |
} |
} |
| 1237 |
res.push_back (item); |
res.push_back (item); |
| 1251 |
} |
} |
| 1252 |
} |
} |
| 1253 |
|
|
| 1254 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1255 |
llinfos << "number of locked objects under " << root->getName() << " = " << res.size() << llendl; |
llinfos << "number of locked objects under " << root->getName() << " = " << res.size() << llendl; |
| 1256 |
} |
} |
| 1257 |
} |
} |
| 1438 |
LLInventoryCategory* cat = cats->get(i); |
LLInventoryCategory* cat = cats->get(i); |
| 1439 |
std::string name = cat->getName(); |
std::string name = cat->getName(); |
| 1440 |
if (name == RR_SHARED_FOLDER) { |
if (name == RR_SHARED_FOLDER) { |
| 1441 |
// if (sRestrainedLifeDebug) { |
// if (sRestrainedLoveDebug) { |
| 1442 |
// llinfos << "found " << name << llendl; |
// llinfos << "found " << name << llendl; |
| 1443 |
// } |
// } |
| 1444 |
return cat; |
return cat; |
| 1547 |
} |
} |
| 1548 |
} |
} |
| 1549 |
|
|
| 1550 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1551 |
llinfos << "category not found" << llendl; |
llinfos << "category not found" << llendl; |
| 1552 |
} |
} |
| 1553 |
return NULL; |
return NULL; |
| 1635 |
if (attachment) { |
if (attachment) { |
| 1636 |
attachName = attachment->getName(); |
attachName = attachment->getName(); |
| 1637 |
LLStringUtil::toLower(attachName); |
LLStringUtil::toLower(attachName); |
| 1638 |
// if (sRestrainedLifeDebug) { |
// if (sRestrainedLoveDebug) { |
| 1639 |
// llinfos << "trying attachment " << attachName << llendl; |
// llinfos << "trying attachment " << attachName << llendl; |
| 1640 |
// } |
// } |
| 1641 |
if (exactName && objectName == attachName) return attachment; |
if (exactName && objectName == attachName) return attachment; |
| 1647 |
new_candidate.attachment = attachment; |
new_candidate.attachment = attachment; |
| 1648 |
candidates.push_back (new_candidate); |
candidates.push_back (new_candidate); |
| 1649 |
found_one = true; |
found_one = true; |
| 1650 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1651 |
llinfos << "new candidate '" << attachName << "' : index=" << new_candidate.index << " length=" << new_candidate.length << llendl; |
llinfos << "new candidate '" << attachName << "' : index=" << new_candidate.index << " length=" << new_candidate.length << llendl; |
| 1652 |
} |
} |
| 1653 |
} |
} |
| 1654 |
} |
} |
| 1655 |
} |
} |
| 1656 |
if (!found_one) { |
if (!found_one) { |
| 1657 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1658 |
llinfos << "no attachment found" << llendl; |
llinfos << "no attachment found" << llendl; |
| 1659 |
} |
} |
| 1660 |
return NULL; |
return NULL; |
| 1685 |
if (ind_res > -1) { |
if (ind_res > -1) { |
| 1686 |
candidate = candidates[ind_res]; |
candidate = candidates[ind_res]; |
| 1687 |
res = candidate.attachment; |
res = candidate.attachment; |
| 1688 |
if (sRestrainedLifeDebug && res) { |
if (sRestrainedLoveDebug && res) { |
| 1689 |
llinfos << "returning '" << res->getName() << "'" << llendl; |
llinfos << "returning '" << res->getName() << "'" << llendl; |
| 1690 |
} |
} |
| 1691 |
} |
} |
| 1776 |
for(S32 i = 0; i < count; ++i) { |
for(S32 i = 0; i < count; ++i) { |
| 1777 |
if (!isRoot) { |
if (!isRoot) { |
| 1778 |
LLViewerInventoryItem* item = (LLViewerInventoryItem*)items->get(i); |
LLViewerInventoryItem* item = (LLViewerInventoryItem*)items->get(i); |
| 1779 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1780 |
llinfos << "trying to attach " << item->getName() << llendl; |
llinfos << "trying to attach " << item->getName() << llendl; |
| 1781 |
} |
} |
| 1782 |
|
|
| 1785 |
LLViewerJointAttachment* attachpt = findAttachmentPointFromName (item->getName()); |
LLViewerJointAttachment* attachpt = findAttachmentPointFromName (item->getName()); |
| 1786 |
|
|
| 1787 |
if (attachpt) { |
if (attachpt) { |
| 1788 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1789 |
llinfos << "attaching item to " << attachpt->getName() << llendl; |
llinfos << "attaching item to " << attachpt->getName() << llendl; |
| 1790 |
} |
} |
| 1791 |
// mimick rez_attachment without displaying an Xml alert to confirm |
// mimick rez_attachment without displaying an Xml alert to confirm |
| 1880 |
for(S32 i = 0; i < count; ++i) { |
for(S32 i = 0; i < count; ++i) { |
| 1881 |
if (!isRoot) { |
if (!isRoot) { |
| 1882 |
LLViewerInventoryItem* item = (LLViewerInventoryItem*)items->get(i); |
LLViewerInventoryItem* item = (LLViewerInventoryItem*)items->get(i); |
| 1883 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1884 |
llinfos << "trying to detach " << item->getName() << llendl; |
llinfos << "trying to detach " << item->getName() << llendl; |
| 1885 |
} |
} |
| 1886 |
|
|
| 1974 |
return FALSE; |
return FALSE; |
| 1975 |
} |
} |
| 1976 |
|
|
| 1977 |
if (sRestrainedLifeDebug) { |
if (sRestrainedLoveDebug) { |
| 1978 |
llinfos << tokens.at(0) << "," << tokens.at(1) << "," << tokens.at(2) << " " << x << "," << y << "," << z << llendl; |
llinfos << tokens.at(0) << "," << tokens.at(1) << "," << tokens.at(2) << " " << x << "," << y << "," << z << llendl; |
| 1979 |
} |
} |
| 1980 |
LLVector3d pos_global; |
LLVector3d pos_global; |