summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-08-31 18:33:47 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-08-31 18:33:47 +0300
commitc2f0d67ab24993d160309c20d2446d58e5d86cb8 (patch)
treeb57acc051699e838ca3d95705e9fc42107289f86 /indra/newview
parent88e04ab2ab2a13cd660f33e64c52ad3375144d2a (diff)
parent28665ddb32af1f075b3a8be4a99db05ce6194f02 (diff)
Merged in MAINT-6291
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llagent.cpp1
-rw-r--r--indra/newview/llagent.h1
-rw-r--r--indra/newview/llviewermessage.cpp30
3 files changed, 28 insertions, 4 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 901294d6b4..9b8cc62aa8 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -4150,6 +4150,7 @@ void LLAgent::setTeleportState(ETeleportState state)
" for previously failed teleport. Ignore!" << LL_ENDL;
return;
}
+ LL_DEBUGS("Teleport") << "Setting teleport state to " << state << " Previous state: " << mTeleportState << LL_ENDL;
mTeleportState = state;
if (mTeleportState > TELEPORT_NONE && gSavedSettings.getBOOL("FreezeTime"))
{
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 4bb4d317e8..b1b39b637e 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -629,6 +629,7 @@ public:
void teleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation
void teleportCancel(); // May or may not be allowed by server
void restoreCanceledTeleportRequest();
+ bool canRestoreCanceledTeleport() { return mTeleportCanceled != NULL; }
bool getTeleportKeepsLookAt() { return mbTeleportKeepsLookAt; } // Whether look-at reset after teleport
protected:
bool teleportCore(bool is_local = false); // Stuff for all teleports; returns true if the teleport can proceed
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 8395322233..0c5bd9ad1d 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2709,6 +2709,12 @@ void process_teleport_start(LLMessageSystem *msg, void**)
U32 teleport_flags = 0x0;
msg->getU32("Info", "TeleportFlags", teleport_flags);
+ if (gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING)
+ {
+ // Race condition?
+ LL_WARNS("Messaging") << "Got TeleportStart, but teleport already in progress. TeleportFlags=" << teleport_flags << LL_ENDL;
+ }
+
LL_DEBUGS("Messaging") << "Got TeleportStart with TeleportFlags=" << teleport_flags << ". gTeleportDisplay: " << gTeleportDisplay << ", gAgent.mTeleportState: " << gAgent.getTeleportState() << LL_ENDL;
// *NOTE: The server sends two StartTeleport packets when you are teleporting to a LM
@@ -2766,7 +2772,7 @@ void process_teleport_progress(LLMessageSystem* msg, void**)
}
std::string buffer;
msg->getString("Info", "Message", buffer);
- LL_DEBUGS("Messaging") << "teleport progress: " << buffer << LL_ENDL;
+ LL_DEBUGS("Messaging") << "teleport progress: " << buffer << " flags: " << teleport_flags << LL_ENDL;
//Sorta hacky...default to using simulator raw messages
//if we don't find the coresponding mapping in our progress mappings
@@ -2889,9 +2895,25 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
if (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE)
{
- // Server either ignored teleport cancel message or did not receive it in time.
- // This message can't be ignored since teleport is complete at server side
- gAgent.restoreCanceledTeleportRequest();
+ if (gAgent.canRestoreCanceledTeleport())
+ {
+ // Server either ignored teleport cancel message or did not receive it in time.
+ // This message can't be ignored since teleport is complete at server side
+ gAgent.restoreCanceledTeleportRequest();
+ }
+ else
+ {
+ // Race condition? Make sure all variables are set correctly for teleport to work
+ LL_WARNS("Messaging") << "Teleport 'finish' message without 'start'" << LL_ENDL;
+ gTeleportDisplay = TRUE;
+ LLViewerMessage::getInstance()->mTeleportStartedSignal();
+ gAgent.setTeleportState(LLAgent::TELEPORT_REQUESTED);
+ make_ui_sound("UISndTeleportOut");
+ }
+ }
+ else if (gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING)
+ {
+ LL_WARNS("Messaging") << "Teleport message in the middle of other teleport" << LL_ENDL;
}
// Teleport is finished; it can't be cancelled now.