From 71d9084a95928a9858a29c7a309d8921dfeb2cd7 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sat, 1 Mar 2014 17:34:22 -0500 Subject: [PATCH 01/96] Clean out old OGPX stuff --- indra/llcommon/CMakeLists.txt | 2 - indra/llcommon/llindraconfigfile.cpp | 119 ------- indra/llcommon/llindraconfigfile.h | 61 ---- indra/llmessage/aihttptimeoutpolicy.cpp | 1 - indra/newview/CMakeLists.txt | 2 - indra/newview/app_settings/settings.xml | 16 - indra/newview/llfloaterabout.cpp | 3 +- indra/newview/llfloaterpermissionsmgr.cpp | 154 -------- indra/newview/llfloaterpermissionsmgr.h | 82 ----- indra/newview/llfloaterteleport.cpp | 332 ------------------ indra/newview/llfloaterteleport.h | 65 ---- indra/newview/llinventorymodel.cpp | 19 - indra/newview/llinventorymodel.h | 8 - indra/newview/llpanellogin.cpp | 3 +- indra/newview/llurlhistory.cpp | 33 -- indra/newview/llurlhistory.h | 3 - indra/newview/lluserauth.cpp | 1 - indra/newview/llviewerbuild.h | 37 -- .../default/xui/en-us/floater_teleport.xml | 55 --- .../skins/default/xui/es/floater_teleport.xml | 8 - 20 files changed, 2 insertions(+), 1002 deletions(-) delete mode 100644 indra/llcommon/llindraconfigfile.cpp delete mode 100644 indra/llcommon/llindraconfigfile.h delete mode 100644 indra/newview/llfloaterpermissionsmgr.cpp delete mode 100644 indra/newview/llfloaterpermissionsmgr.h delete mode 100644 indra/newview/llfloaterteleport.cpp delete mode 100644 indra/newview/llfloaterteleport.h delete mode 100644 indra/newview/llviewerbuild.h delete mode 100644 indra/newview/skins/default/xui/en-us/floater_teleport.xml delete mode 100644 indra/newview/skins/default/xui/es/floater_teleport.xml diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index be045f100..7c1f724d0 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -59,7 +59,6 @@ set(llcommon_SOURCE_FILES llformat.cpp llframetimer.cpp llheartbeat.cpp - llindraconfigfile.cpp llinitparam.cpp llinstancetracker.cpp llliveappconfig.cpp @@ -183,7 +182,6 @@ set(llcommon_HEADER_FILES llheartbeat.h llhttpstatuscodes.h llindexedqueue.h - llindraconfigfile.h llinitparam.h llinstancetracker.h llkeythrottle.h diff --git a/indra/llcommon/llindraconfigfile.cpp b/indra/llcommon/llindraconfigfile.cpp deleted file mode 100644 index f0873450f..000000000 --- a/indra/llcommon/llindraconfigfile.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @file llindraconfigfile.cpp - * - * - * This class is an LLLiveFile that has config info for indra - * Currently only whether it's blacklisted - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llindraconfigfile.h" - -#include "llfile.h" -#include "llsd.h" -#include "llsdserialize.h" -#include "llframetimer.h" - -static std::string sConfigDir = ""; -static const char indraConfigFileName[] = "indra.xml"; - - -LLIndraConfigFile::LLIndraConfigFile() - : LLLiveFile(filename()), - mConfig(LLSD()) -{ -} - -//static -void LLIndraConfigFile::initClass(const std::string& config_dir) -{ - sConfigDir = config_dir; - llinfos << "LLIndraConfigFile::initClass config dir " - << config_dir << "/" << indraConfigFileName << llendl; -} - -LLSD LLIndraConfigFile::getConfig(const std::string& config_name) -{ - if (sConfigDir.empty()) - { - llerrs << "LLIndraConfigFile::initClass() not called" << llendl; - } - - LLFrameTimer::updateFrameTime(); - - static LLIndraConfigFile the_file; - the_file.checkAndReload(); - - return the_file.mConfig[config_name]; -} - -std::string LLIndraConfigFile::filename() -{ - std::ostringstream ostr; - - ostr << sConfigDir - << "/" << indraConfigFileName; - - return ostr.str(); -} - -/* virtual */ -bool LLIndraConfigFile::loadFile() -{ - llinfos << "LLIndraConfigFile::loadFile: reading from " - << filename() << llendl; - - LLSD config; - - { - llifstream file(filename()); - if (file.is_open()) - { - LLSDSerialize::fromXML(config, file); - } - - if (config.isUndefined()) - { - llinfos << "LLIndraConfigFile::loadFile: file missing, ill-formed," - " or simply undefined; not changing the blacklist" << llendl; - return false; - } - } - - if (config.isMap()) - { - mConfig = config; - return true; - } - else - { - llwarns << "LLIndraConfigFile: " << indraConfigFileName << " expects a map; wrong format" << llendl; - return false; - } -} diff --git a/indra/llcommon/llindraconfigfile.h b/indra/llcommon/llindraconfigfile.h deleted file mode 100644 index 17eda906e..000000000 --- a/indra/llcommon/llindraconfigfile.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file llindraconfigfile.h - * @brief manages configuration file for indra.xml - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLINDRACONFIGFILE_H -#define LL_LLINDRACONFIGFILE_H - -#include "linden_common.h" -#include - -#include "lllivefile.h" -#include "llsd.h" - - -// To use, call LLIndraConfigFile::initClass(config_dir); -// Then whenever getConfig is called, it will check and reload automatically - -class LLIndraConfigFile : public LLLiveFile -{ -public: - LLIndraConfigFile(); - static void initClass(const std::string& config_dir); - static LLSD getConfig(const std::string& config_name); - -private: - static std::string filename(); - -protected: - /* virtual */ bool loadFile(); - LLSD mConfig; -}; - -#endif //LL_LLINDRACONFIGFILE_H diff --git a/indra/llmessage/aihttptimeoutpolicy.cpp b/indra/llmessage/aihttptimeoutpolicy.cpp index 019750efc..b9052f12f 100644 --- a/indra/llmessage/aihttptimeoutpolicy.cpp +++ b/indra/llmessage/aihttptimeoutpolicy.cpp @@ -965,7 +965,6 @@ P(newAgentInventoryVariablePriceResponder); P(objectCostResponder); P(objectLinksetsResponder); P(physicsFlagsResponder); -P(placeAvatarTeleportResponder); P(productInfoRequestResponder); P(regionResponder); P(remoteParcelRequestResponder); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fbcc7c4d4..e6e49e4e1 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -244,7 +244,6 @@ set(viewer_SOURCE_FILES llfloaterpathfindingcharacters.cpp llfloaterpathfindinglinksets.cpp llfloaterpathfindingobjects.cpp - llfloaterpermissionsmgr.cpp llfloaterperms.cpp llfloaterpostcard.cpp llfloaterpostprocess.cpp @@ -764,7 +763,6 @@ set(viewer_HEADER_FILES llfloaterpathfindingcharacters.h llfloaterpathfindinglinksets.h llfloaterpathfindingobjects.h - llfloaterpermissionsmgr.h llfloaterperms.h llfloaterpostcard.h llfloaterpostprocess.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5680b9b5a..ece509daa 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11101,22 +11101,6 @@ This should be as low as possible, but too low may break functionality Value 0 - PermissionsManagerRect - - Comment - Rectangle for permissions manager window - Persist - 1 - Type - Rect - Value - - 0 - 85 - 300 - 0 - - PickerContextOpacity Comment diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index d47f5fb43..5d205fd60 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -50,7 +50,6 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "sgversion.h" -#include "llviewerbuild.h" #include "lluictrlfactory.h" #include "lluri.h" #include "llweb.h" @@ -140,7 +139,7 @@ LLFloaterAbout::LLFloaterAbout() + " (64 bit)" #endif + llformat(" %d.%d.%d (%d) %s %s (%s)\n", - gVersionMajor, gVersionMinor, gVersionPatch, LL_VIEWER_BUILD, + gVersionMajor, gVersionMinor, gVersionPatch, gVersionBuild, __DATE__, __TIME__, gVersionChannel)); support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); diff --git a/indra/newview/llfloaterpermissionsmgr.cpp b/indra/newview/llfloaterpermissionsmgr.cpp deleted file mode 100644 index 750cd8bfd..000000000 --- a/indra/newview/llfloaterpermissionsmgr.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @file llfloaterpermissionsmgr.cpp - * @brief for user control of script permissions - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterpermissionsmgr.h" - -#include "llscrollcontainer.h" -#include "lltextbox.h" -#include "llbutton.h" -#include "llagent.h" -#include "llviewerobjectlist.h" -#include "llviewerregion.h" -#include "llstl.h" - -// constants -const S32 MIN_PERM_MGR_WIDTH = 100; -const S32 MIN_PERM_MGR_HEIGHT = 100; -const S32 VPAD = 8; -const S32 HPAD = 8; -const S32 LINE = 16; - -// statics -LLFloaterPermissionsMgr* LLFloaterPermissionsMgr::sInstance = NULL; - -LLFloaterPermissionsMgr* LLFloaterPermissionsMgr::show() -{ - if (!sInstance) - { - sInstance = new LLFloaterPermissionsMgr(); - - sInstance->open(); /* Flawfinder: ignore */ - gFloaterView->adjustToFitScreen(sInstance, TRUE); - } - else - { - sInstance->open(); /* Flawfinder: ignore */ - } - - return sInstance; -} - -void LLFloaterPermissionsMgr::processPermissionsList(LLMessageSystem* msg, void**) -{ -} - -LLFloaterPermissionsMgr::LLFloaterPermissionsMgr() : - LLFloater(std::string("floater_perm_mgr"), std::string("PermissionsManagerRect"), std::string("Permissions Manager"), - TRUE, MIN_PERM_MGR_WIDTH, MIN_PERM_MGR_HEIGHT) -{ - S32 y = getRect().getHeight() - VPAD - LINE; - LLRect scrollable_container_rect(0, y, getRect().getWidth(), 0); - LLRect permissions_rect(0, 0, getRect().getWidth() - HPAD - HPAD, 0); - mPermissions = new LLPermissionsView(permissions_rect); - mScroller = new LLScrollContainer( - std::string("permissions container"), - scrollable_container_rect, - mPermissions - ); - mScroller->setFollowsAll(); - mScroller->setReserveScrollCorner(TRUE); - addChild(mScroller); -} - -LLFloaterPermissionsMgr::~LLFloaterPermissionsMgr() -{ -} - - -// -// LLPermissionsView -// - -LLPermissionsView::LLPermissionsView(const LLRect &rect) : LLView(std::string("permissions_view"), rect, TRUE, FOLLOWS_NONE) -{ -} - -void LLPermissionsView::clearPermissionsData() -{ - deleteAllChildren(); -} - -void LLPermissionsView::addPermissionsData(const std::string& object_name, const LLUUID& object_id, U32 permissions_flags) -{ - // grow to make room for new element - reshape(getRect().getWidth(), getRect().getHeight() + LINE + VPAD + BTN_HEIGHT + VPAD); - S32 y = getRect().getHeight() - LINE - VPAD; - LLRect label_rect(HPAD, y + LINE, getRect().getWidth(), y); - LLTextBox* text = new LLTextBox(std::string("perm_label"), label_rect, object_name); - text->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM); - addChild(text); - - y -= LINE + VPAD; - - LLRect btn_rect(HPAD, y + BTN_HEIGHT, 120, y); - LLButton* button = new LLButton(std::string("Revoke permissions"), btn_rect, LLStringUtil::null, boost::bind(&LLPermissionsView::revokePermissions, object_id, permissions_flags)); - button->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM); - addChild(button); - - /*btn_rect.set(HPAD + 120 + HPAD, y + BTN_HEIGHT, HPAD + 120 + HPAD + 120, y); - button = new LLButton(std::string("Find in world"), btn_rect, LLStringUtil::null, boost::bind(&LLPermissionsView::findObject, object_id, permissions_flags)); - button->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM); - addChild(button);*/ -} - -void LLPermissionsView::revokePermissions(const LLUUID& object_id, U32 permission_flags) -{ - LLViewerObject* objectp = gObjectList.findObject(object_id); - if (objectp) - { - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_RevokePermissions); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_Data); - msg->addUUIDFast(_PREHASH_ObjectID, object_id); - msg->addU32Fast(_PREHASH_ObjectPermissions, permission_flags); - msg->sendReliable(objectp->getRegion()->getHost()); - } -} - -/*void LLPermissionsView::findObject(const LLUUID& object_id, U32 permission_flags) -{ -}*/ diff --git a/indra/newview/llfloaterpermissionsmgr.h b/indra/newview/llfloaterpermissionsmgr.h deleted file mode 100644 index ac933e3f1..000000000 --- a/indra/newview/llfloaterpermissionsmgr.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file llfloaterpermissionsmgr.h - * @brief for user control of script permissions - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERPERMISSIONSMGR_H -#define LL_LLFLOATERPERMISSIONSMGR_H - -#include "llfloater.h" -#include - -class LLScrollContainer; -class LLPermissionsView; - -class LLFloaterPermissionsMgr -: public LLFloater -{ -public: - static LLFloaterPermissionsMgr* show(); - - // Message system callbacks - static void processPermissionsList(LLMessageSystem* msg, void**); - - virtual void onClose(bool app_quitting) { setVisible(FALSE); } - -private: - // Must construct by calling show(). - LLFloaterPermissionsMgr(); - virtual ~LLFloaterPermissionsMgr(); - -public: - LLPermissionsView* mPermissions; - -protected: - LLScrollContainer* mScroller; - - static LLFloaterPermissionsMgr* sInstance; -}; - -class LLPermissionsView : public LLView -{ -public: - LLPermissionsView(const LLRect& rect); - virtual ~LLPermissionsView() {}; - -public: - void clearPermissionsData(); - void addPermissionsData(const std::string& object_name, const LLUUID& object_id, U32 permissions_flags); - - static void revokePermissions(const LLUUID& object_id, U32 permission_flags); - //static void findObject(const LLUUID& object_id, U32 permission_flags); -}; - - -#endif diff --git a/indra/newview/llfloaterteleport.cpp b/indra/newview/llfloaterteleport.cpp deleted file mode 100644 index dd546c5b0..000000000 --- a/indra/newview/llfloaterteleport.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/** - * @file llfloaterteleport.cpp - * @brief floater code for agentd teleports. - * - * $LicenseInfo:firstyear=2008&license=viewergpl$ - * - * Copyright (c) 2008, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ -//Teleport floater used for agent domain TP. URI text floater. -//Copyright International Business Machines Corporation 2008-9 -//Contributed to Linden Research, Inc. under the Second Life Viewer Contribution -//Agreement and licensed as above. -#include "llviewerprecompiledheaders.h" // must be first include - -#include "llfloaterteleport.h" - -#include "llagent.h" //for hack in teleport start -#include "llchat.h" -#include "llcombobox.h" -#include "llfloaterchat.h" -#include "llsdserialize.h" -#include "llsdutil.h" -#include "llsdutil_math.h" -#include "lluictrlfactory.h" // builds floaters from XML -#include "llurlhistory.h" -#include "lluserauth.h" // for saving placeavatarresponder result -#include "llviewercontrol.h" // for gSavedSettings -#include "llviewerdisplay.h" // for gTeleportDisplay -#include "llviewermessage.h" // for send_agent_movement_complete attempt -#include "llviewerregion.h" -#include "llviewerwindow.h" // for hack in teleport start -#include "llvoavatar.h" -#include "llworld.h" -#include "pipeline.h" // for gPipeline - -class AIHTTPTimeoutPolicy; -extern AIHTTPTimeoutPolicy placeAvatarTeleportResponder_timeout; - -// OGPX HTTP responder for PlaceAvatar cap used for Teleport -// very similar to the responder in Login, but not as many fields are returned in the TP version -// OGPX TODO: should this be combined with the Login responder for rez_avatar/place? -// OGPX TODO: mResult should not get replaced in result(), instead -// should replace individual LLSD fields in mResult. -class LLPlaceAvatarTeleportResponder : public LLHTTPClient::ResponderWithResult -{ -public: - LLPlaceAvatarTeleportResponder() - { - } - - ~LLPlaceAvatarTeleportResponder() - { - } - - /*virtual*/ void error(U32 statusNum, const std::string& reason) - { - LL_INFOS("OGPX") << "LLPlaceAvatarTeleportResponder error in TP " - << statusNum << " " << reason << LL_ENDL; - - LLSD args; - args["REASON"] = reason; - - - LLNotificationsUtil::add("CouldNotTeleportReason", args); - - gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); - - } - - /*virtual*/ void result(const LLSD& content) - { - - LLSD result; - result["agent_id"] = content["agent_id"]; // need this for send_complete_agent_movement - result["region_x"] = content["region_x"]; // need these for making the first region - result["region_y"] = content["region_y"]; - result["login"] = "true"; // this gets checked in idle_startup() - result["session_id"] = content["session_id"]; - result["secure_session_id"] = content["secure_session_id"]; - result["circuit_code"] = content["circuit_code"]; - result["sim_port"] = content["sim_port"]; - result["sim_host"] = content["sim_host"]; - result["look_at"] = content["look_at"]; - // maintaining result seed_capability name for compatibility with legacy login - result["seed_capability"] = content["region_seed_capability"]; - result["position"] = content["position"]; // save this for agentmovementcomplete type processing - - // Even though we have the pretty print of the complete content returned, we still find it handy - // when scanning SecondLife.log to have these laid out in this way. So they are still here. - LL_DEBUGS("OGPX") << " Teleport placeAvatar responder " << LL_ENDL; - LL_DEBUGS("OGPX") << "agent_id: " << content["agent_id"] << LL_ENDL; - LL_DEBUGS("OGPX") << "region_x: " << content["region_x"] << LL_ENDL; - LL_DEBUGS("OGPX") << "session_id: " << content["session_id"] << LL_ENDL; - LL_DEBUGS("OGPX") << "sim_port: " << content["sim_port"] << LL_ENDL; - LL_DEBUGS("OGPX") << "sim_host: " << content["sim_host"] << LL_ENDL; - LL_DEBUGS("OGPX") << "look_at: " << content["look_at"] << LL_ENDL; - LL_DEBUGS("OGPX") << "position: " << content["position"] << LL_ENDL; - LL_DEBUGS("OGPX") << "seed_capability: " << content["region_seed_capability"] << LL_ENDL; - - LL_INFOS("OGPX") << " All the LLSD PlaceAvatarTeleportResponder content: \n " << ll_pretty_print_sd(content) << LL_ENDL; // OGPX - - - // check "connect" to make sure place_avatar fully successful - if (!content["connect"].asBoolean()) - { - // place_avatar failed somewhere - LL_INFOS("OGPX") << "TP failed, connect false in TP PlaceAvatarResponder " << LL_ENDL; - - LLSD args; - args["REASON"] = "Place Avatar Failed"; - - //gViewerWindow->alertXml("CouldNotTeleportReason", args); - LLNotificationsUtil::add("CouldNotTeleportReason",args); - - gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); - - return; - } - - - U64 region_handle; - region_handle = to_region_handle_global(content["region_x"].asInteger(), content["region_y"].asInteger()); - - LLHost sim_host; - U32 sim_port = strtoul(result["sim_port"].asString().c_str(), NULL, 10); - sim_host.setHostByName(result["sim_host"].asString().c_str()); - sim_host.setPort(sim_port); - - if (sim_host.isOk()) - { - LLMessageSystem* msg = gMessageSystem; - gMessageSystem->enableCircuit(sim_host, TRUE); - msg->newMessageFast(_PREHASH_UseCircuitCode); - msg->nextBlockFast(_PREHASH_CircuitCode); - msg->addU32Fast(_PREHASH_Code, msg->getOurCircuitCode()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_ID, gAgent.getID()); - msg->sendReliable(sim_host); - } - else - { - LL_INFOS("OGPX") << "TP failed, could not resolve hostname for UDP messages." << LL_ENDL; - LLSD args; - args["REASON"] = "Failed to resolve host."; - //gViewerWindow->alertXml("CouldNotTeleportReason", args); - LLNotificationsUtil::add("CouldNotTeleportReason", args); - gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); - return; - } - - - - - // Viewer trusts the simulator. - LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); - regionp->setSeedCapability(content["seed_capability"].asString().c_str()); - // process_agent_movement_complete needs the region to still be the old region gAgent.setRegion(regionp); - - // placing these in result so they can be set properly in LLUserAuth result - // ...they are only passed in on login, and not on TP - result["session_id"] = gAgent.getSessionID(); - result["agent_id"] = gAgent.getID(); - result["circuit_code"].asString() = gMessageSystem->mOurCircuitCode; // this is what startup sets, is this proper to do? - - // grab the skeleton and root. - result["inventory-skeleton"] = LLUserAuth::getInstance()->mResult["inventory-skeleton"]; - result["inventory-root"] = LLUserAuth::getInstance()->mResult["inventory-root"]; - - LL_DEBUGS("OGPX") << "session_id: " << result["session_id"] << LL_ENDL; - - - - // results need to be stored so process_agent_movement_complete() can pull them - LLUserAuth::getInstance()->mAuthResponse = LLUserAuth::E_OK; - - // OGPX TODO: This just reeks of causing problems, because we are using - // ... mResult to store things that we get from other caps....So slamming a - // ... completely new result in on teleport is going to cause issues. - // ... It makes changing the things we save in mResult error prone. - // ... Question is, how should we really be storing the seemingly random things - // ... that we get back from (now) various different caps that used to all come back - // ... in the result of XMLRPC authenticate? - LLUserAuth::getInstance()->mResult = result; - - - - // ... new sim not sending me much without sending it CompleteAgentMovement msg. - //gAgent.setTeleportState( LLAgent::TELEPORT_MOVING ); // process_agent_mv_complete looks for TELEPORT_MOVING - LLVector3 position = ll_vector3_from_sd(result["position"]); - gAgent.setHomePosRegion(region_handle, position); // taken from teleport_finish (not sure regular code path gets this) - - send_complete_agent_movement(sim_host); - - // Turn off progress msg (also need to do this in all the possible failure places) - // I think we leave this, as the scene is still changing during the - // processing of agentmovementcomeplete message. TELEPORT_NONE resets it anyway - // gViewerWindow->setShowProgress(FALSE); - - } - - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return placeAvatarTeleportResponder_timeout; } - /*virtual*/ char const* getName(void) const { return "LLPlaceAvatarTeleportResponder"; } -}; - -// Statics -LLFloaterTeleport* LLFloaterTeleport::sInstance = NULL; - -LLFloaterTeleport::LLFloaterTeleport() -: LLFloater("floater_teleport") -{ - if(!sInstance) - { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_teleport.xml"); - - LLComboBox* regioncombo = getChild("teleport_edit"); - regioncombo->setAllowTextEntry(TRUE, 256, FALSE); // URL bar needs to allow user text input - - // iterate on uri list adding to combobox (couldn't figure out how to add them all in one call) - LLSD regionuri_history = LLURLHistory::getURLHistory("regionuri"); - LLSD::array_iterator iter_history = regionuri_history.beginArray(); - LLSD::array_iterator iter_end = regionuri_history.endArray(); - for(; iter_history != iter_end; ++iter_history) - { - regioncombo->addSimpleElement((*iter_history).asString()); - } - - // select which is displayed if we have a current URL. - regioncombo->setSelectedByValue(LLSD(gSavedSettings.getString("CmdLineRegionURI")),TRUE); - - // TODO : decide if 'enter' when selecting something from the combox box should *not* be sent - // to the floater (p.s. and figure out how to change it) - - childSetAction("teleport_btn", onClickTeleport, this); - childSetAction("cancel_btn", onClickCancel, this); - - setDefaultBtn("teleport_btn"); - } - else - { - sInstance->show(NULL); - } -} - -// static -void LLFloaterTeleport::show(void*) -{ - if (!sInstance) - { - sInstance = new LLFloaterTeleport(); - } - - sInstance->open(); -} - -LLFloaterTeleport::~LLFloaterTeleport() -{ - sInstance=NULL; -} - - - -// static -void LLFloaterTeleport::onClickTeleport(void* userdata) -{ - std::string placeAvatarCap = LLAppViewer::instance()->getPlaceAvatarCap(); - LLSD args; - - LLFloaterTeleport* self = (LLFloaterTeleport*)userdata; - std::string text = self->childGetText("teleport_edit"); - if (text.find("://",0) == std::string::npos) - { - // if there is no uri, prepend it with http:// - text = "http://"+text; - LL_DEBUGS("OGPX") << "Teleport URI was prepended, now " << text << LL_ENDL; - } - - LL_DEBUGS("OGPX") << "onClickTeleport! from using place_avatar cap "<< placeAvatarCap << " contains "<< text << LL_ENDL; - LLStringUtil::trim(text); // trim extra spacing - gAgent.setTeleportSourceURL(gSavedSettings.getString("CmdLineRegionURI")); // grab src region name - gSavedSettings.setString("CmdLineRegionURI",text); // save the dst region - args["public_region_seed_capability"] = text; - args["position"] = ll_sd_from_vector3(LLVector3(128, 128, 50)); // default to middle of region above base terrain - LL_INFOS("OGPX") << " args to placeavatar cap " << placeAvatarCap << " on teleport: " << LLSDOStreamer(args) << LL_ENDL; - LLHTTPClient::post(placeAvatarCap, args, new LLPlaceAvatarTeleportResponder()); - gAgent.setTeleportMessage( - LLAgent::sTeleportProgressMessages["requesting"]); - gViewerWindow->setShowProgress(TRUE); - gAgent.teleportCore(); - gAgent.setTeleportState( LLAgent::TELEPORT_PLACE_AVATAR ); // teleportcore() sets tp state to legacy path, so reset. ick! - gTeleportDisplayTimer.reset(); - - - - self->setVisible(FALSE); - if ( LLURLHistory::appendToURLCollection("regionuri",text)) - { - // since URL history only populated on create of sInstance, add to combo list directly - LLComboBox* regioncombo = self->getChild("teleport_edit"); - // BUG : this should add the new item to the combo box, but doesn't - regioncombo->addSimpleElement(text); - } - -} - -void LLFloaterTeleport::onClickCancel(void *userdata) -{ - LLFloaterTeleport* self = (LLFloaterTeleport*)userdata; - LL_INFOS("OGPX") << "Teleport Cancel " << self->getName() << LL_ENDL; - self->setVisible(FALSE); -} diff --git a/indra/newview/llfloaterteleport.h b/indra/newview/llfloaterteleport.h deleted file mode 100644 index 58e907a68..000000000 --- a/indra/newview/llfloaterteleport.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @file llfloaterteleport.h - * @brief floater header for agentd teleports. - * - * $LicenseInfo:firstyear=2008&license=viewergpl$ - * - * Copyright (c) 2008, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ -// Teleport floater for agent domain TPs using URIs. -//Copyright International Business Machines Corporation 2008-9 -//Contributed to Linden Research, Inc. under the Second Life Viewer Contribution -//Agreement and licensed as above. -#ifndef LL_FLOATER_TELEPORT_H -#define LL_FLOATER_TELEPORT_H -#include "llfloater.h" - -class LLFloaterTeleport : public LLFloater -{ -public: - LLFloaterTeleport(); - - virtual ~LLFloaterTeleport(); - - // by convention, this shows the floater and does instance management - static void show(void*); - -private: - // when a line editor loses keyboard focus, it is committed. - // commit callbacks are named onCommitWidgetName by convention. - static void onCommitTeleport(LLUICtrl* ctrl, void *userdata); - - // by convention, button callbacks are named onClickButtonLabel - static void onClickTeleport(void* userdata); - static void onClickCancel(void *userdata); - - // no pointers to widgets here - they are referenced by name - - // assuming we just need one, which is typical - static LLFloaterTeleport* sInstance; - -}; -#endif - diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 4d4e7ce8f..4b2466f89 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2112,25 +2112,6 @@ bool LLInventoryModel::loadSkeleton( return rv; } -//OGPX crap. Since this function is actually functionally the same as its LLSD variant.. -// just convert options_t to LLSD and route to the LLSD version. Yuck. -bool LLInventoryModel::loadSkeleton( - const LLInventoryModel::options_t& options, - const LLUUID& owner_id) -{ - LLSD options_list; - for(options_t::const_iterator it = options.begin(); it < options.end(); ++it) - { - LLSD entry; - for(response_t::const_iterator it2 = it->begin(); it2 != it->end(); ++it2) - { - entry[it2->first]=it2->second; - } - options_list.append(entry); - } - return loadSkeleton(options_list,owner_id); -} - // This is a brute force method to rebuild the entire parent-child // relations. The overall operation has O(NlogN) performance, which // should be sufficient for our needs. diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 09a85ba5d..259b08f87 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -409,14 +409,6 @@ public: void addCategory(LLViewerInventoryCategory* category); void addItem(LLViewerInventoryItem* item); - // methods to load up inventory skeleton & meat. These are used - // during authentication. return true if everything parsed. - typedef std::map response_t; - typedef std::vector options_t; - - - //OGPX really screwed with the login process. This is needed until it's all sorted out. - bool loadSkeleton(const options_t& options, const LLUUID& owner_id); /** Mutators ** ** *******************************************************************************/ diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 6f0cdf10c..10b563484 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -62,7 +62,6 @@ #include "llui.h" #include "lluiconstants.h" #include "llurlhistory.h" // OGPX : regionuri text box has a history of region uris (if FN/LN are loaded at startup) -#include "llviewerbuild.h" #include "llviewertexturelist.h" #include "llviewermenu.h" // for handle_preferences() #include "llviewernetwork.h" @@ -254,7 +253,7 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect) gVersionMajor, gVersionMinor, gVersionPatch, - LL_VIEWER_BUILD ); + gVersionBuild ); LLTextBox* channel_text = getChild("channel_text"); channel_text->setTextArg("[CHANNEL]", channel); // though not displayed channel_text->setTextArg("[VERSION]", version); diff --git a/indra/newview/llurlhistory.cpp b/indra/newview/llurlhistory.cpp index 876ce02d4..57fc7e3f8 100644 --- a/indra/newview/llurlhistory.cpp +++ b/indra/newview/llurlhistory.cpp @@ -106,39 +106,6 @@ LLSD LLURLHistory::getURLHistory(const std::string& collection) return LLSD(); } -// OGPX : static function that appends unique values to existing collection. -// returns true if appended, else false. -BOOL LLURLHistory::appendToURLCollection(const std::string& collection, const std::string& url) -{ - if (!url.empty()) - { - BOOL found_current_url = FALSE; - // make room for the new url if needed - // always append to the end and remove from the front so you have the most recent. - if (sHistorySD[collection].size() >= MAX_URL_COUNT) - { - sHistorySD[collection].erase(0); - } - - LLSD::array_iterator iter_history = sHistorySD[collection].beginArray(); - LLSD::array_iterator iter_end = sHistorySD[collection].endArray(); - for (; iter_history != iter_end; ++iter_history) - { - if ((*iter_history).asString() == url) - { - found_current_url = TRUE; - } - } - if (!found_current_url ) - { - sHistorySD[collection].append(LLSD(url)); - LLURLHistory::limitSize(collection); - //llinfos << " appending XX" << url << "XX urlcollection: " << LLSDOStreamer(sHistorySD) << llendl; - return TRUE; // value was unique, needed to be inserted - } - } - return FALSE; // value was empty or already in the collection -} // static void LLURLHistory::addURL(const std::string& collection, const std::string& url) { diff --git a/indra/newview/llurlhistory.h b/indra/newview/llurlhistory.h index 1c7e6637c..2b9d41429 100644 --- a/indra/newview/llurlhistory.h +++ b/indra/newview/llurlhistory.h @@ -49,9 +49,6 @@ public: static LLSD getURLHistory(const std::string& collection); static void addURL(const std::string& collection, const std::string& url); - // OGPX appends url to a collection if it doesn't already exist in the collection. - // this is used in the collection of region URIs that are saved per region - static BOOL appendToURLCollection(const std::string& collection, const std::string& url); static void removeURL(const std::string& collection, const std::string& url); static void clear(const std::string& collection); diff --git a/indra/newview/lluserauth.cpp b/indra/newview/lluserauth.cpp index c2f00bb68..21e9835ea 100644 --- a/indra/newview/lluserauth.cpp +++ b/indra/newview/lluserauth.cpp @@ -40,7 +40,6 @@ #include "lldir.h" #include "sgversion.h" #include "llappviewer.h" -#include "llviewerbuild.h" #include "llviewercontrol.h" #include "llxmlrpcresponder.h" #include "llsdutil.h" diff --git a/indra/newview/llviewerbuild.h b/indra/newview/llviewerbuild.h deleted file mode 100644 index b02bdece5..000000000 --- a/indra/newview/llviewerbuild.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file llviewerbuild.h - * @brief Sets viewer build number - * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "sgversion.h" - -// Set the build number in indra/llcommon/llversionviewer.h! - -const S32 LL_VIEWER_BUILD = gVersionBuild; diff --git a/indra/newview/skins/default/xui/en-us/floater_teleport.xml b/indra/newview/skins/default/xui/en-us/floater_teleport.xml deleted file mode 100644 index 9460de5f6..000000000 --- a/indra/newview/skins/default/xui/en-us/floater_teleport.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Public Region Seed: - - - + LiruMouselookHidesToolbar + + Comment + Whether or not the toolbar will be hidden in mouselook + Persist + 1 + Type + Boolean + Value + 1 + LiruMouselookMenu Comment diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index f924b93c2..5612088d8 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -58,24 +58,30 @@ #if LL_DARWIN - #include "llresizehandle.h" - #include "llviewerwindow.h" +#include "llresizehandle.h" +#include "llviewerwindow.h" - // This class draws like an LLResizeHandle but has no interactivity. - // It's just there to provide a cue to the user that the lower right corner of the window functions as a resize handle. - class LLFakeResizeHandle : public LLResizeHandle +// This class draws like an LLResizeHandle but has no interactivity. +// It's just there to provide a cue to the user that the lower right corner of the window functions as a resize handle. +class LLFakeResizeHandle : public LLResizeHandle +{ +public: + LLFakeResizeHandle(const LLResizeHandle::Params& p) : LLResizeHandle(p) {} + + virtual BOOL handleHover(S32 x, S32 y, MASK mask) { return false; } + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return false; } + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) { return false; } + virtual void reshape(S32 width, S32 height, BOOL called_from_parent) { - public: - LLFakeResizeHandle(const LLResizeHandle::Params& p) - : LLResizeHandle(p) - { - } + // Only when running in windowed mode on the Mac, leave room for a resize widget on the right edge of the bar. + if (gViewerWindow->getWindow()->getFullscreen()) + return setVisible(false); - virtual BOOL handleHover(S32 x, S32 y, MASK mask) { return FALSE; }; - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) { return FALSE; }; - - }; + setVisible(true); + const F32 wide(gViewerWindow->getWindowWidth() + 2); + setRect(LLRect(wide - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, wide, 0)); + } +}; #endif // LL_DARWIN @@ -98,9 +104,6 @@ void show_floater(const std::string& floater_name); LLToolBar::LLToolBar() : LLLayoutPanel() -#if LL_DARWIN - , mResizeHandle(NULL) -#endif // LL_DARWIN { setIsChrome(TRUE); setFocusRoot(TRUE); @@ -130,22 +133,16 @@ BOOL LLToolBar::postBuild() } #if LL_DARWIN - if(mResizeHandle == NULL) - { - LLResizeHandle::Params p; - p.rect(LLRect(0, 0, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT)); - p.name(std::string("")); - p.min_width(RESIZE_HANDLE_WIDTH); - p.min_height(RESIZE_HANDLE_HEIGHT); - p.corner(LLResizeHandle::RIGHT_BOTTOM); - mResizeHandle = new LLFakeResizeHandle(p); this->addChildInBack(mResizeHandle); - LLLayoutStack* toolbar_stack = getChild("toolbar_stack"); - toolbar_stack->reshape(toolbar_stack->getRect().getWidth() - RESIZE_HANDLE_WIDTH, toolbar_stack->getRect().getHeight()); - } + LLResizeHandle::Params p; + p.rect(LLRect(0, 0, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT)); + p.name(std::string("")); + p.min_width(RESIZE_HANDLE_WIDTH); + p.min_height(RESIZE_HANDLE_HEIGHT); + p.corner(LLResizeHandle::RIGHT_BOTTOM); + addChildInBack(new LLFakeResizeHandle(p)); + reshape(getRect().getWidth(), getRect().getHeight()); #endif // LL_DARWIN - layoutButtons(); - return TRUE; } @@ -161,18 +158,18 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* accept, std::string& tooltip_msg) { - LLButton* inventory_btn = getChild("inventory_btn"); + LLButton* inventory_btn = mInventoryBtn; if (!inventory_btn || !inventory_btn->getVisible()) return FALSE; LLInventoryView* active_inventory = LLInventoryView::getActiveInventory(); if (active_inventory && active_inventory->getVisible()) { - mInventoryAutoOpen = FALSE; + mInventoryAutoOpenTimer.stop(); } else if (inventory_btn->getRect().pointInRect(x, y)) { - if (mInventoryAutoOpen) + if (mInventoryAutoOpenTimer.getStarted()) { if (!(active_inventory && active_inventory->getVisible()) && mInventoryAutoOpenTimer.getElapsedTimeF32() > sInventoryAutoOpenTime) @@ -182,71 +179,35 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, } else { - mInventoryAutoOpen = TRUE; - mInventoryAutoOpenTimer.reset(); + mInventoryAutoOpenTimer.start(); } } return LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } -void LLToolBar::layoutButtons() -{ -#if LL_DARWIN - const S32 FUDGE_WIDTH_OF_SCREEN = 4; - S32 width = gViewerWindow->getWindowWidth() + FUDGE_WIDTH_OF_SCREEN; - S32 pad = 2; - - // this function may be called before postBuild(), in which case mResizeHandle won't have been set up yet. - if(mResizeHandle != NULL) - { - if(!gViewerWindow->getWindow()->getFullscreen()) - { - // Only when running in windowed mode on the Mac, leave room for a resize widget on the right edge of the bar. - width -= RESIZE_HANDLE_WIDTH; - - LLRect r; - r.mLeft = width - pad; - r.mBottom = 0; - r.mRight = r.mLeft + RESIZE_HANDLE_WIDTH; - r.mTop = r.mBottom + RESIZE_HANDLE_HEIGHT; - mResizeHandle->setRect(r); - mResizeHandle->setVisible(TRUE); - } - else - { - mResizeHandle->setVisible(FALSE); - } - } -#endif // LL_DARWIN -} - - -// virtual -void LLToolBar::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLPanel::reshape(width, height, called_from_parent); - - layoutButtons(); -} - // Per-frame updates of visibility void LLToolBar::refresh() { - if(!isAgentAvatarValid()) - return; + static const LLCachedControl show_toolbar("ShowToolBar", true); + bool show = show_toolbar; + if (show && gAgentCamera.cameraMouselook()) + { + static const LLCachedControl hidden("LiruMouselookHidesToolbar"); + show = !hidden; + } + setVisible(show); + if (!show) return; // Everything below this point manipulates visible UI, anyway - static LLCachedControl show("ShowToolBar", true); - BOOL mouselook = gAgentCamera.cameraMouselook(); - setVisible(show && !mouselook); + updateCommunicateList(); - static LLCachedControl continue_flying_on_unsit("LiruContinueFlyingOnUnsit"); - bool sitting = !continue_flying_on_unsit && gAgentAvatarp && gAgentAvatarp->isSitting(); + if (!isAgentAvatarValid()) return; - mFlyBtn->setEnabled((gAgent.canFly() || gAgent.getFlying()) && !sitting ); - static LLCachedControl ascent_build_always_enabled("AscentBuildAlwaysEnabled", true); - mBuildBtn->setEnabled((LLViewerParcelMgr::getInstance()->allowAgentBuild() || ascent_build_always_enabled)); + static const LLCachedControl continue_flying_on_unsit("LiruContinueFlyingOnUnsit"); + mFlyBtn->setEnabled((gAgent.canFly() || gAgent.getFlying()) && (continue_flying_on_unsit || !gAgentAvatarp->isSitting())); + static const LLCachedControl ascent_build_always_enabled("AscentBuildAlwaysEnabled", true); + mBuildBtn->setEnabled(ascent_build_always_enabled || LLViewerParcelMgr::getInstance()->allowAgentBuild()); // Check to see if we're in build mode // And not just clicking on a scripted object @@ -268,11 +229,6 @@ void LLToolBar::refresh() mInventoryBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV)); } // [/RLVa:KB] - - if (isInVisibleChain() && mCommunicateBtn->getVisible()) - { - updateCommunicateList(); - } } void bold_if_equal(const LLFloater* f1, const LLFloater* f2, LLScrollListItem* itemp) @@ -283,11 +239,13 @@ void bold_if_equal(const LLFloater* f1, const LLFloater* f2, LLScrollListItem* i void LLToolBar::updateCommunicateList() { + if (!mCommunicateBtn->getVisible()) return; + LLSD selected = mCommunicateBtn->getValue(); mCommunicateBtn->removeall(); - LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater(); + const LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater(); bold_if_equal(LLFloaterMyFriends::getInstance(), frontmost_floater, mCommunicateBtn->add(LLFloaterMyFriends::getInstance()->getShortTitle(), LLSD("contacts"), ADD_TOP)); bold_if_equal(LLFloaterChat::getInstance(), frontmost_floater, mCommunicateBtn->add(LLFloaterChat::getInstance()->getShortTitle(), LLSD("local chat"), ADD_TOP)); mCommunicateBtn->addSeparator(ADD_TOP); @@ -300,11 +258,11 @@ void LLToolBar::updateCommunicateList() { if (LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get()) { - S32 count = im_floaterp->getNumUnreadMessages(); + const S32 count = im_floaterp->getNumUnreadMessages(); std::string floater_title; if (count > 0) floater_title = "*"; floater_title.append(im_floaterp->getShortTitle()); - static LLCachedControl show_counts("ShowUnreadIMsCounts", true); + static const LLCachedControl show_counts("ShowUnreadIMsCounts", true); if (show_counts && count > 0) { floater_title += " - "; @@ -323,7 +281,8 @@ void LLToolBar::updateCommunicateList() } } - mCommunicateBtn->setToggleState(gSavedSettings.getBOOL("ShowCommunicate")); + static const LLCachedControl show_comm("ShowCommunicate", true); + mCommunicateBtn->setToggleState(show_comm); if (!selected.isUndefined()) mCommunicateBtn->setValue(selected); } diff --git a/indra/newview/lltoolbar.h b/indra/newview/lltoolbar.h index 23307a78b..958c0b4bc 100644 --- a/indra/newview/lltoolbar.h +++ b/indra/newview/lltoolbar.h @@ -41,10 +41,6 @@ // "Constants" loaded from settings.xml at start time extern S32 TOOL_BAR_HEIGHT; -#if LL_DARWIN - class LLFakeResizeHandle; -#endif // LL_DARWIN - class LLFlyoutButton; class LLToolBar @@ -62,11 +58,6 @@ public: EAcceptance* accept, std::string& tooltip_msg); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - - // Move buttons to appropriate locations based on rect. - void layoutButtons(); - // Per-frame refresh call void refresh(); @@ -79,12 +70,8 @@ private: void updateCommunicateList(); private: - BOOL mInventoryAutoOpen; LLFrameTimer mInventoryAutoOpenTimer; S32 mNumUnreadIMs; -#if LL_DARWIN - LLFakeResizeHandle *mResizeHandle; -#endif // LL_DARWIN CachedUICtrl mCommunicateBtn; CachedUICtrl mFlyBtn; diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml index aadd1526c..0baf30023 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml @@ -9,6 +9,7 @@ + Movement Options: From 0b2d019e612a5162d4d699a897ad57396d0e8f5e Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 8 Apr 2014 01:07:19 -0400 Subject: [PATCH 31/96] Latif's requested touch-ups for IM windows in concise mode. Profile option for concise flyout. Fix for ding in multi-user chats breaking button alignment. --- indra/newview/llimpanel.cpp | 2 +- .../en-us/floater_instant_message_ad_hoc_concisebuttons.xml | 6 +++--- .../xui/en-us/floater_instant_message_concisebuttons.xml | 1 + .../en-us/floater_instant_message_group_concisebuttons.xml | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index aaf79dbfc..76e81a87b 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -969,7 +969,7 @@ void copy_profile_uri(const LLUUID& id, bool group = false); void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value) { - if (value.isUndefined()) + if (value.isUndefined() || value == LLSD(0)) { LLAvatarActions::showProfile(mOtherParticipantUUID); return; diff --git a/indra/newview/skins/default/xui/en-us/floater_instant_message_ad_hoc_concisebuttons.xml b/indra/newview/skins/default/xui/en-us/floater_instant_message_ad_hoc_concisebuttons.xml index 57188eac1..88bb69bcb 100644 --- a/indra/newview/skins/default/xui/en-us/floater_instant_message_ad_hoc_concisebuttons.xml +++ b/indra/newview/skins/default/xui/en-us/floater_instant_message_ad_hoc_concisebuttons.xml @@ -1,5 +1,5 @@ - + Joining Voice Chat... Connected, click End Call to hang up Left Voice Chat @@ -8,8 +8,8 @@ [NAME] is typing... Starting session with [NAME], please wait. Click here to instant message. - + + + From 4c82a5660fb2a67b8659ea66fc0a6f29b6ef0b14 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 17 Apr 2014 18:20:34 -0400 Subject: [PATCH 45/96] [LLMeshRepo sync] Change camelcase LLConvexDecomp to lowercase, so mergetool is happy~ --- indra/libndhacd/CMakeLists.txt | 6 +++--- ...{LLConvexDecomposition.cpp => llconvexdecomposition.cpp} | 4 ++-- .../{LLConvexDecomposition.h => llconvexdecomposition.h} | 2 +- ...sitionStubImpl.cpp => llconvexdecompositionstubimpl.cpp} | 4 ++-- ...ompositionStubImpl.h => llconvexdecompositionstubimpl.h} | 4 ++-- indra/libndhacd/nd_StructTracer.h | 2 +- indra/libndhacd/nd_hacdConvexDecomposition.h | 2 +- indra/libndhacd/nd_hacdStructs.cpp | 1 - indra/libndhacd/nd_hacdStructs.h | 2 +- indra/libndhacd/nd_hacdUtils.h | 1 - indra/newview/llmeshrepository.h | 2 +- 11 files changed, 14 insertions(+), 16 deletions(-) rename indra/libndhacd/{LLConvexDecomposition.cpp => llconvexdecomposition.cpp} (96%) rename indra/libndhacd/{LLConvexDecomposition.h => llconvexdecomposition.h} (99%) rename indra/libndhacd/{LLConvexDecompositionStubImpl.cpp => llconvexdecompositionstubimpl.cpp} (97%) rename indra/libndhacd/{LLConvexDecompositionStubImpl.h => llconvexdecompositionstubimpl.h} (97%) diff --git a/indra/libndhacd/CMakeLists.txt b/indra/libndhacd/CMakeLists.txt index bcc1973c0..28c4d2f9a 100644 --- a/indra/libndhacd/CMakeLists.txt +++ b/indra/libndhacd/CMakeLists.txt @@ -7,7 +7,7 @@ include(00-Common) include_directories(${LIBS_OPEN_DIR}/libhacd) set (libndhacd_SOURCE_FILES - LLConvexDecomposition.cpp + llconvexdecomposition.cpp nd_hacdConvexDecomposition.cpp nd_hacdStructs.cpp nd_hacdUtils.cpp @@ -16,12 +16,12 @@ set (libndhacd_SOURCE_FILES ) set (libndhacd_HEADER_FILES - LLConvexDecomposition.h + llconvexdecomposition.h ndConvexDecomposition.h nd_hacdConvexDecomposition.h nd_hacdStructs.h nd_StructTracer.h - LLConvexDecompositionStubImpl.h + llconvexdecompositionstubimpl.h nd_EnterExitTracer.h nd_hacdDefines.h nd_hacdUtils.h diff --git a/indra/libndhacd/LLConvexDecomposition.cpp b/indra/libndhacd/llconvexdecomposition.cpp similarity index 96% rename from indra/libndhacd/LLConvexDecomposition.cpp rename to indra/libndhacd/llconvexdecomposition.cpp index 80ec5f435..2c1948629 100644 --- a/indra/libndhacd/LLConvexDecomposition.cpp +++ b/indra/libndhacd/llconvexdecomposition.cpp @@ -1,5 +1,5 @@ /** - * @file LLConvexDecomposition.cpp + * @file llconvexdecomposition.cpp * @author falcon@lindenlab.com * @brief A stub implementation of LLConvexDecomposition interface * @@ -35,7 +35,7 @@ #include "nd_hacdConvexDecomposition.h" -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" /*static */bool LLConvexDecomposition::s_isInitialized = false; diff --git a/indra/libndhacd/LLConvexDecomposition.h b/indra/libndhacd/llconvexdecomposition.h similarity index 99% rename from indra/libndhacd/LLConvexDecomposition.h rename to indra/libndhacd/llconvexdecomposition.h index 2d7f5aa3a..9603c434f 100644 --- a/indra/libndhacd/LLConvexDecomposition.h +++ b/indra/libndhacd/llconvexdecomposition.h @@ -1,5 +1,5 @@ /** - * @file LLConvexDecomposition.cpp + * @file llconvexdecomposition.cpp * @brief LLConvexDecomposition interface definition * * $LicenseInfo:firstyear=2011&license=viewerlgpl$ diff --git a/indra/libndhacd/LLConvexDecompositionStubImpl.cpp b/indra/libndhacd/llconvexdecompositionstubimpl.cpp similarity index 97% rename from indra/libndhacd/LLConvexDecompositionStubImpl.cpp rename to indra/libndhacd/llconvexdecompositionstubimpl.cpp index 018143de1..d91f2ea86 100644 --- a/indra/libndhacd/LLConvexDecompositionStubImpl.cpp +++ b/indra/libndhacd/llconvexdecompositionstubimpl.cpp @@ -1,5 +1,5 @@ /** - * @file LLConvexDecompositionStubImpl.cpp + * @file llconvexdecompositionstubimpl.cpp * @author falcon@lindenlab.com * @brief A stub implementation of LLConvexDecomposition * @@ -28,7 +28,7 @@ #include #include -#include "LLConvexDecompositionStubImpl.h" +#include "llconvexdecompositionstubimpl.h" LLConvexDecomposition* LLConvexDecompositionImpl::getInstance() { diff --git a/indra/libndhacd/LLConvexDecompositionStubImpl.h b/indra/libndhacd/llconvexdecompositionstubimpl.h similarity index 97% rename from indra/libndhacd/LLConvexDecompositionStubImpl.h rename to indra/libndhacd/llconvexdecompositionstubimpl.h index 9599175ef..023bd7c23 100644 --- a/indra/libndhacd/LLConvexDecompositionStubImpl.h +++ b/indra/libndhacd/llconvexdecompositionstubimpl.h @@ -1,5 +1,5 @@ /** - * @file LLConvexDecompositionStubImpl.h + * @file llconvexdecompositionstubimpl.h * @author falcon@lindenlab.com * @brief A stub implementation of LLConvexDecomposition * @@ -29,7 +29,7 @@ #ifndef LL_CONVEX_DECOMP_UTIL_H #define LL_CONVEX_DECOMP_UTIL_H -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" class LLConvexDecompositionImpl : public LLConvexDecomposition { diff --git a/indra/libndhacd/nd_StructTracer.h b/indra/libndhacd/nd_StructTracer.h index 6dbe3ce3e..631bfd788 100644 --- a/indra/libndhacd/nd_StructTracer.h +++ b/indra/libndhacd/nd_StructTracer.h @@ -21,7 +21,7 @@ #include "ndConvexDecomposition.h" -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include "nd_hacdStructs.h" namespace ndStructTracer diff --git a/indra/libndhacd/nd_hacdConvexDecomposition.h b/indra/libndhacd/nd_hacdConvexDecomposition.h index e31779c65..6b7c7f952 100644 --- a/indra/libndhacd/nd_hacdConvexDecomposition.h +++ b/indra/libndhacd/nd_hacdConvexDecomposition.h @@ -19,7 +19,7 @@ #ifndef ND_HACD_CONVEXDECOMP_H #define ND_HACD_CONVEXDECOMP_H -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include #include diff --git a/indra/libndhacd/nd_hacdStructs.cpp b/indra/libndhacd/nd_hacdStructs.cpp index 4a5c9e6fb..8d3a21462 100644 --- a/indra/libndhacd/nd_hacdStructs.cpp +++ b/indra/libndhacd/nd_hacdStructs.cpp @@ -17,7 +17,6 @@ */ #include "nd_hacdStructs.h" -#include "LLConvexDecomposition.h" void DecompHull::clear() { diff --git a/indra/libndhacd/nd_hacdStructs.h b/indra/libndhacd/nd_hacdStructs.h index 5097b7428..c295fedca 100644 --- a/indra/libndhacd/nd_hacdStructs.h +++ b/indra/libndhacd/nd_hacdStructs.h @@ -21,7 +21,7 @@ #include "nd_hacdDefines.h" #include "hacdHACD.h" -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include struct LLCDHull; diff --git a/indra/libndhacd/nd_hacdUtils.h b/indra/libndhacd/nd_hacdUtils.h index e2d80e78d..8a59125ab 100644 --- a/indra/libndhacd/nd_hacdUtils.h +++ b/indra/libndhacd/nd_hacdUtils.h @@ -20,7 +20,6 @@ #define ND_HACD_UTILS_H #include "nd_hacdStructs.h" -#include "LLConvexDecomposition.h" tHACD* init( int nConcavity, int nClusters, int nMaxVerticesPerHull, double dMaxConnectDist, HACDDecoder *aData ); DecompData decompose( tHACD *aHACD ); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 4b535f397..33447db7b 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -36,7 +36,7 @@ #define LLCONVEXDECOMPINTER_STATIC 1 -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include "lluploadfloaterobservers.h" #include "aistatemachinethread.h" From 5c06afc977d173435dc063936cdc7c9d2afbcf47 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 17 Apr 2014 20:23:48 -0400 Subject: [PATCH 46/96] [LLMeshRepo sync] AICurl updates toward LLCurl LLHTTPClient::getByteRange no longer throws AICurlNoEasyHandle, instead it returns whether or not it threw, to match the true/false convention of LLCurl. - In addition, the header param has been shifted to earlier in this function to ease diffings. ResponderBase now has static bool isGoodStatus, introduced into the Responder base class of LLCurl --- indra/llmessage/llhttpclient.cpp | 16 ++- indra/llmessage/llhttpclient.h | 14 +- indra/newview/llfloateravatarpicker.cpp | 2 +- indra/newview/llmeshrepository.cpp | 167 +++++++++++------------- indra/newview/llmeshrepository.h | 2 +- indra/newview/llvoavatarself.cpp | 2 +- 6 files changed, 99 insertions(+), 104 deletions(-) diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 1374a1b93..bd40d8e69 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -237,13 +237,21 @@ void LLHTTPClient::request( req->run(parent, new_parent_state, parent != NULL, true, default_engine); } -void LLHTTPClient::getByteRange(std::string const& url, S32 offset, S32 bytes, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug)) +bool LLHTTPClient::getByteRange(std::string const& url, AIHTTPHeaders& headers, S32 offset, S32 bytes, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug)) { - if(offset > 0 || bytes > 0) + try { - headers.addHeader("Range", llformat("bytes=%d-%d", offset, offset + bytes - 1)); + if (offset > 0 || bytes > 0) + { + headers.addHeader("Range", llformat("bytes=%d-%d", offset, offset + bytes - 1)); + } + request(url, HTTP_GET, NULL, responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug)); } - request(url, HTTP_GET, NULL, responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug)); + catch(AICurlNoEasyHandle const&) + { + return false; + } + return true; } void LLHTTPClient::head(std::string const& url, ResponderHeadersOnly* responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug)) diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index a366811d6..3bb60b04f 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -133,6 +133,14 @@ public: public: typedef boost::shared_ptr buffer_ptr_t; + /** + * @brief return true if the status code indicates success. + */ + static bool isGoodStatus(U32 status) + { + return((200 <= status) && (status < 300)); + } + protected: ResponderBase(void); virtual ~ResponderBase(); @@ -452,9 +460,9 @@ public: static void head(std::string const& url, ResponderHeadersOnly* responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) { AIHTTPHeaders headers; head(url, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } - static void getByteRange(std::string const& url, S32 offset, S32 bytes, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); - static void getByteRange(std::string const& url, S32 offset, S32 bytes, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) - { AIHTTPHeaders headers; getByteRange(url, offset, bytes, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } + static bool getByteRange(std::string const& url, AIHTTPHeaders& headers, S32 offset, S32 bytes, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); + static bool getByteRange(std::string const& url, S32 offset, S32 bytes, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) + { AIHTTPHeaders headers; return getByteRange(url, headers, offset, bytes, responder/*,*/ DEBUG_CURLIO_PARAM(debug)); } static void get(std::string const& url, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); static void get(std::string const& url, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index f503fa3ba..718750b5f 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -427,7 +427,7 @@ public: // in case of invalid characters, the avatar picker returns a 400 // just set it to process so it displays 'not found' - if ((200 <= status && status < 300) || status == 400) + if (isGoodStatus(status) || status == 400) { if (LLFloaterAvatarPicker::instanceExists()) { diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 5a55d2562..4b46e1ca0 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -239,7 +239,7 @@ public: } } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -278,7 +278,7 @@ public: } } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -306,7 +306,7 @@ public: llassert(mProcessed || LLApp::isExiting()); } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -334,7 +334,7 @@ public: llassert(mProcessed || LLApp::isExiting()); } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -362,7 +362,7 @@ public: llassert(mProcessed || LLApp::isExiting()); } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -437,7 +437,7 @@ public: { } - /*virtual*/ void completed(U32 status, + virtual void completed(U32 status, const std::string& reason, const LLSD& content) { @@ -451,7 +451,7 @@ public: LLWholeModelFeeObserver* observer = mObserverHandle.get(); - if (((200 <= status) && (status < 300)) && + if (isGoodStatus(status) && cc["state"].asString() == "upload") { mWholeModelUploadURL = cc["uploader"].asString(); @@ -495,7 +495,7 @@ public: { } - /*virtual*/ void completed(U32 status, + virtual void completed(U32 status, const std::string& reason, const LLSD& content) { @@ -511,7 +511,7 @@ public: // requested "mesh" asset type isn't actually the type // of the resultant object, fix it up here. - if (((200 <= status) && (status < 300)) && + if (isGoodStatus(status) && cc["state"].asString() == "complete") { mModelData["asset_type"] = "object"; @@ -583,50 +583,35 @@ void LLMeshRepoThread::run() while (!mLODReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && sActiveLODRequests < (S32)sMaxConcurrentRequests) { + if (mMutex) { mMutex->lock(); LODRequest req = mLODReqQ.front(); mLODReqQ.pop(); LLMeshRepository::sLODProcessing--; mMutex->unlock(); - try + if (!fetchMeshLOD(req.mMeshParams, req.mLOD, count))//failed, resubmit { - fetchMeshLOD(req.mMeshParams, req.mLOD, count); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshLOD() failed: " << error.what() << llendl; mMutex->lock(); - LLMeshRepository::sLODProcessing++; mLODReqQ.push(req); mMutex->unlock(); - break; } } } while (!mHeaderReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && sActiveHeaderRequests < (S32)sMaxConcurrentRequests) { + if (mMutex) { mMutex->lock(); HeaderRequest req = mHeaderReqQ.front(); mHeaderReqQ.pop(); mMutex->unlock(); - bool success = false; - try - { - success = fetchMeshHeader(req.mMeshParams, count); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshHeader() failed: " << error.what() << llendl; - } - if (!success) + if (!fetchMeshHeader(req.mMeshParams, count))//failed, resubmit { mMutex->lock(); mHeaderReqQ.push(req) ; mMutex->unlock(); - break; } } } @@ -636,16 +621,7 @@ void LLMeshRepoThread::run() for (std::set::iterator iter = mSkinRequests.begin(); iter != mSkinRequests.end(); ++iter) { LLUUID mesh_id = *iter; - bool success = false; - try - { - success = fetchMeshSkinInfo(mesh_id); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshSkinInfo(" << mesh_id << ") failed: " << error.what() << llendl; - } - if (!success) + if (!fetchMeshSkinInfo(mesh_id)) { incomplete.insert(mesh_id); } @@ -658,16 +634,7 @@ void LLMeshRepoThread::run() for (std::set::iterator iter = mDecompositionRequests.begin(); iter != mDecompositionRequests.end(); ++iter) { LLUUID mesh_id = *iter; - bool success = false; - try - { - success = fetchMeshDecomposition(mesh_id); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshDecomposition(" << mesh_id << ") failed: " << error.what() << llendl; - } - if (!success) + if (!fetchMeshDecomposition(mesh_id)) { incomplete.insert(mesh_id); } @@ -680,16 +647,7 @@ void LLMeshRepoThread::run() for (std::set::iterator iter = mPhysicsShapeRequests.begin(); iter != mPhysicsShapeRequests.end(); ++iter) { LLUUID mesh_id = *iter; - bool success = false; - try - { - success = fetchMeshPhysicsShape(mesh_id); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshPhysicsShape(" << mesh_id << ") failed: " << error.what() << llendl; - } - if (!success) + if (!fetchMeshPhysicsShape(mesh_id)) { incomplete.insert(mesh_id); } @@ -799,6 +757,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) return false; } + bool ret = true ; U32 header_size = mMeshHeaderSize[mesh_id]; if (header_size > 0) @@ -820,7 +779,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -845,9 +804,12 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) { - LLHTTPClient::getByteRange(http_url, offset, size, - new LLMeshSkinInfoResponder(mesh_id, offset, size), headers); - LLMeshRepository::sHTTPRequestCount++; + ret = LLHTTPClient::getByteRange(http_url, headers, offset, size, + new LLMeshSkinInfoResponder(mesh_id, offset, size)); + if (ret) + { + LLMeshRepository::sHTTPRequestCount++; + } } } } @@ -857,7 +819,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) } //early out was not hit, effectively fetched - return true; + return ret; } //return false if failed to get header @@ -873,6 +835,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) } U32 header_size = mMeshHeaderSize[mesh_id]; + bool ret = true ; if (header_size > 0) { @@ -893,7 +856,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -918,10 +881,12 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) { - // This might throw AICurlNoEasyHandle. - LLHTTPClient::getByteRange(http_url, offset, size, - new LLMeshDecompositionResponder(mesh_id, offset, size), headers); - LLMeshRepository::sHTTPRequestCount++; + ret = LLHTTPClient::getByteRange(http_url, headers, offset, size, + new LLMeshDecompositionResponder(mesh_id, offset, size)); + if(ret) + { + LLMeshRepository::sHTTPRequestCount++; + } } } } @@ -931,7 +896,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) } //early out was not hit, effectively fetched - return true; + return ret; } //return false if failed to get header @@ -947,6 +912,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) } U32 header_size = mMeshHeaderSize[mesh_id]; + bool ret = true ; if (header_size > 0) { @@ -992,10 +958,13 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) { - // This might throw AICurlNoEasyHandle. - LLHTTPClient::getByteRange(http_url, offset, size, - new LLMeshPhysicsShapeResponder(mesh_id, offset, size), headers); - LLMeshRepository::sHTTPRequestCount++; + ret = LLHTTPClient::getByteRange(http_url, headers, offset, size, + new LLMeshPhysicsShapeResponder(mesh_id, offset, size)); + + if(ret) + { + LLMeshRepository::sHTTPRequestCount++; + } } } else @@ -1009,7 +978,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) } //early out was not hit, effectively fetched - return true; + return ret; } //static @@ -1056,14 +1025,14 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c LLMeshRepository::sCacheBytesRead += bytes; file.read(buffer, bytes); if (headerReceived(mesh_params, buffer, bytes)) - { - // Already have header, no need to retry. + { //did not do an HTTP request, return false return true; } } } //either cache entry doesn't exist or is corrupt, request header from simulator + bool retval = true; AIHTTPHeaders headers("Accept", "application/octet-stream"); std::string http_url = constructUrl(mesh_params.getSculptID()); @@ -1072,19 +1041,24 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c //grab first 4KB if we're going to bother with a fetch. Cache will prevent future fetches if a full mesh fits //within the first 4KB //NOTE -- this will break of headers ever exceed 4KB - // This might throw AICurlNoEasyHandle. - LLHTTPClient::getByteRange(http_url, 0, 4096, new LLMeshHeaderResponder(mesh_params), headers); - LLMeshRepository::sHTTPRequestCount++; + retval = LLHTTPClient::getByteRange(http_url, headers, 0, 4096, new LLMeshHeaderResponder(mesh_params)); + if (retval) + { + LLMeshRepository::sHTTPRequestCount++; + } count++; } - return true; + return retval; } -void LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count) +//return false if failed to get mesh lod. +bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count) { //protected by mMutex mHeaderMutex->lock(); + bool retval = true; + LLUUID mesh_id = mesh_params.getSculptID(); U32 header_size = mMeshHeaderSize[mesh_id]; @@ -1120,7 +1094,7 @@ void LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, if (lodReceived(mesh_params, lod, buffer, size)) { delete[] buffer; - return; + return true; } } @@ -1133,10 +1107,13 @@ void LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) { - // This might throw AICurlNoEasyHandle. - LLHTTPClient::getByteRange(constructUrl(mesh_id), offset, size, - new LLMeshLODResponder(mesh_params, lod, offset, size), headers); - LLMeshRepository::sHTTPRequestCount++; + retval = LLHTTPClient::getByteRange(constructUrl(mesh_id), headers, offset, size, + new LLMeshLODResponder(mesh_params, lod, offset, size)); + + if (retval) + { + LLMeshRepository::sHTTPRequestCount++; + } count++; } else @@ -1476,18 +1453,18 @@ bool LLMeshUploadThread::run() void LLMeshUploadThread::postRequest(std::string& whole_model_upload_url, AIMeshUpload* state_machine) { - if (!mDoUpload) - { - LLHTTPClient::post(mWholeModelFeeCapability, mModelData, - new LLWholeModelFeeResponder(mModelData, mFeeObserverHandle, whole_model_upload_url)/*,*/ - DEBUG_CURLIO_PARAM(debug_on), keep_alive, state_machine, AIMeshUpload_responderFinished); - } - else + if (mDoUpload) { LLHTTPClient::post(whole_model_upload_url, mBody, new LLWholeModelUploadResponder(mModelData, mUploadObserverHandle)/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, state_machine, AIMeshUpload_responderFinished); } + else + { + LLHTTPClient::post(mWholeModelFeeCapability, mModelData, + new LLWholeModelFeeResponder(mModelData, mFeeObserverHandle, whole_model_upload_url)/*,*/ + DEBUG_CURLIO_PARAM(debug_on), keep_alive, state_machine, AIMeshUpload_responderFinished); + } } void dump_llsd_to_file(const LLSD& content, std::string filename) @@ -1877,6 +1854,7 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, } else { + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -1928,12 +1906,13 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason { if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); } else { + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 33447db7b..4ef99f1b1 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -324,7 +324,7 @@ public: void lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); void loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); bool fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count); - void fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count); + bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count); bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size); bool lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size); bool skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index c3ead99db..14cbd4993 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2492,7 +2492,7 @@ public: /*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers) { - if (200 <= status && status < 300) + if (isGoodStatus(status)) { LL_DEBUGS("Avatar") << "status OK" << llendl; } From c2748a22469e8529ca4b27ad4ab1f31bffa51fb5 Mon Sep 17 00:00:00 2001 From: Liru Date: Fri, 18 Apr 2014 04:43:46 -0400 Subject: [PATCH 47/96] [LLMeshRepo sync] The rest of the changes from upstream --- indra/newview/llmeshrepository.cpp | 185 ++++++++++++++++++++++------- indra/newview/llmeshrepository.h | 8 +- 2 files changed, 147 insertions(+), 46 deletions(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 4b46e1ca0..033619628 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -67,6 +67,7 @@ #include "aicurl.h" #include "boost/lexical_cast.hpp" + #ifndef LL_WINDOWS #include "netdb.h" #endif @@ -303,7 +304,14 @@ public: ~LLMeshSkinInfoResponder() { - llassert(mProcessed || LLApp::isExiting()); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -331,7 +339,14 @@ public: ~LLMeshDecompositionResponder() { - llassert(mProcessed || LLApp::isExiting()); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshDecomposition(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -359,7 +374,14 @@ public: ~LLMeshPhysicsShapeResponder() { - llassert(mProcessed || LLApp::isExiting()); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -542,6 +564,7 @@ public: LLMeshRepoThread::LLMeshRepoThread() : LLThread("mesh repo") { + mWaiting = false; mMutex = new LLMutex(); mHeaderMutex = new LLMutex(); mSignal = new LLCondition(); @@ -565,9 +588,13 @@ void LLMeshRepoThread::run() llwarns << "convex decomposition unable to be loaded" << llendl; } - mSignal->lock(); while (!LLApp::isQuitting()) { + mWaiting = true; + mSignal->wait(); + mWaiting = false; + + if (!LLApp::isQuitting()) { static U32 count = 0; @@ -659,7 +686,11 @@ void LLMeshRepoThread::run() mSignal->wait(); } - mSignal->unlock(); + + if (mSignal->isLocked()) + { //make sure to let go of the mutex associated with the given signal before shutting down + mSignal->unlock(); + } res = LLConvexDecomposition::quitThread(); if (res != LLCD_OK) @@ -692,6 +723,8 @@ void LLMeshRepoThread::lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 } } + + void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod) { //could be called from any thread LLMutexLock lock(mMutex); @@ -713,7 +746,7 @@ void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod) if (pending != mPendingLOD.end()) { //append this lod request to existing header request pending->second.push_back(lod); - llassert(pending->second.size() <= LLModel::NUM_LODS); + llassert(pending->second.size() <= LLModel::NUM_LODS) } else { //if no header request is pending, fetch header @@ -748,11 +781,16 @@ std::string LLMeshRepoThread::constructUrl(LLUUID mesh_id) bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) { //protected by mMutex + + if (!mHeaderMutex) + { + return false; + } + mHeaderMutex->lock(); if (mMeshHeader.find(mesh_id) == mMeshHeader.end()) - { - // We have no header info for this mesh, try again later. + { //we have no header info for this mesh, do nothing mHeaderMutex->unlock(); return false; } @@ -822,14 +860,17 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) return ret; } -//return false if failed to get header bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) { //protected by mMutex + if (!mHeaderMutex) + { + return false; + } + mHeaderMutex->lock(); if (mMeshHeader.find(mesh_id) == mMeshHeader.end()) - { - // We have no header info for this mesh, try again later. + { //we have no header info for this mesh, do nothing mHeaderMutex->unlock(); return false; } @@ -852,6 +893,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) if (file.getSize() >= offset+size) { LLMeshRepository::sCacheBytesRead += size; + file.seek(offset); U8* buffer = new U8[size]; file.read(buffer, size); @@ -899,14 +941,17 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) return ret; } -//return false if failed to get header bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) { //protected by mMutex + if (!mHeaderMutex) + { + return false; + } + mHeaderMutex->lock(); if (mMeshHeader.find(mesh_id) == mMeshHeader.end()) - { - // We have no header info for this mesh, retry later. + { //we have no header info for this mesh, do nothing mHeaderMutex->unlock(); return false; } @@ -933,7 +978,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -1055,6 +1100,11 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c //return false if failed to get mesh lod. bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count) { //protected by mMutex + if (!mHeaderMutex) + { + return false; + } + mHeaderMutex->lock(); bool retval = true; @@ -1082,7 +1132,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -1130,6 +1180,8 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, { mHeaderMutex->unlock(); } + + return retval; } bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size) @@ -1176,7 +1228,6 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat mMeshHeader[mesh_id] = header; } - LLMutexLock lock(mMutex); // make sure only one thread access mPendingLOD at the same time. //check for pending requests @@ -1189,10 +1240,8 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat mLODReqQ.push(req); LLMeshRepository::sLODProcessing++; } - - mPendingLOD.erase(iter); // FIRE-7182, only call erase if iter is really valid. + mPendingLOD.erase(iter); } - // mPendingLOD.erase(iter); // avoid crash by moving erase up. } return true; @@ -1352,6 +1401,11 @@ void LLMeshUploadThread::init(LLMeshUploadThread::instance_list& data, LLVector3 mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut") ; } +LLMeshUploadThread::~LLMeshUploadThread() +{ + +} + LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread) { mStage = "single_hull"; @@ -1712,8 +1766,14 @@ void LLMeshUploadThread::generateHulls() } } + void LLMeshRepoThread::notifyLoadedMeshes() -{//called via gMeshRepo.notifyLoadedMeshes(). mMutex already locked +{ + if (!mMutex) + { + return; + } + while (!mLoadedQ.empty()) { mMutex->lock(); @@ -1837,6 +1897,12 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, { mProcessed = true; + // thread could have already be destroyed during logout + if( !gMeshRepo.mThread ) + { + return; + } + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status >= 400) @@ -1895,6 +1961,12 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason { mProcessed = true; + // thread could have already be destroyed during logout + if( !gMeshRepo.mThread ) + { + return; + } + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status >= 400) @@ -1953,6 +2025,11 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r { mProcessed = true; + if( !gMeshRepo.mThread ) + { + return; + } + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status >= 400) @@ -1964,12 +2041,13 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r { if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshDecomposition(mMeshID); } else { + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -2010,6 +2088,12 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re { mProcessed = true; + // thread could have already be destroyed during logout + if( !gMeshRepo.mThread ) + { + return; + } + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status >= 400) @@ -2021,12 +2105,13 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re { if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); } else { + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -2067,18 +2152,27 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, { mProcessed = true; + // thread could have already be destroyed during logout + if( !gMeshRepo.mThread ) + { + return; + } + if (status < 200 || status >= 400) { //llwarns // << "Header responder failed with status: " // << status << ": " << reason << llendl; - // HTTP_SERVICE_UNAVAILABLE (503) or HTTP_INTERNAL_ERROR_*'s. + // 503 (service unavailable) or HTTP_INTERNAL_ERROR_*'s. // can be due to server load and can be retried // TODO*: Add maximum retry logic, exponential backoff // and (somewhat more optional than the others) retries // again after some set period of time + + llassert(status == HTTP_NOT_FOUND || status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR); + if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE) { //retry llwarns << "Timeout or service unavailable, retrying." << llendl; @@ -2091,7 +2185,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, } else { - llwarns << "Unhandled status." << llendl; + llwarns << "Unhandled status: " << status << llendl; } } @@ -2379,12 +2473,10 @@ void LLMeshRepository::notifyLoadedMeshes() //call completed callbacks on finished decompositions mDecompThread->notifyCompleted(); - if (!mThread->mSignal->tryLock()) - { - // Curl thread is churning, wait for it to go idle. + if (!mThread->mWaiting) + { //curl thread is churning, wait for it to go idle return; } - mThread->mSignal->unlock(); static std::string region_name("never name a region this"); @@ -2393,7 +2485,6 @@ void LLMeshRepository::notifyLoadedMeshes() if (gAgent.getRegion()->getName() != region_name && gAgent.getRegion()->capabilitiesReceived()) { region_name = gAgent.getRegion()->getName(); - mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh2"); if (mGetMeshCapability.empty()) { @@ -2751,8 +2842,9 @@ void LLMeshRepository::uploadModel(std::vector& data, LLVector3 llinfos << "unable to upload, fee request failed" << llendl; return; } - AIMeshUpload* uploader = new AIMeshUpload(data, scale, upload_textures, upload_skin, upload_joints, upload_url, do_upload, fee_observer, upload_observer); - uploader->run(NULL, 0, false, true, &gMainThreadEngine); + AIMeshUpload* thread = new AIMeshUpload(data, scale, upload_textures, upload_skin, upload_joints, upload_url, + do_upload, fee_observer, upload_observer); + thread->run(NULL, 0, false, true, &gMainThreadEngine); } S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod) @@ -3048,13 +3140,15 @@ bool needTriangles( LLConvexDecomposition *aDC ) void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based) { - LLConvexDecomposition *pDeComp = LLConvexDecomposition::getInstance(); - - if( !pDeComp ) - return; - - if( vertex_based ) - vertex_based = !needTriangles( pDeComp ); + // HACD + if (vertex_based) + { + if (LLConvexDecomposition* pDeComp = LLConvexDecomposition::getInstance()) + vertex_based = !needTriangles(pDeComp); + else + return; + } + // mesh.mVertexBase = mCurRequest->mPositions[0].mV; mesh.mVertexStrideBytes = 12; @@ -3072,7 +3166,10 @@ void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based) if ((vertex_based || mesh.mNumTriangles > 0) && mesh.mNumVertices > 2) { LLCDResult ret = LLCD_OK; - ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based); + if (LLConvexDecomposition::getInstance() != NULL) + { + ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based); + } if (ret) { @@ -3127,6 +3224,7 @@ void LLPhysicsDecomp::doDecomposition() continue; } + if (param->mType == LLCDParam::LLCD_FLOAT) { ret = LLConvexDecomposition::getInstance()->setParam(param->mName, (F32) value.asReal()); @@ -3440,10 +3538,12 @@ void LLPhysicsDecomp::run() } } - mSignal->unlock(); - decomp->quitThread(); + if (mSignal->isLocked()) + { //let go of mSignal's associated mutex + mSignal->unlock(); + } mDone = true; } @@ -3649,4 +3749,3 @@ bool LLMeshRepository::meshRezEnabled() } return false; } - diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 4ef99f1b1..c408f8a12 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -225,6 +225,8 @@ public: LLMutex* mHeaderMutex; LLCondition* mSignal; + bool mWaiting; + //map of known mesh headers typedef std::map mesh_header_map; mesh_header_map mMeshHeader; @@ -405,10 +407,11 @@ public: #endif void init(instance_list& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool do_upload, LLHandle const& fee_observer, LLHandle const& upload_observer); + ~LLMeshUploadThread(); void postRequest(std::string& url, AIMeshUpload* state_machine); - /*virtual*/ bool run(); + virtual bool run(); void preStart(); void generateHulls(); @@ -504,8 +507,7 @@ public: void uploadModel(std::vector& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true, - LLHandle fee_observer= (LLHandle()), - LLHandle upload_observer = (LLHandle())); + LLHandle fee_observer= (LLHandle()), LLHandle upload_observer = (LLHandle())); S32 getMeshSize(const LLUUID& mesh_id, S32 lod); From 4027ec7a67936ac3918b5b1573b407bfef560459 Mon Sep 17 00:00:00 2001 From: Liru Date: Fri, 18 Apr 2014 04:58:49 -0400 Subject: [PATCH 48/96] [Floater Flexibility] Fix yet another broken button, this time group titles, thanks again to the french singularity group --- indra/newview/skins/default/xui/en-us/panel_toolbar.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml index 5d0c3e761..c35dbfac2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml @@ -39,7 +39,7 @@ From 86b5737d512aa734295702aa8e301c17de344224 Mon Sep 17 00:00:00 2001 From: Liru Date: Fri, 18 Apr 2014 09:17:41 -0400 Subject: [PATCH 49/96] [Floater Flexibility] French Translation~ Danke Nomade. --- .../default/xui/fr/floater_toolbar_prefs.xml | 93 +++++++++++++++++++ .../skins/default/xui/fr/menu_viewer.xml | 1 + .../skins/default/xui/fr/panel_toolbar.xml | 92 ++++++++++++++++-- 3 files changed, 180 insertions(+), 6 deletions(-) create mode 100644 indra/newview/skins/default/xui/fr/floater_toolbar_prefs.xml diff --git a/indra/newview/skins/default/xui/fr/floater_toolbar_prefs.xml b/indra/newview/skins/default/xui/fr/floater_toolbar_prefs.xml new file mode 100644 index 000000000..7a2d6dc5e --- /dev/null +++ b/indra/newview/skins/default/xui/fr/floater_toolbar_prefs.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index 477a728b8..109e28971 100644 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -76,6 +76,7 @@ + diff --git a/indra/newview/skins/default/xui/fr/panel_toolbar.xml b/indra/newview/skins/default/xui/fr/panel_toolbar.xml index 4a6af2b12..6c053e9ce 100644 --- a/indra/newview/skins/default/xui/fr/panel_toolbar.xml +++ b/indra/newview/skins/default/xui/fr/panel_toolbar.xml @@ -1,11 +1,9 @@ - - Rétablir les fenêtres - - + établir les fenêtres + -