summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llstartup.cpp277
1 files changed, 146 insertions, 131 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 37e6ded986..42fc300187 100644..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,6 +51,7 @@
#include "lllandmark.h"
#include "llcachename.h"
#include "lldir.h"
+#include "lldonotdisturbnotificationstorage.h"
#include "llerrorcontrol.h"
#include "llfloaterreg.h"
#include "llfocusmgr.h"
@@ -67,12 +69,12 @@
#include "llfloaterimnearbychat.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
+#include "llpersistentnotificationstorage.h"
#include "llteleporthistory.h"
#include "llregionhandle.h"
#include "llsd.h"
#include "llsdserialize.h"
#include "llsdutil_math.h"
-#include "llsecondlifeurls.h"
#include "llstring.h"
#include "lluserrelations.h"
#include "llversioninfo.h"
@@ -81,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"
@@ -130,7 +131,6 @@
#include "llpreviewscript.h"
#include "llproxy.h"
#include "llproductinforequest.h"
-#include "llsecondlifeurls.h"
#include "llselectmgr.h"
#include "llsky.h"
#include "llstatview.h"
@@ -240,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());
@@ -310,13 +311,18 @@ 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()
{
const F32 PRECACHING_DELAY = gSavedSettings.getF32("PrecachingDelay");
static LLTimer timeout;
- static S32 timeout_count = 0;
static LLTimer login_time;
@@ -332,7 +338,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;
@@ -623,34 +628,31 @@ bool idle_startup()
if (FALSE == gSavedSettings.getBOOL("NoAudio"))
{
+ delete gAudiop;
gAudiop = NULL;
-#ifdef LL_OPENAL
- if (!gAudiop
+#ifdef LL_FMODEX
#if !LL_WINDOWS
- && NULL == getenv("LL_BAD_OPENAL_DRIVER")
+ if (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
- if (!gAudiop
+#ifdef LL_OPENAL
#if !LL_WINDOWS
- && NULL == getenv("LL_BAD_FMOD_DRIVER")
+ if (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 +746,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 +772,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);
@@ -791,14 +787,18 @@ bool idle_startup()
display_startup();
LLPanelLogin::giveFocus();
- if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
+ // MAINT-3231 Show first run dialog only for Desura viewer
+ if (gSavedSettings.getString("sourceid") == "1208_desura")
{
- LL_INFOS("AppInit") << "FirstLoginThisInstall, calling show_first_run_dialog()" << LL_ENDL;
- show_first_run_dialog();
- }
- else
- {
- LL_DEBUGS("AppInit") << "FirstLoginThisInstall off" << LL_ENDL;
+ if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
+ {
+ LL_INFOS("AppInit") << "FirstLoginThisInstall, calling show_first_run_dialog()" << LL_ENDL;
+ show_first_run_dialog();
+ }
+ else
+ {
+ LL_DEBUGS("AppInit") << "FirstLoginThisInstall off" << LL_ENDL;
+ }
}
LLStartUp::setStartupState( STATE_LOGIN_WAIT ); // Wait for user input
@@ -907,6 +907,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,
@@ -993,15 +997,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;
}
@@ -1043,6 +1044,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
@@ -1194,6 +1196,7 @@ bool idle_startup()
// create the default proximal channel
LLVoiceChannel::initClass();
LLStartUp::setStartupState( STATE_WORLD_INIT);
+ LLTrace::get_frame_recording().reset();
}
else
{
@@ -1254,6 +1257,9 @@ bool idle_startup()
LLPostProcess::initClass();
display_startup();
+ LLAvatarAppearance::initClass();
+ display_startup();
+
LLViewerObject::initVOClasses();
display_startup();
@@ -1287,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();
@@ -1344,11 +1352,11 @@ bool idle_startup()
{
LLStringUtil::format_map_t args;
args["[NUMBER]"] = llformat("%d", num_retries + 1);
- set_startup_status(0.4f, LLTrans::getString("LoginRetrySeedCapGrant", args), gAgent.mMOTD);
+ set_startup_status(0.4f, LLTrans::getString("LoginRetrySeedCapGrant", args), gAgent.mMOTD.c_str());
}
else
{
- set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD);
+ set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD.c_str());
}
}
display_startup();
@@ -1436,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)
@@ -1514,7 +1522,7 @@ bool idle_startup()
gFirstSim,
gSavedSettings.getS32("UseCircuitCodeMaxRetries"),
FALSE,
- gSavedSettings.getF32("UseCircuitCodeTimeout"),
+ (F32Seconds)gSavedSettings.getF32("UseCircuitCodeTimeout"),
use_circuit_callback,
NULL);
@@ -1682,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"];
@@ -1771,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 );
@@ -1874,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();
@@ -1938,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();
@@ -1954,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;
@@ -1962,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);
@@ -2018,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
@@ -2027,18 +2031,38 @@ 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
@@ -2046,7 +2070,7 @@ bool idle_startup()
update_texture_fetch();
set_startup_status(0.60f + 0.30f * timeout_frac,
LLTrans::getString("LoginPrecaching"),
- gAgent.mMOTD);
+ gAgent.mMOTD.c_str());
display_startup();
}
@@ -2058,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
@@ -2073,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;
}
@@ -2103,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())
@@ -2178,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;
@@ -2186,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();
@@ -2202,10 +2210,11 @@ bool idle_startup()
llassert(LLPathfindingManager::getInstance() != NULL);
LLPathfindingManager::getInstance()->initSystem();
+ gAgentAvatarp->sendHoverHeight();
+
return TRUE;
}
- LL_WARNS("AppInit") << "Reached end of idle_startup for state " << LLStartUp::getStartupState() << LL_ENDL;
return TRUE;
}
@@ -2368,8 +2377,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);
@@ -2443,9 +2450,6 @@ void register_viewer_callbacks(LLMessageSystem* msg)
// msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply,
// LLFloaterRate::processReputationIndividualReply);
- msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate,
- LLAgentWearables::processAgentInitialWearablesUpdate );
-
msg->setHandlerFunc("ScriptControlChange",
LLAgent::processScriptControlChange );
@@ -2549,7 +2553,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);
@@ -2559,18 +2563,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;
}
@@ -2583,39 +2587,43 @@ 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
{
+ // 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);
- lldebugs << "initial outfit category id: " << cat_id << llendl;
+ // Need to fetch cof contents before we can wear.
+ callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(),
+ boost::bind(&LLAppearanceMgr::wearInventoryCategory, LLAppearanceMgr::getInstance(), cat, do_copy, do_append));
+ 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);
}
@@ -2813,6 +2821,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()
@@ -3154,7 +3163,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;
@@ -3360,7 +3369,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;
@@ -3455,6 +3468,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,19 +3514,13 @@ bool process_login_success_response()
{
success = true;
}
-
+ LLAppViewer* pApp = LLAppViewer::instance();
+ pApp->writeDebugInfo(); //Write our static data now that we have username, session_id, etc.
return success;
}
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);