diff options
author | Don Kjer <don@lindenlab.com> | 2007-05-01 21:39:25 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-05-01 21:39:25 +0000 |
commit | 4ecb9cb63e4993b3b4bc65d73ed255139b5c3f75 (patch) | |
tree | 48d9bb9a1ae468ecdbd53cf21a598d66ee8eced3 /indra/newview | |
parent | f5e9ce7e47694e349a4eb28b052016b11e1bdf81 (diff) |
svn merge -r 59163:61099 svn+ssh://svn/svn/linden/branches/release-candidate into release
Diffstat (limited to 'indra/newview')
52 files changed, 1432 insertions, 1174 deletions
diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings index 784525aad4..54687b1a43 100644 --- a/indra/newview/English.lproj/InfoPlist.strings +++ b/indra/newview/English.lproj/InfoPlist.strings @@ -1,5 +1,5 @@ /* Localized versions of Info.plist keys */ CFBundleName = "Second Life"; -CFBundleShortVersionString = "Second Life version 1.14.0.1"; -CFBundleGetInfoString = "Second Life version 1.14.0.1, Copyright 2004-2007 Linden Research, Inc."; +CFBundleShortVersionString = "Second Life version 1.15.0.2"; +CFBundleGetInfoString = "Second Life version 1.15.0.2, Copyright 2004-2007 Linden Research, Inc."; diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index c7d430725f..0908e18a1a 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -32,7 +32,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>1.14.0.1</string> + <string>1.15.0.2</string> <key>CSResourcesFileMapped</key> <true/> </dict> diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 49b199c0a4..4e6373d57e 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -22,8 +22,11 @@ ATI All-in-Wonder X1800 .*ATI.*All-in-Wonder X18.* 3 ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3 ATI ASUS X1xxx .*ASUS X1.* 3 ATI Mobility Radeon X1xxx .*ATI.*Mobility.*X1.* 2 -ATI Mobility Radeon X3xx .*ATI.*Mobility.*X3.* 1 -ATI Mobility Radeon X6xx .*ATI.*Mobility.*X6.* 1 +// HACK: We crash on startup on some Mobility Radeon chips, with 1.15.0 +// in FMOD (!). Try defaulting them to class 0. JC +ATI Mobility Radeon X3xx .*ATI.*Mobility.*X3.* 0 +ATI Mobility Radeon X6xx .*ATI.*Mobility.*X6.* 0 +ATI Mobility Radeon X7xx .*ATI.*Mobility.*X7.* 0 ATI Radeon OpenGL .*ATI.*Radeon OpenGL.* 3 ATI Diamond X1xxx .*ATI.*Diamond.*X1.* 3 ATI FireGL 5xxx .*ATI.*FireGL V5.* 3 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3939c14dbb..13fa29e242 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -203,6 +203,9 @@ BOOL LLAgent::sDebugDisplayTarget = FALSE; const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f; +std::map<LLString, LLString> LLAgent::sTeleportErrorMessages; +std::map<LLString, LLString> LLAgent::sTeleportProgressMessages; + class LLAgentFriendObserver : public LLFriendObserver { public: @@ -5472,6 +5475,8 @@ bool LLAgent::teleportCore(bool is_local) LLFloaterWorldMap::hide(NULL); LLFloaterDirectory::hide(NULL); + gParcelMgr->deselectLand(); + // Close all pie menus, deselect land, etc. // Don't change the camera until we know teleport succeeded. JC resetView(FALSE); @@ -7197,4 +7202,57 @@ void LLAgent::observeFriends() } } +void LLAgent::parseTeleportMessages(const LLString& xml_filename) +{ + LLXMLNodePtr root; + BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root); + + if (!success || !root || !root->hasName( "teleport_messages" )) + { + llerrs << "Problem reading teleport string XML file: " + << xml_filename << llendl; + return; + } + + for (LLXMLNode* message_set = root->getFirstChild(); + message_set != NULL; + message_set = message_set->getNextSibling()) + { + if ( !message_set->hasName("message_set") ) continue; + + std::map<LLString, LLString> *teleport_msg_map = NULL; + LLString message_set_name; + + if ( message_set->getAttributeString("name", message_set_name) ) + { + //now we loop over all the string in the set and add them + //to the appropriate set + if ( message_set_name == "errors" ) + { + teleport_msg_map = &sTeleportErrorMessages; + } + else if ( message_set_name == "progress" ) + { + teleport_msg_map = &sTeleportProgressMessages; + } + } + + if ( !teleport_msg_map ) continue; + + LLString message_name; + for (LLXMLNode* message_node = message_set->getFirstChild(); + message_node != NULL; + message_node = message_node->getNextSibling()) + { + if ( message_node->hasName("message") && + message_node->getAttributeString("name", message_name) ) + { + (*teleport_msg_map)[message_name] = + message_node->getTextContents(); + } //end if ( message exists and has a name) + } //end for (all message in set) + }//end for (all message sets in xml file) +} + + // EOF diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index d0bda5d46a..89d60709d5 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -672,6 +672,13 @@ public: BOOL mForceMouselook; + static void parseTeleportMessages(const LLString& xml_filename); + //we should really define ERROR and PROGRESS enums here + //but I don't really feel like doing that, so I am just going + //to expose the mappings....yup + static std::map<LLString, LLString> sTeleportErrorMessages; + static std::map<LLString, LLString> sTeleportProgressMessages; + private: ETeleportState mTeleportState; LLString mTeleportMessage; diff --git a/indra/newview/llcaphttpsender.cpp b/indra/newview/llcaphttpsender.cpp new file mode 100644 index 0000000000..7928a5004c --- /dev/null +++ b/indra/newview/llcaphttpsender.cpp @@ -0,0 +1,30 @@ +/** + * @file llcaphttpsender.cpp + * @brief Abstracts details of sending messages via UntrustedMessage cap. + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "linden_common.h" +#include "llcaphttpsender.h" + +LLCapHTTPSender::LLCapHTTPSender(const std::string& cap) : + mCap(cap) +{ +} + +//virtual +void LLCapHTTPSender::send(const LLHost& host, const char* message, + const LLSD& body, + LLHTTPClient::ResponderPtr response) const +{ + llinfos << "LLCapHTTPSender::send: message " << message + << " to host " << host << llendl; + LLSD llsd; + llsd["message"] = message; + llsd["body"] = body; + LLHTTPClient::post(mCap, llsd, response); +} diff --git a/indra/newview/llcaphttpsender.h b/indra/newview/llcaphttpsender.h new file mode 100644 index 0000000000..af71c66563 --- /dev/null +++ b/indra/newview/llcaphttpsender.h @@ -0,0 +1,30 @@ +/** + * @file llcaphttpsender.h + * @brief Abstracts details of sending messages via the + * UntrustedMessage capability. + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#ifndef LL_CAP_HTTP_SENDER_H +#define LL_CAP_HTTP_SENDER_H + +#include "llhttpsender.h" + +class LLCapHTTPSender : public LLHTTPSender +{ +public: + LLCapHTTPSender(const std::string& cap); + + /** @brief Send message via UntrustedMessage capability with body, + call response when done */ + virtual void send(const LLHost& host, + const char* message, const LLSD& body, + LLHTTPClient::ResponderPtr response) const; + +private: + std::string mCap; +}; + +#endif // LL_CAP_HTTP_SENDER_H diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index 13e7fef4ec..41f8f1d714 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -226,7 +226,7 @@ void LLColorSwatchCtrl::draw() void LLColorSwatchCtrl::setEnabled( BOOL enabled ) { mCaption->setEnabled( enabled ); - LLUICtrl::setEnabled( enabled ); + LLView::setEnabled( enabled ); if (!enabled) { diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 2ad7eb6866..6d1c384b5a 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -1,163 +1,167 @@ -/** +/** * @file lleventpoll.cpp - * @brief Implementation of the LLEventPoll class. + * @brief Implementation of the LLEventPoll class. * - * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. * $License$ */ #include "llviewerprecompiledheaders.h" +#include "llagent.h" #include "lleventpoll.h" #include "llhttpclient.h" -#include "llhttpnode.h" #include "llsdserialize.h" +#include "llviewerregion.h" +#include "message.h" +class LLEventPoll::Impl : LLHTTPClient::Responder +{ +public: + static Impl& start(const std::string& pollURL); + void stop(); + +private: + Impl(const std::string& pollURL); + ~Impl(); + + void makeRequest(); + void handleMessage(const LLSD& content); + virtual void error(U32 status, const std::string& reason); + virtual void result(const LLSD& content); +private: + typedef LLHTTPClient::ResponderPtr Ptr; -class LLEventPoll::Impl : LLHTTPClient::Responder + Ptr mPtr; + bool mDone; + + std::string mPollURL; + std::string mSender; + + LLSD mAcknowledge; + + // these are only here for debugging so we can see which poller is which + static int sCount; + int mCount; +}; + +//static +LLEventPoll::Impl& LLEventPoll::Impl::start( + const std::string& pollURL) { -public: - static Impl& start( - const std::string& pollURL, const LLHTTPNode& treeRoot) - { - Impl* i = new Impl(pollURL, treeRoot); - llinfos << "LLEventPoll::Impl::start <" << i->mCount << "> " + Impl* i = new Impl(pollURL); + llinfos << "LLEventPoll::Impl::start <" << i->mCount << "> " << pollURL << llendl; - return *i; - } - - void stop() + return *i; +} + +void LLEventPoll::Impl::stop() +{ + lldebugs << "LLEventPoll::Impl::stop <" << mCount << "> " + << mPollURL << llendl; + // there should be a way to stop a LLHTTPClient request in progress + mDone = true; + mPtr = NULL; +} + +int LLEventPoll::Impl::sCount = 0; + +LLEventPoll::Impl::Impl(const std::string& pollURL) + : mPtr(NULL), mDone(false), + mPollURL(pollURL), + mCount(++sCount) +{ + mPtr = this; + //extract host and port of simulator to set as sender + LLViewerRegion *regionp = gAgent.getRegion(); + if (!regionp) { - lldebugs << "LLEventPoll::Impl::stop <" << mCount << "> " - << mPollURL << llendl; - // there should be a way to stop a LLHTTPClient request in progress - mDone = true; - mPtr = NULL; + llerrs << "LLEventPoll initialized before region is added." << llendl; } + mSender = regionp->getHost().getIPandPort(); + llinfos << "LLEventPoll initialized with sender " << mSender << llendl; + makeRequest(); +} + +LLEventPoll::Impl::~Impl() +{ + lldebugs << "LLEventPoll::Impl::~Impl <" << mCount << "> " + << mPollURL << llendl; +} + +void LLEventPoll::Impl::makeRequest() +{ + LLSD request; + request["ack"] = mAcknowledge; + request["done"] = mDone; -private: - Impl(const std::string& pollURL, const LLHTTPNode& treeRoot) - : mPtr(NULL), mDone(false), - mPollURL(pollURL), mTreeRoot(treeRoot), - mCount(++sCount) - { - mPtr = this; - makeRequest(); - } - - ~Impl() - { - lldebugs << "LLEventPoll::Impl::~Impl <" << mCount << "> " - << mPollURL << llendl; - } + lldebugs << "LLEventPoll::Impl::makeRequest <" << mCount << "> ack = " + << LLSDXMLStreamer(mAcknowledge) << llendl; + LLHTTPClient::post(mPollURL, request, mPtr); +} + +void LLEventPoll::Impl::handleMessage(const LLSD& content) +{ + std::string msg_name = content["message"]; + LLSD message; + message["sender"] = mSender; + message["body"] = content["body"]; + LLMessageSystem::dispatch(msg_name, message); +} +//virtual +void LLEventPoll::Impl::error(U32 status, const std::string& reason) +{ + if (mDone) return; - void makeRequest() + if(status != 499) { - LLSD request; - request["ack"] = mAcknowledge; - request["done"] = mDone; - - lldebugs << "LLEventPoll::Impl::makeRequest <" << mCount << "> ack = " - << LLSDXMLStreamer(mAcknowledge) << llendl; - LLHTTPClient::post(mPollURL, request, mPtr); + llwarns << "LLEventPoll::Impl::error: <" << mCount << "> got " + << status << ": " << reason + << (mDone ? " -- done" : "") << llendl; + stop(); + return; } + + makeRequest(); +} + +//virtual +void LLEventPoll::Impl::result(const LLSD& content) +{ + lldebugs << "LLEventPoll::Impl::result <" << mCount << ">" + << (mDone ? " -- done" : "") << llendl; - void handleMessage(const LLSD& content) - { - std::string message = content["message"]; - if (message.empty()) - { - llwarns << "LLEventPoll::Impl::handleMessage <" << mCount - << "> empty message name" << llendl; - return; - } - - std::string path = "/message/" + message; - - LLSD context; - const LLHTTPNode* handler = mTreeRoot.traverse(path, context); - if (!handler) - { - llwarns << "LLEventPoll::Impl::handleMessage <" << mCount - << "> no handler for " << path << llendl; - return; - } - LLPointer<LLSimpleResponse> responsep = LLSimpleResponse::create(); - handler->post((LLHTTPNode::ResponsePtr)responsep, context, content["body"]); - - lldebugs << "LLEventPoll::Impl::handleMessage handled <" << mCount << "> " - << message << ": " << *responsep << llendl; - } + if (mDone) return; + + mAcknowledge = content["id"]; + LLSD events = content["events"]; - virtual void error(U32 status, const std::string& reason) + if(mAcknowledge.isUndefined()) { - lldebugs << "LLEventPoll::Impl::error <" << mCount << "> got " - << status << ": " << reason - << (mDone ? " -- done" : "") << llendl; - - if (mDone) return; - - if (status == 404) - { - // the capability has been revoked - stop(); - return; - } - - makeRequest(); + llwarns << "LLEventPoll::Impl: id undefined" << llendl; } + llinfos << "LLEventPoll::Impl::completed <" << mCount << "> " << events.size() << "events (id " + << LLSDXMLStreamer(mAcknowledge) << ")" << llendl; - virtual void result(const LLSD& content) + LLSD::array_const_iterator i = events.beginArray(); + LLSD::array_const_iterator end = events.endArray(); + for (; i != end; ++i) { - lldebugs << "LLEventPoll::Impl::result <" << mCount << ">" - << (mDone ? " -- done" : "") << llendl; - - if (mDone) return; - - mAcknowledge = content["id"]; - LLSD events = content["events"]; - - lldebugs << "LLEventPoll::Impl::completed <" << mCount << "> ack = " - << LLSDXMLStreamer(mAcknowledge) << llendl; - - LLSD::array_const_iterator i = events.beginArray(); - LLSD::array_const_iterator end = events.endArray(); - for (; i != end; ++i) + if (i->has("message")) { - if (i->has("message")) - { - handleMessage(*i); - } + handleMessage(*i); } - - makeRequest(); } - -private: - typedef LLHTTPClient::ResponderPtr Ptr; - - Ptr mPtr; - bool mDone; - - std::string mPollURL; - const LLHTTPNode& mTreeRoot; - LLSD mAcknowledge; - - // these are only here for debugging so we can see which poller is which - static int sCount; - int mCount; -}; - -int LLEventPoll::Impl::sCount = 0; - + makeRequest(); +} -LLEventPoll::LLEventPoll(const std::string& pollURL, const LLHTTPNode& treeRoot) - : impl(Impl::start(pollURL, treeRoot)) +LLEventPoll::LLEventPoll(const std::string& pollURL) + : impl(Impl::start(pollURL)) { } LLEventPoll::~LLEventPoll() diff --git a/indra/newview/lleventpoll.h b/indra/newview/lleventpoll.h index c5024b2b95..c2d798360f 100644 --- a/indra/newview/lleventpoll.h +++ b/indra/newview/lleventpoll.h @@ -9,20 +9,12 @@ #ifndef LL_LLEVENTPOLL_H #define LL_LLEVENTPOLL_H -class LLHTTPNode; - - class LLEventPoll ///< implements the viewer side of server-to-viewer pushed events. { public: - LLEventPoll(const std::string& pollURL, const LLHTTPNode& treeRoot); - /**< Start polling the URL. - - The object will automatically responde to events - by calling handlers in the tree. - */ - + LLEventPoll(const std::string& pollURL); + ///< Start polling the URL. virtual ~LLEventPoll(); ///< will stop polling, cancelling any poll in progress. diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 12891bd7b2..bc2c340999 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -57,12 +57,6 @@ LLFloaterAuction::LLFloaterAuction() : childSetCommitCallback("fence_check", LLSavedSettingsGlue::setBOOL, (void*)"AuctionShowFence"); - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(this, "saletype_combo"); - if (combo) - { - combo->selectFirstItem(); - } - childSetAction("snapshot_btn", onClickSnapshot, this); childSetAction("ok_btn", onClickOK, this); } @@ -196,28 +190,18 @@ void LLFloaterAuction::onClickSnapshot(void* data) void LLFloaterAuction::onClickOK(void* data) { LLFloaterAuction* self = (LLFloaterAuction*)(data); - bool is_auction = false; - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(self, "saletype_combo"); - if (combo - && combo->getCurrentIndex() == 0) - { - is_auction = true; - } + if(self->mImageID.notNull()) { LLSD parcel_name = self->childGetValue("parcel_text"); - // create the asset - if(is_auction) - { - // only need the tga if it is an auction. - LLString* name = new LLString(parcel_name.asString()); - gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_IMAGE_TGA, - &auction_tga_upload_done, - (void*)name, - FALSE); - self->getWindow()->incBusyCount(); - } + // create the asset + LLString* name = new LLString(parcel_name.asString()); + gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_IMAGE_TGA, + &auction_tga_upload_done, + (void*)name, + FALSE); + self->getWindow()->incBusyCount(); LLString* j2c_name = new LLString(parcel_name.asString()); gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_TEXTURE, @@ -226,24 +210,13 @@ void LLFloaterAuction::onClickOK(void* data) FALSE); self->getWindow()->incBusyCount(); - if(is_auction) - { - LLNotifyBox::showXml("UploadingAuctionSnapshot"); - } - else - { - LLNotifyBox::showXml("UploadingSnapshot"); - } + LLNotifyBox::showXml("UploadingAuctionSnapshot"); + } LLMessageSystem* msg = gMessageSystem; - if(is_auction) - { - msg->newMessage("ViewerStartAuction"); - } - else - { - msg->newMessage("ParcelGodReserveForNewbie"); - } + + msg->newMessage("ViewerStartAuction"); + msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 68f002f9d9..9beaa82cb9 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -65,7 +65,7 @@ void LLFloaterBump::show(void *contents) LLString none_detected = sInstance->childGetText("none_detected"); LLSD row; row["columns"][0]["value"] = none_detected; - row["columns"][0]["font-style"] = "BOLD"; + row["columns"][0]["font"] = "SansSerifBold"; list->addElement(row); } else @@ -136,6 +136,6 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) LLSD row; row["id"] = mcd->mPerp; row["columns"][0]["value"] = text; - row["columns"][0]["font-style"] = "BOLD"; + row["columns"][0]["font"] = "SansSerifBold"; list->addElement(row); } diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 1ee8cd62ab..7ed84e495a 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -75,7 +75,6 @@ private: // information about the parcel bool mParcelValid; bool mParcelIsForSale; - bool mParcelIsFirstLand; bool mParcelIsGroupLand; S32 mParcelGroupContribution; S32 mParcelPrice; @@ -352,7 +351,6 @@ void LLFloaterBuyLandUI::updateParcelInfo() LLParcel* parcel = mParcel->getParcel(); mParcelValid = parcel && mRegion; mParcelIsForSale = false; - mParcelIsFirstLand = false; mParcelIsGroupLand = false; mParcelGroupContribution = 0; mParcelPrice = 0; @@ -386,7 +384,6 @@ void LLFloaterBuyLandUI::updateParcelInfo() { mParcelActualArea = parcel->getArea(); mParcelIsForSale = parcel->getForSale(); - mParcelIsFirstLand = parcel->getReservedForNewbie(); mParcelIsGroupLand = parcel->getIsGroupOwned(); mParcelPrice = mParcelIsForSale ? parcel->getSalePrice() : 0; @@ -493,36 +490,6 @@ void LLFloaterBuyLandUI::updateParcelInfo() } } - /* - if ((mRegion->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL) - && !gAgent.isGodlike()) - { - mCannotBuyReason = llformat( - "The region %s does not allow transfer of land.", - mRegion->getName().c_str() ); - return; - } - */ - - if (parcel->getReservedForNewbie()) - { - if (mIsForGroup) - { - mCannotBuyReason = childGetText("first_time_group"); - return; - } - - if (gStatusBar->getSquareMetersCommitted() > 0) - { - mCannotBuyReason == childGetText("first_time"); - return; - } - - // *TODO: There should be a check based on the database value - // indra.user.ever_owned_land, only that value never makes it - // to the viewer, see SL-10728 - } - mCanBuy = true; } @@ -1143,17 +1110,6 @@ void LLFloaterBuyLandUI::refreshUI() message += childGetText("insufficient_land_credits"); } - else if (mAgentHasNeverOwnedLand) - { - if (mParcelIsFirstLand) - { - message += childGetText("first_purchase"); - } - else - { - message += childGetText("first_time_but_not_first_land"); - } - } else { diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 534aac077f..1e65ae5620 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -501,14 +501,11 @@ void LLFloaterFriends::onClickIM(void* user_data) } else { - LLUUID session_id; - session_id.generate(); gIMView->setFloaterOpen(TRUE); - gIMView->addSession( - "Friends Conference", - IM_SESSION_ADD, - session_id, - ids); + gIMView->addSession("Friends Conference", + IM_SESSION_CONFERENCE_START, + ids[0], + ids); } } } diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 8bb73e3a9b..1548c0e5d6 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -218,4 +218,3 @@ void LLFloaterInspect::draw() LLFloater::draw(); } - diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 9b28211476..51a1a99d71 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -793,10 +793,6 @@ void LLPanelLandGeneral::refreshNames() mSaleInfoForSale2->setTextArg("[BUYER]", name); } - else if(parcel->getReservedForNewbie()) - { - mSaleInfoForSale2->setTextArg("[BUYER]", childGetText("new users only")); - } else { mSaleInfoForSale2->setTextArg("[BUYER]", childGetText("anyone")); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 9a486d76ee..8968da9720 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -40,7 +40,6 @@ #include "llviewerobject.h" #include "llviewerregion.h" #include "llcombobox.h" -#include "llfloaterrate.h" #include "lltooldraganddrop.h" #include "llfloatermap.h" #include "lluiconstants.h" diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index f7bf4de34f..b71772bd93 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -162,6 +162,7 @@ BOOL LLFloaterTOS::postBuild() childSetValue("tos_text", LLSD(mMessage)); #endif + return TRUE; } diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 9ab9a3f6bb..7c03500f85 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -55,40 +55,171 @@ const S32 MIN_HEIGHT = 130; // static LLString sTitleString = "Instant Message with [NAME]"; static LLString sTypingStartString = "[NAME]: ..."; +static LLString sSessionStartString = "Starting session with [NAME] please wait."; + +void session_starter_helper(const LLUUID& temp_session_id, + const LLUUID& other_participant_id, + EInstantMessage im_type) +{ + LLMessageSystem *msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_ImprovedInstantMessage); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlockFast(_PREHASH_MessageBlock); + msg->addBOOLFast(_PREHASH_FromGroup, FALSE); + msg->addUUIDFast(_PREHASH_ToAgentID, other_participant_id); + msg->addU8Fast(_PREHASH_Offline, IM_ONLINE); + msg->addU8Fast(_PREHASH_Dialog, im_type); + msg->addUUIDFast(_PREHASH_ID, temp_session_id); + msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary + + std::string name; + gAgent.buildFullname(name); + + msg->addStringFast(_PREHASH_FromAgentName, name); + msg->addStringFast(_PREHASH_Message, LLString::null); + msg->addU32Fast(_PREHASH_ParentEstateID, 0); + msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); + msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); +} + +// Returns true if any messages were sent, false otherwise. +// Is sort of equivalent to "does the server need to do anything?" +bool send_start_session_messages(const LLUUID& temp_session_id, + const LLUUID& other_participant_id, + const LLDynamicArray<LLUUID>& ids, + EInstantMessage dialog) +{ + if ( (dialog == IM_SESSION_911_START) || + (dialog == IM_SESSION_GROUP_START) || + (dialog == IM_SESSION_CONFERENCE_START) ) + { + S32 count = ids.size(); + S32 bucket_size = UUID_BYTES * count; + U8* bucket; + U8* pos; + + session_starter_helper(temp_session_id, + other_participant_id, + dialog); + + switch(dialog) + { + case IM_SESSION_GROUP_START: + case IM_SESSION_911_START: + gMessageSystem->addBinaryDataFast(_PREHASH_BinaryBucket, + EMPTY_BINARY_BUCKET, + EMPTY_BINARY_BUCKET_SIZE); + break; + case IM_SESSION_CONFERENCE_START: + bucket = new U8[bucket_size]; + pos = bucket; + + // *FIX: this could suffer from endian issues + for(S32 i = 0; i < count; ++i) + { + memcpy(pos, &(ids.get(i)), UUID_BYTES); + pos += UUID_BYTES; + } + gMessageSystem->addBinaryDataFast(_PREHASH_BinaryBucket, + bucket, + bucket_size); + delete[] bucket; + + break; + default: + break; + } + gAgent.sendReliableMessage(); + + return true; + } + + return false; +} // Member Functions // -LLFloaterIMPanel::LLFloaterIMPanel(const std::string& name, const LLRect& rect, - const std::string& session_label, - const LLUUID& session_id, - const LLUUID& other_participant_id, - EInstantMessage dialog) : +LLFloaterIMPanel::LLFloaterIMPanel(const std::string& name, + const LLRect& rect, + const std::string& session_label, + const LLUUID& session_id, + const LLUUID& other_participant_id, + EInstantMessage dialog) : + LLFloater(name, rect, session_label), + mInputEditor(NULL), + mHistoryEditor(NULL), + mSessionUUID(session_id), + mOtherParticipantUUID(other_participant_id), + mDialog(dialog), + mTyping(FALSE), + mOtherTyping(FALSE), + mTypingLineStartIndex(0), + mSentTypingState(TRUE), + mFirstKeystrokeTimer(), + mLastKeystrokeTimer(), + mSessionInitialized(FALSE), + mSessionInitRequested(FALSE) +{ + init(session_label); +} + +LLFloaterIMPanel::LLFloaterIMPanel(const std::string& name, + const LLRect& rect, + const std::string& session_label, + const LLUUID& session_id, + const LLUUID& other_participant_id, + const LLDynamicArray<LLUUID>& ids, + EInstantMessage dialog) : LLFloater(name, rect, session_label), mInputEditor(NULL), mHistoryEditor(NULL), - mSessionLabel(session_label), mSessionUUID(session_id), mOtherParticipantUUID(other_participant_id), - mLureID(), mDialog(dialog), mTyping(FALSE), mOtherTyping(FALSE), mTypingLineStartIndex(0), mSentTypingState(TRUE), mFirstKeystrokeTimer(), - mLastKeystrokeTimer() + mLastKeystrokeTimer(), + mSessionInitialized(FALSE), + mSessionInitRequested(FALSE) +{ + init(session_label); + + mSessionInitialTargetIDs = ids; +} + + +void LLFloaterIMPanel::init(const LLString& session_label) { - init(); + gUICtrlFactory->buildFloater(this, + "floater_instant_message.xml", + NULL, + FALSE); + setLabel(session_label); setTitle(session_label); mInputEditor->setMaxTextLength(1023); -} + if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) + { + LLLogChat::loadHistory(session_label, + &chatFromLogFile, + (void *)this); + } -void LLFloaterIMPanel::init() -{ - gUICtrlFactory->buildFloater(this, "floater_instant_message.xml", NULL, FALSE); + if(IM_SESSION_911_START == mDialog) + { + LLTextBox* live_help_text = + LLUICtrlFactory::getTextBoxByName(this, "live_help_dialog"); + addHistoryLine(live_help_text->getText()); + } } @@ -101,6 +232,8 @@ BOOL LLFloaterIMPanel::postBuild() requires("live_help_dialog", WIDGET_TYPE_TEXT_BOX); requires("title_string", WIDGET_TYPE_TEXT_BOX); requires("typing_start_string", WIDGET_TYPE_TEXT_BOX); + requires("session_start_string", WIDGET_TYPE_TEXT_BOX); + requires("teleport_btn", WIDGET_TYPE_BUTTON); if (checkRequirements()) { @@ -118,24 +251,19 @@ BOOL LLFloaterIMPanel::postBuild() LLButton* close_btn = LLUICtrlFactory::getButtonByName(this, "close_btn"); close_btn->setClickedCallback(&LLFloaterIMPanel::onClickClose, this); + LLButton* tp_btn = LLUICtrlFactory::getButtonByName(this, "teleport_btn"); + tp_btn->setClickedCallback(&LLFloaterIMPanel::onTeleport, this); + tp_btn->setVisible(FALSE); + tp_btn->setEnabled(FALSE); + mHistoryEditor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "im_history"); mHistoryEditor->setParseHTML(TRUE); - if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) - { - LLLogChat::loadHistory(mSessionLabel, &chatFromLogFile, (void *)this); - } if (IM_SESSION_GROUP_START == mDialog || IM_SESSION_911_START == mDialog) { profile_btn->setEnabled(FALSE); - if(IM_SESSION_911_START == mDialog) - { - LLTextBox* live_help_text = LLUICtrlFactory::getTextBoxByName(this, "live_help_dialog"); - addHistoryLine(live_help_text->getText()); - } } - LLTextBox* title = LLUICtrlFactory::getTextBoxByName(this, "title_string"); sTitleString = title->getText(); @@ -143,6 +271,11 @@ BOOL LLFloaterIMPanel::postBuild() sTypingStartString = typing_start->getText(); + LLTextBox* session_start = LLUICtrlFactory::getTextBoxByName( + this, + "session_start_string"); + sSessionStartString = session_start->getText(); + return TRUE; } @@ -176,12 +309,14 @@ void LLFloaterIMPanel::draw() BOOL LLFloaterIMPanel::addParticipants(const LLDynamicArray<LLUUID>& ids) { - if(isAddAllowed()) + S32 count = ids.count(); + + if( isAddAllowed() && (count > 0) ) { llinfos << "LLFloaterIMPanel::addParticipants() - adding participants" << llendl; const S32 MAX_AGENTS = 50; - S32 count = ids.count(); if(count > MAX_AGENTS) return FALSE; + LLMessageSystem *msg = gMessageSystem; msg->newMessageFast(_PREHASH_ImprovedInstantMessage); msg->nextBlockFast(_PREHASH_AgentData); @@ -191,7 +326,7 @@ BOOL LLFloaterIMPanel::addParticipants(const LLDynamicArray<LLUUID>& ids) msg->addBOOLFast(_PREHASH_FromGroup, FALSE); msg->addUUIDFast(_PREHASH_ToAgentID, mOtherParticipantUUID); msg->addU8Fast(_PREHASH_Offline, IM_ONLINE); - msg->addU8Fast(_PREHASH_Dialog, mDialog); + msg->addU8Fast(_PREHASH_Dialog, IM_SESSION_ADD); msg->addUUIDFast(_PREHASH_ID, mSessionUUID); msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary std::string name; @@ -201,57 +336,21 @@ BOOL LLFloaterIMPanel::addParticipants(const LLDynamicArray<LLUUID>& ids) msg->addU32Fast(_PREHASH_ParentEstateID, 0); msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); - if (IM_SESSION_GROUP_START == mDialog) - { - // *HACK: binary bucket contains session label - the server - // will actually add agents. - llinfos << "Group IM session name '" << mSessionLabel - << "'" << llendl; - msg->addStringFast(_PREHASH_BinaryBucket, mSessionLabel); - gAgent.sendReliableMessage(); - } - else if (IM_SESSION_911_START == mDialog) - { - // HACK -- we modify the name of the session going out to - // the helpers to help them easily identify "Help" - // sessions in their collection of IM panels. - LLString name; - gAgent.getName(name); - LLString buffer = LLString("HELP ") + name; - llinfos << "LiveHelp IM session '" << buffer << "'." << llendl; - msg->addStringFast(_PREHASH_BinaryBucket, buffer.c_str()); - - // automaticaly open a wormhole when this reliable message gets through - msg->sendReliable( - gAgent.getRegionHost(), - 3, // retries - TRUE, // ping-based - 5.0f, // timeout - send_lure_911, - (void**)&mSessionUUID); - } - else + + // *FIX: this could suffer from endian issues + S32 bucket_size = UUID_BYTES * count; + U8* bucket = new U8[bucket_size]; + U8* pos = bucket; + for(S32 i = 0; i < count; ++i) { - if (mDialog != IM_SESSION_ADD - && mDialog != IM_SESSION_OFFLINE_ADD) - { - llwarns << "LLFloaterIMPanel::addParticipants() - dialog type " << mDialog - << " is not an ADD" << llendl; - } - // *FIX: this could suffer from endian issues - S32 bucket_size = UUID_BYTES * count; - U8* bucket = new U8[bucket_size]; - U8* pos = bucket; - for(S32 i = 0; i < count; ++i) - { - memcpy(pos, &(ids.get(i)), UUID_BYTES); /* Flawfinder: ignore */ - pos += UUID_BYTES; - } - msg->addBinaryDataFast(_PREHASH_BinaryBucket, bucket, bucket_size); - delete[] bucket; - gAgent.sendReliableMessage(); + memcpy(pos, &(ids.get(i)), UUID_BYTES); + pos += UUID_BYTES; } - + msg->addBinaryDataFast(_PREHASH_BinaryBucket, + bucket, + bucket_size); + delete[] bucket; + gAgent.sendReliableMessage(); } else { @@ -260,6 +359,7 @@ BOOL LLFloaterIMPanel::addParticipants(const LLDynamicArray<LLUUID>& ids) // successful add, because everyone that needed to get added // was added. } + return TRUE; } @@ -293,7 +393,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 { LLString histstr = timestring + utf8msg; - LLLogChat::saveHistory(mSessionLabel,histstr); + LLLogChat::saveHistory(getTitle(),histstr); } } @@ -455,11 +555,8 @@ BOOL LLFloaterIMPanel::dropCategory(LLInventoryCategory* category, BOOL drop) BOOL LLFloaterIMPanel::isAddAllowed() const { - return ((IM_SESSION_ADD == mDialog) - || (IM_SESSION_OFFLINE_ADD == mDialog) - || (IM_SESSION_GROUP_START == mDialog) - || (IM_SESSION_911_START == mDialog) - || (IM_SESSION_CARDLESS_START == mDialog)); + return ((IM_SESSION_CONFERENCE_START == mDialog) + || (IM_SESSION_ADD) ); } @@ -493,72 +590,36 @@ void LLFloaterIMPanel::onClickClose( void* userdata ) } } -void LLFloaterIMPanel::addTeleportButton(const LLUUID& lure_id) +void LLFloaterIMPanel::addTeleportButton() { - LLButton* btn = LLViewerUICtrlFactory::getButtonByName(this, "Teleport Btn"); - if (!btn) - { - S32 BTN_VPAD = 2; - S32 BTN_HPAD = 2; + LLButton* btn = + LLViewerUICtrlFactory::getButtonByName(this, "teleport_btn"); - const char* teleport_label = "Teleport"; - - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); - S32 p_btn_width = 75; - S32 c_btn_width = 60; - S32 t_btn_width = 75; - - // adjust the size of the editor to make room for the new button + if ( !btn->getEnabled() ) + { + //it's required, don't need to check for null here + // adjust the size of the editor to make room for the button LLRect rect = mInputEditor->getRect(); - S32 editor_right = rect.mRight - t_btn_width; + S32 editor_right = rect.mRight - btn->getRect().getWidth(); rect.mRight = editor_right; mInputEditor->reshape(rect.getWidth(), rect.getHeight(), FALSE); mInputEditor->setRect(rect); - - const S32 IMPANEL_PAD = 1 + LLPANEL_BORDER_WIDTH; - const S32 IMPANEL_INPUT_HEIGHT = 20; - - rect.setLeftTopAndSize( - mRect.getWidth() - IMPANEL_PAD - p_btn_width - c_btn_width - t_btn_width - BTN_HPAD - RESIZE_HANDLE_WIDTH, - IMPANEL_INPUT_HEIGHT + IMPANEL_PAD - BTN_VPAD, - t_btn_width, - BTN_HEIGHT); - - btn = new LLButton( - "Teleport Btn", rect, - "","", "", - &LLFloaterIMPanel::onTeleport, this, - font, teleport_label, teleport_label ); - - btn->setFollowsBottom(); - btn->setFollowsRight(); - addChild( btn ); - } - btn->setEnabled(TRUE); - mLureID = lure_id; -} -void LLFloaterIMPanel::removeTeleportButton() -{ - // TODO -- purge the button - LLButton* btn = LLViewerUICtrlFactory::getButtonByName(this, "Teleport Btn"); - if (btn) - { - btn->setEnabled(FALSE); + btn->setVisible(TRUE); + btn->setEnabled(TRUE); } } -// static +// static void LLFloaterIMPanel::onTeleport(void* userdata) { LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; if(self) { - send_simple_im(self->mLureID, - "", - IM_LURE_911, - LLUUID::null); - self->removeTeleportButton(); + send_simple_im(self->mSessionUUID, //to + "", + IM_TELEPORT_911, + self->mSessionUUID);//session } } @@ -618,6 +679,44 @@ void LLFloaterIMPanel::onClose(bool app_quitting) destroy(); } +void deliver_message(const std::string& utf8_text, + const LLUUID& im_session_id, + const LLUUID& other_participant_id, + EInstantMessage dialog) +{ + std::string name; + gAgent.buildFullname(name); + + const LLRelationship* info = NULL; + info = LLAvatarTracker::instance().getBuddyInfo(other_participant_id); + U8 offline = (!info || info->isOnline()) ? IM_ONLINE : IM_OFFLINE; + + // default to IM_SESSION_SEND unless it's nothing special - in + // which case it's probably an IM to everyone. + U8 new_dialog = dialog; + + if ( dialog == IM_SESSION_911_START ) + { + new_dialog = IM_SESSION_911_SEND; + } + else if ( dialog != IM_NOTHING_SPECIAL ) + { + new_dialog = IM_SESSION_SEND; + } + + pack_instant_message( + gMessageSystem, + gAgent.getID(), + FALSE, + gAgent.getSessionID(), + other_participant_id, + name.c_str(), + utf8_text.c_str(), + offline, + (EInstantMessage)new_dialog, + im_session_id); + gAgent.sendReliableMessage(); +} void LLFloaterIMPanel::sendMsg() { @@ -635,50 +734,82 @@ void LLFloaterIMPanel::sendMsg() // Truncate and convert to UTF8 for transport std::string utf8_text = wstring_to_utf8str(text); utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1); - std::string name; - gAgent.buildFullname(name); - - const LLRelationship* info = NULL; - info = LLAvatarTracker::instance().getBuddyInfo(mOtherParticipantUUID); - U8 offline = (!info || info->isOnline()) ? IM_ONLINE : IM_OFFLINE; - - // default to IM_SESSION_SEND unless it's nothing special - in - // which case it's probably an IM to everyone. - U8 dialog = (mDialog == IM_NOTHING_SPECIAL) - ? (U8)IM_NOTHING_SPECIAL : (U8)IM_SESSION_SEND; - pack_instant_message( - gMessageSystem, - gAgent.getID(), - FALSE, - gAgent.getSessionID(), - mOtherParticipantUUID, - name.c_str(), - utf8_text.c_str(), - offline, - (EInstantMessage)dialog, - mSessionUUID); - gAgent.sendReliableMessage(); - // local echo - if((mDialog == IM_NOTHING_SPECIAL) && (mOtherParticipantUUID.notNull())) + if ( !mSessionInitialized ) { - std::string history_echo; - gAgent.buildFullname(history_echo); - - // Look for IRC-style emotes here. - char tmpstr[5]; /* Flawfinder: ignore */ - strncpy(tmpstr,utf8_text.substr(0,4).c_str(), sizeof(tmpstr) -1); /* Flawfinder: ignore */ - tmpstr[sizeof(tmpstr) -1] = '\0'; - if (!strncmp(tmpstr, "/me ", 4) || !strncmp(tmpstr, "/me'", 4)) + //we send requests (if we need to) to initialize our session + if ( !mSessionInitRequested ) { - utf8_text.replace(0,3,""); + mSessionInitRequested = TRUE; + if ( !send_start_session_messages(mSessionUUID, + mOtherParticipantUUID, + mSessionInitialTargetIDs, + mDialog) ) + { + //we don't need to need to wait for any responses + //so we don't need to disable + mSessionInitialized = TRUE; + } + else + { + //queue up the message to send once the session is + //initialized + mQueuedMsgsForInit.append(utf8_text); + + //locally echo a little "starting session" message + LLUIString session_start = sSessionStartString; + + session_start.setArg("[NAME]", getTitle()); + mSessionStartMsgPos = + mHistoryEditor->getText().length(); + + bool log_to_file = false; + addHistoryLine(session_start, + LLColor4::grey, + log_to_file); + + } } else { - history_echo += ": "; + //queue up the message to send once the session is + //initialized + mQueuedMsgsForInit.append(utf8_text); + } + } + + if ( mSessionInitialized ) + { + deliver_message(utf8_text, + mSessionUUID, + mOtherParticipantUUID, + mDialog); + + // local echo + if((mDialog == IM_NOTHING_SPECIAL) && + (mOtherParticipantUUID.notNull())) + { + std::string history_echo; + gAgent.buildFullname(history_echo); + + // Look for IRC-style emotes here. + char tmpstr[5]; /* Flawfinder: ignore */ + strncpy(tmpstr, + utf8_text.substr(0,4).c_str(), + sizeof(tmpstr) -1); /* Flawfinder: ignore */ + tmpstr[sizeof(tmpstr) -1] = '\0'; + if (!strncmp(tmpstr, "/me ", 4) || + !strncmp(tmpstr, "/me'", 4)) + { + utf8_text.replace(0,3,""); + } + else + { + history_echo += ": "; + } + history_echo += utf8_text; + addHistoryLine(history_echo); } - history_echo += utf8_text; - addHistoryLine(history_echo); } gViewerStats->incStat(LLViewerStats::ST_IM_COUNT); @@ -691,6 +822,31 @@ void LLFloaterIMPanel::sendMsg() mSentTypingState = TRUE; } +void LLFloaterIMPanel::sessionInitReplyReceived(const LLUUID& session_id) +{ + mSessionUUID = session_id; + mSessionInitialized = TRUE; + + //we assume the history editor hasn't moved at all since + //we added the starting session message + //so, we count how many characters to remove + S32 chars_to_remove = mHistoryEditor->getText().length() - + mSessionStartMsgPos; + mHistoryEditor->removeTextFromEnd(chars_to_remove); + + //and now, send the queued msg + LLSD::array_iterator iter; + for ( iter = mQueuedMsgsForInit.beginArray(); + iter != mQueuedMsgsForInit.endArray(); + ++iter) + { + deliver_message(iter->asString(), + mSessionUUID, + mOtherParticipantUUID, + mDialog); + } +} + void LLFloaterIMPanel::setTyping(BOOL typing) { diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 21a0cbcd41..45dda8ec79 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -27,10 +27,20 @@ public: // the default. For example, if you open a session though a // calling card, a new session id will be generated, but the // target_id will be the agent referenced by the calling card. - LLFloaterIMPanel(const std::string& name, const LLRect& rect, - const std::string& session_label, - const LLUUID& session_id, const LLUUID& target_id, - EInstantMessage dialog); + LLFloaterIMPanel(const std::string& name, + const LLRect& rect, + const std::string& session_label, + const LLUUID& session_id, + const LLUUID& target_id, + EInstantMessage dialog); + LLFloaterIMPanel(const std::string& name, + const LLRect& rect, + const std::string& session_label, + const LLUUID& session_id, + const LLUUID& target_id, + const LLDynamicArray<LLUUID>& ids, + EInstantMessage dialog); + /*virtual*/ BOOL postBuild(); @@ -66,14 +76,14 @@ public: static void onClickProfile( void* userdata ); // Profile button pressed static void onClickClose( void* userdata ); - //const LLUUID& getItemUUID() const { return mItemUUID; } const LLUUID& getSessionID() const { return mSessionUUID; } const LLUUID& getOtherParticipantID() const { return mOtherParticipantUUID; } // HACK -- for enabling a teleport button for helpers static void onTeleport(void* userdata); - void addTeleportButton(const LLUUID& lure_id); - void removeTeleportButton(); + void addTeleportButton(); + + void sessionInitReplyReceived(const LLUUID& im_session_id); // Handle other participant in the session typing. void processIMTyping(const LLIMInfo* im_info, BOOL typing); @@ -81,7 +91,7 @@ public: private: // called by constructors - void init(); + void init(const LLString& session_label); // Called by UI methods. void sendMsg(); @@ -110,7 +120,6 @@ private: private: LLLineEditor* mInputEditor; LLViewerTextEditor* mHistoryEditor; - std::string mSessionLabel; // The value of the mSessionUUID depends on how the IM session was started: // one-on-one ==> random id @@ -119,15 +128,17 @@ private: // 911 ==> Gaurdian_Angel_Group_ID ^ gAgent.getID() LLUUID mSessionUUID; + BOOL mSessionInitRequested; + BOOL mSessionInitialized; + LLSD mQueuedMsgsForInit; + // The value mOtherParticipantUUID depends on how the IM session was started: // one-on-one = recipient's id // group ==> group_id // inventory folder ==> first target id in list // 911 ==> sender LLUUID mOtherParticipantUUID; - - // the lure ID for help IM sessions - LLUUID mLureID; + LLDynamicArray<LLUUID> mSessionInitialTargetIDs; EInstantMessage mDialog; @@ -139,6 +150,8 @@ private: // Where does the "User is typing..." line start? S32 mTypingLineStartIndex; + //Where does the "Starting session..." line start? + S32 mSessionStartMsgPos; BOOL mSentTypingState; @@ -149,6 +162,8 @@ private: // Timer to detect when user has stopped typing. LLFrameTimer mLastKeystrokeTimer; + + void disableWhileSessionStarting(); }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c093faa1ca..553c6ec6c3 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -23,6 +23,7 @@ #include "llviewerwindow.h" #include "llresmgr.h" #include "llfloaternewim.h" +#include "llhttpnode.h" #include "llimpanel.h" #include "llresizebar.h" #include "lltabcontainer.h" @@ -35,7 +36,6 @@ #include "llcallingcard.h" #include "lltoolbar.h" -const EInstantMessage EVERYONE_DIALOG = IM_NOTHING_SPECIAL; const EInstantMessage GROUP_DIALOG = IM_SESSION_GROUP_START; const EInstantMessage DEFAULT_DIALOG = IM_NOTHING_SPECIAL; @@ -50,6 +50,9 @@ LLIMView* gIMView = NULL; static LLString sOnlyUserMessage; static LLString sOfflineMessage; +static std::map<std::string,LLString> sEventStringsMap; +static std::map<std::string,LLString> sErrorStringsMap; +static std::map<std::string,LLString> sForceCloseSessionMap; // // Helper Functions // @@ -63,7 +66,8 @@ static BOOL group_dictionary_sort( LLGroupData* a, LLGroupData* b ) // the other_participant_id is either an agent_id, a group_id, or an inventory // folder item_id (collection of calling cards) -static LLUUID compute_session_id(EInstantMessage dialog, const LLUUID& other_participant_id) +static LLUUID compute_session_id(EInstantMessage dialog, + const LLUUID& other_participant_id) { LLUUID session_id; if (IM_SESSION_GROUP_START == dialog) @@ -71,6 +75,10 @@ static LLUUID compute_session_id(EInstantMessage dialog, const LLUUID& other_par // slam group session_id to the group_id (other_participant_id) session_id = other_participant_id; } + else if (IM_SESSION_CONFERENCE_START == dialog) + { + session_id.generate(); + } else { LLUUID agent_id = gAgent.getID(); @@ -102,11 +110,34 @@ BOOL LLFloaterIM::postBuild() { requires("only_user_message", WIDGET_TYPE_TEXT_BOX); requires("offline_message", WIDGET_TYPE_TEXT_BOX); + requires("generic_request_error", WIDGET_TYPE_TEXT_BOX); + requires("insufficient_perms_error", WIDGET_TYPE_TEXT_BOX); + requires("generic_request_error", WIDGET_TYPE_TEXT_BOX); + requires("add_session_event", WIDGET_TYPE_TEXT_BOX); + requires("message_session_event", WIDGET_TYPE_TEXT_BOX); + requires("removed_from_group", WIDGET_TYPE_TEXT_BOX); if (checkRequirements()) { sOnlyUserMessage = childGetText("only_user_message"); sOfflineMessage = childGetText("offline_message"); + + sErrorStringsMap["generic"] = + childGetText("generic_request_error"); + sErrorStringsMap["unverified"] = + childGetText("insufficient_perms_error"); + sErrorStringsMap["no_user_911"] = + childGetText("user_no_help"); + + sEventStringsMap["add"] = childGetText("add_session_event");; + sEventStringsMap["message"] = + childGetText("message_session_event");; + sEventStringsMap["teleport"] = + childGetText("teleport_session_event");; + + sForceCloseSessionMap["removed"] = + childGetText("removed_from_group"); + return TRUE; } return FALSE; @@ -190,16 +221,12 @@ protected: // static EInstantMessage LLIMView::defaultIMTypeForAgent(const LLUUID& agent_id) { - EInstantMessage type = IM_SESSION_CARDLESS_START; + EInstantMessage type = IM_NOTHING_SPECIAL; if(is_agent_friend(agent_id)) { if(LLAvatarTracker::instance().isBuddyOnline(agent_id)) { - type = IM_SESSION_ADD; - } - else - { - type = IM_SESSION_OFFLINE_ADD; + type = IM_SESSION_CONFERENCE_START; } } return type; @@ -327,11 +354,21 @@ void LLIMView::addMessage( } else { + //if we have recently requsted to be dropped from a session + //but are still receiving messages from the session, don't make + //a new floater +// if ( mSessionsDropRequested.has(session_id.asString()) ) +// { +// return ; +// } + const char* name = from; if(session_name && (strlen(session_name)>1)) { name = session_name; } + + floater = createFloater(new_session_id, other_participant_id, name, dialog, FALSE); // When we get a new IM, and if you are a god, display a bit @@ -407,18 +444,25 @@ BOOL LLIMView::isIMSessionOpen(const LLUUID& uuid) // exists, it is brought forward. Specifying id = NULL results in an // im session to everyone. Returns the uuid of the session. LLUUID LLIMView::addSession(const std::string& name, - EInstantMessage dialog, - const LLUUID& other_participant_id) + EInstantMessage dialog, + const LLUUID& other_participant_id) { LLUUID session_id = compute_session_id(dialog, other_participant_id); + LLFloaterIMPanel* floater = findFloaterBySession(session_id); if(!floater) { - floater = createFloater(session_id, other_participant_id, name, dialog, TRUE); LLDynamicArray<LLUUID> ids; ids.put(other_participant_id); + + floater = createFloater(session_id, + other_participant_id, + name, + ids, + dialog, + TRUE); + noteOfflineUsers(floater, ids); - floater->addParticipants(ids); mTalkFloater->showFloater(floater); } else @@ -433,30 +477,34 @@ LLUUID LLIMView::addSession(const std::string& name, // Adds a session using the given session_id. If the session already exists // the dialog type is assumed correct. Returns the uuid of the session. LLUUID LLIMView::addSession(const std::string& name, - EInstantMessage dialog, - const LLUUID& session_id, - const LLDynamicArray<LLUUID>& ids) + EInstantMessage dialog, + const LLUUID& other_participant_id, + const LLDynamicArray<LLUUID>& ids) { if (0 == ids.getLength()) { return LLUUID::null; } - LLUUID other_participant_id = ids[0]; - LLUUID new_session_id = session_id; - if (new_session_id.isNull()) - { - new_session_id = compute_session_id(dialog, other_participant_id); - } + LLUUID session_id = compute_session_id(dialog, + other_participant_id); - LLFloaterIMPanel* floater = findFloaterBySession(new_session_id); + LLFloaterIMPanel* floater = findFloaterBySession(session_id); if(!floater) { - // On creation, use the first element of ids as the "other_participant_id" - floater = createFloater(new_session_id, other_participant_id, name, dialog, TRUE); + // On creation, use the first element of ids as the + // "other_participant_id" + floater = createFloater(session_id, + other_participant_id, + name, + ids, + dialog, + TRUE); + + if ( !floater ) return LLUUID::null; + noteOfflineUsers(floater, ids); } - floater->addParticipants(ids); mTalkFloater->showFloater(floater); //mTabContainer->selectTabPanel(panel); floater->setInputFocus(TRUE); @@ -474,6 +522,11 @@ void LLIMView::removeSession(const LLUUID& session_id) mTalkFloater->removeFloater(floater); //mTabContainer->removeTabPanel(floater); } + +// if ( session_id.notNull() ) +// { +// mSessionsDropRequested[session_id.asString()] = LLSD(); +// } } void LLIMView::refresh() @@ -499,8 +552,7 @@ void LLIMView::refresh() group; group = group_list.getNextData()) { - mNewIMFloater->addTarget(group->mID, group->mName, - (void*)(&GROUP_DIALOG), TRUE, FALSE); + mNewIMFloater->addGroup(group->mID, (void*)(&GROUP_DIALOG), TRUE, FALSE); } // build a set of buddies in the current buddy list. @@ -520,13 +572,6 @@ void LLIMView::refresh() { mNewIMFloater->addAgent((*it).second, (void*)(&DEFAULT_DIALOG), FALSE); } - - if(gAgent.isGodlike()) - { - // XUI:translate - mNewIMFloater->addTarget(LLUUID::null, "All Residents, All Grids", - (void*)(&EVERYONE_DIALOG), TRUE, FALSE); - } mNewIMFloater->setScrollPos( old_scroll_pos ); } @@ -600,12 +645,17 @@ void LLIMView::disconnectAllSessions() std::set<LLViewHandle>::iterator handle_it; for(handle_it = mFloaters.begin(); handle_it != mFloaters.end(); - ++handle_it) + ) { floater = (LLFloaterIMPanel*)LLFloater::getFloaterByHandle(*handle_it); + + // MUST do this BEFORE calling floater->onClose() because that may remove the item from the set, causing the subsequent increment to crash. + ++handle_it; + if (floater) { floater->setEnabled(FALSE); + floater->onClose(TRUE); } } } @@ -643,16 +693,45 @@ BOOL LLIMView::hasSession(const LLUUID& session_id) // consistency. Returns the pointer, caller (the class instance since // it is a private method) is not responsible for deleting the // pointer. Add the floater to this but do not select it. -LLFloaterIMPanel* LLIMView::createFloater(const LLUUID& session_id, - const LLUUID& other_participant_id, - const std::string& session_label, - EInstantMessage dialog, - BOOL user_initiated) +LLFloaterIMPanel* LLIMView::createFloater( + const LLUUID& session_id, + const LLUUID& other_participant_id, + const std::string& session_label, + EInstantMessage dialog, + BOOL user_initiated) +{ + if (session_id.isNull()) + { + llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; + } + + llinfos << "LLIMView::createFloater: from " << other_participant_id + << " in session " << session_id << llendl; + LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, + LLRect(), + session_label, + session_id, + other_participant_id, + dialog); + LLTabContainerCommon::eInsertionPoint i_pt = user_initiated ? LLTabContainerCommon::RIGHT_OF_CURRENT : LLTabContainerCommon::END; + mTalkFloater->addFloater(floater, FALSE, i_pt); + mFloaters.insert(floater->getHandle()); + return floater; +} + +LLFloaterIMPanel* LLIMView::createFloater( + const LLUUID& session_id, + const LLUUID& other_participant_id, + const std::string& session_label, + const LLDynamicArray<LLUUID>& ids, + EInstantMessage dialog, + BOOL user_initiated) { if (session_id.isNull()) { llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; } + llinfos << "LLIMView::createFloater: from " << other_participant_id << " in session " << session_id << llendl; LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, @@ -660,6 +739,7 @@ LLFloaterIMPanel* LLIMView::createFloater(const LLUUID& session_id, session_label, session_id, other_participant_id, + ids, dialog); LLTabContainerCommon::eInsertionPoint i_pt = user_initiated ? LLTabContainerCommon::RIGHT_OF_CURRENT : LLTabContainerCommon::END; mTalkFloater->addFloater(floater, FALSE, i_pt); @@ -715,3 +795,193 @@ void LLIMView::processIMTypingCore(const LLIMInfo* im_info, BOOL typing) floater->processIMTyping(im_info, typing); } } + +void LLIMView::updateFloaterSessionID(const LLUUID& old_session_id, + const LLUUID& new_session_id) +{ + LLFloaterIMPanel* floater = findFloaterBySession(old_session_id); + if (floater) + { + floater->sessionInitReplyReceived(new_session_id); + } +} + +void LLIMView::onDropRequestReplyReceived(const LLUUID& session_id) +{ + mSessionsDropRequested.erase(session_id.asString()); +} + +void onConfirmForceCloseError(S32 option, void* data) +{ + //only 1 option really + LLFloaterIMPanel* floater = ((LLFloaterIMPanel*) data); + + if ( floater ) floater->onClose(FALSE); +} + +class LLViewerIMSessionStartReply : public LLHTTPNode +{ +public: + virtual void describe(Description& desc) const + { + desc.shortInfo("Used for receiving a reply to a request to initialize an IM session"); + desc.postAPI(); + desc.input( + "{\"client_session_id\": UUID, \"session_id\": UUID, \"success\" boolean, \"reason\": string"); + desc.source(__FILE__, __LINE__); + } + + virtual void post(ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + LLSD body; + LLUUID temp_session_id; + LLUUID session_id; + bool success; + + body = input["body"]; + success = body["success"].asBoolean(); + temp_session_id = body["temp_session_id"].asUUID(); + + if ( success ) + { + session_id = body["session_id"].asUUID(); + gIMView->updateFloaterSessionID(temp_session_id, + session_id); + } + else + { + //throw an error dialog and close the temp session's + //floater + LLFloaterIMPanel* floater = + gIMView->findFloaterBySession(temp_session_id); + if (floater) + { + LLString::format_map_t args; + args["[REASON]"] = + sErrorStringsMap[body["error"].asString()]; + args["[RECIPIENT]"] = floater->getTitle(); + + gViewerWindow->alertXml("IMSessionStartError", + args, + onConfirmForceCloseError, + floater); + + } + } + } +}; + +class LLViewerIMSessionEventReply : public LLHTTPNode +{ +public: + virtual void describe(Description& desc) const + { + desc.shortInfo("Used for receiving a reply to a IM session event"); + desc.postAPI(); + desc.input( + "{\"event\": string, \"reason\": string, \"success\": boolean, \"session_id\": UUID"); + desc.source(__FILE__, __LINE__); + } + + virtual void post(ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + LLUUID session_id; + bool success; + + LLSD body = input["body"]; + success = body["success"].asBoolean(); + session_id = body["session_id"].asUUID(); + + if ( !success ) + { + //throw an error dialog + LLFloaterIMPanel* floater = + gIMView->findFloaterBySession(session_id); + if (floater) + { + LLString::format_map_t args; + args["[REASON]"] = + sErrorStringsMap[body["error"].asString()]; + args["[EVENT]"] = + sEventStringsMap[body["event"].asString()]; + args["[RECIPIENT]"] = floater->getTitle(); + + gViewerWindow->alertXml("IMSessionEventError", + args); + } + } + } +}; + +class LLViewerForceCloseIMSession: public LLHTTPNode +{ +public: + virtual void post(ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + LLUUID session_id; + LLString reason; + + session_id = input["body"]["session_id"].asUUID(); + reason = input["body"]["reason"].asString(); + + LLFloaterIMPanel* floater = + gIMView ->findFloaterBySession(session_id); + + if ( floater ) + { + LLString::format_map_t args; + + args["[NAME]"] = floater->getTitle(); + args["[REASON]"] = sForceCloseSessionMap[reason]; + + gViewerWindow->alertXml("ForceCloseIMSession", + args, + onConfirmForceCloseError, + floater); + } + } +}; + +class LLViewerIMSessionDropReply : public LLHTTPNode +{ +public: + virtual void post(ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + LLUUID session_id; + bool success; + + success = input["body"]["success"].asBoolean(); + session_id = input["body"]["session_id"].asUUID(); + + if ( !success ) + { + //throw an error alert? + } + + gIMView->onDropRequestReplyReceived(session_id); + } +}; + +LLHTTPRegistration<LLViewerIMSessionStartReply> + gHTTPRegistrationMessageImsessionstartreply( + "/message/IMSessionStartReply"); + +LLHTTPRegistration<LLViewerIMSessionEventReply> + gHTTPRegistrationMessageImsessioneventreply( + "/message/IMSessionEventReply"); + +LLHTTPRegistration<LLViewerForceCloseIMSession> + gHTTPRegistrationMessageForceCloseImSession( + "/message/ForceCloseIMSession"); + +LLHTTPRegistration<LLViewerIMSessionDropReply> + gHTTPRegistrationMessageImSessionDropReply( + "/message/IMSessionDropReply"); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 8732484e0e..aac6fd63ce 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -55,11 +55,11 @@ public: EInstantMessage dialog, const LLUUID& other_participant_id); - // Adds a session using the given session_id. If the session already exists + // Adds a session using a specific group of starting agents // the dialog type is assumed correct. Returns the uuid of the session. LLUUID addSession(const std::string& name, EInstantMessage dialog, - const LLUUID& session_id, + const LLUUID& other_participant_id, const LLDynamicArray<LLUUID>& ids); // This removes the panel referenced by the uuid, and then @@ -67,6 +67,12 @@ public: // deleted. void removeSession(const LLUUID& session_id); + //Updates a given session's session IDs. Does not open, + //create or do anything new. If the old session doesn't + //exist, then nothing happens. + void updateFloaterSessionID(const LLUUID& old_session_id, + const LLUUID& new_session_id); + void processIMTypingStart(const LLIMInfo* im_info); void processIMTypingStop(const LLIMInfo* im_info); @@ -105,13 +111,25 @@ public: // is no matching panel. LLFloaterIMPanel* findFloaterBySession(const LLUUID& session_id); + void onDropRequestReplyReceived(const LLUUID& session_id); + private: // create a panel and update internal representation for // consistency. Returns the pointer, caller (the class instance // since it is a private method) is not responsible for deleting // the pointer. - LLFloaterIMPanel* createFloater(const LLUUID& session_id, const LLUUID& target_id, - const std::string& name, EInstantMessage dialog, BOOL user_initiated = FALSE); + LLFloaterIMPanel* createFloater(const LLUUID& session_id, + const LLUUID& target_id, + const std::string& name, + EInstantMessage dialog, + BOOL user_initiated = FALSE); + + LLFloaterIMPanel* createFloater(const LLUUID& session_id, + const LLUUID& target_id, + const std::string& name, + const LLDynamicArray<LLUUID>& ids, + EInstantMessage dialog, + BOOL user_initiated = FALSE); // This simple method just iterates through all of the ids, and // prints a simple message if they are not online. Used to help @@ -131,6 +149,8 @@ private: // An IM has been received that you haven't seen yet. BOOL mIMReceived; + + LLSD mSessionsDropRequested; }; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0338e7f02a..f90fe340b4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1724,7 +1724,7 @@ void LLFolderBridge::folderOptionsMenu() if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) { mItems.push_back("Calling Card Separator"); - mItems.push_back("IM Contacts In Folder"); + mItems.push_back("Conference Chat Folder"); mItems.push_back("IM All Contacts In Folder"); } @@ -2043,58 +2043,6 @@ void LLFolderBridge::createWearable(LLUUID parent_id, EWearableType type) LLPointer<LLInventoryCallback>(NULL)); } -void LLFolderBridge::beginIMSession(BOOL only_online) -{ - LLInventoryModel* model = mInventoryPanel->getModel(); - if(!model) return; - LLViewerInventoryCategory* cat = getCategory(); - if(!cat) return; - LLUniqueBuddyCollector is_buddy; - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - model->collectDescendentsIf(mUUID, - cat_array, - item_array, - LLInventoryModel::EXCLUDE_TRASH, - is_buddy); - S32 count = item_array.count(); - if(count > 0) - { - // create the session - gIMView->setFloaterOpen(TRUE); - LLDynamicArray<LLUUID> members; - //members.put(gAgent.getID()); - S32 i; - EInstantMessage type = IM_SESSION_ADD; - if(only_online) - { - LLAvatarTracker& at = LLAvatarTracker::instance(); - LLUUID id; - for(i = 0; i < count; ++i) - { - id = item_array.get(i)->getCreatorUUID(); - if(at.isBuddyOnline(id)) - { - members.put(id); - } - } - } - else - { - type = IM_SESSION_OFFLINE_ADD; - for(i = 0; i < count; ++i) - { - members.put(item_array.get(i)->getCreatorUUID()); - } - } - // the session_id is always the item_id of the inventory folder - gIMView->addSession(cat->getName(), - type, - mUUID, - members); - } -} - void LLFolderBridge::modifyOutfit(BOOL append) { LLInventoryModel* model = mInventoryPanel->getModel(); @@ -2689,11 +2637,13 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back("Send Instant Message"); items.push_back("Offer Teleport..."); + items.push_back("Conference Chat"); if (!good_card) { disabled_items.push_back("Send Instant Message"); disabled_items.push_back("Offer Teleport..."); + disabled_items.push_back("Conference Chat"); } } hideContextEntries(menu, items, disabled_items); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index ddfc4fe791..d91ca7fc75 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -296,7 +296,6 @@ protected: BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& typeToCheck); - void beginIMSession(BOOL only_online); void modifyOutfit(BOOL append); public: static LLFolderBridge* sSelf; diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b834845107..edc4ba0ca6 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1823,7 +1823,7 @@ void LLInventoryModel::buildParentChildMap() msg->addUUIDFast(_PREHASH_ItemID, (*it)); msg->addUUIDFast(_PREHASH_FolderID, lnf); msg->addString("NewName", NULL); - if(msg->mCurrentSendTotal >= MTUBYTES) + if(msg->isSendFull(NULL)) { start_new_message = TRUE; gAgent.sendReliableMessage(); @@ -3182,7 +3182,7 @@ void LLInventoryFetchObserver::fetchItems( msg->nextBlockFast(_PREHASH_InventoryData); msg->addUUIDFast(_PREHASH_OwnerID, owner_id); msg->addUUIDFast(_PREHASH_ItemID, (*it)); - if(msg->getCurrentSendTotal() >= MTUBYTES) + if(msg->isSendFull(NULL)) { start_new_message = TRUE; gAgent.sendReliableMessage(); diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 6aca7abc11..7ba0ccad3a 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -36,7 +36,7 @@ #include "llagent.h" #include "llfloatermute.h" -#include "llviewermessage.h" // for gGenericDispatcher +#include "llviewergenericmessage.h" // for gGenericDispatcher #include "llviewerwindow.h" #include "viewer.h" #include "llworld.h" //for particle system banning diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index d8c2987470..bc451ecfc0 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -175,20 +175,28 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - LLString fullname; - if (gCacheName->getName(item->getUUID(), first, last)) - { - fullname.assign(first); - fullname.append(1, ' '); - fullname.append(last); - } - else // didn't work as a resident name, try looking up as a group + // use supplied name by default + LLString fullname = value["name"].asString(); + if (value["target"].asString() == "GROUP") { char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ gCacheName->getGroupName(item->getUUID(), group_name); // fullname will be "nobody" if group not found fullname = group_name; } + else if (value["target"].asString() == "SPECIAL") + { + // just use supplied name + } + else // normal resident + { + if (gCacheName->getName(item->getUUID(), first, last)) + { + fullname.assign(first); + fullname.append(1, ' '); + fullname.append(last); + } + } LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); ((LLScrollListText*)cell)->setText( fullname ); @@ -429,3 +437,4 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto return name_list; } + diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 1b0c731ea9..383d2846c0 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -30,7 +30,6 @@ #include "llfloatergroupinfo.h" #include "llfloaterworldmap.h" #include "llfloatermute.h" -#include "llfloaterrate.h" #include "llfloateravatarinfo.h" #include "lliconctrl.h" #include "llinventoryview.h" @@ -48,7 +47,7 @@ #include "lluiconstants.h" #include "llvoavatar.h" #include "llviewermenu.h" // *FIX: for is_agent_friend() -#include "llviewermessage.h" // send_generic_message +#include "llviewergenericmessage.h" // send_generic_message #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewborder.h" @@ -258,14 +257,13 @@ void LLPanelAvatarTab::draw() } } -void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const char* type) +void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const char* method) { if (!mDataRequested) { std::vector<std::string> strings; strings.push_back( mPanelAvatar->getAvatarID().asString() ); - strings.push_back( type ); - send_generic_message("avatarprofilerequest", strings); + send_generic_message(method, strings); mDataRequested = true; } } @@ -449,7 +447,7 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) childSetAction("Show on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); - //childSetAction("Rate...", LLPanelAvatar::onClickRate, getPanelAvatar()); + childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar()); childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar()); childSetAction("Mute", LLPanelAvatar::onClickMute, getPanelAvatar() ); @@ -807,7 +805,7 @@ LLPanelAvatarNotes::LLPanelAvatarNotes(const std::string& name, const LLRect& re void LLPanelAvatarNotes::refresh() { - sendAvatarProfileRequestIfNeeded("notes"); + sendAvatarProfileRequestIfNeeded("avatarnotesrequest"); } void LLPanelAvatarNotes::clearControls() @@ -851,7 +849,7 @@ void LLPanelAvatarClassified::refresh() childSetEnabled("Delete...",self && allow_delete); childSetVisible("classified tab",!show_help); - sendAvatarProfileRequestIfNeeded("classifieds"); + sendAvatarProfileRequestIfNeeded("avatarclassifiedsrequest"); } @@ -1052,7 +1050,7 @@ void LLPanelAvatarPicks::refresh() childSetEnabled("New...",self && allow_new); childSetEnabled("Delete...",self && allow_delete); - sendAvatarProfileRequestIfNeeded("picks"); + sendAvatarProfileRequestIfNeeded("avatarpicksrequest"); } @@ -1083,6 +1081,9 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) // number of new panels. deletePickPanels(); + // The database needs to know for which user to look up picks. + LLUUID avatar_id = getPanelAvatar()->getAvatarID(); + block_count = msg->getNumberOfBlocks("Data"); for (block = 0; block < block_count; block++) { @@ -1091,7 +1092,7 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) panel_pick = new LLPanelPick(FALSE); - panel_pick->setPickID(pick_id); + panel_pick->setPickID(pick_id, avatar_id); // This will request data from the server when the pick is first // drawn. @@ -1170,23 +1171,24 @@ void LLPanelAvatarPicks::callbackDelete(S32 option, void* data) if(gAgent.isGodlike()) { msg->newMessage("PickGodDelete"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("Data"); + msg->addUUID("PickID", panel_pick->getPickID()); + // *HACK: We need to send the pick's creator id to accomplish + // the delete, and we don't use the query id for anything. JC + msg->addUUID( "QueryID", panel_pick->getPickCreatorID() ); } else { msg->newMessage("PickDelete"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("Data"); + msg->addUUID("PickID", panel_pick->getPickID()); } - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("Data"); - msg->addUUID("PickID", panel_pick->getPickID()); - - //God delete receiving end expects a query ID but we dont need it, so send a null. - //This is to resolve SL-24170 God Picks Delete results in crash. - if(gAgent.isGodlike()) - msg->addUUID( "QueryID", LLUUID::null ); - - gAgent.sendReliableMessage(); if(tabs) @@ -1219,8 +1221,7 @@ LLPanelAvatar::LLPanelAvatar( mAvatarID( LLUUID::null ), // mAvatarID is set with 'setAvatar' or 'setAvatarID' mHaveProperties(FALSE), mHaveStatistics(FALSE), - mAllowEdit(allow_edit), - mDisableRate(FALSE) + mAllowEdit(allow_edit) { sAllPanels.push_back(this); @@ -1435,8 +1436,6 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, childSetEnabled("drop target",FALSE); childSetVisible("Show on Map",FALSE); childSetEnabled("Show on Map",FALSE); - childSetVisible("Rate...",FALSE); - childSetEnabled("Rate...",FALSE); childSetVisible("Add Friend...",FALSE); childSetEnabled("Add Friend...",FALSE); childSetVisible("Pay...",FALSE); @@ -1475,8 +1474,6 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, { childSetToolTip("Show on Map",childGetValue("ShowOnMapFriendOnline").asString()); } - childSetVisible("Rate...",TRUE); - childSetEnabled("Rate...",FALSE); childSetVisible("Add Friend...", true); childSetEnabled("Add Friend...", true); childSetVisible("Pay...",TRUE); @@ -1576,16 +1573,6 @@ void LLPanelAvatar::onClickTrack(void* userdata) } } -// static -//----------------------------------------------------------------------------- -// onClickRate() -//----------------------------------------------------------------------------- -void LLPanelAvatar::onClickRate(void *userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - - LLFloaterRate::show(self->mAvatarID); -} // static void LLPanelAvatar::onClickAddFriend(void* userdata) @@ -1627,15 +1614,6 @@ void LLPanelAvatar::onClickMute(void *userdata) } -void LLPanelAvatar::disableRate() -{ - // Force off the rate button, but enable IM. - // Note that these buttons may not exist if it is your own profile. - childSetEnabled("Rate...",FALSE); - mDisableRate = TRUE; -} - - // static void LLPanelAvatar::onClickOfferTeleport(void *userdata) { @@ -1783,10 +1761,6 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) self->childSetEnabled("Pay...",TRUE); self->childSetEnabled("Mute",TRUE); - if (!self->mDisableRate) - { - self->childSetEnabled("Rate...",TRUE); - } self->childSetEnabled("drop target",TRUE); self->mHaveProperties = TRUE; @@ -2015,7 +1989,7 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**) // Otherwise you will write blanks back into the database. void LLPanelAvatar::enableOKIfReady() { - if(mHaveProperties && mHaveStatistics && childIsVisible("OK")) + if(mHaveProperties && childIsVisible("OK")) { childSetEnabled("OK", TRUE); } @@ -2121,69 +2095,6 @@ void LLPanelAvatar::selectTabByName(std::string tab_name) } -// static -void LLPanelAvatar::processAvatarStatisticsReply(LLMessageSystem *msg, void**) -{ - // extract the agent id - LLUUID agent_id; - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); - - LLUUID avatar_id; - msg->getUUIDFast(_PREHASH_AvatarData, _PREHASH_AvatarID, avatar_id); - - // look up all panels which have this avatar - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelAvatar* self = *iter; - if (self->mAvatarID != avatar_id) - { - continue; - } - - self->mHaveStatistics = TRUE; - self->enableOKIfReady(); - - // clear out list - LLScrollListCtrl* ratings_list = LLUICtrlFactory::getScrollListByName(self->mPanelSecondLife,"ratings"); - if (ratings_list) - { - ratings_list->deleteAllItems(); - } - // build the item list - S32 items = msg->getNumberOfBlocksFast(_PREHASH_StatisticsData); - for (S32 i = 0; i < items; i++) - { - char name[MAX_STRING]; /*Flawfinder: ignore*/ - S32 positive; - S32 negative; - char value_string[MAX_STRING]; /*Flawfinder: ignore*/ - - msg->getStringFast( _PREHASH_StatisticsData, - _PREHASH_Name, MAX_STRING, name, i); - msg->getS32( "StatisticsData", "Positive", positive, i); - msg->getS32( "StatisticsData", "Negative", negative, i); - - const S32 TEXT_WIDTH = 75; - - LLSD row; - row["columns"][0]["value"] = name; - row["columns"][0]["font"] = "SANSSERIF_SMALL"; - row["columns"][0]["width"] = TEXT_WIDTH; - row["columns"][1]["value"] = value_string; - row["columns"][1]["font"] = "SANSSERIF_SMALL"; - row["columns"][1]["width"] = 50; - row["columns"][2]["value"] = ""; - row["columns"][2]["font"] = "SANSSERIF_SMALL"; - - if(ratings_list) - { - ratings_list->addElement( row ); - } - } - } -} - - void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**) { // extract the agent id diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 994d23b7d3..f54da2538f 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -60,8 +60,9 @@ public: // If the data for this tab has not yet been requested, // send the request. Used by tabs that are filled in only // when they are first displayed. - // type is one of "notes", "classifieds", "picks" - void sendAvatarProfileRequestIfNeeded(const char* type); + // type is one of "avatarnotesrequest", "avatarpicksrequest", + // or "avatarclassifiedsrequest" + void sendAvatarProfileRequestIfNeeded(const char* method); private: LLPanelAvatar* mPanelAvatar; @@ -256,8 +257,6 @@ public: void setOnlineStatus(EOnlineStatus online_status); const LLUUID& getAvatarID() const { return mAvatarID; } - - void disableRate(); void resetGroupList(); @@ -279,7 +278,6 @@ public: static void processAvatarPropertiesReply(LLMessageSystem *msg, void **); static void processAvatarInterestsReply(LLMessageSystem *msg, void **); static void processAvatarGroupsReply(LLMessageSystem* msg, void**); - static void processAvatarStatisticsReply(LLMessageSystem *msg, void **); static void processAvatarNotesReply(LLMessageSystem *msg, void **); static void processAvatarPicksReply(LLMessageSystem *msg, void **); static void processAvatarClassifiedReply(LLMessageSystem *msg, void **); @@ -288,7 +286,6 @@ public: static void onClickIM( void *userdata); static void onClickOfferTeleport( void *userdata); static void onClickPay( void *userdata); - static void onClickRate( void *userdata); static void onClickAddFriend(void* userdata); static void onClickOK( void *userdata); static void onClickCancel( void *userdata); @@ -337,7 +334,6 @@ protected: BOOL mHaveStatistics; LLTabContainerCommon* mTab; BOOL mAllowEdit; - BOOL mDisableRate; typedef std::list<LLPanelAvatar*> panel_list_t; static panel_list_t sAllPanels; diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 5c5e0479d4..95ed517794 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -38,7 +38,7 @@ #include "llviewerwindow.h" #include "llworldmap.h" #include "llfloaterworldmap.h" -#include "llviewermessage.h" // send_generic_message +#include "llviewergenericmessage.h" // send_generic_message #include "llviewerwindow.h" // for window width, height const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 9d40357544..610bfec8ae 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -146,6 +146,7 @@ BOOL LLPanelGroupGeneral::postBuild() { mCtrlMature->setCommitCallback(onCommitAny); mCtrlMature->setCallbackUserData(this); + mCtrlMature->setVisible( gAgent.mAccess > SIM_ACCESS_PG ); } mCtrlOpenEnrollment = (LLCheckBoxCtrl*) getChildByName("open_enrollement", recurse); @@ -447,7 +448,17 @@ bool LLPanelGroupGeneral::apply(LLString& mesg) if (mCtrlPublishOnWeb) gdatap->mAllowPublish = mCtrlPublishOnWeb->get(); if (mEditCharter) gdatap->mCharter = mEditCharter->getText(); if (mInsignia) gdatap->mInsigniaID = mInsignia->getImageAssetID(); - if (mCtrlMature) gdatap->mMaturePublish = mCtrlMature->get(); + if (mCtrlMature) + { + if (gAgent.mAccess > SIM_ACCESS_PG) + { + gdatap->mMaturePublish = mCtrlMature->get(); + } + else + { + gdatap->mMaturePublish = FALSE; + } + } if (mCtrlShowInGroupList) gdatap->mShowInList = mCtrlShowInGroupList->get(); } @@ -598,6 +609,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlMature->set(gdatap->mMaturePublish); mCtrlMature->setEnabled(mAllowEdit && can_change_ident); + mCtrlMature->setVisible( gAgent.mAccess > SIM_ACCESS_PG ); } if (mCtrlOpenEnrollment) { diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index a05f7c54c6..ff2a64075c 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -28,6 +28,7 @@ #include "llviewertexteditor.h" #include "lltexturectrl.h" #include "lluiconstants.h" +#include "llviewergenericmessage.h" #include "llvieweruictrlfactory.h" #include "llviewerparcelmgr.h" #include "llworldmap.h" @@ -165,9 +166,10 @@ void LLPanelPick::initNewPick() } -void LLPanelPick::setPickID(const LLUUID& id) +void LLPanelPick::setPickID(const LLUUID& pick_id, const LLUUID& creator_id) { - mPickID = id; + mPickID = pick_id; + mCreatorID = creator_id; } @@ -188,15 +190,12 @@ std::string LLPanelPick::getPickName() void LLPanelPick::sendPickInfoRequest() { - LLMessageSystem *msg = gMessageSystem; - - msg->newMessage("PickInfoRequest"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID() ); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("Data"); - msg->addUUID("PickID", mPickID); - gAgent.sendReliableMessage(); + // Must ask for a pick based on the creator id because + // the pick database is distributed to the inventory cluster. JC + std::vector<std::string> strings; + strings.push_back( mCreatorID.asString() ); + strings.push_back( mPickID.asString() ); + send_generic_message("pickinforequest", strings); mDataRequested = TRUE; } diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index a347133be6..232bbb736a 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -39,13 +39,15 @@ public: /*virtual*/ void draw(); - void refresh(); + /*virtual*/ void refresh(); // Setup a new pick, including creating an id, giving a sane // initial position, etc. void initNewPick(); - void setPickID(const LLUUID& id); + // We need to know the creator id so the database knows which partition + // to query for the pick data. + void setPickID(const LLUUID& pick_id, const LLUUID& creator_id); // Schedules the panel to request data // from the server next time it is drawn. @@ -53,6 +55,7 @@ public: std::string getPickName(); const LLUUID& getPickID() const { return mPickID; } + const LLUUID& getPickCreatorID() const { return mCreatorID; } void sendPickInfoRequest(); void sendPickInfoUpdate(); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index cd4d8d2f87..a02dd912e3 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -32,7 +32,6 @@ #include "lldrawable.h" #include "llfloaterinspect.h" #include "llfloaterproperties.h" -#include "llfloaterrate.h" #include "llfloaterreporter.h" #include "llfloatertools.h" #include "llframetimer.h" @@ -542,7 +541,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s msg->addU32Fast(_PREHASH_ObjectLocalID, (objects[i])->getLocalID()); select_count++; - if(msg->mCurrentSendTotal >= MTUBYTES || select_count >= MAX_OBJECTS_PER_PACKET) + if(msg->isSendFull(NULL) || select_count >= MAX_OBJECTS_PER_PACKET) { msg->sendReliable(regionp->getHost() ); select_count = 0; @@ -4179,7 +4178,7 @@ void LLSelectMgr::sendListToRegions(const LLString& message_name, // if to same simulator and message not too big if ((current_region == last_region) - && (gMessageSystem->mCurrentSendTotal < MTUBYTES) + && (! gMessageSystem->isSendFull(NULL)) && (objects_in_this_packet < MAX_OBJECTS_PER_PACKET)) { // add another instance of the body of the data @@ -4214,7 +4213,7 @@ void LLSelectMgr::sendListToRegions(const LLString& message_name, } // flush messages - if (gMessageSystem->mCurrentSendTotal > 0) + if (gMessageSystem->getCurrentSendTotal() > 0) { gMessageSystem->sendReliable( current_region->getHost()); packets_sent++; @@ -6220,7 +6219,6 @@ BOOL LLObjectSelection::getOwnershipCost(S32 &cost) } - //----------------------------------------------------------------------------- // getObjectCount() //----------------------------------------------------------------------------- @@ -6556,3 +6554,4 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_root) return object; } + diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index baf6abda11..4bbdca521c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -35,6 +35,7 @@ #include "llloginflags.h" #include "llmd5.h" #include "llmemorystream.h" +#include "llmessageconfig.h" #include "llregionhandle.h" #include "llsd.h" #include "llsdserialize.h" @@ -67,7 +68,6 @@ #include "llfloatergesture.h" #include "llfloaterland.h" #include "llfloatertopobjects.h" -#include "llfloaterrate.h" #include "llfloatertos.h" #include "llfloaterworldmap.h" #include "llframestats.h" @@ -108,6 +108,7 @@ #include "llviewerassetstorage.h" #include "llviewercamera.h" #include "llviewerdisplay.h" +#include "llviewergenericmessage.h" #include "llviewergesture.h" #include "llviewerimagelist.h" #include "llviewermenu.h" @@ -398,6 +399,7 @@ BOOL idle_startup() port = gSavedSettings.getU32("ConnectionPort"); } + LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); if(!start_messaging_system( message_template_path, port, @@ -941,16 +943,7 @@ BOOL idle_startup() } llinfos << "Verifying message template..." << llendl; - - // register with the message system so it knows we're - // expecting this message - LLMessageSystem* msg = gMessageSystem; - msg->setHandlerFuncFast(_PREHASH_TemplateChecksumReply, null_message_callback, NULL); - msg->newMessageFast(_PREHASH_SecuredTemplateChecksumRequest); - msg->nextBlockFast(_PREHASH_TokenBlock); - lldebugs << "random token: " << gTemplateToken << llendl; - msg->addUUIDFast(_PREHASH_Token, gTemplateToken); - msg->sendReliable(mt_host); + LLMessageSystem::sendSecureMessageTemplateChecksum(mt_host); timeout.reset(); gStartupState++; @@ -959,40 +952,16 @@ BOOL idle_startup() if (STATE_MESSAGE_TEMPLATE_WAIT == gStartupState) { - U32 remote_template_checksum = 0; - - U8 major_version = 0; - U8 minor_version = 0; - U8 patch_version = 0; - U8 server_version = 0; - U32 flags = 0x0; - LLMessageSystem* msg = gMessageSystem; - while (msg->checkMessages(gFrameCount)) + while (msg->checkAllMessages(gFrameCount, gServicePump)) { - if (msg->isMessageFast(_PREHASH_TemplateChecksumReply)) + if (msg->isTemplateConfirmed()) { - LLUUID token; - msg->getUUID("TokenBlock", "Token", token); - if(token != gTemplateToken) - { - llwarns << "Incorrect token in template checksum reply: " - << token << llendl; - return do_normal_idle; - } - msg->getU32("DataBlock", "Checksum", remote_template_checksum); - msg->getU8 ("DataBlock", "MajorVersion", major_version); - msg->getU8 ("DataBlock", "MinorVersion", minor_version); - msg->getU8 ("DataBlock", "PatchVersion", patch_version); - msg->getU8 ("DataBlock", "ServerVersion", server_version); - msg->getU32("DataBlock", "Flags", flags); - BOOL update_available = FALSE; BOOL mandatory = FALSE; - if (remote_template_checksum != msg->mMessageFileChecksum) + if (!LLMessageSystem::doesTemplateMatch()) { - llinfos << "Message template out of sync" << llendl; // Mandatory update -- message template checksum doesn't match update_available = TRUE; mandatory = TRUE; @@ -1012,6 +981,7 @@ BOOL idle_startup() quit = TRUE; } } + // Bail out and clean up circuit if (quit) { @@ -1022,7 +992,6 @@ BOOL idle_startup() } // If we get here, we've got a compatible message template - if (!mandatory) { llinfos << "Message template is current!" << llendl; @@ -1189,7 +1158,7 @@ BOOL idle_startup() } // Process messages to keep from dropping circuit. LLMessageSystem* msg = gMessageSystem; - while (msg->checkMessages(gFrameCount)) + while (msg->checkAllMessages(gFrameCount, gServicePump)) { } msg->processAcks(); @@ -1214,7 +1183,7 @@ BOOL idle_startup() } // Process messages to keep from dropping circuit. LLMessageSystem* msg = gMessageSystem; - while (msg->checkMessages(gFrameCount)) + while (msg->checkAllMessages(gFrameCount, gServicePump)) { } msg->processAcks(); @@ -1920,7 +1889,7 @@ BOOL idle_startup() ++gStartupState; } LLMessageSystem* msg = gMessageSystem; - while (msg->checkMessages(gFrameCount)) + while (msg->checkAllMessages(gFrameCount, gServicePump)) { } msg->processAcks(); @@ -1939,8 +1908,7 @@ BOOL idle_startup() LLMessageSystem* msg = gMessageSystem; msg->setHandlerFuncFast( _PREHASH_AgentMovementComplete, - process_agent_movement_complete, - NULL); + process_agent_movement_complete); LLViewerRegion* regionp = gAgent.getRegion(); if(!gRunLocal && regionp) { @@ -1977,9 +1945,9 @@ BOOL idle_startup() if (STATE_AGENT_WAIT == gStartupState) { LLMessageSystem* msg = gMessageSystem; - while (msg->checkMessages(gFrameCount)) + while (msg->checkAllMessages(gFrameCount, gServicePump)) { - if (msg->isMessageFast(_PREHASH_AgentMovementComplete)) + if (gAgentMovementCompleted) { gStartupState++; // Sometimes we have more than one message in the @@ -2887,7 +2855,21 @@ void update_dialog_callback(S32 option, void *userdata) } return; } - + + LLSD query_map = LLSD::emptyMap(); + // *TODO place os string in a global constant +#if LL_WINDOWS + query_map["os"] = "win"; +#elif LL_DARWIN + query_map["os"] = "mac"; +#elif LL_LINUX + query_map["os"] = "lnx"; +#endif + query_map["userserver"] = gUserServerName; + query_map["channel"] = gChannelName; + // *TODO constantize this guy + LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); + #if LL_WINDOWS char ip[MAX_STRING]; /* Flawfinder: ignore */ @@ -2919,9 +2901,6 @@ void update_dialog_callback(S32 option, void *userdata) } u32_to_ip_string(gUserServer.getAddress(), ip); - std::ostringstream params; - params << "-userserver " << gUserServerName; - // if a sim name was passed in via command line parameter (typically through a SLURL) if ( LLURLSimString::sInstance.mSimString.length() ) { @@ -2929,6 +2908,8 @@ void update_dialog_callback(S32 option, void *userdata) gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); }; + std::ostringstream params; + params << "-url \"" << update_url.asString() << "\""; if (gHideLinks) { // Figure out the program name. @@ -2949,7 +2930,8 @@ void update_dialog_callback(S32 option, void *userdata) program_name = "SecondLife"; } - params << " -silent -name \"" << gSecondLife << "\" -program \"" << program_name << "\""; + params << " -silent -name \"" << gSecondLife << "\""; + params << " -program \"" << program_name << "\""; } llinfos << "Calling updater: " << update_exe_path << " " << params.str() << llendl; @@ -2967,12 +2949,12 @@ void update_dialog_callback(S32 option, void *userdata) // record the location to start at next time gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); }; - + update_exe_path = "'"; update_exe_path += gDirUtilp->getAppRODataDir(); - update_exe_path += "/AutoUpdater.app/Contents/MacOS/AutoUpdater' -userserver "; - update_exe_path += gUserServerName; - update_exe_path += " -name \""; + update_exe_path += "/AutoUpdater.app/Contents/MacOS/AutoUpdater' -url \""; + update_exe_path += update_url.asString(); + update_exe_path += "\" -name \""; update_exe_path += gSecondLife; update_exe_path += "\" &"; @@ -3100,8 +3082,9 @@ void register_viewer_callbacks(LLMessageSystem* msg) LLPanelAvatar::processAvatarInterestsReply); msg->setHandlerFunc("AvatarGroupsReply", LLPanelAvatar::processAvatarGroupsReply); - msg->setHandlerFuncFast(_PREHASH_AvatarStatisticsReply, - LLPanelAvatar::processAvatarStatisticsReply); + // ratings deprecated + //msg->setHandlerFuncFast(_PREHASH_AvatarStatisticsReply, + // LLPanelAvatar::processAvatarStatisticsReply); msg->setHandlerFunc("AvatarNotesReply", LLPanelAvatar::processAvatarNotesReply); msg->setHandlerFunc("AvatarPicksReply", @@ -3120,8 +3103,9 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_GroupProfileReply, LLGroupMgr::processGroupPropertiesReply); - msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply, - LLFloaterRate::processReputationIndividualReply); + // ratings deprecated + // msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply, + // LLFloaterRate::processReputationIndividualReply); msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate, LLAgent::processAgentInitialWearablesUpdate ); @@ -3129,9 +3113,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("ScriptControlChange", LLAgent::processScriptControlChange ); - msg->setHandlerFuncFast(_PREHASH_GestureUpdate, - LLViewerGestureList::processGestureUpdate); - msg->setHandlerFuncFast(_PREHASH_ViewerEffect, LLHUDManager::processViewerEffect); msg->setHandlerFuncFast(_PREHASH_GrantGodlikePowers, process_grant_godlike_powers); diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index e5952f4f5b..7d64640fb0 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -61,6 +61,7 @@ enum EStartupState{ // exorted symbol extern S32 gStartupState; +extern BOOL gAgentMovementCompleted; extern bool gQuickTimeInitialized; extern LLPointer<LLImageGL> gStartImageGL; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index c732394b4e..bc5efa20aa 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1012,7 +1012,7 @@ void LLTextureCtrl::setEnabled( BOOL enabled ) mCaption->setEnabled( enabled ); - LLUICtrl::setEnabled( enabled ); + LLView::setEnabled( enabled ); } void LLTextureCtrl::setValid(BOOL valid ) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index b4aee4e2e1..64ec8f0b2f 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1219,6 +1219,7 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj, return FALSE; } } +std::cout << "ASSET ID: " << new_item->getAssetUUID() << "\n"; hit_obj->updateInventory(new_item, TASK_INVENTORY_ASSET_KEY, true); } else if(!item->getPermissions().allowOperationBy(PERM_TRANSFER, @@ -1232,6 +1233,7 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj, // *FIX: may want to make sure agent can paint hit_obj. // make sure the object has the texture in it's inventory. +std::cout << "ASSET ID: " << new_item->getAssetUUID() << "\n"; hit_obj->updateInventory(new_item, TASK_INVENTORY_ASSET_KEY, true); } return TRUE; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index ee878c1dc0..cbb37e5fe4 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -253,7 +253,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) gViewerWindow->setShowProgress(TRUE); gViewerWindow->setProgressPercent(0); gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); - gAgent.setTeleportMessage("Requesting Teleport..."); + gAgent.setTeleportMessage( + LLAgent::sTeleportProgressMessages["requesting"]); break; case LLAgent::TELEPORT_REQUESTED: @@ -274,7 +275,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) gViewerWindow->setProgressCancelButtonVisible(FALSE, "Cancel"); gViewerWindow->setProgressPercent(75.f); gAgent.setTeleportState( LLAgent::TELEPORT_ARRIVING ); - gAgent.setTeleportMessage("Arriving..."); + gAgent.setTeleportMessage( + LLAgent::sTeleportProgressMessages["arriving"]); gImageList.mForceResetTextureStats = TRUE; break; diff --git a/indra/newview/llviewergenericmessage.cpp b/indra/newview/llviewergenericmessage.cpp new file mode 100644 index 0000000000..d155d11570 --- /dev/null +++ b/indra/newview/llviewergenericmessage.cpp @@ -0,0 +1,77 @@ +/** + * @file llviewergenericmessage.cpp + * @brief Handle processing of "generic messages" which contain short lists of strings. + * @author James Cook + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llviewergenericmessage.h" + +#include "lldispatcher.h" +#include "lluuid.h" +#include "message.h" + +#include "llagent.h" + + +LLDispatcher gGenericDispatcher; + + +void send_generic_message(const char* method, + const std::vector<std::string>& strings, + const LLUUID& invoice) +{ + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("GenericMessage"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used + msg->nextBlock("MethodData"); + msg->addString("Method", method); + msg->addUUID("Invoice", invoice); + if(strings.empty()) + { + msg->nextBlock("ParamList"); + msg->addString("Parameter", NULL); + } + else + { + std::vector<std::string>::const_iterator it = strings.begin(); + std::vector<std::string>::const_iterator end = strings.end(); + for(; it != end; ++it) + { + msg->nextBlock("ParamList"); + msg->addString("Parameter", (*it).c_str()); + } + } + gAgent.sendReliableMessage(); +} + + + +void process_generic_message(LLMessageSystem* msg, void**) +{ + LLUUID agent_id; + msg->getUUID("AgentData", "AgentID", agent_id); + if (agent_id != gAgent.getID()) + { + llwarns << "GenericMessage for wrong agent" << llendl; + return; + } + + std::string request; + LLUUID invoice; + LLDispatcher::sparam_t strings; + LLDispatcher::unpackMessage(msg, request, invoice, strings); + + if(!gGenericDispatcher.dispatch(request, invoice, strings)) + { + llwarns << "GenericMessage " << request << " failed to dispatch" + << llendl; + } +} diff --git a/indra/newview/llviewergenericmessage.h b/indra/newview/llviewergenericmessage.h new file mode 100644 index 0000000000..547421648c --- /dev/null +++ b/indra/newview/llviewergenericmessage.h @@ -0,0 +1,26 @@ +/** + * @file llviewergenericmessage.h + * @brief Handle processing of "generic messages" which contain short lists of strings. + * @author James Cook + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#ifndef LLVIEWERGENERICMESSAGE_H +#define LLVIEWERGENERICMESSAGE_H + +class LLUUID; +class LLDispatcher; + + +void send_generic_message(const char* method, + const std::vector<std::string>& strings, + const LLUUID& invoice = LLUUID::null); + +void process_generic_message(LLMessageSystem* msg, void**); + + +extern LLDispatcher gGenericDispatcher; + +#endif diff --git a/indra/newview/llviewergesture.cpp b/indra/newview/llviewergesture.cpp index 69bee4431f..f5ef19cc33 100644 --- a/indra/newview/llviewergesture.cpp +++ b/indra/newview/llviewergesture.cpp @@ -123,69 +123,6 @@ LLViewerGestureList::LLViewerGestureList() mIsLoaded = FALSE; } -void LLViewerGestureList::saveToServer() -{ - U8 *buffer = new U8[getMaxSerialSize()]; - - U8 *end = serialize(buffer); - - if (end - buffer > getMaxSerialSize()) - { - llerrs << "Wrote off end of buffer, serial size computation is wrong" << llendl; - } - - //U64 xfer_id = gXferManager->registerXfer(buffer, end - buffer); - // write to a file because mem<->mem xfer isn't implemented - LLUUID random_uuid; - char filename[LL_MAX_PATH]; /* Flawfinder: ignore */ - random_uuid.generate(); - random_uuid.toString(filename); - strcat(filename,".tmp"); /* Flawfinder: ignore */ - - char filename_and_path[LL_MAX_PATH]; /* Flawfinder: ignore */ - snprintf(filename_and_path, LL_MAX_PATH, "%s%s%s", /* Flawfinder: ignore */ - gDirUtilp->getTempDir().c_str(), - gDirUtilp->getDirDelimiter().c_str(), - filename); - - FILE* fp = LLFile::fopen(filename_and_path, "wb"); /* Flawfinder: ignore */ - - if (fp) - { - fwrite(buffer, end - buffer, 1, fp); - fclose(fp); - - gMessageSystem->newMessageFast(_PREHASH_GestureUpdate); - gMessageSystem->nextBlockFast(_PREHASH_AgentBlock); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addStringFast(_PREHASH_Filename, filename); - gMessageSystem->addBOOLFast(_PREHASH_ToViewer, FALSE); - gMessageSystem->sendReliable(gUserServer); - } - - delete[] buffer; -} - -/* -void LLViewerGestureList::requestFromServer() -{ - gMessageSystem->newMessageFast(_PREHASH_GestureRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentBlock); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, agent_get_id()); - gMessageSystem->addU8("Reset", 0); - gMessageSystem->sendReliable(gUserServer); -} - -void LLViewerGestureList::requestResetFromServer( BOOL is_male ) -{ - gMessageSystem->newMessageFast(_PREHASH_GestureRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentBlock); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, agent_get_id()); - gMessageSystem->addU8("Reset", is_male ? 1 : 2); - gMessageSystem->sendReliable(gUserServer); - mIsLoaded = FALSE; -} -*/ // helper for deserialize that creates the right LLGesture subclass LLGesture *LLViewerGestureList::create_gesture(U8 **buffer, S32 max_size) @@ -247,14 +184,3 @@ void LLViewerGestureList::xferCallback(void *data, S32 size, void** /*user_data* llwarns << "Unable to load gesture list!" << llendl; } } - -// static -void LLViewerGestureList::processGestureUpdate(LLMessageSystem *msg, void** /*user_data*/) -{ - char remote_filename[MAX_STRING]; /* Flawfinder: ignore */ - msg->getStringFast(_PREHASH_AgentBlock, _PREHASH_Filename, MAX_STRING, remote_filename); - - - gXferManager->requestFile(remote_filename, LL_PATH_CACHE, msg->getSender(), TRUE, xferCallback, NULL, - LLXferManager::HIGH_PRIORITY); -} diff --git a/indra/newview/llviewergesture.h b/indra/newview/llviewergesture.h index ced12a7c34..6eca0d1eca 100644 --- a/indra/newview/llviewergesture.h +++ b/indra/newview/llviewergesture.h @@ -45,7 +45,6 @@ class LLViewerGestureList : public LLGestureList public: LLViewerGestureList(); - void saveToServer(); //void requestFromServer(); BOOL getIsLoaded() { return mIsLoaded; } @@ -57,7 +56,6 @@ public: BOOL matchPrefix(const std::string& in_str, std::string* out_str); static void xferCallback(void *data, S32 size, void** /*user_data*/, S32 status); - static void processGestureUpdate(LLMessageSystem *msg, void** /*user_data*/); protected: LLGesture *create_gesture(U8 **buffer, S32 max_size); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e9d2218d55..2ac1c30ae5 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -95,7 +95,6 @@ #include "llfloateropenobject.h" #include "llfloaterpermissionsmgr.h" #include "llfloaterpreference.h" -#include "llfloaterrate.h" #include "llfloaterregioninfo.h" #include "llfloaterreporter.h" #include "llfloaterscriptdebug.h" @@ -155,6 +154,7 @@ #include "lluuid.h" #include "llvelocitybar.h" #include "llviewercamera.h" +#include "llviewergenericmessage.h" #include "llviewergesture.h" #include "llviewerimagelist.h" #include "llviewerinventory.h" @@ -377,8 +377,6 @@ void handle_force_parcel_owner_to_me(void*); void handle_force_parcel_to_content(void*); void handle_claim_public_land(void*); -void handle_god_expunge_user(void*); - void handle_god_request_havok(void *); void handle_god_request_avatar_geometry(void *); // Hack for easy testing of new avatar geometry void reload_personal_settings_overrides(void *); @@ -1381,8 +1379,6 @@ void init_server_menu(LLMenuGL* menu) &handle_force_parcel_to_content, &enable_god_customer_service, NULL, 'C', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); - //sub->append(new LLMenuItemCallGL("Toggle First Land bit", - // &handle_toggle_parcel_newbie)); sub->appendSeparator(); sub->append(new LLMenuItemCallGL("Claim Public Land", &handle_claim_public_land, &enable_god_customer_service)); @@ -1435,33 +1431,6 @@ void cleanup_menus() // Object pie menu //----------------------------------------------------------------------------- -class LLObjectRateCreator : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - LLFloaterRate::show(LLFloaterRate::RS_CREATOR); - return true; - } -}; - -class LLObjectRateOwner : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - // Don't allow rating of group owned objects. - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); - if (!node) return true; - if (node->mPermissions->isGroupOwned()) - { - gViewerWindow->alertXml("CantRateOwnedByGroup"); - return true; - } - - LLFloaterRate::show(LLFloaterRate::RS_OWNER); - return true; - } -}; - class LLObjectReportAbuse : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) @@ -1471,59 +1440,6 @@ class LLObjectReportAbuse : public view_listener_t } }; -// Enable only when you didn't create it, and the creator -// is not the owner. -class LLObjectEnableRateCreator : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - LLUUID creator_id; - LLUUID owner_id; - LLString dummy; - BOOL identical_creator = gSelectMgr->selectGetCreator(creator_id, dummy); - - BOOL new_value; - if (!identical_creator) - { - new_value = FALSE; - } - else - { - new_value = (creator_id != gAgent.getID()); - } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; - } -}; - -// Enabled if object owner isn't the agent. -class LLObjectEnableRateOwner : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - LLUUID owner_id; - LLString dummy; - BOOL identical_owner = gSelectMgr->selectGetOwner(owner_id, dummy); - - BOOL new_value; - if (!identical_owner) - { - new_value = FALSE; - } - else if (owner_id.isNull()) - { - new_value = FALSE; - } - else - { - new_value = (owner_id != gAgent.getID()); - } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; - } -}; - - // Enabled it you clicked an object class LLObjectEnableReportAbuse : public view_listener_t { @@ -2247,20 +2163,6 @@ void login_done(S32 which, void *user) } - -class LLAvatarRate : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); - if( avatar ) - { - LLFloaterRate::show( avatar->getID() ); - } - return true; - } -}; - void callback_leave_group(S32 option, void *userdata) { if (option == 0) @@ -3397,40 +3299,6 @@ void handle_claim_public_land(void*) gAgent.sendReliableMessage(); } -//void handle_toggle_parcel_newbie(void*) -//{ -// gParcelMgr->toggleParcelGodReserveForNewbie(); -//} - -void on_expunge_user(S32 option, const LLString& text, void*) -{ - if(option == -1) return; - llinfos << "on_expunge_user(" << option << "," << text << ")" << llendl; - LLMessageSystem* msg = gMessageSystem; - LLUUID user_id; - if(user_id.set(text)) - { - msg->newMessage("GodExpungeUser"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("ExpungeData"); - msg->addUUID("AgentID", user_id); - msg->sendReliable(gUserServer); - } - else - { - gViewerWindow->alertXml("InvalidUUID"); - } -} - -void handle_god_expunge_user(void*) -{ - gViewerWindow->alertXmlEditText("ExpungeUser", LLString::format_map_t(), - NULL, NULL, - on_expunge_user, NULL); -} - void handle_god_request_havok(void *) { if (gAgent.isGodlike()) @@ -6433,14 +6301,7 @@ class LLShowFloater : public view_listener_t { if (gParcelMgr->selectionEmpty()) { - if (gLastHitPosGlobal.isExactlyZero()) - { - gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); - } - else - { - gParcelMgr->selectParcelAt( gLastHitPosGlobal ); - } + gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); } LLFloaterLand::show(); @@ -6449,14 +6310,7 @@ class LLShowFloater : public view_listener_t { if (gParcelMgr->selectionEmpty()) { - if (gLastHitPosGlobal.isExactlyZero()) - { - gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); - } - else - { - gParcelMgr->selectParcelAt( gLastHitPosGlobal ); - } + gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); } gParcelMgr->startBuyLand(); @@ -8709,7 +8563,6 @@ void initialize_menu_actions() // Avatar pie menu (new LLObjectMute())->registerListener(gMenuHolder, "Avatar.Mute"); - (new LLAvatarRate())->registerListener(gMenuHolder, "Avatar.Rate"); (new LLAvatarAddFriend())->registerListener(gMenuHolder, "Avatar.AddFriend"); (new LLAvatarFreeze())->registerListener(gMenuHolder, "Avatar.Freeze"); (new LLAvatarDebug())->registerListener(gMenuHolder, "Avatar.Debug"); @@ -8731,9 +8584,7 @@ void initialize_menu_actions() (new LLObjectDelete())->registerListener(gMenuHolder, "Object.Delete"); (new LLObjectAttachToAvatar())->registerListener(gMenuHolder, "Object.AttachToAvatar"); (new LLObjectReturn())->registerListener(gMenuHolder, "Object.Return"); - (new LLObjectRateOwner())->registerListener(gMenuHolder, "Object.RateOwner"); (new LLObjectReportAbuse())->registerListener(gMenuHolder, "Object.ReportAbuse"); - (new LLObjectRateCreator())->registerListener(gMenuHolder, "Object.RateCreator"); (new LLObjectMute())->registerListener(gMenuHolder, "Object.Mute"); (new LLObjectBuy())->registerListener(gMenuHolder, "Object.Buy"); (new LLObjectEdit())->registerListener(gMenuHolder, "Object.Edit"); @@ -8745,9 +8596,7 @@ void initialize_menu_actions() (new LLObjectEnableDelete())->registerListener(gMenuHolder, "Object.EnableDelete"); (new LLObjectEnableWear())->registerListener(gMenuHolder, "Object.EnableWear"); (new LLObjectEnableReturn())->registerListener(gMenuHolder, "Object.EnableReturn"); - (new LLObjectEnableRateOwner())->registerListener(gMenuHolder, "Object.EnableRateOwner"); (new LLObjectEnableReportAbuse())->registerListener(gMenuHolder, "Object.EnableReportAbuse"); - (new LLObjectEnableRateCreator())->registerListener(gMenuHolder, "Object.EnableRateCreator"); (new LLObjectEnableMute())->registerListener(gMenuHolder, "Object.EnableMute"); (new LLObjectEnableBuy())->registerListener(gMenuHolder, "Object.EnableBuy"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index cc1beefec5..316de37ce1 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -87,6 +87,7 @@ #include "llui.h" // for make_ui_sound #include "lluploaddialog.h" #include "llviewercamera.h" +#include "llviewergenericmessage.h" #include "llviewerinventory.h" #include "llviewermenu.h" #include "llviewerobject.h" @@ -123,8 +124,6 @@ extern BOOL gDebugClicks; extern void bad_network_handler(); -LLDispatcher gGenericDispatcher; - // function prototypes void open_offer(const std::vector<LLUUID>& items); void friendship_offer_callback(S32 option, void* user_data); @@ -1540,26 +1539,90 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) break; } case IM_GROUP_VOTE: + { + LLUUID *userdata = new LLUUID(session_id); + args["[NAME]"] = name; + args["[MESSAGE]"] = message; + LLNotifyBox::showXml("GroupVote", args, + &group_vote_callback, userdata); + } + break; + + case IM_GROUP_ELECTION_DEPRECATED: + { + llwarns << "Received IM: IM_GROUP_ELECTION_DEPRECATED" << llendl; + } + break; + + case IM_SESSION_911_SEND: + { + //this is just the same code as IM_SESSION_SEND for a bit + //I was too lazy to make this a function....sorry - jwolk + if (!is_linden && is_busy) { - LLUUID *userdata = new LLUUID(session_id); - args["[NAME]"] = name; - args["[MESSAGE]"] = message; - LLNotifyBox::showXml("GroupVote", args, - &group_vote_callback, userdata); + return; + } + + // standard message, not from system + char saved[MAX_STRING]; /* Flawfinder: ignore */ + saved[0] = '\0'; + if(offline == IM_OFFLINE) + { + char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */ + snprintf(saved, /* Flawfinder: ignore */ + MAX_STRING, + "(Saved %s) ", + formatted_time(timestamp, time_buf)); + } + + snprintf(buffer, /* Flawfinder: ignore */ + sizeof(buffer), + "%s%s%s%s", + name, + separator_string, + saved, + (message+message_offset)); + + BOOL is_this_agent = FALSE; + if(from_id == gAgentID) + { + from_id = LLUUID::null; + is_this_agent = TRUE; } - break; - case IM_GROUP_ELECTION_DEPRECATED: + gIMView->addMessage( + session_id, + from_id, + name, + buffer, + (char*)binary_bucket, + IM_SESSION_ADD, + parent_estate_id, + region_id, + position); + + snprintf(buffer, sizeof(buffer), "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */ + chat.mText = buffer; + LLFloaterChat::addChat(chat, TRUE, is_this_agent); + + //ok, now we want to add a teleport button if we are receving + //a message from not ourself + LLFloaterIMPanel* panel = + gIMView->findFloaterBySession(session_id); + + if (panel && !is_this_agent ) { - llwarns << "Received IM: IM_GROUP_ELECTION_DEPRECATED" << llendl; + //don't add a teleport button for yourself + panel->addTeleportButton(); } break; + } case IM_SESSION_SEND: + { + if (!is_linden && is_busy) { - if (!is_linden && is_busy) - { - return; - } + return; + } // System messages, specifically "Foo Bar has left this session" // are not shown unless you actually have that session open. @@ -1571,40 +1634,40 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } - // standard message, not from system - char saved[MAX_STRING]; /* Flawfinder: ignore */ - saved[0] = '\0'; - if(offline == IM_OFFLINE) - { - char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */ - snprintf(saved, /* Flawfinder: ignore */ - MAX_STRING, - "(Saved %s) ", - formatted_time(timestamp, time_buf)); - } - snprintf(buffer, sizeof(buffer), "%s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */ - BOOL is_this_agent = FALSE; - if(from_id == gAgentID) - { - from_id = LLUUID::null; - is_this_agent = TRUE; - } - gIMView->addMessage( - session_id, - from_id, - name, - buffer, - (char*)binary_bucket, - IM_SESSION_ADD, - parent_estate_id, - region_id, - position); - - snprintf(buffer, sizeof(buffer), "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */ - chat.mText = buffer; - LLFloaterChat::addChat(chat, TRUE, is_this_agent); + // standard message, not from system + char saved[MAX_STRING]; /* Flawfinder: ignore */ + saved[0] = '\0'; + if(offline == IM_OFFLINE) + { + char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */ + snprintf(saved, /* Flawfinder: ignore */ + MAX_STRING, + "(Saved %s) ", + formatted_time(timestamp, time_buf)); } - break; + snprintf(buffer, sizeof(buffer), "%s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */ + BOOL is_this_agent = FALSE; + if(from_id == gAgentID) + { + from_id = LLUUID::null; + is_this_agent = TRUE; + } + gIMView->addMessage( + session_id, + from_id, + name, + buffer, + (char*)binary_bucket, + IM_SESSION_ADD, + parent_estate_id, + region_id, + position); + + snprintf(buffer, sizeof(buffer), "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */ + chat.mText = buffer; + LLFloaterChat::addChat(chat, TRUE, is_this_agent); + } + break; case IM_FROM_TASK: if (is_busy && !is_owned_by_me) @@ -1675,21 +1738,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } break; - case IM_LURE_911: - { - // HACK -- the from_id is the im_session_id - LLFloaterIMPanel* panel = gIMView->findFloaterBySession(session_id); - if (panel) - { - panel->addTeleportButton(from_id); - } - else - { - llinfos << "LLFloaterIMPanel not found for " << session_id << " from " << from_id << llendl; - } - } - break; - case IM_GOTO_URL: { char* url = new char[binary_bucket_size]; @@ -2299,7 +2347,18 @@ void process_teleport_progress(LLMessageSystem* msg, void**) char buffer[MAX_STRING]; /* Flawfinder: ignore */ msg->getString("Info", "Message", MAX_STRING, buffer); lldebugs << "teleport progress: " << buffer << llendl; - gAgent.setTeleportMessage(buffer); + + //Sorta hacky...default to using simulator raw messages + //if we don't find the coresponding mapping in our progress mappings + LLString message = buffer; + + if (LLAgent::sTeleportProgressMessages.find(buffer) != + LLAgent::sTeleportProgressMessages.end() ) + { + message = LLAgent::sTeleportProgressMessages[buffer]; + } + + gAgent.setTeleportMessage(LLAgent::sTeleportProgressMessages[message]); } class LLFetchInWelcomeArea : public LLInventoryFetchDescendentsObserver @@ -2456,7 +2515,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**) send_complete_agent_movement(sim_host); gAgent.setTeleportState( LLAgent::TELEPORT_MOVING ); - gAgent.setTeleportMessage("Contacting New Region..."); + gAgent.setTeleportMessage(LLAgent::sTeleportProgressMessages["contacting"]); regionp->setSeedCapability(std::string(seedCap)); @@ -2492,6 +2551,8 @@ void process_avatar_init_complete(LLMessageSystem* msg, void**) void process_agent_movement_complete(LLMessageSystem* msg, void**) { + gAgentMovementCompleted = TRUE; + LLUUID agent_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); LLUUID session_id; @@ -4295,7 +4356,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, STD_STRING_BUF_SIZE, reason); LLStringBase<char>::format_map_t args; - args["[REASON]"] = reason; + args["[REASON]"] = LLAgent::sTeleportErrorMessages[reason]; gViewerWindow->alertXml("CouldNotTeleportReason", args); if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) @@ -4449,25 +4510,6 @@ void handle_lure_callback_godlike(S32 option, void* userdata) handle_lure_callback(option, LLString::null, userdata); } -void send_lure_911(void** user_data, S32 result) -{ - LLUUID im_session_id(*((LLUUID*)user_data)); - LLString name; - gAgent.getName(name); - LLString text = name + " needs help"; // this text is ignored for 911 lures - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_StartLure); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_Info); - msg->addU8Fast(_PREHASH_LureType, (U8)IM_LURE_911); - msg->addStringFast(_PREHASH_Message, text.c_str()); - msg->nextBlockFast(_PREHASH_TargetData); - msg->addUUIDFast(_PREHASH_TargetID, im_session_id); - gAgent.sendReliableMessage(); -} - void handle_lure(const LLUUID& invitee) { LLDynamicArray<LLUUID> ids; @@ -4985,59 +5027,6 @@ void onCovenantLoadComplete(LLVFS *vfs, LLFloaterBuyLand::updateCovenantText(covenant_text, asset_uuid); } -void send_generic_message(const char* method, - const std::vector<std::string>& strings, - const LLUUID& invoice) -{ - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("GenericMessage"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used - msg->nextBlock("MethodData"); - msg->addString("Method", method); - msg->addUUID("Invoice", invoice); - if(strings.empty()) - { - msg->nextBlock("ParamList"); - msg->addString("Parameter", NULL); - } - else - { - std::vector<std::string>::const_iterator it = strings.begin(); - std::vector<std::string>::const_iterator end = strings.end(); - for(; it != end; ++it) - { - msg->nextBlock("ParamList"); - msg->addString("Parameter", (*it).c_str()); - } - } - gAgent.sendReliableMessage(); -} - - -void process_generic_message(LLMessageSystem* msg, void**) -{ - LLUUID agent_id; - msg->getUUID("AgentData", "AgentID", agent_id); - if (agent_id != gAgent.getID()) - { - llwarns << "GenericMessage for wrong agent" << llendl; - return; - } - - std::string request; - LLUUID invoice; - LLDispatcher::sparam_t strings; - LLDispatcher::unpackMessage(msg, request, invoice, strings); - - if(!gGenericDispatcher.dispatch(request, invoice, strings)) - { - llwarns << "GenericMessage " << request << " failed to dispatch" - << llendl; - } -} void process_feature_disabled_message(LLMessageSystem* msg, void**) { @@ -5062,3 +5051,6 @@ void invalid_message_callback(LLMessageSystem* msg, { bad_network_handler(); } + +// Please do not add more message handlers here. This file is huge. +// Put them in a file related to the functionality you are implementing. JC diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index c7d22656c7..04fb668aba 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -9,12 +9,10 @@ #ifndef LL_LLVIEWERMESSAGE_H #define LL_LLVIEWERMESSAGE_H -//#include "linked_lists.h" #include "llinstantmessage.h" #include "lltransactiontypes.h" #include "lluuid.h" #include "stdenums.h" -#include "message.h" // // Forward declarations @@ -23,6 +21,7 @@ class LLColor4; class LLViewerObject; class LLInventoryObject; class LLInventoryItem; +class LLMessageSystem; class LLViewerRegion; // @@ -169,8 +168,6 @@ void process_decline_callingcard(LLMessageSystem* msg, void**); // Message system exception prototypes void invalid_message_callback(LLMessageSystem*, void*, EMessageException); -void send_lure_911(void** user_data, S32 result); - void process_initiate_download(LLMessageSystem* msg, void**); void inventory_offer_callback(S32 option, void* user_data); @@ -189,15 +186,7 @@ struct LLOfferInfo LLHost mHost; }; -void send_generic_message(const char* method, - const std::vector<std::string>& strings, - const LLUUID& invoice = LLUUID::null); - -void process_generic_message(LLMessageSystem* msg, void**); - void process_feature_disabled_message(LLMessageSystem* msg, void**); -extern LLDispatcher gGenericDispatcher; - #endif diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index c3f2b2d2f6..5af3d532a6 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1347,7 +1347,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use LLUUID owner_id; BOOL is_group_owned; U32 auction_id = 0; - BOOL is_reserved = FALSE; S32 claim_price_per_meter = 0; S32 rent_price_per_meter = 0; S32 claim_date = 0; @@ -1424,7 +1423,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use msg->getUUIDFast(_PREHASH_ParcelData, _PREHASH_OwnerID, owner_id); msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_IsGroupOwned, is_group_owned); msg->getU32Fast(_PREHASH_ParcelData, _PREHASH_AuctionID, auction_id); - msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_ReservedNewbie, is_reserved); msg->getS32Fast( _PREHASH_ParcelData, _PREHASH_ClaimDate, claim_date); msg->getS32Fast( _PREHASH_ParcelData, _PREHASH_ClaimPrice, claim_price_per_meter); msg->getS32Fast( _PREHASH_ParcelData, _PREHASH_RentPrice, rent_price_per_meter); @@ -1461,7 +1459,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use parcel->setAABBMax(aabb_max); parcel->setAuctionID(auction_id); - parcel->setReservedForNewbie(is_reserved); parcel->setOwnershipStatus((LLParcel::EOwnershipStatus)status); parcel->setSimWideMaxPrimCapacity(sw_max_prims); @@ -2214,16 +2211,10 @@ bool LLViewerParcelMgr::canAgentBuyParcel(LLParcel* parcel, bool forGroup) const bool isOwner = parcelOwner == (forGroup ? gAgent.getGroupID() : gAgent.getID()); - bool isAvailable - = parcel->getReservedForNewbie() - ? (!forGroup && gStatusBar->getSquareMetersCommitted() == 0) - : true; - // *TODO: should be based on never_owned_land, see SL-10728 - bool isAuthorized = (authorizeBuyer.isNull() || (gAgent.getID() == authorizeBuyer)); - return isForSale && !isOwner && isAuthorized && isAvailable && isEmpowered; + return isForSale && !isOwner && isAuthorized && isEmpowered; } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index ae772aebf1..ae288d70ec 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -203,12 +203,6 @@ public: // make the selected parcel a content parcel. void sendParcelGodForceToContent(); - // Take the selected parcel, and toggle it's 'reserved for newbie' - // status. - // *NOTE: There is no longer a newbie toggle. It is a linden sale - // for newbie now. - //void toggleParcelGodReserveForNewbie(); - // Pack information about this parcel and send it to the region // containing the southwest corner of the selection. // If want_reply_to_update, simulator will send back a ParcelProperties diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index cc93ea8bdc..303e83d672 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -15,7 +15,6 @@ #include "llhttpclient.h" #include "llregionflags.h" #include "llregionhandle.h" -#include "llsdmessagesystem.h" #include "llsurface.h" #include "message.h" //#include "vmath.h" @@ -24,6 +23,7 @@ #include "llagent.h" #include "llcallingcard.h" +#include "llcaphttpsender.h" #include "lldir.h" #include "lleventpoll.h" #include "llfloatergodtools.h" @@ -38,6 +38,12 @@ #include "llvocache.h" #include "llvoclouds.h" #include "llworld.h" +#include "viewer.h" + +// Viewer object cache version, change if object update +// format changes. JC +const U32 INDRA_OBJECT_CACHE_VERSION = 12; + extern BOOL gNoRender; @@ -142,6 +148,7 @@ LLViewerRegion::~LLViewerRegion() delete mParcelOverlay; delete mLandp; delete mEventPoll; + LLHTTPSender::clearSender(mHost); saveCache(); } @@ -1278,35 +1285,34 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("SendUserReport"); capabilityNames.append("SendUserReportWithScreenshot"); capabilityNames.append("RequestTextureDownload"); + capabilityNames.append("UntrustedSimulatorMessage"); + LLHTTPClient::post(url, capabilityNames, BaseCapabilitiesComplete::build(this)); } static LLEventPoll* createViewerEventPoll(const std::string& url) { - static LLHTTPNode eventRoot; - static bool eventRootServicesAdded = false; - if (!eventRootServicesAdded) - { - LLSDMessageSystem::useServices(); - LLHTTPRegistrar::buildAllServices(eventRoot); - eventRootServicesAdded = true; - } - - return new LLEventPoll(url, eventRoot); + return new LLEventPoll(url); } void LLViewerRegion::setCapability(const std::string& name, const std::string& url) { - mCapabilities[name] = url; - - if (name == "EventQueueGet") + if(name == "EventQueueGet") { delete mEventPoll; mEventPoll = NULL; mEventPoll = createViewerEventPoll(url); } + else if(name == "UntrustedSimulatorMessage") + { + LLHTTPSender::setSender(mHost, new LLCapHTTPSender(url)); + } + else + { + mCapabilities[name] = url; + } } std::string LLViewerRegion::getCapability(const std::string& name) const diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f11f9fb1be..1b3c0193f4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -610,22 +610,19 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask // Topmost view gets a chance before the hierarchy LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); + BOOL mouse_over_top_ctrl = FALSE; if (top_ctrl) { S32 local_x, local_y; top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); if (top_ctrl->pointInView(local_x, local_y)) { + mouse_over_top_ctrl = TRUE; if(top_ctrl->handleMouseDown(local_x, local_y, mask)) { return TRUE; } } - else if (top_ctrl->hasFocus()) - { - // always defocus top view if we click off of it - top_ctrl->setFocus(FALSE); - } } // Give the UI views a chance to process the click @@ -636,6 +633,11 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl; LLView::sMouseHandlerMessage = ""; } + if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl) + { + // always defocus top view if we click off of it + top_ctrl->setFocus(FALSE); + } return TRUE; } else if (LLView::sDebugMouseHandling) @@ -643,6 +645,12 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask llinfos << "Left Mouse Down not handled by view" << llendl; } + if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl) + { + // always defocus top view if we click off of it + top_ctrl->setFocus(FALSE); + } + if (gDisconnected) { return FALSE; @@ -699,24 +707,19 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma // Check for hit on UI. LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); + BOOL mouse_over_top_ctrl = FALSE; if (top_ctrl) { S32 local_x, local_y; top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); if (top_ctrl->pointInView(local_x, local_y)) { + mouse_over_top_ctrl = TRUE; if(top_ctrl->handleDoubleClick(local_x, local_y, mask)) { return TRUE; } } - else - { - if (top_ctrl->hasFocus()) - { - top_ctrl->setFocus(FALSE); - } - } } if (mRootView->handleDoubleClick(x, y, mask)) @@ -726,6 +729,11 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl; LLView::sMouseHandlerMessage = ""; } + if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl) + { + // always defocus top view if we click off of it + top_ctrl->setFocus(FALSE); + } return TRUE; } else if (LLView::sDebugMouseHandling) @@ -733,7 +741,13 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma llinfos << "Left Mouse Down not handled by view" << llendl; } - // Why is this here? JC 9/3/2002 + if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl) + { + // always defocus top view if we click off of it + top_ctrl->setFocus(FALSE); + } + + // Why is this here? JC 9/3/2002 if (gNoRender) { return TRUE; @@ -903,24 +917,19 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK } LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); + BOOL mouse_over_top_ctrl = FALSE; if (top_ctrl) { S32 local_x, local_y; top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); if (top_ctrl->pointInView(local_x, local_y)) { + mouse_over_top_ctrl = TRUE; if(top_ctrl->handleRightMouseDown(local_x, local_y, mask)) { return TRUE; } } - else - { - if (top_ctrl->hasFocus()) - { - top_ctrl->setFocus(FALSE); - } - } } if( mRootView->handleRightMouseDown(x, y, mask) ) @@ -930,6 +939,11 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK llinfos << "Right Mouse Down" << LLView::sMouseHandlerMessage << llendl; LLView::sMouseHandlerMessage = ""; } + if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl) + { + // always defocus top view if we click off of it + top_ctrl->setFocus(FALSE); + } return TRUE; } else if (LLView::sDebugMouseHandling) @@ -937,6 +951,12 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK llinfos << "Right Mouse Down not handled by view" << llendl; } + if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl) + { + // always defocus top view if we click off of it + top_ctrl->setFocus(FALSE); + } + if (gToolMgr) { if(gToolMgr->getCurrentTool()->handleRightMouseDown( x, y, mask ) ) @@ -1464,8 +1484,27 @@ LLViewerWindow::LLViewerWindow( // stuff like AGP if we think that it'll crash the viewer. // gFeatureManagerp->initGraphicsFeatureMasks(); + + // The ATI Mobility Radeon with 1.15.0 causes crashes in FMOD on startup for + // unknown reasons, but only if you have an old settings.ini file. + // In this case, force the graphics settings back to recommended, but only + // do it once. JC + std::string gpu_string = gFeatureManagerp->getGPUString(); + LLString::toLower(gpu_string); + bool upgrade_to_1_15 = (gSavedSettings.getString("LastRunVersion") != "1.15.0"); + bool mobility_radeon = (gpu_string.find("mobility radeon") != std::string::npos); + bool mobility_radeon_upgrade_hack = upgrade_to_1_15 && mobility_radeon; + if (mobility_radeon_upgrade_hack) + { + llinfos << "1.15.0 update on Mobility Radeon" << llendl; + llinfos << "Forcing recommended graphics settings" << llendl; + llinfos << "Forcing audio off" << llendl; + gUseAudio = FALSE; + } + if (gFeatureManagerp->isSafe() - || (gSavedSettings.getS32("LastFeatureVersion") != gFeatureManagerp->getVersion())) + || (gSavedSettings.getS32("LastFeatureVersion") != gFeatureManagerp->getVersion()) + || mobility_radeon_upgrade_hack) { gFeatureManagerp->applyRecommendedFeatures(); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e74c286e43..2b821bed9f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3060,6 +3060,13 @@ void LLVOAvatar::updateCharacter(LLAgent &agent) return; } + // For fading out the names above heads, only let the timer + // run if we're visible. + if (mDrawable.notNull() && !mDrawable->isVisible()) + { + mTimeVisible.reset(); + } + if (!mIsSelf && !isVisible()) { return; @@ -3090,13 +3097,6 @@ void LLVOAvatar::updateCharacter(LLAgent &agent) getOffObject(); } - // For fading out the names above heads, only let the timer - // run if we're visible. - if (mDrawable.notNull() && !mDrawable->isVisible()) - { - mTimeVisible.reset(); - } - //-------------------------------------------------------------------- // create local variables in world coords for region position values //-------------------------------------------------------------------- diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index c00a202f91..cf57ae3cd0 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -219,6 +219,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) curl_easy_setopt(mCurl, CURLOPT_ERRORBUFFER, &mCurlErrorBuffer); curl_easy_setopt(mCurl, CURLOPT_CAINFO, gDirUtilp->getCAFile().c_str()); curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYPEER, gVerifySSLCert); + curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYHOST, gVerifySSLCert? 2 : 0); /* Setting the DNS cache timeout to -1 disables it completely. This might help with bug #503 */ |