diff options
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rwxr-xr-x | indra/newview/llstartup.cpp | 190 |
1 files changed, 96 insertions, 94 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d4b3fcf28a..9da7717b74 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -75,7 +75,6 @@ #include "llsd.h" #include "llsdserialize.h" #include "llsdutil_math.h" -#include "llsecondlifeurls.h" #include "llstring.h" #include "lluserrelations.h" #include "llversioninfo.h" @@ -84,7 +83,6 @@ #include "llvfs.h" #include "llxorcipher.h" // saved password, MAC address #include "llwindow.h" -#include "imageids.h" #include "message.h" #include "v3math.h" @@ -133,7 +131,6 @@ #include "llpreviewscript.h" #include "llproxy.h" #include "llproductinforequest.h" -#include "llsecondlifeurls.h" #include "llselectmgr.h" #include "llsky.h" #include "llstatview.h" @@ -243,6 +240,7 @@ static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f); static std::string gAgentStartLocation = "safe"; static bool mLoginStatePastUI = false; +const S32 DEFAULT_MAX_AGENT_GROUPS = 25; boost::scoped_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState")); boost::scoped_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener()); @@ -313,6 +311,12 @@ void update_texture_fetch() gTextureList.updateImages(0.10f); } +void set_flags_and_update_appearance() +{ + LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); + LLAppearanceMgr::instance().updateAppearanceFromCOF(true, true, no_op); +} + // Returns false to skip other idle processing. Should only return // true when all initialization done. bool idle_startup() @@ -624,30 +628,27 @@ bool idle_startup() if (FALSE == gSavedSettings.getBOOL("NoAudio")) { + delete gAudiop; gAudiop = NULL; #ifdef LL_FMODEX - if (!gAudiop #if !LL_WINDOWS - && NULL == getenv("LL_BAD_FMODEX_DRIVER") + if (NULL == getenv("LL_BAD_FMODEX_DRIVER")) #endif // !LL_WINDOWS - ) { gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX(gSavedSettings.getBOOL("FMODExProfilerEnable")); } #endif #ifdef LL_OPENAL - if (!gAudiop #if !LL_WINDOWS - && NULL == getenv("LL_BAD_OPENAL_DRIVER") + if (NULL == getenv("LL_BAD_OPENAL_DRIVER")) #endif // !LL_WINDOWS - ) { gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); } #endif - + if (gAudiop) { #if LL_WINDOWS @@ -1195,6 +1196,7 @@ bool idle_startup() // create the default proximal channel LLVoiceChannel::initClass(); LLStartUp::setStartupState( STATE_WORLD_INIT); + LLTrace::get_frame_recording().reset(); } else { @@ -1291,6 +1293,8 @@ bool idle_startup() LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle); LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL; + LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from init_idle(). Seed cap == " + << gFirstSimSeedCap << LL_ENDL; regionp->setSeedCapability(gFirstSimSeedCap); LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL; display_startup(); @@ -1440,8 +1444,8 @@ bool idle_startup() LL_DEBUGS("AppInit") << "Initializing camera..." << LL_ENDL; gFrameTime = totalTime(); - F32 last_time = gFrameTimeSeconds; - gFrameTimeSeconds = (S64)(gFrameTime - gStartTime)/SEC_TO_MICROSEC; + F32Seconds last_time = gFrameTimeSeconds; + gFrameTimeSeconds = (gFrameTime - gStartTime); gFrameIntervalSeconds = gFrameTimeSeconds - last_time; if (gFrameIntervalSeconds < 0.f) @@ -1518,7 +1522,7 @@ bool idle_startup() gFirstSim, gSavedSettings.getS32("UseCircuitCodeMaxRetries"), FALSE, - gSavedSettings.getF32("UseCircuitCodeTimeout"), + (F32Seconds)gSavedSettings.getF32("UseCircuitCodeTimeout"), use_circuit_callback, NULL); @@ -1686,7 +1690,7 @@ bool idle_startup() LLSD inv_basic = response["inventory-basic"]; if(inv_basic.isDefined()) { - llinfos << "Basic inventory root folder id is " << inv_basic["folder_id"] << llendl; + LL_INFOS() << "Basic inventory root folder id is " << inv_basic["folder_id"] << LL_ENDL; } LLSD buddy_list = response["buddy-list"]; @@ -1775,36 +1779,45 @@ bool idle_startup() // This method MUST be called before gInventory.findCategoryUUIDForType because of // gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap. gInventory.buildParentChildMap(); + gInventory.createCommonSystemCategories(); + + // It's debatable whether this flag is a good idea - sets all + // bits, and in general it isn't true that inventory + // initialization generates all types of changes. Maybe add an + // INITIALIZE mask bit instead? + gInventory.addChangedMask(LLInventoryObserver::ALL, LLUUID::null); + gInventory.notifyObservers(); + display_startup(); //all categories loaded. lets create "My Favorites" category gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true); // set up callbacks - llinfos << "Registering Callbacks" << llendl; + LL_INFOS() << "Registering Callbacks" << LL_ENDL; LLMessageSystem* msg = gMessageSystem; - llinfos << " Inventory" << llendl; + LL_INFOS() << " Inventory" << LL_ENDL; LLInventoryModel::registerCallbacks(msg); - llinfos << " AvatarTracker" << llendl; + LL_INFOS() << " AvatarTracker" << LL_ENDL; LLAvatarTracker::instance().registerCallbacks(msg); - llinfos << " Landmark" << llendl; + LL_INFOS() << " Landmark" << LL_ENDL; LLLandmark::registerCallbacks(msg); display_startup(); // request mute list - llinfos << "Requesting Mute List" << llendl; + LL_INFOS() << "Requesting Mute List" << LL_ENDL; LLMuteList::getInstance()->requestFromServer(gAgent.getID()); display_startup(); // Get L$ and ownership credit information - llinfos << "Requesting Money Balance" << llendl; + LL_INFOS() << "Requesting Money Balance" << LL_ENDL; LLStatusBar::sendMoneyBalanceRequest(); display_startup(); // request all group information - llinfos << "Requesting Agent Data" << llendl; + LL_INFOS() << "Requesting Agent Data" << LL_ENDL; gAgent.sendAgentDataUpdateRequest(); display_startup(); // Create the inventory views - llinfos << "Creating Inventory Views" << llendl; + LL_INFOS() << "Creating Inventory Views" << LL_ENDL; LLFloaterReg::getInstance("inventory"); display_startup(); LLStartUp::setStartupState( STATE_MISC ); @@ -1878,19 +1891,6 @@ bool idle_startup() display_startup(); - // based on the comments, we've successfully logged in so we can delete the 'forced' - // URL that the updater set in settings.ini (in a mostly paranoid fashion) - std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); - if ( nextLoginLocation.length() ) - { - // clear it - gSavedSettings.setString( "NextLoginLocation", "" ); - - // and make sure it's saved - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); - LLUIColorTable::instance().saveUserSettings(); - }; - display_startup(); // JC: Initializing audio requests many sounds for download. init_audio(); @@ -1942,6 +1942,7 @@ bool idle_startup() LL_DEBUGS("AppInit") << "Initialization complete" << LL_ENDL; + LL_DEBUGS("SceneLoadTiming", "Start") << "Scene Load Started " << LL_ENDL; gRenderStartTime.reset(); gForegroundTime.reset(); @@ -1958,7 +1959,7 @@ bool idle_startup() // thus, do not show this alert. if (!gAgent.isFirstLogin()) { - llinfos << "gAgentStartLocation : " << gAgentStartLocation << llendl; + LL_INFOS() << "gAgentStartLocation : " << gAgentStartLocation << LL_ENDL; LLSLURL start_slurl = LLStartUp::getStartSLURL(); LL_DEBUGS("AppInit") << "start slurl "<<start_slurl.asString()<<LL_ENDL; @@ -1966,10 +1967,9 @@ bool idle_startup() ((start_slurl.getType() == LLSLURL::LAST_LOCATION) && (gAgentStartLocation == "last")) || ((start_slurl.getType() == LLSLURL::HOME_LOCATION) && (gAgentStartLocation == "home"))) { - // Start location is OK - // Disabled code to restore camera location and focus if logging in to default location - static bool samename = false; - if (samename) + if (start_slurl.getType() == LLSLURL::LAST_LOCATION + && gAgentStartLocation == "last" + && gSavedSettings.getBOOL("RestoreCameraPosOnLogin")) { // restore old camera pos gAgentCamera.setFocusOnAvatar(FALSE, FALSE); @@ -2022,7 +2022,7 @@ bool idle_startup() { display_startup(); F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY; - + // We now have an inventory skeleton, so if this is a user's first // login, we can start setting up their clothing and avatar // appearance. This helps to avoid the generic "Ruth" avatar in @@ -2031,20 +2031,40 @@ bool idle_startup() && !sInitialOutfit.empty() // registration set up an outfit && !sInitialOutfitGender.empty() // and a gender && isAgentAvatarValid() // can't wear clothes without object - && !gAgent.isGenderChosen() ) // nothing already loading + && !gAgent.isOutfitChosen()) // nothing already loading { // Start loading the wearables, textures, gestures LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); } + // If not first login, we need to fetch COF contents and + // compute appearance from that. + if (isAgentAvatarValid() && !gAgent.isFirstLogin() && !gAgent.isOutfitChosen()) + { + gAgentWearables.notifyLoadingStarted(); + gAgent.setOutfitChosen(TRUE); + gAgentWearables.sendDummyAgentWearablesUpdate(); + callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), set_flags_and_update_appearance); + } display_startup(); // wait precache-delay and for agent's avatar or a lot longer. - if(((timeout_frac > 1.f) && isAgentAvatarValid()) - || (timeout_frac > 3.f)) + if ((timeout_frac > 1.f) && isAgentAvatarValid()) { LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); } + else if (timeout_frac > 10.f) + { + // If we exceed the wait above while isAgentAvatarValid is + // not true yet, we will change startup state and + // eventually (once avatar does get created) wind up at + // the gender chooser. This should occur only in very + // unusual circumstances, so set the timeout fairly high + // to minimize mistaken hits here. + LL_WARNS() << "Wait for valid avatar state exceeded " + << timeout.getElapsedTimeF32() << " will invoke gender chooser" << LL_ENDL; + LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); + } else { update_texture_fetch(); @@ -2062,13 +2082,13 @@ bool idle_startup() static LLFrameTimer wearables_timer; const F32 wearables_time = wearables_timer.getElapsedTimeF32(); - const F32 MAX_WEARABLES_TIME = 10.f; + static LLCachedControl<F32> max_wearables_time(gSavedSettings, "ClothingLoadingDelay"); - if (!gAgent.isGenderChosen() && isAgentAvatarValid()) + if (!gAgent.isOutfitChosen() && isAgentAvatarValid()) { - // No point in waiting for clothing, we don't even - // know what gender we are. Pop a dialog to ask and - // proceed to draw the world. JC + // No point in waiting for clothing, we don't even know + // what outfit we want. Pop up a gender chooser dialog to + // ask and proceed to draw the world. JC // // *NOTE: We might hit this case even if we have an // initial outfit, but if the load hasn't started @@ -2077,26 +2097,25 @@ bool idle_startup() LLNotificationsUtil::add("WelcomeChooseSex", LLSD(), LLSD(), callback_choose_gender); LLStartUp::setStartupState( STATE_CLEANUP ); - return TRUE; } display_startup(); - if (wearables_time > MAX_WEARABLES_TIME) + if (gAgent.isOutfitChosen() && (wearables_time > max_wearables_time)) { LLNotificationsUtil::add("ClothingLoading"); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); + record(LLStatViewer::LOADING_WEARABLES_LONG_DELAY, wearables_time); LLStartUp::setStartupState( STATE_CLEANUP ); - return TRUE; } - - if (gAgent.isFirstLogin()) + else if (gAgent.isFirstLogin() + && isAgentAvatarValid() + && gAgentAvatarp->isFullyLoaded()) { // wait for avatar to be completely loaded if (isAgentAvatarValid() && gAgentAvatarp->isFullyLoaded()) { - //llinfos << "avatar fully loaded" << llendl; + LL_DEBUGS("Avatar") << "avatar fully loaded" << LL_ENDL; LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } @@ -2107,20 +2126,12 @@ bool idle_startup() if ( gAgentWearables.areWearablesLoaded() ) { // We have our clothing, proceed. - //llinfos << "wearables loaded" << llendl; + LL_DEBUGS("Avatar") << "wearables loaded" << LL_ENDL; LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } } - - display_startup(); - update_texture_fetch(); - display_startup(); - set_startup_status(0.9f + 0.1f * wearables_time / MAX_WEARABLES_TIME, - LLTrans::getString("LoginDownloadingClothing").c_str(), - gAgent.mMOTD.c_str()); - display_startup(); - return TRUE; + //fall through this frame to STATE_CLEANUP } if (STATE_CLEANUP == LLStartUp::getStartupState()) @@ -2182,7 +2193,7 @@ bool idle_startup() // 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() output to aid diagnosis. LL_INFOS("AppInit") << "Doing first audio_update_volume..." << LL_ENDL; audio_update_volume(); LL_INFOS("AppInit") << "Done first audio_update_volume." << LL_ENDL; @@ -2190,15 +2201,8 @@ bool idle_startup() // reset keyboard focus to sane state of pointing at world gFocusMgr.setKeyboardFocus(NULL); -#if 0 // sjb: enable for auto-enabling timer display - gDebugView->mFastTimerView->setVisible(TRUE); -#endif - LLAppViewer::instance()->handleLoginComplete(); - // reset timers now that we are running "logged in" logic - LLFastTimer::reset(); - LLAgentPicksInfo::getInstance()->requestNumberOfPicks(); display_startup(); @@ -2209,7 +2213,6 @@ bool idle_startup() return TRUE; } - LL_WARNS("AppInit") << "Reached end of idle_startup for state " << LLStartUp::getStartupState() << LL_ENDL; return TRUE; } @@ -2372,8 +2375,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value); msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance); - msg->setHandlerFunc("AgentCachedTextureResponse", LLAgent::processAgentCachedTextureResponse); - msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatarSelf::processRebakeAvatarTextures); msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint); msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response); msg->setHandlerFunc("SetFollowCamProperties", process_set_follow_cam_properties); @@ -2447,9 +2448,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) // msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply, // LLFloaterRate::processReputationIndividualReply); - msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate, - LLAgentWearables::processAgentInitialWearablesUpdate ); - msg->setHandlerFunc("ScriptControlChange", LLAgent::processScriptControlChange ); @@ -2553,7 +2551,7 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response) void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ) { - lldebugs << "starting" << llendl; + LL_DEBUGS() << "starting" << LL_ENDL; // Not going through the processAgentInitialWearables path, so need to set this here. LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); @@ -2563,18 +2561,18 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, ESex gender; if (gender_name == "male") { - lldebugs << "male" << llendl; + LL_DEBUGS() << "male" << LL_ENDL; gender = SEX_MALE; } else { - lldebugs << "female" << llendl; + LL_DEBUGS() << "female" << LL_ENDL; gender = SEX_FEMALE; } if (!isAgentAvatarValid()) { - llwarns << "Trying to load an initial outfit for an invalid agent avatar" << llendl; + LL_WARNS() << "Trying to load an initial outfit for an invalid agent avatar" << LL_ENDL; return; } @@ -2587,7 +2585,7 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, outfit_folder_name); if (cat_id.isNull()) { - lldebugs << "standard wearables" << llendl; + LL_DEBUGS() << "standard wearables" << LL_ENDL; gAgentWearables.createStandardWearables(); } else @@ -2603,28 +2601,27 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, // 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; + LL_DEBUGS() << "initial outfit category id: " << cat_id << LL_ENDL; } - // This is really misnamed -- it means we have started loading - // an outfit/shape that will give the avatar a gender eventually. JC - gAgent.setGenderChosen(TRUE); + gAgent.setOutfitChosen(TRUE); + gAgentWearables.sendDummyAgentWearablesUpdate(); } //static void LLStartUp::saveInitialOutfit() { if (sInitialOutfit.empty()) { - lldebugs << "sInitialOutfit is empty" << llendl; + LL_DEBUGS() << "sInitialOutfit is empty" << LL_ENDL; return; } if (sWearablesLoadedCon.connected()) { - lldebugs << "sWearablesLoadedCon is connected, disconnecting" << llendl; + LL_DEBUGS("Avatar") << "sWearablesLoadedCon is connected, disconnecting" << LL_ENDL; sWearablesLoadedCon.disconnect(); } - lldebugs << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << llendl; + LL_DEBUGS("Avatar") << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << LL_ENDL; LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false); } @@ -2822,6 +2819,7 @@ void LLStartUp::initNameCache() // capabilities for display name lookup LLAvatarNameCache::initClass(false,gSavedSettings.getBOOL("UsePeopleAPI")); LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames")); + LLAvatarNameCache::setUseUsernames(gSavedSettings.getBOOL("NameTagShowUsernames")); } void LLStartUp::cleanupNameCache() @@ -3163,7 +3161,7 @@ void apply_udp_blacklist(const std::string& csv) } std::string item(csv, start, comma-start); - lldebugs << "udp_blacklist " << item << llendl; + LL_DEBUGS() << "udp_blacklist " << item << LL_ENDL; gMessageSystem->banUdpMessage(item); start = comma + 1; @@ -3369,7 +3367,11 @@ bool process_login_success_response() flag = login_flags["gendered"].asString(); if(flag == "Y") { - gAgent.setGenderChosen(TRUE); + // We don't care about this flag anymore; now base whether + // outfit is chosen on COF contents, initial outfit + // requested and available, etc. + + //gAgent.setGenderChosen(TRUE); } bool pacific_daylight_time = false; |