Merge branch 'Moap' of git://github.com/Shyotl/SingularityViewer into VoiceUpdate

Conflicts:
	indra/newview/llfloateravatarinfo.cpp - llpanelprofile.cpp update
	indra/newview/llfloatergroupinfo.cpp - llgroupactions.cpp update
	indra/newview/llfloaterobjectiminfo.cpp - simple merge
	indra/newview/llstartup.cpp - Followed Shyotl's directions from 07165961dc
	indra/newview/llviewermedia.cpp - includes conflict, simple stuff.

SLURL update:
	indra/newview/llavataractions.cpp
	indra/newview/llgroupactions.cpp
This commit is contained in:
Lirusaito
2013-06-11 15:32:18 -04:00
179 changed files with 16760 additions and 6029 deletions

View File

@@ -86,6 +86,7 @@
#include "llsecondlifeurls.h"
#include "llstring.h"
#include "lltexteditor.h"
#include "llurlentry.h"
#include "lluserrelations.h"
#include "sgversion.h"
#include "llviewercontrol.h"
@@ -166,7 +167,6 @@
#include "lltrans.h"
#include "llui.h"
#include "llurldispatcher.h"
#include "llurlsimstring.h"
#include "llurlhistory.h"
#include "llurlwhitelist.h"
#include "lluserauth.h"
@@ -263,7 +263,7 @@ extern S32 gStartImageHeight;
//
static LLHost gAgentSimHost;
static BOOL gSkipOptionalUpdate = FALSE;
//static BOOL gSkipOptionalUpdate = FALSE;
static bool gGotUseCircuitCodeAck = false;
static std::string sInitialOutfit;
@@ -273,6 +273,7 @@ static boost::signals2::connection sWearablesLoadedCon;
static bool gUseCircuitCallbackCalled = false;
EStartupState LLStartUp::gStartupState = STATE_FIRST;
LLSLURL LLStartUp::sStartSLURL;
static U64 gFirstSimHandle = 0;
@@ -295,7 +296,7 @@ void show_first_run_dialog();
bool first_run_dialog_callback(const LLSD& notification, const LLSD& response);
void set_startup_status(const F32 frac, const std::string& string, const std::string& msg);
bool login_alert_status(const LLSD& notification, const LLSD& response);
void update_app(BOOL mandatory, const std::string& message);
//void update_app(BOOL mandatory, const std::string& message);
bool update_dialog_callback(const LLSD& notification, const LLSD& response);
void login_packet_failed(void**, S32 result);
void use_circuit_callback(void**, S32 result);
@@ -308,6 +309,7 @@ void release_start_screen();
void reset_login();
void apply_udp_blacklist(const std::string& csv);
bool process_login_success_response(std::string &password);
void transition_back_to_login_panel(const std::string& emsg);
void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group)
{
@@ -392,7 +394,7 @@ bool idle_startup()
static LLUUID web_login_key;
static std::string password;
static std::vector<const char*> requested_options;
static std::string redirect_uri;
static std::string redirect_uri;
static LLVector3 initial_sun_direction(1.f, 0.f, 0.f);
static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server
@@ -402,8 +404,6 @@ bool idle_startup()
static bool show_connect_box = true;
static bool samename = false;
// HACK: These are things from the main loop that usually aren't done
// until initialization is complete, but need to be done here for things
// to work.
@@ -414,7 +414,7 @@ bool idle_startup()
if (gNoRender)
{
// HACK, skip optional updates if you're running drones
gSkipOptionalUpdate = TRUE;
//gSkipOptionalUpdate = TRUE;
}
else
{
@@ -684,7 +684,7 @@ bool idle_startup()
#endif // !LL_WINDOWS
)
{
gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX(gSavedSettings.getBOOL("SHEnableFMODExProfiler"));
gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX(gSavedSettings.getBOOL("SHEnableFMODExProfiler"),gSavedSettings.getBOOL("SHEnableFMODEXVerboseDebugging"));
}
#endif
@@ -755,11 +755,11 @@ bool idle_startup()
//
// Log on to system
//
if (!LLStartUp::sSLURLCommand.empty())
/*if (!LLStartUp::sSLURLCommand.empty())
{
// this might be a secondlife:///app/login URL
gLoginHandler.parseDirectLogin(LLStartUp::sSLURLCommand);
}
}*/
if (!gLoginHandler.getFirstName().empty()
|| !gLoginHandler.getLastName().empty()
|| !gLoginHandler.getWebLoginKey().isNull() )
@@ -784,11 +784,8 @@ bool idle_startup()
pass.hex_digest(md5pass);
password = md5pass;
#ifdef USE_VIEWER_AUTH
show_connect_box = true;
#else
show_connect_box = false;
#endif
gSavedSettings.setBOOL("AutoLogin", TRUE);
}
else if (gSavedSettings.getBOOL("AutoLogin"))
@@ -798,11 +795,7 @@ bool idle_startup()
password = LLStartUp::loadPasswordFromDisk();
gSavedSettings.setBOOL("RememberPassword", TRUE);
#ifdef USE_VIEWER_AUTH
show_connect_box = true;
#else
show_connect_box = false;
#endif
}
else
{
@@ -863,6 +856,7 @@ bool idle_startup()
if (show_connect_box)
{
LL_DEBUGS("AppInit") << "show_connect_box on" << LL_ENDL;
// Load all the name information out of the login view
// NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't
// show the login view until login_show() is called below.
@@ -888,13 +882,15 @@ bool idle_startup()
if (login_history.size() > 0)
{
LLPanelLogin::setFields(*login_history.getEntries().rbegin());
display_startup();
}
else
{
LLPanelLogin::setFields(firstname, lastname, password);
display_startup();
LLPanelLogin::giveFocus();
}
display_startup();
gSavedSettings.setBOOL("FirstRunThisInstall", FALSE);
@@ -902,6 +898,7 @@ bool idle_startup()
}
else
{
LL_DEBUGS("AppInit") << "show_connect_box off, skipping to STATE_LOGIN_CLEANUP" << LL_ENDL;
// skip directly to message template verification
LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
}
@@ -1027,10 +1024,10 @@ bool idle_startup()
// Set PerAccountSettingsFile to the default value.
gSavedSettings.setString("PerAccountSettingsFile",
gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT,
LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount")
)
);
LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount")));
// Note: can't store warnings files per account because some come up before login
// Overwrite default user settings with user settings
LLAppViewer::instance()->loadSettingsFromDirectory(AIReadAccess<settings_map_type>(gSettings), "Account");
@@ -1095,10 +1092,10 @@ bool idle_startup()
if (show_connect_box)
{
std::string location;
/*std::string location;
LLPanelLogin::getLocation( location );
LLURLSimString::setString( location );
*/
// END TODO
LLPanelLogin::close();
}
@@ -1127,27 +1124,21 @@ bool idle_startup()
#endif // RLV_EXTENSION_STARTLOCATION
{
// Force login at the last location
agent_location_id = START_LOCATION_ID_LAST;
gSavedSettings.setBOOL("LoginLastLocation", FALSE);
// Clear some things that would cause us to divert to a user-specified location
LLURLSimString::setString(LLURLSimString::sLocationStringLast);
LLStartUp::sSLURLCommand.clear();
} else
LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST));
}
// [/RLVa:KB]
if (LLURLSimString::parse())
{
// a startup URL was specified
agent_location_id = START_LOCATION_ID_URL;
}
else if (gSavedSettings.getBOOL("LoginLastLocation"))
{
agent_location_id = START_LOCATION_ID_LAST; // last location
}
else
{
agent_location_id = START_LOCATION_ID_HOME; // home
}
switch (LLStartUp::getStartSLURL().getType())
{
case LLSLURL::LOCATION:
agent_location_id = START_LOCATION_ID_URL;
break;
case LLSLURL::LAST_LOCATION:
agent_location_id = START_LOCATION_ID_LAST;
break;
default:
agent_location_id = START_LOCATION_ID_HOME;
break;
}
gViewerWindow->getWindow()->setCursor(UI_CURSOR_WAIT);
@@ -1244,97 +1235,41 @@ bool idle_startup()
auth_method = "login_to_simulator";
auth_desc = LLTrans::getString("LoginInProgress");
set_startup_status(progress, auth_desc, auth_message);
LLStartUp::setStartupState( STATE_XMLRPC_LEGACY_LOGIN ); // XMLRPC
}
// OGPX : Note that this uses existing STATE_LOGIN_AUTHENTICATE in viewer,
// and also inserts two new states for LEGACY (where Legacy in this case
// was LLSD HTTP Post in OGP9, and not XML-RPC).
//
// The OGP login daisy chains together several POSTs that must complete successfully
// in order for startup state to finally get set to STATE_LOGIN_PROCESS_RESPONSE.
//
if (STATE_LOGIN_AUTHENTICATE == LLStartUp::getStartupState())
{
redirect_uri.clear();
LL_DEBUGS("AppInit") << "STATE_LOGIN_AUTHENTICATE" << LL_ENDL;
set_startup_status(progress, auth_desc, auth_message);
LLSD args;
LLSD identifier;
LLSD authenticator;
identifier["type"] = "agent";
identifier["first_name"] = firstname;
identifier["last_name"] = lastname;
authenticator["type"] = "hash";
authenticator["algorithm"] = "md5";
authenticator["secret"] = password;
args["identifier"] = identifier;
args["authenticator"] = authenticator;
//args["firstname"] = firstname;
//args["lastname"] = lastname;
//args["md5-password"] = password;
// allows you to 'suggest' which agent service you'd like to use
std::string agenturi = gSavedSettings.getString("CmdLineAgentURI");
if (!agenturi.empty())
{
args["agent_url"] = agenturi;
}
char hashed_mac_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
LLMD5 hashed_mac;
hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES );
hashed_mac.finalize();
hashed_mac.hex_digest(hashed_mac_string);
args["mac_address"] = hashed_mac_string;
args["id0"] = LLAppViewer::instance()->getSerialNumber();
args["agree_to_tos"] = gAcceptTOS;
args["read_critical"] = gAcceptCriticalMessage;
LLViewerLogin* vl = LLViewerLogin::getInstance();
std::string grid_uri = vl->getCurrentGridURI();
gAcceptTOS = FALSE;
gAcceptCriticalMessage = FALSE;
LLStartUp::setStartupState(STATE_WAIT_LEGACY_LOGIN);
return FALSE;
}
if (STATE_XMLRPC_LEGACY_LOGIN == LLStartUp::getStartupState())
{
lldebugs << "STATE_XMLRPC_LEGACY_LOGIN" << llendl;
progress += 0.02f;
display_startup();
LLSLURL start_slurl = LLStartUp::getStartSLURL();
std::stringstream start;
if (LLURLSimString::parse())
LLSLURL::SLURL_TYPE start_slurl_type = start_slurl.getType();
switch ( start_slurl_type )
{
case LLSLURL::LOCATION:
{
// a startup URL was specified
std::stringstream unescaped_start;
unescaped_start << "uri:"
<< LLURLSimString::sInstance.mSimName << "&"
<< LLURLSimString::sInstance.mX << "&"
<< LLURLSimString::sInstance.mY << "&"
<< LLURLSimString::sInstance.mZ;
<< start_slurl.getRegion() << "&"
<< start_slurl.getPosition().mV[VX] << "&"
<< start_slurl.getPosition().mV[VY] << "&"
<< start_slurl.getPosition().mV[VZ];
start << xml_escape_string(unescaped_start.str());
}
else if (gSavedSettings.getBOOL("LoginLastLocation"))
{
start << "last";
}
else
{
}
break;
case LLSLURL::HOME_LOCATION:
start << "home";
break;
case LLSLURL::LAST_LOCATION:
start << "last";
break;
default:
break;
}
char hashed_mac_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
@@ -1343,7 +1278,6 @@ bool idle_startup()
hashed_mac.finalize();
hashed_mac.hex_digest(hashed_mac_string);
LLViewerLogin* vl = LLViewerLogin::getInstance();
std::string grid_uri = vl->getCurrentGridURI();
if(!redirect_uri.empty())
@@ -1364,7 +1298,8 @@ bool idle_startup()
lastname,
password, // web_login_key,
start.str(),
gSkipOptionalUpdate,
//gSkipOptionalUpdate,
true,
gAcceptTOS,
gAcceptCriticalMessage,
gLastExecEvent,
@@ -1440,7 +1375,7 @@ bool idle_startup()
LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL;
std::ostringstream emsg;
bool quit = false;
bool update = false;
//bool update = false;
bool successful_login = false;
LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse();
// reset globals
@@ -1460,6 +1395,11 @@ bool idle_startup()
reason_response = response["reason"].asString();
message_response = response["message"].asString();
message_id = response["message_id"].asString();
{
std::stringstream dump_str;
dump_str << response;
llinfos << dump_str.str() << llendl;
}
if(login_response == "true")
{
@@ -1487,6 +1427,7 @@ bool idle_startup()
}
else
{
emsg << LLTrans::getString("LoginFailed") + "\n";
if (!message_response.empty())
@@ -1509,6 +1450,7 @@ bool idle_startup()
if (show_connect_box)
{
LL_DEBUGS("AppInit") << "Need tos agreement" << LL_ENDL;
LLStartUp::setStartupState( STATE_UPDATE_CHECK );
LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS,
message_response);
@@ -1544,7 +1486,7 @@ bool idle_startup()
// Clear the password
password = "";
}
if(reason_response == "update")
/*if(reason_response == "update")
{
auth_message = message_response;
update = true;
@@ -1560,7 +1502,7 @@ bool idle_startup()
gSkipOptionalUpdate = TRUE;
return false;
}
}
}*/
}
break;
default:
@@ -1587,14 +1529,6 @@ bool idle_startup()
break;
}
if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
{
gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
update_app(TRUE, auth_message);
LLStartUp::setStartupState( STATE_UPDATE_CHECK );
return false;
}
// Version update and we're not showing the dialog
if(quit)
{
@@ -1634,8 +1568,7 @@ bool idle_startup()
LLSD args;
args["ERROR_MESSAGE"] = emsg.str();
LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done);
reset_login();
gSavedSettings.setBOOL("AutoLogin", FALSE);
transition_back_to_login_panel(emsg.str());
show_connect_box = true;
}
}
@@ -1650,10 +1583,11 @@ bool idle_startup()
// Bounce back to the login screen.
LLSD args;
args["ERROR_MESSAGE"] = emsg.str();
LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL;
LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done);
reset_login();
gSavedSettings.setBOOL("AutoLogin", FALSE);
transition_back_to_login_panel(emsg.str());
show_connect_box = true;
return FALSE;
}
return FALSE;
}
@@ -2522,38 +2456,24 @@ bool idle_startup()
// JC - 7/20/2002
gViewerWindow->sendShapeToSim();
// The reason we show the alert is because we want to
// reduce confusion for when you log in and your provided
// location is not your expected location. So, if this is
// your first login, then you do not have an expectation,
// thus, do not show this alert.
if (!gAgent.isFirstLogin())
{
bool url_ok = LLURLSimString::sInstance.parse();
if (!((gAgentStartLocation == "url" && url_ok) ||
(!url_ok && ((gAgentStartLocation == "last" && gSavedSettings.getBOOL("LoginLastLocation")) ||
(gAgentStartLocation == "home" && !gSavedSettings.getBOOL("LoginLastLocation"))))))
{
// The reason we show the alert is because we want to
// reduce confusion for when you log in and your provided
// location is not your expected location. So, if this is
// your first login, then you do not have an expectation,
// thus, do not show this alert.
LLSD args;
if (url_ok)
{
args["TYPE"] = "desired";
args["HELP"] = "";
}
else if (gSavedSettings.getBOOL("LoginLastLocation"))
{
args["TYPE"] = "last";
args["HELP"] = "";
}
else
{
args["TYPE"] = "home";
args["HELP"] = "You may want to set a new home location.";
}
LLNotificationsUtil::add("AvatarMoved", args);
}
else
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")))
{
// Start location is OK
// Disabled code to restore camera location and focus if logging in to default location
static bool samename = false;
if (samename)
{
// restore old camera pos
@@ -2568,6 +2488,29 @@ bool idle_startup()
gAgentCamera.stopCameraAnimation();
}
}
else
{
std::string msg;
switch(start_slurl.getType())
{
case LLSLURL::LOCATION:
{
msg = "AvatarMovedDesired";
break;
}
case LLSLURL::HOME_LOCATION:
{
msg = "AvatarMovedHome";
break;
}
default:
{
msg = "AvatarMovedLast";
}
}
LLNotificationsUtil::add(msg);
}
}
display_startup();
@@ -2738,7 +2681,7 @@ bool idle_startup()
}
// If we've got a startup URL, dispatch it
LLStartUp::dispatchURL();
//LLStartUp::dispatchURL();
// Retrieve information about the land data
// (just accessing this the first time will fetch it,
@@ -2958,7 +2901,7 @@ void show_first_run_dialog()
bool first_run_dialog_callback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == option)
{
LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL;
@@ -3008,7 +2951,7 @@ void set_startup_status(const F32 frac, const std::string& string, const std::st
bool login_alert_status(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
// Buttons
switch( option )
{
@@ -3022,7 +2965,7 @@ bool login_alert_status(const LLSD& notification, const LLSD& response)
}
case 2: // Teleport
// Restart the login process, starting at our home locaton
LLURLSimString::setString(LLURLSimString::sLocationStringHome);
LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME));
LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
break;
default:
@@ -3033,201 +2976,7 @@ bool login_alert_status(const LLSD& notification, const LLSD& response)
return false;
}
void update_app(BOOL mandatory, const std::string& auth_msg)
{
// store off config state, as we might quit soon
gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
std::ostringstream message;
// *TODO:translate
std::string msg;
if (!auth_msg.empty())
{
msg = "(" + auth_msg + ") \n";
}
LLSD args;
args["MESSAGE"] = msg;
LLSD payload;
payload["mandatory"] = mandatory;
/*
We're constructing one of the following 6 strings here:
"DownloadWindowsMandatory"
"DownloadWindowsReleaseForDownload"
"DownloadWindows"
"DownloadMacMandatory"
"DownloadMacReleaseForDownload"
"DownloadMac"
I've called them out explicitly in this comment so that they can be grepped for.
Also, we assume that if we're not Windows we're Mac. If we ever intend to support
Linux with autoupdate, this should be an explicit #elif LL_DARWIN, but
we'd rather deliver the wrong message than no message, so until Linux is supported
we'll leave it alone.
*/
std::string notification_name = "Download";
#if LL_WINDOWS
notification_name += "Windows";
#else
notification_name += "Mac";
#endif
if (mandatory)
{
notification_name += "Mandatory";
}
else
{
#if LL_RELEASE_FOR_DOWNLOAD
notification_name += "ReleaseForDownload";
#endif
}
LLNotifications::instance().add(notification_name, args, payload, update_dialog_callback);
}
bool update_dialog_callback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
std::string update_exe_path;
bool mandatory = notification["payload"]["mandatory"].asBoolean();
#if !LL_RELEASE_FOR_DOWNLOAD
if (option == 2)
{
LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
return false;
}
#endif
if (option == 1)
{
// ...user doesn't want to do it
if (mandatory)
{
LLAppViewer::instance()->forceQuit();
// Bump them back to the login screen.
//reset_login();
}
else
{
LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
}
return false;
}
LLSD query_map = LLSD::emptyMap();
// *TODO place os string in a global constant
#if LL_WINDOWS
query_map["os"] = "win";
#elif LL_DARWIN
query_map["os"] = "mac";
#elif LL_LINUX
query_map["os"] = "lnx";
#elif LL_SOLARIS
query_map["os"] = "sol";
#endif
// *TODO change userserver to be grid on both viewer and sim, since
// userserver no longer exists.
query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel();
// <edit>
query_map["channel"] = gVersionChannel;
// *TODO constantize this guy
// *NOTE: This URL is also used in win_setup/lldownloader.cpp
LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
if(LLAppViewer::sUpdaterInfo)
{
delete LLAppViewer::sUpdaterInfo ;
}
LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ;
#if LL_WINDOWS
LLAppViewer::sUpdaterInfo->mUpdateExePath = gDirUtilp->getTempFilename();
if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty())
{
delete LLAppViewer::sUpdaterInfo ;
LLAppViewer::sUpdaterInfo = NULL ;
// We're hosed, bail
LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL;
LLAppViewer::instance()->forceQuit();
return false;
}
LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe";
std::string updater_source = gDirUtilp->getAppRODataDir();
updater_source += gDirUtilp->getDirDelimiter();
updater_source += "updater.exe";
LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source
<< " dest: " << LLAppViewer::sUpdaterInfo->mUpdateExePath
<< LL_ENDL;
if (!CopyFileA(updater_source.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), FALSE))
{
delete LLAppViewer::sUpdaterInfo ;
LLAppViewer::sUpdaterInfo = NULL ;
LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL;
LLAppViewer::instance()->forceQuit();
return false;
}
// if a sim name was passed in via command line parameter (typically through a SLURL)
if ( LLURLSimString::sInstance.mSimString.length() )
{
// record the location to start at next time
gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString );
};
LLAppViewer::sUpdaterInfo->mParams << "-url \"" << update_url.asString() << "\"";
LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << " " << LLAppViewer::sUpdaterInfo->mParams.str() << LL_ENDL;
//Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird.
LLAppViewer::instance()->removeMarkerFile(); // In case updater fails
#elif LL_DARWIN
// if a sim name was passed in via command line parameter (typically through a SLURL)
if ( LLURLSimString::sInstance.mSimString.length() )
{
// record the location to start at next time
gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString );
};
LLAppViewer::sUpdaterInfo->mUpdateExePath = "'";
LLAppViewer::sUpdaterInfo->mUpdateExePath += gDirUtilp->getAppRODataDir();
LLAppViewer::sUpdaterInfo->mUpdateExePath += "/mac-updater.app/Contents/MacOS/mac-updater' -url \"";
LLAppViewer::sUpdaterInfo->mUpdateExePath += update_url.asString();
LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -name \"";
LLAppViewer::sUpdaterInfo->mUpdateExePath += LLAppViewer::instance()->getSecondLifeTitle();
LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -bundleid \"";
LLAppViewer::sUpdaterInfo->mUpdateExePath += gVersionBundleID;
LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &";
LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL;
// Run the auto-updater.
system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
#elif LL_LINUX || LL_SOLARIS
OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
"Please download the latest version from www.secondlife.com.",
LLStringUtil::null, OSMB_OK);
#endif
LLAppViewer::instance()->forceQuit();
return false;
}
void use_circuit_callback(void**, S32 result)
{
@@ -3651,8 +3400,6 @@ std::string LLStartUp::startupStateToString(EStartupState state)
RTNENUM( STATE_LOGIN_VOICE_LICENSE );
RTNENUM( STATE_UPDATE_CHECK );
RTNENUM( STATE_LOGIN_AUTH_INIT );
RTNENUM( STATE_LOGIN_AUTHENTICATE );
RTNENUM( STATE_WAIT_LEGACY_LOGIN );
RTNENUM( STATE_XMLRPC_LEGACY_LOGIN );
RTNENUM( STATE_LOGIN_NO_DATA_YET );
RTNENUM( STATE_LOGIN_DOWNLOADING );
@@ -3726,8 +3473,6 @@ void reset_login()
//---------------------------------------------------------------------------
std::string LLStartUp::sSLURLCommand;
bool LLStartUp::canGoFullscreen()
{
return gStartupState >= STATE_WORLD_INIT;
@@ -3784,67 +3529,64 @@ void LLStartUp::cleanupNameCache()
delete gCacheName;
gCacheName = NULL;
}
bool LLStartUp::dispatchURL()
{
// ok, if we've gotten this far and have a startup URL
if (!sSLURLCommand.empty())
if (!getStartSLURL().isValid())
{
LLMediaCtrl* web = NULL;
const bool trusted_browser = false;
LLURLDispatcher::dispatch(sSLURLCommand, web, trusted_browser);
return false;
}
else if (LLURLSimString::parse())
if(getStartSLURL().getType() != LLSLURL::APP)
{
// If we started with a location, but we're already
// at that location, don't pop dialogs open.
LLVector3 pos = gAgent.getPositionAgent();
F32 dx = pos.mV[VX] - (F32)LLURLSimString::sInstance.mX;
F32 dy = pos.mV[VY] - (F32)LLURLSimString::sInstance.mY;
LLVector3 slurlpos = getStartSLURL().getPosition();
F32 dx = pos.mV[VX] - slurlpos.mV[VX];
F32 dy = pos.mV[VY] - slurlpos.mV[VY];
const F32 SLOP = 2.f; // meters
if( LLURLSimString::sInstance.mSimName != gAgent.getRegion()->getName()
if( getStartSLURL().getRegion() != gAgent.getRegion()->getName()
|| (dx*dx > SLOP*SLOP)
|| (dy*dy > SLOP*SLOP) )
{
std::string url = LLURLSimString::getURL();
LLMediaCtrl* web = NULL;
const bool trusted_browser = false;
LLURLDispatcher::dispatch(url, web, trusted_browser);
LLURLDispatcher::dispatch(getStartSLURL().getSLURLString(), "clicked",
NULL, false);
}
return true;
}
return false;
}
bool login_alert_done(const LLSD& notification, const LLSD& response)
void LLStartUp::setStartSLURL(const LLSLURL& slurl)
{
LLPanelLogin::giveFocus();
return false;
LL_DEBUGS("AppInit")<<slurl.asString()<<LL_ENDL;
if ( slurl.isSpatial() )
{
std::string new_start = slurl.getSLURLString();
LL_DEBUGS("AppInit")<<new_start<<LL_ENDL;
sStartSLURL = slurl;
LLPanelLogin::onUpdateStartSLURL(slurl); // updates grid if needed
// remember that this is where we wanted to log in...if the login fails,
// the next attempt will default to the same place.
gSavedSettings.setString("NextLoginLocation", new_start);
// following a successful login, this is cleared
// and the default reverts to LoginLocation
}
else
{
LL_WARNS("AppInit")<<"Invalid start SLURL (ignored): "<<slurl.asString()<<LL_ENDL;
}
}
void apply_udp_blacklist(const std::string& csv)
// static
LLSLURL& LLStartUp::getStartSLURL()
{
std::string::size_type start = 0;
std::string::size_type comma = 0;
do
{
comma = csv.find(",", start);
if (comma == std::string::npos)
{
comma = csv.length();
}
std::string item(csv, start, comma-start);
lldebugs << "udp_blacklist " << item << llendl;
gMessageSystem->banUdpMessage(item);
start = comma + 1;
}
while(comma < csv.length());
return sStartSLURL;
}
/*
@@ -4099,6 +3841,36 @@ bool LLStartUp::startLLProxy()
return proxy_ok;
}
bool login_alert_done(const LLSD& notification, const LLSD& response)
{
LLPanelLogin::giveFocus();
return false;
}
void apply_udp_blacklist(const std::string& csv)
{
std::string::size_type start = 0;
std::string::size_type comma = 0;
do
{
comma = csv.find(",", start);
if (comma == std::string::npos)
{
comma = csv.length();
}
std::string item(csv, start, comma-start);
lldebugs << "udp_blacklist " << item << llendl;
gMessageSystem->banUdpMessage(item);
start = comma + 1;
}
while(comma < csv.length());
}
bool process_login_success_response(std::string& password)
{
LLSD response = LLUserAuth::getInstance()->getResponse();
@@ -4114,9 +3886,17 @@ bool process_login_success_response(std::string& password)
if(!text.empty()) gAgentID.set(text);
gDebugInfo["AgentID"] = text;
// Agent id needed for parcel info request in LLUrlEntryParcel
// to resolve parcel name.
LLUrlEntryParcel::setAgentID(gAgentID);
text = response["session_id"].asString();
if(!text.empty()) gAgentSessionID.set(text);
gDebugInfo["SessionID"] = text;
// Session id needed for parcel info request in LLUrlEntryParcel
// to resolve parcel name.
LLUrlEntryParcel::setSessionID(gAgentSessionID);
text = response["secure_session_id"].asString();
if(!text.empty()) gAgent.mSecureSessionID.set(text);
@@ -4461,3 +4241,9 @@ bool process_login_success_response(std::string& password)
return success;
}
void transition_back_to_login_panel(const std::string& emsg)
{
// Bounce back to the login screen.
reset_login(); // calls LLStartUp::setStartupState( STATE_LOGIN_SHOW );
gSavedSettings.setBOOL("AutoLogin", FALSE);
}