aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-06-13 13:01:57 -0700
committerJacek Antonelli2010-06-19 02:43:38 -0500
commitcad41f1ae08927737eca4cd9df25381d78e82304 (patch)
tree31c687f74defb0ebdcdcb5f97483312a8e612631 /linden/indra
parentwip forcing region disconnects to log you out (diff)
downloadmeta-impy-cad41f1ae08927737eca4cd9df25381d78e82304.zip
meta-impy-cad41f1ae08927737eca4cd9df25381d78e82304.tar.gz
meta-impy-cad41f1ae08927737eca4cd9df25381d78e82304.tar.bz2
meta-impy-cad41f1ae08927737eca4cd9df25381d78e82304.tar.xz
Fixed #338: addRegion/removeRegion can trigger a viewer quit
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/llstartup.cpp13
-rw-r--r--linden/indra/newview/llviewermessage.cpp20
-rw-r--r--linden/indra/newview/llworld.cpp18
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/notifications.xml7
4 files changed, 41 insertions, 17 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 8882773..30e299a 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -1791,8 +1791,13 @@ bool idle_startup()
1791 regionp->setSeedCapability(first_sim_seed_cap); 1791 regionp->setSeedCapability(first_sim_seed_cap);
1792 LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL; 1792 LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL;
1793 1793
1794 // Set agent's initial region to be the one we just created. 1794 // Set agent's initial region to be the one we just created
1795 gAgent.setRegion(regionp); 1795 // Only if we don't already have one set. We want to catch this here
1796 // because setRegion calls removeRegion, which kills the viewer -- MC
1797 if (!gAgent.getRegion() && gAgent.getRegion() != regionp)
1798 {
1799 gAgent.setRegion(regionp);
1800 }
1796 1801
1797 // Set agent's initial position, which will be read by LLVOAvatar when the avatar 1802 // Set agent's initial position, which will be read by LLVOAvatar when the avatar
1798 // object is created. I think this must be done after setting the region. JC 1803 // object is created. I think this must be done after setting the region. JC
@@ -2095,7 +2100,7 @@ bool idle_startup()
2095 if (STATE_AGENT_WAIT == LLStartUp::getStartupState()) 2100 if (STATE_AGENT_WAIT == LLStartUp::getStartupState())
2096 { 2101 {
2097 LL_DEBUGS("AppInitStartupState") << "STATE_AGENT_WAIT" << LL_ENDL; 2102 LL_DEBUGS("AppInitStartupState") << "STATE_AGENT_WAIT" << LL_ENDL;
2098 if (connecting_region_timer.getElapsedTimeF32() > 15.0f) 2103 if (connecting_region_timer.getElapsedTimeF32() > 10.0f)
2099 { 2104 {
2100 // Bounce back to the login screen -- MC 2105 // Bounce back to the login screen -- MC
2101 LL_WARNS("AppInit") << "Bad login - can't connect to this region for some reason" << LL_ENDL; 2106 LL_WARNS("AppInit") << "Bad login - can't connect to this region for some reason" << LL_ENDL;
@@ -3596,6 +3601,7 @@ std::string LLStartUp::startupStateToString(EStartupState state)
3596#define RTNENUM(E) case E: return #E 3601#define RTNENUM(E) case E: return #E
3597 switch(state){ 3602 switch(state){
3598 RTNENUM( STATE_FIRST ); 3603 RTNENUM( STATE_FIRST );
3604 RTNENUM( STATE_BROWSER_INIT );
3599 RTNENUM( STATE_LOGIN_SHOW ); 3605 RTNENUM( STATE_LOGIN_SHOW );
3600 RTNENUM( STATE_LOGIN_WAIT ); 3606 RTNENUM( STATE_LOGIN_WAIT );
3601 RTNENUM( STATE_LOGIN_CLEANUP ); 3607 RTNENUM( STATE_LOGIN_CLEANUP );
@@ -3606,6 +3612,7 @@ std::string LLStartUp::startupStateToString(EStartupState state)
3606 RTNENUM( STATE_LOGIN_DOWNLOADING ); 3612 RTNENUM( STATE_LOGIN_DOWNLOADING );
3607 RTNENUM( STATE_LOGIN_PROCESS_RESPONSE ); 3613 RTNENUM( STATE_LOGIN_PROCESS_RESPONSE );
3608 RTNENUM( STATE_WORLD_INIT ); 3614 RTNENUM( STATE_WORLD_INIT );
3615 RTNENUM( STATE_MULTIMEDIA_INIT );
3609 RTNENUM( STATE_SEED_GRANTED_WAIT ); 3616 RTNENUM( STATE_SEED_GRANTED_WAIT );
3610 RTNENUM( STATE_SEED_CAP_GRANTED ); 3617 RTNENUM( STATE_SEED_CAP_GRANTED );
3611 RTNENUM( STATE_WORLD_WAIT ); 3618 RTNENUM( STATE_WORLD_WAIT );
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 7832b99..58b6df4 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -3333,14 +3333,18 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3333 3333
3334 // set our upstream host the new simulator and shuffle things as 3334 // set our upstream host the new simulator and shuffle things as
3335 // appropriate. 3335 // appropriate.
3336 LLVector3 shift_vector = regionp->getPosRegionFromGlobal( 3336 // Sometimes OpenSim will get here but still fail on a teleport -- MC
3337 gAgent.getRegion()->getOriginGlobal()); 3337 if (regionp != gAgent.getRegion())
3338 gAgent.setRegion(regionp); 3338 {
3339 gObjectList.shiftObjects(shift_vector); 3339 LLVector3 shift_vector = regionp->getPosRegionFromGlobal(
3340 gAssetStorage->setUpstream(msg->getSender()); 3340 gAgent.getRegion()->getOriginGlobal());
3341 gCacheName->setUpstream(msg->getSender()); 3341 gAgent.setRegion(regionp);
3342 gViewerThrottle.sendToSim(); 3342 gObjectList.shiftObjects(shift_vector);
3343 gViewerWindow->sendShapeToSim(); 3343 gAssetStorage->setUpstream(msg->getSender());
3344 gCacheName->setUpstream(msg->getSender());
3345 gViewerThrottle.sendToSim();
3346 gViewerWindow->sendShapeToSim();
3347 }
3344 3348
3345 bool is_teleport = gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING; 3349 bool is_teleport = gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING;
3346 3350
diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp
index 7cceb30..50d4250 100644
--- a/linden/indra/newview/llworld.cpp
+++ b/linden/indra/newview/llworld.cpp
@@ -267,11 +267,17 @@ void LLWorld::removeRegion(const LLHost &host)
267 267
268 llwarns << "Disabling region " << regionp->getName() << " that agent is in!" << llendl; 268 llwarns << "Disabling region " << regionp->getName() << " that agent is in!" << llendl;
269 269
270 // Don't ever forceQuit on the user if we can avoid it -- MC 270 // Don't ever forceQuit on the user during startup if we can avoid it -- MC
271 //LLAppViewer::instance()->forceDisconnect("You have been disconnected from the region you were in."); 271 //LLAppViewer::instance()->forceDisconnect("You have been disconnected from the region you were in.");
272 LLSD args; 272 // We stop a login, even if it's a successful one, as the expected behavior is to not receive
273 args["ERROR_MESSAGE"] = "You have been disconnected from the region you were in."; 273 // any more messages from a sim when we receive the DisableSimulator message, despite the viewer
274 LLNotifications::instance().add("ErrorMessage", args, LLSD(), connecting_alert_done); 274 // continuing to connect anyway -- MC
275 if (LLStartUp::getStartupState() < STATE_STARTED)
276 {
277 //LLStartUp::setLoginFailed(true);
278 LLStartUp::setStartupState(STATE_SEED_GRANTED_WAIT);
279 }
280 LLNotifications::instance().add("DisconnectedFromRegion", LLSD(), LLSD(), connecting_alert_done);
275 281
276 return; 282 return;
277 } 283 }
@@ -1256,13 +1262,13 @@ bool connecting_alert_done(const LLSD& notification, const LLSD& response)
1256{ 1262{
1257 if (LLStartUp::getStartupState() < STATE_STARTED) 1263 if (LLStartUp::getStartupState() < STATE_STARTED)
1258 { 1264 {
1259 //LLStartUp::setLoginFailed(true);
1260 LLStartUp::resetLogin(); 1265 LLStartUp::resetLogin();
1261 LLPanelLogin::giveFocus(); 1266 LLPanelLogin::giveFocus();
1262 } 1267 }
1263 else 1268 else
1264 { 1269 {
1265 LLAppViewer::instance()->requestLogout(false); 1270 // TODO: make this translatable
1271 LLAppViewer::instance()->forceDisconnect("You have been disconnected from the region you were in. Unable to continue.");
1266 } 1272 }
1267 return false; 1273 return false;
1268} 1274}
diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
index e0a0f60..f7f8e7e 100644
--- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
@@ -6848,6 +6848,13 @@ Are you sure you want to teleport home?
6848</notification> 6848</notification>
6849 6849
6850<notification 6850<notification
6851 icon="alertmodal.tga"
6852 name="DisconnectedFromRegion"
6853 type="alertmodal">
6854You have been disconnected from the region you were in. Unable to continue.
6855</notification>
6856
6857<notification
6851 icon="alert.tga" 6858 icon="alert.tga"
6852 name="IMLogNotFound" 6859 name="IMLogNotFound"
6853 type="alert"> 6860 type="alert">