diff options
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rwxr-xr-x | indra/newview/llstartup.cpp | 106 |
1 files changed, 59 insertions, 47 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3d1fd74ba6..67a76460a7 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" +#include "llappviewer.h" #include "llstartup.h" #if LL_WINDOWS @@ -37,8 +38,8 @@ #include "llviewermedia_streamingaudio.h" #include "llaudioengine.h" -#ifdef LL_FMOD -# include "llaudioengine_fmod.h" +#ifdef LL_FMODEX +# include "llaudioengine_fmodex.h" #endif #ifdef LL_OPENAL @@ -50,11 +51,12 @@ #include "lllandmark.h" #include "llcachename.h" #include "lldir.h" +#include "lldonotdisturbnotificationstorage.h" #include "llerrorcontrol.h" #include "llfloaterreg.h" #include "llfocusmgr.h" #include "llhttpsender.h" -#include "llimfloater.h" +#include "llfloaterimsession.h" #include "lllocationhistory.h" #include "llimageworker.h" @@ -63,9 +65,11 @@ #include "llmemorystream.h" #include "llmessageconfig.h" #include "llmoveview.h" -#include "llnearbychat.h" +#include "llfloaterimcontainer.h" +#include "llfloaterimnearbychat.h" #include "llnotifications.h" #include "llnotificationsutil.h" +#include "llpersistentnotificationstorage.h" #include "llteleporthistory.h" #include "llregionhandle.h" #include "llsd.h" @@ -94,6 +98,7 @@ #include "llcallingcard.h" #include "llconsole.h" #include "llcontainerview.h" +#include "llconversationlog.h" #include "lldebugview.h" #include "lldrawable.h" #include "lleventnotifier.h" @@ -312,11 +317,8 @@ void update_texture_fetch() // true when all initialization done. bool idle_startup() { - LLMemType mt1(LLMemType::MTYPE_STARTUP); - const F32 PRECACHING_DELAY = gSavedSettings.getF32("PrecachingDelay"); static LLTimer timeout; - static S32 timeout_count = 0; static LLTimer login_time; @@ -332,7 +334,6 @@ bool idle_startup() // last location by default static S32 agent_location_id = START_LOCATION_ID_LAST; - static S32 location_which = START_LOCATION_ID_LAST; static bool show_connect_box = true; @@ -625,32 +626,32 @@ bool idle_startup() { gAudiop = NULL; -#ifdef LL_OPENAL +#ifdef LL_FMODEX if (!gAudiop #if !LL_WINDOWS - && NULL == getenv("LL_BAD_OPENAL_DRIVER") + && NULL == getenv("LL_BAD_FMODEX_DRIVER") #endif // !LL_WINDOWS ) { - gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); + gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX(gSavedSettings.getBOOL("FMODExProfilerEnable")); } #endif -#ifdef LL_FMOD +#ifdef LL_OPENAL if (!gAudiop #if !LL_WINDOWS - && NULL == getenv("LL_BAD_FMOD_DRIVER") + && NULL == getenv("LL_BAD_OPENAL_DRIVER") #endif // !LL_WINDOWS ) { - gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); + gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); } #endif if (gAudiop) { #if LL_WINDOWS - // FMOD on Windows needs the window handle to stop playing audio + // FMOD Ex on Windows needs the window handle to stop playing audio // when window is minimized. JC void* window_handle = (HWND)gViewerWindow->getPlatformWindow(); #else @@ -744,8 +745,6 @@ bool idle_startup() gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); - timeout_count = 0; - // Login screen needs menus for preferences, but we can enter // this startup phase more than once. if (gLoginMenuBarView == NULL) @@ -772,10 +771,6 @@ bool idle_startup() gUserCredential = gLoginHandler.initializeLoginInfo(); display_startup(); } - if (gHeadlessClient) - { - LL_WARNS("AppInit") << "Waiting at connection box in headless client. Did you mean to add autologin params?" << LL_ENDL; - } // Make sure the process dialog doesn't hide things display_startup(); gViewerWindow->setShowProgress(FALSE); @@ -907,6 +902,10 @@ bool idle_startup() gDirUtilp->setLindenUserDir(userid); LLFile::mkdir(gDirUtilp->getLindenUserDir()); + // As soon as directories are ready initialize notification storages + LLPersistentNotificationStorage::getInstance()->initialize(); + LLDoNotDisturbNotificationStorage::getInstance()->initialize(); + // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, @@ -917,6 +916,13 @@ bool idle_startup() // Overwrite default user settings with user settings LLAppViewer::instance()->loadSettingsFromDirectory("Account"); + // Convert 'LogInstantMessages' into 'KeepConversationLogTranscripts' for backward compatibility (CHUI-743). + LLControlVariablePtr logInstantMessagesControl = gSavedPerAccountSettings.getControl("LogInstantMessages"); + if (logInstantMessagesControl.notNull()) + { + gSavedPerAccountSettings.setS32("KeepConversationLogTranscripts", logInstantMessagesControl->getValue() ? 2 : 1); + } + // Need to set the LastLogoff time here if we don't have one. LastLogoff is used for "Recent Items" calculation // and startup time is close enough if we don't have a real value. if (gSavedPerAccountSettings.getU32("LastLogoff") == 0) @@ -986,15 +992,12 @@ bool idle_startup() { case LLSLURL::LOCATION: agent_location_id = START_LOCATION_ID_URL; - location_which = START_LOCATION_ID_LAST; break; case LLSLURL::LAST_LOCATION: agent_location_id = START_LOCATION_ID_LAST; - location_which = START_LOCATION_ID_LAST; break; default: agent_location_id = START_LOCATION_ID_HOME; - location_which = START_LOCATION_ID_HOME; break; } @@ -1036,6 +1039,7 @@ bool idle_startup() login->setSerialNumber(LLAppViewer::instance()->getSerialNumber()); login->setLastExecEvent(gLastExecEvent); + login->setLastExecDuration(gLastExecDuration); login->setUpdaterLauncher(boost::bind(&LLAppViewer::launchUpdater, LLAppViewer::instance())); // This call to LLLoginInstance::connect() starts the @@ -1247,6 +1251,9 @@ bool idle_startup() LLPostProcess::initClass(); display_startup(); + LLAvatarAppearance::initClass(); + display_startup(); + LLViewerObject::initVOClasses(); display_startup(); @@ -1293,6 +1300,8 @@ bool idle_startup() display_startup(); LLStartUp::setStartupState( STATE_MULTIMEDIA_INIT ); + LLConversationLog::getInstance(); + return FALSE; } @@ -1403,14 +1412,9 @@ bool idle_startup() LLVoiceClient::getInstance()->updateSettings(); display_startup(); - //gCacheName is required for nearby chat history loading - //so I just moved nearby history loading a few states further - if (gSavedPerAccountSettings.getBOOL("LogShowHistory")) - { - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if (nearby_chat) nearby_chat->loadHistory(); - } - display_startup(); + // create a container's instance for start a controlling conversation windows + // by the voice's events + LLFloaterIMContainer::getInstance(); // *Note: this is where gWorldMap used to be initialized. @@ -1420,7 +1424,7 @@ bool idle_startup() display_startup(); //reset statistics - LLViewerStats::getInstance()->resetStats(); + LLViewerStats::instance().resetStats(); display_startup(); // @@ -1521,7 +1525,7 @@ bool idle_startup() } //--------------------------------------------------------------------- - // Agent Send + // World Wait //--------------------------------------------------------------------- if(STATE_WORLD_WAIT == LLStartUp::getStartupState()) { @@ -1847,6 +1851,10 @@ bool idle_startup() // Set the show start location to true, now that the user has logged // on with this install. gSavedSettings.setBOOL("ShowStartLocation", TRUE); + + // Open Conversation floater on first login. + LLFloaterReg::toggleInstanceOrBringToFront("im_container"); + } display_startup(); @@ -1949,7 +1957,7 @@ bool idle_startup() llinfos << "gAgentStartLocation : " << gAgentStartLocation << llendl; LLSLURL start_slurl = LLStartUp::getStartSLURL(); LL_DEBUGS("AppInit") << "start slurl "<<start_slurl.asString()<<LL_ENDL; - + if (((start_slurl.getType() == LLSLURL::LOCATION) && (gAgentStartLocation == "url")) || ((start_slurl.getType() == LLSLURL::LAST_LOCATION) && (gAgentStartLocation == "last")) || ((start_slurl.getType() == LLSLURL::HOME_LOCATION) && (gAgentStartLocation == "home"))) @@ -2169,7 +2177,6 @@ bool idle_startup() display_startup(); // Unmute audio if desired and setup volumes. - // Unmute audio if desired and setup volumes. // This is a not-uncommon crash site, so surround it with // llinfos output to aid diagnosis. LL_INFOS("AppInit") << "Doing first audio_update_volume..." << LL_ENDL; @@ -2190,7 +2197,6 @@ bool idle_startup() LLAgentPicksInfo::getInstance()->requestNumberOfPicks(); - LLIMFloater::initIMFloater(); display_startup(); llassert(LLPathfindingManager::getInstance() != NULL); @@ -2296,7 +2302,7 @@ bool login_alert_status(const LLSD& notification, const LLSD& response) // break; case 2: // Teleport // Restart the login process, starting at our home locaton - LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME)); + LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME)); LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); break; default: @@ -2582,12 +2588,17 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, } else { + // FIXME SH-3860 - this creates a race condition, where COF + // changes (base outfit link added) after appearance update + // request has been submitted. sWearablesLoadedCon = gAgentWearables.addLoadedCallback(LLStartUp::saveInitialOutfit); bool do_copy = true; bool do_append = false; LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); - LLAppearanceMgr::instance().wearInventoryCategory(cat, do_copy, do_append); + // Need to fetch cof contents before we can wear. + callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), + boost::bind(&LLAppearanceMgr::wearInventoryCategory, LLAppearanceMgr::getInstance(), cat, do_copy, do_append)); lldebugs << "initial outfit category id: " << cat_id << llendl; } @@ -2805,7 +2816,7 @@ void LLStartUp::initNameCache() // Start cache in not-running state until we figure out if we have // capabilities for display name lookup - LLAvatarNameCache::initClass(false); + LLAvatarNameCache::initClass(false,gSavedSettings.getBOOL("UsePeopleAPI")); LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames")); } @@ -3449,6 +3460,14 @@ bool process_login_success_response() } + // set the location of the Agent Appearance service, from which we can request + // avatar baked textures if they are supported by the current region + std::string agent_appearance_url = response["agent_appearance_service"]; + if (!agent_appearance_url.empty()) + { + LLAppearanceMgr::instance().setAppearanceServiceURL(agent_appearance_url); + } + // Set the location of the snapshot sharing config endpoint std::string snapshot_config_url = response["snapshot_config_url"]; if(!snapshot_config_url.empty()) @@ -3493,13 +3512,6 @@ bool process_login_success_response() void transition_back_to_login_panel(const std::string& emsg) { - if (gHeadlessClient && gSavedSettings.getBOOL("AutoLogin")) - { - LL_WARNS("AppInit") << "Failed to login!" << LL_ENDL; - LL_WARNS("AppInit") << emsg << LL_ENDL; - exit(0); - } - // Bounce back to the login screen. reset_login(); // calls LLStartUp::setStartupState( STATE_LOGIN_SHOW ); gSavedSettings.setBOOL("AutoLogin", FALSE); |