summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-05-01 21:39:25 +0000
committerDon Kjer <don@lindenlab.com>2007-05-01 21:39:25 +0000
commit4ecb9cb63e4993b3b4bc65d73ed255139b5c3f75 (patch)
tree48d9bb9a1ae468ecdbd53cf21a598d66ee8eced3 /indra/newview/llstartup.cpp
parentf5e9ce7e47694e349a4eb28b052016b11e1bdf81 (diff)
svn merge -r 59163:61099 svn+ssh://svn/svn/linden/branches/release-candidate into release
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r--indra/newview/llstartup.cpp105
1 files changed, 43 insertions, 62 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index baf6abda11..4bbdca521c 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -35,6 +35,7 @@
#include "llloginflags.h"
#include "llmd5.h"
#include "llmemorystream.h"
+#include "llmessageconfig.h"
#include "llregionhandle.h"
#include "llsd.h"
#include "llsdserialize.h"
@@ -67,7 +68,6 @@
#include "llfloatergesture.h"
#include "llfloaterland.h"
#include "llfloatertopobjects.h"
-#include "llfloaterrate.h"
#include "llfloatertos.h"
#include "llfloaterworldmap.h"
#include "llframestats.h"
@@ -108,6 +108,7 @@
#include "llviewerassetstorage.h"
#include "llviewercamera.h"
#include "llviewerdisplay.h"
+#include "llviewergenericmessage.h"
#include "llviewergesture.h"
#include "llviewerimagelist.h"
#include "llviewermenu.h"
@@ -398,6 +399,7 @@ BOOL idle_startup()
port = gSavedSettings.getU32("ConnectionPort");
}
+ LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
if(!start_messaging_system(
message_template_path,
port,
@@ -941,16 +943,7 @@ BOOL idle_startup()
}
llinfos << "Verifying message template..." << llendl;
-
- // register with the message system so it knows we're
- // expecting this message
- LLMessageSystem* msg = gMessageSystem;
- msg->setHandlerFuncFast(_PREHASH_TemplateChecksumReply, null_message_callback, NULL);
- msg->newMessageFast(_PREHASH_SecuredTemplateChecksumRequest);
- msg->nextBlockFast(_PREHASH_TokenBlock);
- lldebugs << "random token: " << gTemplateToken << llendl;
- msg->addUUIDFast(_PREHASH_Token, gTemplateToken);
- msg->sendReliable(mt_host);
+ LLMessageSystem::sendSecureMessageTemplateChecksum(mt_host);
timeout.reset();
gStartupState++;
@@ -959,40 +952,16 @@ BOOL idle_startup()
if (STATE_MESSAGE_TEMPLATE_WAIT == gStartupState)
{
- U32 remote_template_checksum = 0;
-
- U8 major_version = 0;
- U8 minor_version = 0;
- U8 patch_version = 0;
- U8 server_version = 0;
- U32 flags = 0x0;
-
LLMessageSystem* msg = gMessageSystem;
- while (msg->checkMessages(gFrameCount))
+ while (msg->checkAllMessages(gFrameCount, gServicePump))
{
- if (msg->isMessageFast(_PREHASH_TemplateChecksumReply))
+ if (msg->isTemplateConfirmed())
{
- LLUUID token;
- msg->getUUID("TokenBlock", "Token", token);
- if(token != gTemplateToken)
- {
- llwarns << "Incorrect token in template checksum reply: "
- << token << llendl;
- return do_normal_idle;
- }
- msg->getU32("DataBlock", "Checksum", remote_template_checksum);
- msg->getU8 ("DataBlock", "MajorVersion", major_version);
- msg->getU8 ("DataBlock", "MinorVersion", minor_version);
- msg->getU8 ("DataBlock", "PatchVersion", patch_version);
- msg->getU8 ("DataBlock", "ServerVersion", server_version);
- msg->getU32("DataBlock", "Flags", flags);
-
BOOL update_available = FALSE;
BOOL mandatory = FALSE;
- if (remote_template_checksum != msg->mMessageFileChecksum)
+ if (!LLMessageSystem::doesTemplateMatch())
{
- llinfos << "Message template out of sync" << llendl;
// Mandatory update -- message template checksum doesn't match
update_available = TRUE;
mandatory = TRUE;
@@ -1012,6 +981,7 @@ BOOL idle_startup()
quit = TRUE;
}
}
+
// Bail out and clean up circuit
if (quit)
{
@@ -1022,7 +992,6 @@ BOOL idle_startup()
}
// If we get here, we've got a compatible message template
-
if (!mandatory)
{
llinfos << "Message template is current!" << llendl;
@@ -1189,7 +1158,7 @@ BOOL idle_startup()
}
// Process messages to keep from dropping circuit.
LLMessageSystem* msg = gMessageSystem;
- while (msg->checkMessages(gFrameCount))
+ while (msg->checkAllMessages(gFrameCount, gServicePump))
{
}
msg->processAcks();
@@ -1214,7 +1183,7 @@ BOOL idle_startup()
}
// Process messages to keep from dropping circuit.
LLMessageSystem* msg = gMessageSystem;
- while (msg->checkMessages(gFrameCount))
+ while (msg->checkAllMessages(gFrameCount, gServicePump))
{
}
msg->processAcks();
@@ -1920,7 +1889,7 @@ BOOL idle_startup()
++gStartupState;
}
LLMessageSystem* msg = gMessageSystem;
- while (msg->checkMessages(gFrameCount))
+ while (msg->checkAllMessages(gFrameCount, gServicePump))
{
}
msg->processAcks();
@@ -1939,8 +1908,7 @@ BOOL idle_startup()
LLMessageSystem* msg = gMessageSystem;
msg->setHandlerFuncFast(
_PREHASH_AgentMovementComplete,
- process_agent_movement_complete,
- NULL);
+ process_agent_movement_complete);
LLViewerRegion* regionp = gAgent.getRegion();
if(!gRunLocal && regionp)
{
@@ -1977,9 +1945,9 @@ BOOL idle_startup()
if (STATE_AGENT_WAIT == gStartupState)
{
LLMessageSystem* msg = gMessageSystem;
- while (msg->checkMessages(gFrameCount))
+ while (msg->checkAllMessages(gFrameCount, gServicePump))
{
- if (msg->isMessageFast(_PREHASH_AgentMovementComplete))
+ if (gAgentMovementCompleted)
{
gStartupState++;
// Sometimes we have more than one message in the
@@ -2887,7 +2855,21 @@ void update_dialog_callback(S32 option, void *userdata)
}
return;
}
-
+
+ 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";
+#endif
+ query_map["userserver"] = gUserServerName;
+ query_map["channel"] = gChannelName;
+ // *TODO constantize this guy
+ LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
+
#if LL_WINDOWS
char ip[MAX_STRING]; /* Flawfinder: ignore */
@@ -2919,9 +2901,6 @@ void update_dialog_callback(S32 option, void *userdata)
}
u32_to_ip_string(gUserServer.getAddress(), ip);
- std::ostringstream params;
- params << "-userserver " << gUserServerName;
-
// if a sim name was passed in via command line parameter (typically through a SLURL)
if ( LLURLSimString::sInstance.mSimString.length() )
{
@@ -2929,6 +2908,8 @@ void update_dialog_callback(S32 option, void *userdata)
gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString );
};
+ std::ostringstream params;
+ params << "-url \"" << update_url.asString() << "\"";
if (gHideLinks)
{
// Figure out the program name.
@@ -2949,7 +2930,8 @@ void update_dialog_callback(S32 option, void *userdata)
program_name = "SecondLife";
}
- params << " -silent -name \"" << gSecondLife << "\" -program \"" << program_name << "\"";
+ params << " -silent -name \"" << gSecondLife << "\"";
+ params << " -program \"" << program_name << "\"";
}
llinfos << "Calling updater: " << update_exe_path << " " << params.str() << llendl;
@@ -2967,12 +2949,12 @@ void update_dialog_callback(S32 option, void *userdata)
// record the location to start at next time
gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString );
};
-
+
update_exe_path = "'";
update_exe_path += gDirUtilp->getAppRODataDir();
- update_exe_path += "/AutoUpdater.app/Contents/MacOS/AutoUpdater' -userserver ";
- update_exe_path += gUserServerName;
- update_exe_path += " -name \"";
+ update_exe_path += "/AutoUpdater.app/Contents/MacOS/AutoUpdater' -url \"";
+ update_exe_path += update_url.asString();
+ update_exe_path += "\" -name \"";
update_exe_path += gSecondLife;
update_exe_path += "\" &";
@@ -3100,8 +3082,9 @@ void register_viewer_callbacks(LLMessageSystem* msg)
LLPanelAvatar::processAvatarInterestsReply);
msg->setHandlerFunc("AvatarGroupsReply",
LLPanelAvatar::processAvatarGroupsReply);
- msg->setHandlerFuncFast(_PREHASH_AvatarStatisticsReply,
- LLPanelAvatar::processAvatarStatisticsReply);
+ // ratings deprecated
+ //msg->setHandlerFuncFast(_PREHASH_AvatarStatisticsReply,
+ // LLPanelAvatar::processAvatarStatisticsReply);
msg->setHandlerFunc("AvatarNotesReply",
LLPanelAvatar::processAvatarNotesReply);
msg->setHandlerFunc("AvatarPicksReply",
@@ -3120,8 +3103,9 @@ void register_viewer_callbacks(LLMessageSystem* msg)
msg->setHandlerFuncFast(_PREHASH_GroupProfileReply,
LLGroupMgr::processGroupPropertiesReply);
- msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply,
- LLFloaterRate::processReputationIndividualReply);
+ // ratings deprecated
+ // msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply,
+ // LLFloaterRate::processReputationIndividualReply);
msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate,
LLAgent::processAgentInitialWearablesUpdate );
@@ -3129,9 +3113,6 @@ void register_viewer_callbacks(LLMessageSystem* msg)
msg->setHandlerFunc("ScriptControlChange",
LLAgent::processScriptControlChange );
- msg->setHandlerFuncFast(_PREHASH_GestureUpdate,
- LLViewerGestureList::processGestureUpdate);
-
msg->setHandlerFuncFast(_PREHASH_ViewerEffect, LLHUDManager::processViewerEffect);
msg->setHandlerFuncFast(_PREHASH_GrantGodlikePowers, process_grant_godlike_powers);