Cleanup and Synchronization (pre-merge wrap-up commit)

This commit is contained in:
Lirusaito
2013-04-10 09:14:16 -04:00
parent c2046025e3
commit fd9f8fa71f
7 changed files with 118 additions and 321 deletions

View File

@@ -3,10 +3,9 @@
* @brief The LLAppViewer class definitions * @brief The LLAppViewer class definitions
* *
* $LicenseInfo:firstyear=2007&license=viewergpl$ * $LicenseInfo:firstyear=2007&license=viewergpl$
* * Second Life Viewer Source Code
* Copyright (c) 2007-2009, Linden Research, Inc. * 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 * 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 * to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement * ("GPL"), unless you have obtained a separate licensing agreement
@@ -30,8 +29,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#include "llviewerprecompiledheaders.h" #include "llviewerprecompiledheaders.h"
#include "llappviewer.h" #include "llappviewer.h"
#include "hippogridmanager.h" #include "hippogridmanager.h"
@@ -41,7 +40,6 @@
#include "llfeaturemanager.h" #include "llfeaturemanager.h"
#include "lluictrlfactory.h" #include "lluictrlfactory.h"
#include "lltexteditor.h" #include "lltexteditor.h"
#include "llalertdialog.h"
#include "llerrorcontrol.h" #include "llerrorcontrol.h"
#include "lleventtimer.h" #include "lleventtimer.h"
#include "llviewertexturelist.h" #include "llviewertexturelist.h"
@@ -56,14 +54,13 @@
#include "llmd5.h" #include "llmd5.h"
#include "llmeshrepository.h" #include "llmeshrepository.h"
#include "llpumpio.h" #include "llpumpio.h"
#include "llimpanel.h"
#include "llmimetypes.h" #include "llmimetypes.h"
#include "llstartup.h" #include "llstartup.h"
#include "llfocusmgr.h" #include "llfocusmgr.h"
#include "llviewerjoystick.h" #include "llviewerjoystick.h"
#include "llfloaterjoystick.h"
#include "llares.h" #include "llares.h"
#include "llfloatersnapshot.h" #include "llcurl.h"
#include "llcalc.h"
#include "lltexturestats.h" #include "lltexturestats.h"
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include "llviewerdisplay.h" #include "llviewerdisplay.h"
@@ -80,7 +77,9 @@
#include "llfirstuse.h" #include "llfirstuse.h"
#include "llrender.h" #include "llrender.h"
#include "llvector4a.h" #include "llvector4a.h"
#include "llfontfreetype.h" #include "llimpanel.h" // For LLVoiceClient and LLVoiceChannel
#include "llvoavatarself.h"
#include "llprogressview.h"
#include "llvocache.h" #include "llvocache.h"
#include "llvopartgroup.h" #include "llvopartgroup.h"
#include "llfloaterteleporthistory.h" #include "llfloaterteleporthistory.h"
@@ -92,10 +91,10 @@
#include "llavatarnamecache.h" #include "llavatarnamecache.h"
#include "lldiriterator.h" #include "lldiriterator.h"
#include "llimagej2c.h" #include "llimagej2c.h"
#include "llmemory.h"
#include "llprimitive.h" #include "llprimitive.h"
#include "llnotifications.h" #include "llnotifications.h"
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "llcurl.h"
#include <boost/bind.hpp> #include <boost/bind.hpp>
#if LL_WINDOWS #if LL_WINDOWS
@@ -121,7 +120,6 @@
#include "aihttptimeoutpolicy.h" #include "aihttptimeoutpolicy.h"
// </edit> // </edit>
// The files below handle dependencies from cleanup. // The files below handle dependencies from cleanup.
#include "llcalc.h"
#include "llkeyframemotion.h" #include "llkeyframemotion.h"
#include "llworldmap.h" #include "llworldmap.h"
#include "llhudmanager.h" #include "llhudmanager.h"
@@ -133,7 +131,6 @@
#include "llviewermenu.h" #include "llviewermenu.h"
#include "llselectmgr.h" #include "llselectmgr.h"
#include "lltrans.h" #include "lltrans.h"
#include "lltrans.h"
#include "lltracker.h" #include "lltracker.h"
#include "llviewerparcelmgr.h" #include "llviewerparcelmgr.h"
#include "llworldmapview.h" #include "llworldmapview.h"
@@ -144,15 +141,12 @@
#include "lldebugview.h" #include "lldebugview.h"
#include "llconsole.h" #include "llconsole.h"
#include "llcontainerview.h" #include "llcontainerview.h"
#include "llfloaterstats.h"
#include "llhoverview.h" #include "llhoverview.h"
#include "llfloatermemleak.h"
#include "llsdserialize.h" #include "llsdserialize.h"
#include "llworld.h" #include "llworld.h"
#include "llhudeffecttrail.h" #include "llhudeffecttrail.h"
#include "llhudeffectlookat.h"
#include "llvectorperfoptions.h" #include "llvectorperfoptions.h"
#include "llurlsimstring.h" #include "llurlsimstring.h"
#include "llwatchdog.h" #include "llwatchdog.h"
@@ -160,24 +154,23 @@
// Included so that constants/settings might be initialized // Included so that constants/settings might be initialized
// in save_settings_to_globals() // in save_settings_to_globals()
#include "llbutton.h" #include "llbutton.h"
#include "llcombobox.h"
#include "llstatusbar.h" #include "llstatusbar.h"
#include "llsurface.h" #include "llsurface.h"
#include "llvosky.h" #include "llvosky.h"
#include "llvotree.h" #include "llvotree.h"
#include "llvoavatarself.h"
#include "llfolderview.h" #include "llfolderview.h"
#include "lltoolbar.h" #include "lltoolbar.h"
#include "llframestats.h" #include "llframestats.h"
#include "llagentpilot.h" #include "llagentpilot.h"
#include "llsrv.h"
#include "llvovolume.h" #include "llvovolume.h"
#include "llflexibleobject.h" #include "llflexibleobject.h"
#include "llvosurfacepatch.h" #include "llvosurfacepatch.h"
#include "llcommandlineparser.h"
#include "llfloatermemleak.h"
#include "llfloatersnapshot.h"
#include "llfloaterinventory.h" #include "llfloaterinventory.h"
// includes for idle() idleShutdown() // includes for idle() idleShutdown()
#include "floaterao.h"
#include "llviewercontrol.h" #include "llviewercontrol.h"
#include "lleventnotifier.h" #include "lleventnotifier.h"
#include "llcallbacklist.h" #include "llcallbacklist.h"
@@ -192,10 +185,7 @@
#include "llviewerthrottle.h" #include "llviewerthrottle.h"
#include "llparcel.h" #include "llparcel.h"
#include "llviewerassetstats.h" #include "llviewerassetstats.h"
#include "llcommandlineparser.h"
#include "llprogressview.h"
#include "llmemory.h"
#include "llmainlooprepeater.h" #include "llmainlooprepeater.h"
// [RLVa:KB] // [RLVa:KB]
@@ -220,12 +210,6 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// viewer.cpp - these are only used in viewer, should be easily moved. // viewer.cpp - these are only used in viewer, should be easily moved.
#if LL_DARWIN #if LL_DARWIN
extern void init_apple_menu(const char* product); extern void init_apple_menu(const char* product);
#endif // LL_DARWIN #endif // LL_DARWIN
@@ -483,6 +467,7 @@ static void settings_to_globals()
LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize")); LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize"));
LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile"); LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile");
LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic");
LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures");
LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor");
@@ -1196,6 +1181,7 @@ bool LLAppViewer::mainLoop()
// canonical per-frame event // canonical per-frame event
mainloop.post(newFrame); mainloop.post(newFrame);
if (!LLApp::isExiting()) if (!LLApp::isExiting())
{ {
pingMainloopTimeout("Main:JoystickKeyboard"); pingMainloopTimeout("Main:JoystickKeyboard");
@@ -1203,7 +1189,7 @@ bool LLAppViewer::mainLoop()
// Scan keyboard for movement keys. Command keys and typing // Scan keyboard for movement keys. Command keys and typing
// are handled by windows callbacks. Don't do this until we're // are handled by windows callbacks. Don't do this until we're
// done initializing. JC // done initializing. JC
if (gViewerWindow->mWindow->getVisible() if (gViewerWindow->mWindow->getVisible()
&& gViewerWindow->getActive() && gViewerWindow->getActive()
&& !gViewerWindow->getWindow()->getMinimized() && !gViewerWindow->getWindow()->getMinimized()
&& LLStartUp::getStartupState() == STATE_STARTED && LLStartUp::getStartupState() == STATE_STARTED
@@ -1320,7 +1306,6 @@ bool LLAppViewer::mainLoop()
ms_sleep(500); ms_sleep(500);
} }
const F64 max_idle_time = run_multiple_threads ? 0.0 : llmin(.005*10.0*gFrameIntervalSeconds, 0.005); // 50ms/second, no more than 5ms/frame const F64 max_idle_time = run_multiple_threads ? 0.0 : llmin(.005*10.0*gFrameIntervalSeconds, 0.005); // 50ms/second, no more than 5ms/frame
idleTimer.reset(); idleTimer.reset();
while(1) while(1)
@@ -1382,7 +1367,6 @@ bool LLAppViewer::mainLoop()
pingMainloopTimeout("Main:End"); pingMainloopTimeout("Main:End");
} }
} }
catch(std::bad_alloc) catch(std::bad_alloc)
{ {
@@ -1738,7 +1722,8 @@ bool LLAppViewer::cleanup()
writeDebugInfo(); writeDebugInfo();
if(!gDirUtilp->getLindenUserDir(true).empty()) if(!gDirUtilp->getLindenUserDir(true).empty())
LLViewerMedia::saveCookieFile(); LLViewerMedia::saveCookieFile();
// Stop the plugin read thread if it's running. // Stop the plugin read thread if it's running.
LLPluginProcessParent::setUseReadThread(false); LLPluginProcessParent::setUseReadThread(false);
// Stop curl responder call backs. // Stop curl responder call backs.
@@ -1758,11 +1743,11 @@ bool LLAppViewer::cleanup()
pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread
pending += LLVFSThread::updateClass(0); pending += LLVFSThread::updateClass(0);
pending += LLLFSThread::updateClass(0); pending += LLLFSThread::updateClass(0);
if (pending == 0) if (!pending)
{ {
break; break;
} }
if (idleTimer.getElapsedTimeF64() >= max_idle_time) else if (idleTimer.getElapsedTimeF64() >= max_idle_time)
{ {
llwarns << "Quitting with pending background tasks." << llendl; llwarns << "Quitting with pending background tasks." << llendl;
break; break;
@@ -1927,6 +1912,7 @@ bool LLAppViewer::initThreads()
// Mesh streaming and caching // Mesh streaming and caching
gMeshRepo.init(); gMeshRepo.init();
// *FIX: no error handling here! // *FIX: no error handling here!
return true; return true;
} }
@@ -2122,20 +2108,14 @@ bool LLAppViewer::initConfiguration()
if(!loadSettingsFromDirectory(settings_w, "Default", set_defaults)) if(!loadSettingsFromDirectory(settings_w, "Default", set_defaults))
{ {
std::ostringstream msg; std::ostringstream msg;
msg << "Second Life could not load its default settings file. \n" msg << "Unable to load default settings file. The installation may be corrupted.";
<< "The installation may be corrupted. \n"; OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK);
OSMessageBox(
msg.str(),
LLStringUtil::null,
OSMB_OK);
return false; return false;
} }
LLUICtrlFactory::getInstance()->setupPaths(); // setup paths for LLTrans based on settings files only LLUICtrlFactory::getInstance()->setupPaths(); // setup paths for LLTrans based on settings files only
LLTrans::parseStrings("strings.xml", default_trans_args); LLTrans::parseStrings("strings.xml", default_trans_args);
//COA vars in gSavedSettings will be linked to gSavedPerAccountSettings entries that will be created if not present. //COA vars in gSavedSettings will be linked to gSavedPerAccountSettings entries that will be created if not present.
//Signals will be shared between linked vars. //Signals will be shared between linked vars.
gSavedSettings.connectCOAVars(gSavedPerAccountSettings); gSavedSettings.connectCOAVars(gSavedPerAccountSettings);
@@ -2165,8 +2145,8 @@ bool LLAppViewer::initConfiguration()
// timeout for mac and linux. There is no call stack info // timeout for mac and linux. There is no call stack info
// on these platform to help debug. // on these platform to help debug.
#ifndef LL_RELEASE_FOR_DOWNLOAD #ifndef LL_RELEASE_FOR_DOWNLOAD
gSavedSettings.setBOOL("WatchdogEnabled", FALSE);
gSavedSettings.setBOOL("QAMode", TRUE ); gSavedSettings.setBOOL("QAMode", TRUE );
gSavedSettings.setBOOL("WatchdogEnabled", 0);
#endif #endif
#ifndef LL_WINDOWS #ifndef LL_WINDOWS
@@ -2210,6 +2190,7 @@ bool LLAppViewer::initConfiguration()
LLControlGroupCLP clp; LLControlGroupCLP clp;
std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,
"cmd_line.xml"); "cmd_line.xml");
clp.configure(cmd_line_config, &gSavedSettings); clp.configure(cmd_line_config, &gSavedSettings);
if(!initParseCommandLine(clp)) if(!initParseCommandLine(clp))
@@ -2245,9 +2226,8 @@ bool LLAppViewer::initConfiguration()
clp.notify(); clp.notify();
// Register the core crash option as soon as we can // Register the core crash option as soon as we can
// if we want gdb post-mortum on cores we need to be up and running // if we want gdb post-mortem on cores we need to be up and running
// ASAP or we might miss init issue etc. // ASAP or we might miss init issue etc.
if(clp.hasOption("disablecrashlogger")) if(clp.hasOption("disablecrashlogger"))
{ {
llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" <<llendl; llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" <<llendl;
@@ -2275,36 +2255,6 @@ bool LLAppViewer::initConfiguration()
return false; return false;
} }
//////////////////////////
// Apply settings...
if(clp.hasOption("setdefault"))
{
//const LLCommandLineParser::token_vector_t& setdefault = clp.getOption("setdefault");
//if(0x1 & setdefault.size())
//{
// llwarns << "Invalid '--setdefault' parameter count." << llendl;
//}
//else
//{
// LLCommandLineParser::token_vector_t::const_iterator itr = setdefault.begin();
// for(; itr != setdefault.end(); ++itr)
// {
// const std::string& name = *itr;
// const std::string& value = *(++itr);
// LLControlVariable* c = gSettings[sGlobalSettingsName]->getControl(name);
// if(c)
// {
// c->setDefault(value);
// }
// else
// {
// llwarns << "'--setdefault' specified with unknown setting: '"
// << name << "'." << llendl;
// }
// }
//}
}
if(clp.hasOption("set")) if(clp.hasOption("set"))
{ {
const LLCommandLineParser::token_vector_t& set_values = clp.getOption("set"); const LLCommandLineParser::token_vector_t& set_values = clp.getOption("set");
@@ -2548,7 +2498,7 @@ bool LLAppViewer::initConfiguration()
if ( nextLoginLocation.length() ) if ( nextLoginLocation.length() )
{ {
LLURLSimString::setString( nextLoginLocation ); LLURLSimString::setString( nextLoginLocation );
}; }
gLastRunVersion = gSavedSettings.getString("LastRunVersion"); gLastRunVersion = gSavedSettings.getString("LastRunVersion");
@@ -2740,7 +2690,6 @@ void LLAppViewer::writeSystemInfo()
gDebugInfo["SLLog"] = LLError::logFileName(); gDebugInfo["SLLog"] = LLError::logFileName();
gDebugInfo["ClientInfo"]["Name"] = gVersionChannel; gDebugInfo["ClientInfo"]["Name"] = gVersionChannel;
gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor; gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor;
gDebugInfo["ClientInfo"]["MinorVersion"] = gVersionMinor; gDebugInfo["ClientInfo"]["MinorVersion"] = gVersionMinor;
gDebugInfo["ClientInfo"]["PatchVersion"] = gVersionPatch; gDebugInfo["ClientInfo"]["PatchVersion"] = gVersionPatch;
@@ -2748,7 +2697,6 @@ void LLAppViewer::writeSystemInfo()
gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); gDebugInfo["CAFilename"] = gDirUtilp->getCAFile();
//need to put in something to lie about this stuff
gDebugInfo["CPUInfo"]["CPUString"] = gSysCPU.getCPUString(); gDebugInfo["CPUInfo"]["CPUString"] = gSysCPU.getCPUString();
gDebugInfo["CPUInfo"]["CPUFamily"] = gSysCPU.getFamily(); gDebugInfo["CPUInfo"]["CPUFamily"] = gSysCPU.getFamily();
gDebugInfo["CPUInfo"]["CPUMhz"] = gSysCPU.getMHz(); gDebugInfo["CPUInfo"]["CPUMhz"] = gSysCPU.getMHz();
@@ -2761,10 +2709,10 @@ void LLAppViewer::writeSystemInfo()
gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple();
// The user is not logged on yet, but record the current grid choice login url // The user is not logged on yet, but record the current grid choice login url
// which may have been the intended grid. This can b // which may have been the intended grid.
gDebugInfo["GridName"] = LLViewerLogin::getInstance()->getGridLabel(); gDebugInfo["GridName"] = LLViewerLogin::getInstance()->getGridLabel();
// *FIX:Mani - move this ddown in llappviewerwin32 // *FIX:Mani - move this down in llappviewerwin32
#ifdef LL_WINDOWS #ifdef LL_WINDOWS
DWORD thread_id = GetCurrentThreadId(); DWORD thread_id = GetCurrentThreadId();
gDebugInfo["MainloopThreadID"] = (S32)thread_id; gDebugInfo["MainloopThreadID"] = (S32)thread_id;
@@ -2814,6 +2762,7 @@ void LLAppViewer::handleViewerCrash()
llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ; llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ;
LLMemory::logMemoryInfo(true) ; LLMemory::logMemoryInfo(true) ;
//print out recorded call stacks if there are any. //print out recorded call stacks if there are any.
LLError::LLCallStacks::print(); LLError::LLCallStacks::print();
@@ -2842,7 +2791,6 @@ void LLAppViewer::handleViewerCrash()
//We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version //We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version
//to check against no matter what //to check against no matter what
gDebugInfo["ClientInfo"]["Name"] = gVersionChannel; gDebugInfo["ClientInfo"]["Name"] = gVersionChannel;
gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor; gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor;
@@ -3020,13 +2968,11 @@ void LLAppViewer::initMarkerFile()
std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME);
std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
if (LLAPRFile::isExist(mMarkerFileName, LL_APR_RB) && !anotherInstanceRunning()) if (LLAPRFile::isExist(mMarkerFileName, LL_APR_RB) && !anotherInstanceRunning())
{ {
gLastExecEvent = LAST_EXEC_FROZE; gLastExecEvent = LAST_EXEC_FROZE;
LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL;
} }
if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB)) if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB))
{ {
gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; gLastExecEvent = LAST_EXEC_LOGOUT_FROZE;
@@ -3738,17 +3684,6 @@ void LLAppViewer::loadNameCache()
{ {
if(gCacheName->importFile(cache_file)) return; if(gCacheName->importFile(cache_file)) return;
} }
// Try to load from the legacy format. This should go away after a
// while. Phoenix 2008-01-30
#if 0
LLFILE* name_cache_fp = LLFile::fopen(name_cache, "r"); // Flawfinder: ignore
if (name_cache_fp)
{
gCacheName->importFile(name_cache_fp);
fclose(name_cache_fp);
}
#endif
} }
void LLAppViewer::saveNameCache() void LLAppViewer::saveNameCache()
@@ -3801,6 +3736,7 @@ static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World");
static LLFastTimer::DeclareTimer FTM_NETWORK("Network"); static LLFastTimer::DeclareTimer FTM_NETWORK("Network");
static LLFastTimer::DeclareTimer FTM_AGENT_NETWORK("Agent Network"); static LLFastTimer::DeclareTimer FTM_AGENT_NETWORK("Agent Network");
static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager"); static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager");
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
// idle() // idle()
// //
@@ -3861,7 +3797,6 @@ void LLAppViewer::idle()
// //
// Special case idle if still starting up // Special case idle if still starting up
// //
if (LLStartUp::getStartupState() < STATE_STARTED) if (LLStartUp::getStartupState() < STATE_STARTED)
{ {
// Skip rest if idle startup returns false (essentially, no world yet) // Skip rest if idle startup returns false (essentially, no world yet)
@@ -3923,7 +3858,6 @@ void LLAppViewer::idle()
// Manage statistics // Manage statistics
// //
// //
{ {
// Initialize the viewer_stats_timer with an already elapsed time // Initialize the viewer_stats_timer with an already elapsed time
// of SEND_STATS_PERIOD so that the initial stats report will // of SEND_STATS_PERIOD so that the initial stats report will
@@ -4322,7 +4256,6 @@ void LLAppViewer::sendLogoutRequest()
{ {
if(!mLogoutRequestSent && gMessageSystem) if(!mLogoutRequestSent && gMessageSystem)
{ {
LLMessageSystem* msg = gMessageSystem; LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_LogoutRequest); msg->newMessageFast(_PREHASH_LogoutRequest);
msg->nextBlockFast(_PREHASH_AgentData); msg->nextBlockFast(_PREHASH_AgentData);
@@ -4426,6 +4359,7 @@ static LLFastTimer::DeclareTimer FTM_RETRANSMIT("Retransmit");
static LLFastTimer::DeclareTimer FTM_TIMEOUT_CHECK("Timeout Check"); static LLFastTimer::DeclareTimer FTM_TIMEOUT_CHECK("Timeout Check");
static LLFastTimer::DeclareTimer FTM_DYNAMIC_THROTTLE("Dynamic Throttle"); static LLFastTimer::DeclareTimer FTM_DYNAMIC_THROTTLE("Dynamic Throttle");
static LLFastTimer::DeclareTimer FTM_CHECK_REGION_CIRCUIT("Check Region Circuit"); static LLFastTimer::DeclareTimer FTM_CHECK_REGION_CIRCUIT("Check Region Circuit");
void LLAppViewer::idleNetwork() void LLAppViewer::idleNetwork()
{ {
pingMainloopTimeout("idleNetwork"); pingMainloopTimeout("idleNetwork");
@@ -4442,7 +4376,8 @@ void LLAppViewer::idleNetwork()
// Read all available packets from network // Read all available packets from network
const S64 frame_count = gFrameCount; // U32->S64 const S64 frame_count = gFrameCount; // U32->S64
F32 total_time = 0.0f; F32 total_time = 0.0f;
while (gMessageSystem->checkAllMessages(frame_count, gServicePump))
while (gMessageSystem->checkAllMessages(frame_count, gServicePump))
{ {
if (gDoDisconnect) if (gDoDisconnect)
{ {

View File

@@ -31,79 +31,26 @@
*/ */
#include "llviewerprecompiledheaders.h" #include "llviewerprecompiledheaders.h"
#include <utility> // for std::pair<>
#include "llinventorypanel.h"
#include "llpanelobjectinventory.h"
#include "llinventorybridge.h"
#include "message.h"
#include "llagent.h"
#include "llagentwearables.h" #include "llagentwearables.h"
#include "llcallingcard.h" #include "llimview.h"
#include "llcheckboxctrl.h" // for radio buttons
#include "llfoldervieweventlistener.h"
#include "llnotificationsutil.h"
#include "llradiogroup.h"
#include "llspinctrl.h"
#include "lltextbox.h"
#include "llui.h"
#include "llviewercontrol.h"
#include "llfirstuse.h"
#include "llfloateravatarinfo.h"
#include "llfloaterchat.h"
#include "llfloatercustomize.h"
#include "llfloaterinventory.h"
#include "llfloaterproperties.h"
#include "llfocusmgr.h"
#include "llfolderview.h"
#include "llgesturemgr.h"
#include "lliconctrl.h"
#include "llinventoryfunctions.h" #include "llinventoryfunctions.h"
#include "llinventorybridge.h"
#include "llinventoryclipboard.h" #include "llinventoryclipboard.h"
#include "llinventorymodelbackgroundfetch.h" #include "llinventorymodelbackgroundfetch.h"
#include "lllineeditor.h" #include "llinventorypanel.h"
#include "llmakeoutfitdialog.h" #include "llmakeoutfitdialog.h"
#include "llmenugl.h" #include "llnotificationsutil.h"
#include "llpreviewanim.h" #include "llpanelmaininventory.h"
#include "llpreviewgesture.h" #include "llpanelobjectinventory.h"
#include "llpreviewlandmark.h" #include "llpreview.h" // For LLMultiPreview
#include "llpreviewnotecard.h" #include "llfoldervieweventlistener.h"
#include "llpreviewscript.h" #include "lltrans.h"
#include "llpreviewsound.h"
#include "llpreviewtexture.h"
#include "llresmgr.h"
#include "llscrollcontainer.h"
#include "llimview.h"
#include "lltooldraganddrop.h"
#include "llviewertexturelist.h"
#include "llviewerinventory.h"
#include "llviewerobjectlist.h"
#include "llviewerwindow.h"
#include "llvoavatarself.h" #include "llvoavatarself.h"
#include "llwearable.h"
#include "llwearablelist.h"
#include "llviewermessage.h"
#include "llviewerregion.h"
#include "lltabcontainer.h"
#include "lluictrlfactory.h"
#include "llselectmgr.h"
// <edit> extern LLUUID gAgentID;
#include "lllocalinventory.h"
#include "statemachine/aifilepicker.h"
// </edit>
using namespace LLOldEvents; using namespace LLOldEvents;
const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not)
const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not)
const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not)
typedef LLMemberListener<LLPanelObjectInventory> object_inventory_listener_t; typedef LLMemberListener<LLPanelObjectInventory> object_inventory_listener_t;
typedef LLMemberListener<LLInventoryView> inventory_listener_t; typedef LLMemberListener<LLInventoryView> inventory_listener_t;
typedef LLMemberListener<LLInventoryPanel> inventory_panel_listener_t; typedef LLMemberListener<LLInventoryPanel> inventory_panel_listener_t;
@@ -116,42 +63,39 @@ bool doToSelected(LLFolderView* folder, std::string action)
folder->startRenamingSelectedItem(); folder->startRenamingSelectedItem();
return true; return true;
} }
if ("delete" == action) else if ("delete" == action)
{ {
folder->removeSelectedItems(); folder->removeSelectedItems();
return true; return true;
} }
else if ("copy" == action || "cut" == action)
if ("copy" == action || "cut" == action)
{ {
LLInventoryClipboard::instance().reset(); LLInventoryClipboard::instance().reset();
} }
std::set<LLUUID> selected_items = folder->getSelectionList(); std::set<LLUUID> selected_items = folder->getSelectionList();
LLMultiPreview* multi_previewp = NULL; LLMultiFloater* multi_floaterp = NULL;
LLMultiProperties* multi_propertiesp = NULL;
if (("task_open" == action || "open" == action) && selected_items.size() > 1) if (("task_open" == action || "open" == action) && selected_items.size() > 1)
{ {
S32 left, top; S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top); gFloaterView->getNewFloaterPosition(&left, &top);
multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); multi_floaterp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100));
gFloaterView->addChild(multi_previewp); gFloaterView->addChild(multi_floaterp);
LLFloater::setFloaterHost(multi_previewp); LLFloater::setFloaterHost(multi_floaterp);
} }
else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1) else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1)
{ {
S32 left, top; S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top); gFloaterView->getNewFloaterPosition(&left, &top);
multi_propertiesp = new LLMultiProperties(LLRect(left, top, left + 100, top - 100)); multi_floaterp = new LLMultiProperties(LLRect(left, top, left + 100, top - 100));
gFloaterView->addChild(multi_propertiesp); gFloaterView->addChild(multi_floaterp);
LLFloater::setFloaterHost(multi_propertiesp); LLFloater::setFloaterHost(multi_floaterp);
} }
std::set<LLUUID>::iterator set_iter; std::set<LLUUID>::iterator set_iter;
@@ -167,13 +111,9 @@ bool doToSelected(LLFolderView* folder, std::string action)
} }
LLFloater::setFloaterHost(NULL); LLFloater::setFloaterHost(NULL);
if (multi_previewp) if (multi_floaterp)
{ {
multi_previewp->open(); multi_floaterp->open();
}
else if (multi_propertiesp)
{
multi_propertiesp->open(); /*Flawfinder: ignore*/
} }
return true; return true;
@@ -183,12 +123,11 @@ class LLDoToSelectedPanel : public object_inventory_listener_t
{ {
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{ {
std::string action = userdata.asString();
LLPanelObjectInventory *panel = mPtr; LLPanelObjectInventory *panel = mPtr;
LLFolderView* folder = panel->getRootFolder(); LLFolderView* folder = panel->getRootFolder();
if(!folder) return true; if(!folder) return true;
return doToSelected(folder, action); return doToSelected(folder, userdata.asString());
} }
}; };
@@ -196,12 +135,11 @@ class LLDoToSelectedFloater : public inventory_listener_t
{ {
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{ {
std::string action = userdata.asString();
LLInventoryPanel *panel = mPtr->getPanel(); LLInventoryPanel *panel = mPtr->getPanel();
LLFolderView* folder = panel->getRootFolder(); LLFolderView* folder = panel->getRootFolder();
if(!folder) return true; if(!folder) return true;
return doToSelected(folder, action); return doToSelected(folder, userdata.asString());
} }
}; };
@@ -209,12 +147,11 @@ class LLDoToSelected : public inventory_panel_listener_t
{ {
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{ {
std::string action = userdata.asString();
LLInventoryPanel *panel = mPtr; LLInventoryPanel *panel = mPtr;
LLFolderView* folder = panel->getRootFolder(); LLFolderView* folder = panel->getRootFolder();
if(!folder) return true; if(!folder) return true;
return doToSelected(folder, action); return doToSelected(folder, userdata.asString());
} }
}; };
@@ -356,7 +293,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
else if ("lsl" == type) else if ("lsl" == type)
{ {
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_LSL_TEXT); LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_LSL_TEXT);
ptr->createNewItem(NEW_LSL_NAME, ptr->createNewItem(LLTrans::getString("New Script"),
parent_id, parent_id,
LLAssetType::AT_LSL_TEXT, LLAssetType::AT_LSL_TEXT,
LLInventoryType::IT_LSL, LLInventoryType::IT_LSL,
@@ -365,7 +302,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
else if ("notecard" == type) else if ("notecard" == type)
{ {
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_NOTECARD); LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_NOTECARD);
ptr->createNewItem(NEW_NOTECARD_NAME, ptr->createNewItem(LLTrans::getString("New Note"),
parent_id, parent_id,
LLAssetType::AT_NOTECARD, LLAssetType::AT_NOTECARD,
LLInventoryType::IT_NOTECARD, LLInventoryType::IT_NOTECARD,
@@ -374,7 +311,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
else if ("gesture" == type) else if ("gesture" == type)
{ {
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_GESTURE); LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_GESTURE);
ptr->createNewItem(NEW_GESTURE_NAME, ptr->createNewItem(LLTrans::getString("New Gesture"),
parent_id, parent_id,
LLAssetType::AT_GESTURE, LLAssetType::AT_GESTURE,
LLInventoryType::IT_GESTURE, LLInventoryType::IT_GESTURE,
@@ -383,11 +320,11 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
else if ("outfit" == type) else if ("outfit" == type)
{ {
new LLMakeOutfitDialog(false); new LLMakeOutfitDialog(false);
return;
} }
else else
{ {
LLWearableType::EType wear_type = LLWearableType::typeNameToType(type); LLAgentWearables::createWearable(LLWearableType::typeNameToType(type), false, self ? self->getUUID() : LLUUID::null);
LLAgentWearables::createWearable(wear_type, false, self ? self->getUUID() : LLUUID::null);
} }
ptr->getRootFolder()->setNeedsAutoRename(TRUE); ptr->getRootFolder()->setNeedsAutoRename(TRUE);
} }
@@ -411,14 +348,6 @@ class LLDoCreateFloater : public inventory_listener_t
LLInventoryModel* model = mPtr->getPanel()->getModel(); LLInventoryModel* model = mPtr->getPanel()->getModel();
if(!model) return false; if(!model) return false;
std::string type = userdata.asString(); std::string type = userdata.asString();
// <edit>
if(type == "pretend")
{
LLFloaterNewLocalInventory* floater = new LLFloaterNewLocalInventory();
floater->center();
}
else
// </edit>
do_create(model, mPtr->getPanel(), type); do_create(model, mPtr->getPanel(), type);
return true; return true;
} }
@@ -484,28 +413,6 @@ class LLSetSortBy : public inventory_listener_t
} }
}; };
// <edit>
class LLLoadInvCacheFloater : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryModel* model = mPtr->getPanel()->getModel();
if(!model) return false;
AIFilePicker* filepicker = AIFilePicker::create();
filepicker->open(FFLOAD_INVGZ, "", "invgz");
filepicker->run(boost::bind(&LLLoadInvCacheFloater::filepicker_callback, this, filepicker));
return true;
}
void filepicker_callback(AIFilePicker* filepicker)
{
if(filepicker->hasFilename())
{
LLLocalInventory::loadInvCache(filepicker->getFilename());
}
}
};
class LLRefreshInvModel : public inventory_listener_t class LLRefreshInvModel : public inventory_listener_t
{ {
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -522,8 +429,7 @@ class LLSetSearchType : public inventory_listener_t
{ {
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{ {
std::string toggle = userdata.asString(); U32 flags = mPtr->getActivePanel()->getRootFolder()->toggleSearchType(userdata.asString());
U32 flags = mPtr->getActivePanel()->getRootFolder()->toggleSearchType(toggle);
mPtr->getControl("Inventory.SearchName")->setValue((BOOL)(flags & 1)); mPtr->getControl("Inventory.SearchName")->setValue((BOOL)(flags & 1));
mPtr->getControl("Inventory.SearchDesc")->setValue((BOOL)(flags & 2)); mPtr->getControl("Inventory.SearchDesc")->setValue((BOOL)(flags & 2));
mPtr->getControl("Inventory.SearchCreator")->setValue((BOOL)(flags & 4)); mPtr->getControl("Inventory.SearchCreator")->setValue((BOOL)(flags & 4));
@@ -546,8 +452,7 @@ class LLBeginIMSession : public inventory_panel_listener_t
LLDynamicArray<LLUUID> members; LLDynamicArray<LLUUID> members;
EInstantMessage type = IM_SESSION_CONFERENCE_START; EInstantMessage type = IM_SESSION_CONFERENCE_START;
std::set<LLUUID>::const_iterator iter; for (std::set<LLUUID>::const_iterator iter = selected_items.begin(); iter != selected_items.end(); iter++)
for (iter = selected_items.begin(); iter != selected_items.end(); iter++)
{ {
LLUUID item = *iter; LLUUID item = *iter;
@@ -577,11 +482,10 @@ class LLBeginIMSession : public inventory_panel_listener_t
{ {
// create the session // create the session
gIMMgr->setFloaterOpen(TRUE); gIMMgr->setFloaterOpen(TRUE);
S32 i;
LLAvatarTracker& at = LLAvatarTracker::instance(); LLAvatarTracker& at = LLAvatarTracker::instance();
LLUUID id; LLUUID id;
for(i = 0; i < count; ++i) for(S32 i = 0; i < count; ++i)
{ {
id = item_array.get(i)->getCreatorUUID(); id = item_array.get(i)->getCreatorUUID();
if(at.isBuddyOnline(id)) if(at.isBuddyOnline(id))
@@ -660,27 +564,28 @@ class LLAttachObject : public inventory_panel_listener_t
break; break;
} }
} }
if (attachmentp == NULL) if (!attachmentp)
{ {
return true; return true;
} }
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(id); if (LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(id))
if(item && gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID()))
{ {
rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu if(gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID()))
} {
else if(item && item->isFinished()) rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu
{ }
// must be in library. copy it to our inventory and put it on. else if(item->isFinished())
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp, false)); {
copy_inventory_item( // must be in library. copy it to our inventory and put it on.
gAgent.getID(), LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp, false));
item->getPermissions().getOwner(), copy_inventory_item(
item->getUUID(), gAgentID,
LLUUID::null, item->getPermissions().getOwner(),
std::string(), item->getUUID(),
cb); LLUUID::null,
std::string(),
cb);
}
} }
gFocusMgr.setKeyboardFocus(NULL); gFocusMgr.setKeyboardFocus(NULL);
@@ -688,16 +593,6 @@ class LLAttachObject : public inventory_panel_listener_t
} }
}; };
/*
class LL : public listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
return true;
}
};
*/
void init_object_inventory_panel_actions(LLPanelObjectInventory *panel) void init_object_inventory_panel_actions(LLPanelObjectInventory *panel)
{ {
(new LLDoToSelectedPanel())->registerListener(panel, "Inventory.DoToSelected"); (new LLDoToSelectedPanel())->registerListener(panel, "Inventory.DoToSelected");
@@ -709,9 +604,6 @@ void init_inventory_actions(LLInventoryView *floater)
(new LLCloseAllFoldersFloater())->registerListener(floater, "Inventory.CloseAllFolders"); (new LLCloseAllFoldersFloater())->registerListener(floater, "Inventory.CloseAllFolders");
(new LLEmptyTrashFloater())->registerListener(floater, "Inventory.EmptyTrash"); (new LLEmptyTrashFloater())->registerListener(floater, "Inventory.EmptyTrash");
(new LLDoCreateFloater())->registerListener(floater, "Inventory.DoCreate"); (new LLDoCreateFloater())->registerListener(floater, "Inventory.DoCreate");
// <edit>
(new LLLoadInvCacheFloater())->registerListener(floater, "Inventory.LoadInvCache");
// </edit>
(new LLNewWindow())->registerListener(floater, "Inventory.NewWindow"); (new LLNewWindow())->registerListener(floater, "Inventory.NewWindow");
(new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters"); (new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters");
@@ -719,7 +611,6 @@ void init_inventory_actions(LLInventoryView *floater)
(new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy"); (new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy");
(new LLSetSearchType())->registerListener(floater, "Inventory.SetSearchType"); (new LLSetSearchType())->registerListener(floater, "Inventory.SetSearchType");
} }
void init_inventory_panel_actions(LLInventoryPanel *panel) void init_inventory_panel_actions(LLInventoryPanel *panel)

View File

@@ -102,12 +102,12 @@ void LLInventoryCompletionObserver::changed(U32 mask)
{ {
// scan through the incomplete items and move or erase them as // scan through the incomplete items and move or erase them as
// appropriate. // appropriate.
if(!mIncomplete.empty()) if (!mIncomplete.empty())
{ {
for(uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); )
{ {
LLViewerInventoryItem* item = gInventory.getItem(*it); const LLViewerInventoryItem* item = gInventory.getItem(*it);
if(!item) if (!item)
{ {
it = mIncomplete.erase(it); it = mIncomplete.erase(it);
continue; continue;
@@ -120,7 +120,7 @@ void LLInventoryCompletionObserver::changed(U32 mask)
} }
++it; ++it;
} }
if(mIncomplete.empty()) if (mIncomplete.empty())
{ {
done(); done();
} }
@@ -129,7 +129,7 @@ void LLInventoryCompletionObserver::changed(U32 mask)
void LLInventoryCompletionObserver::watchItem(const LLUUID& id) void LLInventoryCompletionObserver::watchItem(const LLUUID& id)
{ {
if(id.notNull()) if (id.notNull())
{ {
mIncomplete.push_back(id); mIncomplete.push_back(id);
} }
@@ -158,6 +158,7 @@ void LLInventoryFetchItemsObserver::changed(U32 mask)
// appropriate. // appropriate.
if (!mIncomplete.empty()) if (!mIncomplete.empty())
{ {
// Have we exceeded max wait time? // Have we exceeded max wait time?
bool timeout_expired = mFetchingPeriod.hasExpired(); bool timeout_expired = mFetchingPeriod.hasExpired();
@@ -201,6 +202,7 @@ void LLInventoryFetchItemsObserver::changed(U32 mask)
void fetch_items_from_llsd(const LLSD& items_llsd) void fetch_items_from_llsd(const LLSD& items_llsd)
{ {
if (!items_llsd.size() || gDisconnected) return; if (!items_llsd.size() || gDisconnected) return;
LLSD body; LLSD body;
body[0]["cap_name"] = "FetchInventory2"; body[0]["cap_name"] = "FetchInventory2";
body[1]["cap_name"] = "FetchLib2"; body[1]["cap_name"] = "FetchLib2";
@@ -244,7 +246,7 @@ void fetch_items_from_llsd(const LLSD& items_llsd)
for (S32 j=0; j<body[i]["items"].size(); j++) for (S32 j=0; j<body[i]["items"].size(); j++)
{ {
LLSD item_entry = body[i]["items"][j]; LLSD item_entry = body[i]["items"][j];
if(start_new_message) if (start_new_message)
{ {
start_new_message = FALSE; start_new_message = FALSE;
msg->newMessageFast(_PREHASH_FetchInventory); msg->newMessageFast(_PREHASH_FetchInventory);
@@ -255,13 +257,13 @@ void fetch_items_from_llsd(const LLSD& items_llsd)
msg->nextBlockFast(_PREHASH_InventoryData); msg->nextBlockFast(_PREHASH_InventoryData);
msg->addUUIDFast(_PREHASH_OwnerID, item_entry["owner_id"].asUUID()); msg->addUUIDFast(_PREHASH_OwnerID, item_entry["owner_id"].asUUID());
msg->addUUIDFast(_PREHASH_ItemID, item_entry["item_id"].asUUID()); msg->addUUIDFast(_PREHASH_ItemID, item_entry["item_id"].asUUID());
if(msg->isSendFull(NULL)) if (msg->isSendFull(NULL))
{ {
start_new_message = TRUE; start_new_message = TRUE;
gAgent.sendReliableMessage(); gAgent.sendReliableMessage();
} }
} }
if(!start_new_message) if (!start_new_message)
{ {
gAgent.sendReliableMessage(); gAgent.sendReliableMessage();
} }
@@ -335,8 +337,8 @@ void LLInventoryFetchDescendentsObserver::changed(U32 mask)
{ {
for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end();) for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end();)
{ {
LLViewerInventoryCategory* cat = gInventory.getCategory(*it); const LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
if(!cat) if (!cat)
{ {
it = mIncomplete.erase(it); it = mIncomplete.erase(it);
continue; continue;
@@ -465,7 +467,7 @@ void LLInventoryFetchComboObserver::startFetch()
void LLInventoryExistenceObserver::watchItem(const LLUUID& id) void LLInventoryExistenceObserver::watchItem(const LLUUID& id)
{ {
if(id.notNull()) if (id.notNull())
{ {
mMIA.push_back(id); mMIA.push_back(id);
} }
@@ -475,12 +477,12 @@ void LLInventoryExistenceObserver::changed(U32 mask)
{ {
// scan through the incomplete items and move or erase them as // scan through the incomplete items and move or erase them as
// appropriate. // appropriate.
if(!mMIA.empty()) if (!mMIA.empty())
{ {
for(uuid_vec_t::iterator it = mMIA.begin(); it < mMIA.end(); ) for (uuid_vec_t::iterator it = mMIA.begin(); it < mMIA.end(); )
{ {
LLViewerInventoryItem* item = gInventory.getItem(*it); LLViewerInventoryItem* item = gInventory.getItem(*it);
if(!item) if (!item)
{ {
++it; ++it;
continue; continue;
@@ -488,7 +490,7 @@ void LLInventoryExistenceObserver::changed(U32 mask)
mExist.push_back(*it); mExist.push_back(*it);
it = mMIA.erase(it); it = mMIA.erase(it);
} }
if(mMIA.empty()) if (mMIA.empty())
{ {
done(); done();
} }
@@ -589,7 +591,7 @@ void LLInventoryAddedObserver::changed(U32 mask)
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
for(S32 i = 0; i < num_blocks; ++i) for (S32 i = 0; i < num_blocks; ++i)
{ {
titem->unpackMessage(msg, _PREHASH_InventoryData, i); titem->unpackMessage(msg, _PREHASH_InventoryData, i);
if (!(titem->getUUID().isNull())) if (!(titem->getUUID().isNull()))
@@ -639,18 +641,18 @@ LLInventoryTransactionObserver::LLInventoryTransactionObserver(const LLTransacti
void LLInventoryTransactionObserver::changed(U32 mask) void LLInventoryTransactionObserver::changed(U32 mask)
{ {
if(mask & LLInventoryObserver::ADD) if (mask & LLInventoryObserver::ADD)
{ {
// This could be it - see if we are processing a bulk update // This could be it - see if we are processing a bulk update
LLMessageSystem* msg = gMessageSystem; LLMessageSystem* msg = gMessageSystem;
if(msg->getMessageName() if (msg->getMessageName()
&& (0 == strcmp(msg->getMessageName(), "BulkUpdateInventory"))) && (0 == strcmp(msg->getMessageName(), "BulkUpdateInventory")))
{ {
// we have a match for the message - now check the // we have a match for the message - now check the
// transaction id. // transaction id.
LLUUID id; LLUUID id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, id); msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, id);
if(id == mTransactionID) if (id == mTransactionID)
{ {
// woo hoo, we found it // woo hoo, we found it
uuid_vec_t folders; uuid_vec_t folders;
@@ -658,19 +660,19 @@ void LLInventoryTransactionObserver::changed(U32 mask)
S32 count; S32 count;
count = msg->getNumberOfBlocksFast(_PREHASH_FolderData); count = msg->getNumberOfBlocksFast(_PREHASH_FolderData);
S32 i; S32 i;
for(i = 0; i < count; ++i) for (i = 0; i < count; ++i)
{ {
msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_FolderID, id, i); msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_FolderID, id, i);
if(id.notNull()) if (id.notNull())
{ {
folders.push_back(id); folders.push_back(id);
} }
} }
count = msg->getNumberOfBlocksFast(_PREHASH_ItemData); count = msg->getNumberOfBlocksFast(_PREHASH_ItemData);
for(i = 0; i < count; ++i) for (i = 0; i < count; ++i)
{ {
msg->getUUIDFast(_PREHASH_ItemData, _PREHASH_ItemID, id, i); msg->getUUIDFast(_PREHASH_ItemData, _PREHASH_ItemID, id, i);
if(id.notNull()) if (id.notNull())
{ {
items.push_back(id); items.push_back(id);
} }

View File

@@ -3,10 +3,9 @@
* @brief Dumping ground for viewer-side message system callbacks. * @brief Dumping ground for viewer-side message system callbacks.
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewergpl$
* * Second Life Viewer Source Code
* Copyright (c) 2002-2009, Linden Research, Inc. * Copyright (c) 2002-2009, Linden Research, Inc.
* *
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * 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 * to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement * ("GPL"), unless you have obtained a separate licensing agreement
@@ -34,14 +33,10 @@
#include "llviewermessage.h" #include "llviewermessage.h"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <deque>
#include "llanimationstates.h" #include "llanimationstates.h"
#include "llaudioengine.h" #include "llaudioengine.h"
#include "llavatarnamecache.h" #include "llavatarnamecache.h"
#include "../lscript/lscript_byteformat.h" //Need LSCRIPTRunTimePermissionBits and SCRIPT_PERMISSION_* #include "../lscript/lscript_byteformat.h" //Need LSCRIPTRunTimePermissionBits and SCRIPT_PERMISSION_*
#include "llcachename.h"
#include "lleconomy.h" #include "lleconomy.h"
#include "llfocusmgr.h" #include "llfocusmgr.h"
#include "llfollowcamparams.h" #include "llfollowcamparams.h"
@@ -66,11 +61,9 @@
#include "llfloaterchat.h" #include "llfloaterchat.h"
#include "llfloatergroupinfo.h" #include "llfloatergroupinfo.h"
#include "llfloaterimagepreview.h" #include "llfloaterimagepreview.h"
#include "llfloaterinventory.h"
#include "llfloaterland.h" #include "llfloaterland.h"
#include "llfloaterregioninfo.h" #include "llfloaterregioninfo.h"
#include "llfloaterlandholdings.h" #include "llfloaterlandholdings.h"
#include "llurldispatcher.h"
#include "llfloatermute.h" #include "llfloatermute.h"
#include "llfloaterpostcard.h" #include "llfloaterpostcard.h"
#include "llfloaterpreference.h" #include "llfloaterpreference.h"
@@ -86,6 +79,7 @@
#include "llnotifications.h" #include "llnotifications.h"
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "llpanelgrouplandmoney.h" #include "llpanelgrouplandmoney.h"
#include "llpanelmaininventory.h"
#include "llselectmgr.h" #include "llselectmgr.h"
#include "llstartup.h" #include "llstartup.h"
#include "llsky.h" #include "llsky.h"
@@ -94,18 +88,13 @@
#include "llimview.h" #include "llimview.h"
#include "llfloateractivespeakers.h" #include "llfloateractivespeakers.h"
#include "lltrans.h" #include "lltrans.h"
#include "lluploaddialog.h"
#include "llviewercamera.h"
#include "llviewerdisplay.h"
#include "llviewerfoldertype.h" #include "llviewerfoldertype.h"
#include "llviewergenericmessage.h" #include "llviewergenericmessage.h"
#include "llviewermenu.h" #include "llviewermenu.h"
#include "llviewerinventory.h" #include "llviewerinventory.h"
#include "llviewerjoystick.h" #include "llviewerjoystick.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h" #include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h" #include "llviewerparcelmgr.h"
#include "llviewerpartsource.h"
#include "llviewerstats.h" #include "llviewerstats.h"
#include "llviewertexteditor.h" #include "llviewertexteditor.h"
#include "llviewerthrottle.h" #include "llviewerthrottle.h"
@@ -119,15 +108,12 @@
#include "llkeythrottle.h" #include "llkeythrottle.h"
#include "llagentui.h" #include "llagentui.h"
#include "llviewerregion.h" #include "llviewerregion.h"
// <edit>
#include "llviewernetwork.h"
// </edit>
// [RLVa:KB] // [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0a)
#include "llfloateravatarinfo.h" // Checked: 2009-07-08 (RLVa-1.0.0e)
#include "rlvhandler.h" #include "rlvhandler.h"
#include "rlvinventory.h" #include "rlvinventory.h"
#include "rlvui.h" #include "rlvui.h"
#include "rlvcommon.h"
// [/RLVa:KB] // [/RLVa:KB]
#if SHY_MOD //Command handler #if SHY_MOD //Command handler
@@ -140,9 +126,6 @@
#include "sgversion.h" #include "sgversion.h"
#include "m7wlinterface.h" #include "m7wlinterface.h"
#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llgiveinventory.h" #include "llgiveinventory.h"
#include <boost/tokenizer.hpp> #include <boost/tokenizer.hpp>
@@ -161,10 +144,6 @@ static const boost::regex NEWLINES("\\n{1}");
extern AIHTTPTimeoutPolicy authHandler_timeout; extern AIHTTPTimeoutPolicy authHandler_timeout;
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
#include "llfloateravatarinfo.h"
// [/RLVa:KB]
// //
// Constants // Constants
// //
@@ -4974,7 +4953,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
if (object_id == owner_id && !gSavedSettings.getBOOL("EnableGestureSounds")) if (object_id == owner_id && !gSavedSettings.getBOOL("EnableGestureSounds"))
{ {
// Don't mute own gestures, if they're not muted. // Don't mute own gestures, if they're not muted.
if(owner_id != gAgent.getID() || !gSavedSettings.getBOOL("EnableGestureSoundsSelf")) if (owner_id != gAgentID || !gSavedSettings.getBOOL("EnableGestureSoundsSelf"))
return; return;
} }

View File

@@ -7458,10 +7458,6 @@ LLBBox LLVOAvatar::getHUDBBox() const
return bbox; return bbox;
} }
void LLVOAvatar::rebuildHUD()
{
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// onFirstTEMessageReceived() // onFirstTEMessageReceived()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -7981,6 +7977,7 @@ void LLVOAvatar::getAnimNames( LLDynamicArray<std::string>* names )
names->put( "enter_away_from_keyboard_state" ); names->put( "enter_away_from_keyboard_state" );
} }
// static
void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
{ {
if (!userdata) return; if (!userdata) return;
@@ -8074,7 +8071,7 @@ void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTextu
{ {
LLUUID *avatar_idp = (LLUUID *)userdata; LLUUID *avatar_idp = (LLUUID *)userdata;
LLVOAvatar *selfp = gObjectList.findAvatar(*avatar_idp); LLVOAvatar *selfp = gObjectList.findAvatar(*avatar_idp);
if (selfp) if (selfp)
{ {
LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL; LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL;
@@ -8095,7 +8092,7 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success,
LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src,
S32 discard_level, BOOL final, void* userdata) S32 discard_level, BOOL final, void* userdata)
{ {
// llinfos << "onBakedTextureLoaded: " << src_vi->getID() << llendl; LL_DEBUGS("Avatar") << "onBakedTextureLoaded: " << src_vi->getID() << LL_ENDL;
LLUUID id = src_vi->getID(); LLUUID id = src_vi->getID();
LLUUID *avatar_idp = (LLUUID *)userdata; LLUUID *avatar_idp = (LLUUID *)userdata;
@@ -8125,7 +8122,6 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success,
// Called when baked texture is loaded and also when we start up with a baked texture // Called when baked texture is loaded and also when we start up with a baked texture
void LLVOAvatar::useBakedTexture( const LLUUID& id ) void LLVOAvatar::useBakedTexture( const LLUUID& id )
{ {
for (U32 i = 0; i < mBakedTextureDatas.size(); i++) for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{ {
LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 ); LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 );

View File

@@ -755,7 +755,6 @@ public:
public: public:
BOOL hasHUDAttachment() const; BOOL hasHUDAttachment() const;
LLBBox getHUDBBox() const; LLBBox getHUDBBox() const;
void rebuildHUD();
void resetHUDAttachments(); void resetHUDAttachments();
BOOL canAttachMoreObjects() const; BOOL canAttachMoreObjects() const;
BOOL canAttachMoreObjects(U32 n) const; BOOL canAttachMoreObjects(U32 n) const;

View File

@@ -4719,11 +4719,6 @@ void LLPipeline::rebuildPools()
} }
max_count--; max_count--;
} }
if (isAgentAvatarValid())
{
gAgentAvatarp->rebuildHUD();
}
} }
void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp ) void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )